mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
myTouchList[123] is allowed as an alias for myTouchList.item(123). https://developer.mozilla.org/en-US/docs/Web/API/TouchList and http://www.w3.org/TR/touch-events/#idl-def-TouchList
32 lines
731 B
TypeScript
32 lines
731 B
TypeScript
// Type definitions for HTML Touch Events
|
|
// Project: http://www.w3.org/TR/touch-events/
|
|
// Definitions by: Kevin Barabash <https://github.com/kevinb7>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
|
|
interface TouchEvent extends UIEvent {
|
|
touches: TouchList;
|
|
targetTouches: TouchList;
|
|
changedTouches: TouchList;
|
|
altKey: boolean;
|
|
metaKey: boolean;
|
|
ctrlKey: boolean;
|
|
shiftKey: boolean;
|
|
}
|
|
|
|
interface TouchList {
|
|
length: number;
|
|
item: (index: number) => Touch;
|
|
[index: number]: Touch;
|
|
}
|
|
|
|
interface Touch {
|
|
identifier: number;
|
|
target: EventTarget;
|
|
screenX: number;
|
|
screenY: number;
|
|
clientX: number;
|
|
clientY: number;
|
|
pageX: number;
|
|
pageY: number;
|
|
}
|