forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rx-dom.d.ts
142 lines (122 loc) · 6.88 KB
/
rx-dom.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// Type definitions for RxJS v2.5.3
// Project: https://github.com/Reactive-Extensions/RxJS-DOM
// Definitions by: oliver Weichhold <https://github.com/oliverw>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../rx/rx.all.d.ts" />
declare module Rx.DOM {
export interface AjaxSettings {
async?: boolean;
body?: string;
// This options does not seem to be used in the code yet
// contentType?: string;
crossDomain?: boolean;
headers?: any;
method?: string;
password?: string;
progressObserver?: Rx.Observer<any>;
responseType?: string;
url?: string;
user?: string;
}
export interface AjaxSuccessResponse {
response: any;
status: number;
responseType: string;
xhr: XMLHttpRequest;
originalEvent: Event;
}
export interface AjaxErrorResponse {
type: string;
status: number;
xhr: XMLHttpRequest;
originalEvent: Event;
}
export interface JsonpSettings {
async?: boolean;
jsonp?: string;
jsonpCallback?: string;
url?: string;
}
export interface JsonpSuccessResponse {
response: any;
status: number;
responseType: string;
originalEvent: Event;
}
export interface JsonpErrorResponse {
type: string;
status: number;
originalEvent: Event;
}
export interface GeolocationOptions {
enableHighAccuracy?: boolean;
timeout?: number;
maximumAge?: number;
}
// Events
function fromEvent<T>(element:any, eventName:string, selector?:Function, useCapture?:boolean):Rx.Observable<T>;
function ready():Rx.Observable<any>;
// Event Shortcuts
function blur(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<FocusEvent>;
function change(element: Element, selector?:Function):Rx.Observable<Event>;
function click(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function contextmenu(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function dblclick(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function error(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<Event>;
function focus(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<FocusEvent>;
function focusin(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function focusout(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function keydown(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<KeyboardEvent>;
function keypress(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<KeyboardEvent>;
function keyup(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<KeyboardEvent>;
function load(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<UIEvent>;
function mousedown(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function mouseenter(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function mouseleave(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function mousemove(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function mouseout(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function mouseover(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function mouseup(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
function resize(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<UIEvent>;
function scroll(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<UIEvent>;
function select(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<Event>;
function submit(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<Event>;
function unload(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<Event>;
// Pointer Events
function pointerdown(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
function pointerenter(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
function pointerleave(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
function pointermove(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
function pointerout(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
function pointerover(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
function pointerup(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
// Touch Events
function touchcancel(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<TouchEvent>;
function touchend(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<TouchEvent>;
function touchmove(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<TouchEvent>;
function touchstart(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<TouchEvent>;
// Ajax
function ajax(url:string):Rx.Observable<AjaxSuccessResponse>;
function ajax(settings:AjaxSettings):Rx.Observable<AjaxSuccessResponse>;
function get(url:string):Rx.Observable<AjaxSuccessResponse>;
function getJSON(url:string):Rx.Observable<string>;
function post(url:string, body:any):Rx.Observable<AjaxSuccessResponse>;
function jsonpRequest(url:string):Rx.Observable<string>;
function jsonpRequest(settings:JsonpSettings):Rx.Observable<JsonpSuccessResponse>;
// Server-Sent Events
function fromEventSource<T>(url:string, openObservable?:Rx.Observer<T>):Rx.Observable<T>;
// Web Sockets
function fromWebSocket(url:string, protocol:string, openObserver?:Rx.Observer<Event>, closingObserver?:Rx.Observer<CloseEvent>):Rx.Subject<MessageEvent>;
// Web Workers
function fromWebWorker(url:string):Rx.Subject<string>;
// Mutation Observers
function fromMutationObserver(target:Node, options:MutationObserverInit):Rx.Observable<MutationEvent>;
// Geolocation
export module geolocation {
function getCurrentPosition(geolocationOptions?:GeolocationOptions):Rx.Observable<Position>;
function watchPosition(geolocationOptions?:GeolocationOptions):Rx.Observable<Position>;
}
}
declare module "rx.DOM" {
export default Rx.DOM;
}