Bug 1861467 - [wpt-sync] Update web-platform-tests to eedf737ce39c512d0ca3471f988972e...
[gecko.git] / dom / webidl / MIDIPort.webidl
blob97ee46bf006b1b9f707bd8151fb3c801d7e2366f
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://webaudio.github.io/web-midi-api/
8  */
10 enum MIDIPortType {
11   "input",
12   "output"
15 enum MIDIPortDeviceState {
16   "disconnected",
17   "connected"
20 enum MIDIPortConnectionState {
21   "open",
22   "closed",
23   "pending"
26 [SecureContext, Pref="dom.webmidi.enabled",
27  Exposed=Window]
28 interface MIDIPort : EventTarget {
29   readonly attribute DOMString    id;
30   readonly attribute DOMString?   manufacturer;
31   readonly attribute DOMString?   name;
32   readonly attribute DOMString?   version;
33   readonly attribute MIDIPortType type;
34   readonly attribute MIDIPortDeviceState state;
35   readonly attribute MIDIPortConnectionState connection;
36            attribute EventHandler onstatechange;
37   [Throws]
38   Promise<MIDIPort> open();
39   [Throws]
40   Promise<MIDIPort> close();