-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
59 lines (55 loc) · 1.46 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import 'webmidi';
/** MIDI Source -- a virtual MIDI-In port */
interface MidiSrc {
/** Port name */
readonly name: string;
/** Connect the port */
readonly connect: () => boolean;
/** Disconnect the port */
readonly disconnect: () => boolean;
/** Emit MIDI message */
readonly emit: (message: number[]) => void;
/** Port is busy */
busy: boolean;
}
/** MIDI Destination -- a virtual MIDI-Out port */
interface MidiDst {
/** Port name */
readonly name: string;
/** Connect the port */
readonly connect: () => boolean;
/** Disconnect the port */
readonly disconnect: () => boolean;
/** User-defined MIDI message handler */
receive: (message?: number[]) => void;
/** Port is busy */
busy: boolean;
}
declare namespace MidiSrc {
interface Constructor {
/** Create new MidiDst object */
new (name: string): MidiSrc;
/** Create new MidiDst object */
(name: string): MidiSrc;
}
}
declare namespace MidiDst {
interface Constructor {
/** Create new MidiDst object */
new (name: string): MidiDst;
/** Create new MidiDst object */
(name: string): MidiDst;
}
}
interface WebMidiTest {
/** MIDI enabled */
midi: boolean;
/** MIDI SysEx enabled */
sysex: boolean;
readonly MidiSrc: MidiSrc.Constructor;
readonly MidiDst: MidiDst.Constructor;
/** Invoke Web MIDI API */
readonly requestMIDIAccess: (options?: WebMidi.MIDIOptions) => Promise<WebMidi.MIDIAccess>;
}
declare const wmt: WebMidiTest;
export = wmt;