gracias por el asesoramiento. Fui a la Especificación de eventos de Touch W3C Working Draft el 5 de mayo de 2011 y creé un conjunto de declaraciones ambientales a partir de eso. Hay una recomendación de candidato más reciente, pero esto es lo que creo que realmente se implementa en la mayoría de los navegadores. Esto parece funcionar bien.
PD: el declare var TouchEvent en la parte inferior no es parte del borrador de w3c. Es una adaptación del mismo código para UIEvent que forma parte de las interfaces estándar incluidas con TypeScript.
interface Touch {
identifier:number;
target:EventTarget;
screenX:number;
screenY:number;
clientX:number;
clientY:number;
pageX:number;
pageY:number;
};
interface TouchList {
length:number;
item (index:number):Touch;
identifiedTouch(identifier:number):Touch;
};
interface TouchEvent extends UIEvent {
touches:TouchList;
targetTouches:TouchList;
changedTouches:TouchList;
altKey:bool;
metaKey:bool;
ctrlKey:bool;
shiftKey:bool;
initTouchEvent (type:string, canBubble:bool, cancelable:bool, view:AbstractView, detail:number, ctrlKey:bool, altKey:bool, shiftKey:bool, metaKey:bool, touches:TouchList, targetTouches:TouchList, changedTouches:TouchList);
};
declare var TouchEvent: {
prototype: TouchEvent;
new(): TouchEvent;
}
@norahiko tiene un proyecto Github con un acercamiento a esta: https://github.com/norahiko/TouchEvent.d.ts –
Aquí está. : [github.com/borisyankov/DefinitelyTyped/touch-events/touch-events.d.ts] (https://github.com/borisyankov/DefinitelyTyped/blob/master/touch-events/touch-events.d.ts) – harry0000