summaryrefslogblamecommitdiffstats
path: root/touchEvent.d.ts
blob: ab8a61bf0ce97457cf4d1c0e9a5b790432ed35e4 (plain) (tree)

















































                                                                       
interface AbstractView {
}

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:boolean;
    metaKey:boolean;
    ctrlKey:boolean;
    shiftKey:boolean;
    initTouchEvent (type:string, canBubble:boolean, cancelable:boolean,
                    view:AbstractView, detail:number, ctrlKey:boolean,
                    altKey:boolean, shiftKey:boolean, metaKey:boolean,
                    touches:TouchList, targetTouches:TouchList,
                    changedTouches:TouchList);
}

declare var TouchEvent: {
    prototype: TouchEvent;
    new(): TouchEvent;
}

//
// add touch events to HTMLElement
//
interface HTMLElement extends Element, ElementCSSInlineStyle,
          MSEventAttachmentTarget, MSNodeExtensions {
    ontouchstart: (ev: TouchEvent) => any;
    ontouchmove: (ev: TouchEvent) => any;
    ontouchend: (ev: TouchEvent) => any;
    ontouchcancel: (ev: TouchEvent) => any;
}