google-closure-compiler
Version:
Check, compile, optimize and compress Javascript with Closure-Compiler
229 lines (160 loc) • 3.54 kB
JavaScript
/*
* Copyright 2014 The Closure Compiler Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview W3C Web MIDI specification.
* @see http://www.w3.org/TR/webmidi/
*
* @externs
*/
/**
* @param {!MIDIOptions=} opt_options
* @return {!Promise.<!MIDIAccess>}
*/
navigator.requestMIDIAccess = function(opt_options) {};
/**
* @typedef {{
* software: (boolean|undefined),
* sysex: (boolean|undefined)
* }}
*/
var MIDIOptions;
/**
* @interface
* @extends {ReadonlyMap<string, !MIDIInput>}
*/
var MIDIInputMap = function() {};
/**
* @interface
* @extends {ReadonlyMap<string, !MIDIOutput>}
*/
var MIDIOutputMap = function() {};
/**
* @interface
* @extends {EventTarget}
*/
var MIDIAccess = function() {};
/**
* @const {!MIDIInputMap}
*/
MIDIAccess.prototype.inputs;
/**
* @const {!MIDIOutputMap}
*/
MIDIAccess.prototype.outputs;
/**
* @const {function(!MIDIConnectionEvent)}
*/
MIDIAccess.prototype.onconnect;
/**
* @type {function(!MIDIConnectionEvent)}
*/
MIDIAccess.prototype.ondisconnect;
/**
* @const {boolean}
*/
MIDIAccess.prototype.sysexEnabled;
/**
* @interface
* @extends {EventTarget}
*/
var MIDIPort = function() {};
/**
* @const {string}
*/
MIDIPort.prototype.id;
/**
* @const {string}
*/
MIDIPort.prototype.manufacturer;
/**
* @const {string}
*/
MIDIPort.prototype.name;
/**
* @const {string}
*/
MIDIPort.prototype.type;
/**
* @const {string}
*/
MIDIPort.prototype.version;
/**
* @type {function(!MIDIConnectionEvent)}
*/
MIDIPort.prototype.ondisconnect;
/**
* @interface
* @extends {MIDIPort}
*/
var MIDIInput = function() {};
/**
* @type {function(!MIDIMessageEvent)}
*/
MIDIInput.prototype.onmidimessage;
/**
* @interface
* @extends {MIDIPort}
*/
var MIDIOutput = function() {};
/**
* @param {!Uint8Array} data
* @param {number=} opt_timestamp
*/
MIDIOutput.prototype.send = function(data, opt_timestamp) {};
/**
* @constructor
* @extends {Event}
* @param {string} type
* @param {!MIDIMessageEventInit=} opt_init
*/
var MIDIMessageEvent = function(type, opt_init) {};
/**
* @const {number}
*/
MIDIMessageEvent.prototype.receivedTime;
/**
* @const {!Uint8Array}
*/
MIDIMessageEvent.prototype.data;
/**
* @record
* @extends {EventInit}
* @see https://www.w3.org/TR/webmidi/#midimessageeventinit-interface
*/
function MIDIMessageEventInit() {}
/** @type {undefined|number} */
MIDIMessageEventInit.prototype.receivedTime;
/** @type {undefined|!Uint8Array} */
MIDIMessageEventInit.prototype.data;
/**
* @constructor
* @extends {Event}
* @param {string} type
* @param {!MIDIConnectionEventInit=} opt_init
*/
var MIDIConnectionEvent = function(type, opt_init) {};
/**
* @const {MIDIPort}
*/
MIDIConnectionEvent.prototype.port;
/**
* @record
* @extends {EventInit}
* @see https://www.w3.org/TR/webmidi/#idl-def-MIDIConnectionEventInit
*/
function MIDIConnectionEventInit() {}
/** @type {undefined|!MIDIPort} */
MIDIConnectionEventInit.prototype.port;