Skip to content

Commit

Permalink
Add the event externs for InputEvent. This should follow the specs at:
Browse files Browse the repository at this point in the history
- https://www.w3.org/TR/uievents/#interface-inputevent
- https://w3c.github.io/input-events/#interface-InputEvent (draft, may change)

This is used by the 'input' and 'beforeinput' events.

Note that getTargetRanges() has been omitted as there is not a clear consensus yet regarding how to handle these (see w3c/input-events#38)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146809699
  • Loading branch information
charleyroy authored and blickly committed Feb 8, 2017
1 parent 26440f6 commit 4d19a90
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions externs/browser/w3c_event.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,43 @@ AddEventListenerOptions.prototype.passive;

/** @type {boolean|undefined} */
AddEventListenerOptions.prototype.once;

/**
* @typedef {{
* bubbles: (boolean|undefined),
* cancelable: (boolean|undefined),
* view: (Window|undefined),
* detail: (number|undefined),
* data: (string|undefined),
* isComposed: (boolean|undefined),
* inputType: (string|undefined),
* dataTransfer: (DataTransfer|undefined)
* }}
*/
var InputEventInit;


// TODO(charleyroy): Add getTargetRanges() once a consensus has been made
// regarding how to structure these values. See
// https://github.com/w3c/input-events/issues/38.
/**
* @constructor
* @extends {UIEvent}
* @param {string} type
* @param {InputEventInit=} opt_eventInitDict
* @see https://www.w3.org/TR/uievents/#interface-inputevent
* @see https://w3c.github.io/input-events/#interface-InputEvent
*/
function InputEvent(type, opt_eventInitDict) {}

/** @type {string} */
InputEvent.prototype.data;

/** @type {boolean} */
InputEvent.prototype.isComposed;

/** @type {string} */
InputEvent.prototype.inputType;

/** @type {?DataTransfer} */
InputEvent.prototype.dataTransfer;
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/resources.json

Large diffs are not rendered by default.

0 comments on commit 4d19a90

Please sign in to comment.