@@ -707,6 +707,19 @@ interface LockOptions {
707
707
steal?: boolean;
708
708
}
709
709
710
+ interface MIDIConnectionEventInit extends EventInit {
711
+ port?: MIDIPort;
712
+ }
713
+
714
+ interface MIDIMessageEventInit extends EventInit {
715
+ data?: Uint8Array;
716
+ }
717
+
718
+ interface MIDIOptions {
719
+ software?: boolean;
720
+ sysex?: boolean;
721
+ }
722
+
710
723
interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo {
711
724
configuration?: MediaDecodingConfiguration;
712
725
}
@@ -4648,6 +4661,8 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4648
4661
createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent;
4649
4662
createEvent(eventInterface: "InputEvent"): InputEvent;
4650
4663
createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent;
4664
+ createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent;
4665
+ createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent;
4651
4666
createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent;
4652
4667
createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent;
4653
4668
createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent;
@@ -9274,6 +9289,126 @@ declare var LockManager: {
9274
9289
new(): LockManager;
9275
9290
};
9276
9291
9292
+ interface MIDIAccessEventMap {
9293
+ "statechange": Event;
9294
+ }
9295
+
9296
+ /** Available only in secure contexts. */
9297
+ interface MIDIAccess extends EventTarget {
9298
+ readonly inputs: MIDIInputMap;
9299
+ onstatechange: ((this: MIDIAccess, ev: Event) => any) | null;
9300
+ readonly outputs: MIDIOutputMap;
9301
+ readonly sysexEnabled: boolean;
9302
+ addEventListener<K extends keyof MIDIAccessEventMap>(type: K, listener: (this: MIDIAccess, ev: MIDIAccessEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
9303
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
9304
+ removeEventListener<K extends keyof MIDIAccessEventMap>(type: K, listener: (this: MIDIAccess, ev: MIDIAccessEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
9305
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
9306
+ }
9307
+
9308
+ declare var MIDIAccess: {
9309
+ prototype: MIDIAccess;
9310
+ new(): MIDIAccess;
9311
+ };
9312
+
9313
+ /** Available only in secure contexts. */
9314
+ interface MIDIConnectionEvent extends Event {
9315
+ readonly port: MIDIPort;
9316
+ }
9317
+
9318
+ declare var MIDIConnectionEvent: {
9319
+ prototype: MIDIConnectionEvent;
9320
+ new(type: string, eventInitDict?: MIDIConnectionEventInit): MIDIConnectionEvent;
9321
+ };
9322
+
9323
+ interface MIDIInputEventMap extends MIDIPortEventMap {
9324
+ "midimessage": Event;
9325
+ }
9326
+
9327
+ /** Available only in secure contexts. */
9328
+ interface MIDIInput extends MIDIPort {
9329
+ onmidimessage: ((this: MIDIInput, ev: Event) => any) | null;
9330
+ addEventListener<K extends keyof MIDIInputEventMap>(type: K, listener: (this: MIDIInput, ev: MIDIInputEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
9331
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
9332
+ removeEventListener<K extends keyof MIDIInputEventMap>(type: K, listener: (this: MIDIInput, ev: MIDIInputEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
9333
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
9334
+ }
9335
+
9336
+ declare var MIDIInput: {
9337
+ prototype: MIDIInput;
9338
+ new(): MIDIInput;
9339
+ };
9340
+
9341
+ /** Available only in secure contexts. */
9342
+ interface MIDIInputMap {
9343
+ forEach(callbackfn: (value: MIDIInput, key: string, parent: MIDIInputMap) => void, thisArg?: any): void;
9344
+ }
9345
+
9346
+ declare var MIDIInputMap: {
9347
+ prototype: MIDIInputMap;
9348
+ new(): MIDIInputMap;
9349
+ };
9350
+
9351
+ /** Available only in secure contexts. */
9352
+ interface MIDIMessageEvent extends Event {
9353
+ readonly data: Uint8Array;
9354
+ }
9355
+
9356
+ declare var MIDIMessageEvent: {
9357
+ prototype: MIDIMessageEvent;
9358
+ new(type: string, eventInitDict?: MIDIMessageEventInit): MIDIMessageEvent;
9359
+ };
9360
+
9361
+ /** Available only in secure contexts. */
9362
+ interface MIDIOutput extends MIDIPort {
9363
+ send(data: number[], timestamp?: DOMHighResTimeStamp): void;
9364
+ addEventListener<K extends keyof MIDIPortEventMap>(type: K, listener: (this: MIDIOutput, ev: MIDIPortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
9365
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
9366
+ removeEventListener<K extends keyof MIDIPortEventMap>(type: K, listener: (this: MIDIOutput, ev: MIDIPortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
9367
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
9368
+ }
9369
+
9370
+ declare var MIDIOutput: {
9371
+ prototype: MIDIOutput;
9372
+ new(): MIDIOutput;
9373
+ };
9374
+
9375
+ /** Available only in secure contexts. */
9376
+ interface MIDIOutputMap {
9377
+ forEach(callbackfn: (value: MIDIOutput, key: string, parent: MIDIOutputMap) => void, thisArg?: any): void;
9378
+ }
9379
+
9380
+ declare var MIDIOutputMap: {
9381
+ prototype: MIDIOutputMap;
9382
+ new(): MIDIOutputMap;
9383
+ };
9384
+
9385
+ interface MIDIPortEventMap {
9386
+ "statechange": Event;
9387
+ }
9388
+
9389
+ /** Available only in secure contexts. */
9390
+ interface MIDIPort extends EventTarget {
9391
+ readonly connection: MIDIPortConnectionState;
9392
+ readonly id: string;
9393
+ readonly manufacturer: string | null;
9394
+ readonly name: string | null;
9395
+ onstatechange: ((this: MIDIPort, ev: Event) => any) | null;
9396
+ readonly state: MIDIPortDeviceState;
9397
+ readonly type: MIDIPortType;
9398
+ readonly version: string | null;
9399
+ close(): Promise<MIDIPort>;
9400
+ open(): Promise<MIDIPort>;
9401
+ addEventListener<K extends keyof MIDIPortEventMap>(type: K, listener: (this: MIDIPort, ev: MIDIPortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
9402
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
9403
+ removeEventListener<K extends keyof MIDIPortEventMap>(type: K, listener: (this: MIDIPort, ev: MIDIPortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
9404
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
9405
+ }
9406
+
9407
+ declare var MIDIPort: {
9408
+ prototype: MIDIPort;
9409
+ new(): MIDIPort;
9410
+ };
9411
+
9277
9412
interface MathMLElementEventMap extends ElementEventMap, DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap {
9278
9413
}
9279
9414
@@ -9986,6 +10121,8 @@ interface Navigator extends NavigatorAutomationInformation, NavigatorConcurrentH
9986
10121
canShare(data?: ShareData): boolean;
9987
10122
getGamepads(): (Gamepad | null)[];
9988
10123
/** Available only in secure contexts. */
10124
+ requestMIDIAccess(options?: MIDIOptions): Promise<MIDIAccess>;
10125
+ /** Available only in secure contexts. */
9989
10126
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>;
9990
10127
sendBeacon(url: string | URL, data?: BodyInit | null): boolean;
9991
10128
/** Available only in secure contexts. */
@@ -18397,6 +18534,9 @@ type KeyType = "private" | "public" | "secret";
18397
18534
type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
18398
18535
type LineAlignSetting = "center" | "end" | "start";
18399
18536
type LockMode = "exclusive" | "shared";
18537
+ type MIDIPortConnectionState = "closed" | "open" | "pending";
18538
+ type MIDIPortDeviceState = "connected" | "disconnected";
18539
+ type MIDIPortType = "input" | "output";
18400
18540
type MediaDecodingType = "file" | "media-source" | "webrtc";
18401
18541
type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput";
18402
18542
type MediaEncodingType = "record" | "webrtc";
0 commit comments