@@ -13,39 +13,59 @@ See the Apache Version 2.0 License for specific language governing permissions
13
13
and limitations under the License.
14
14
***************************************************************************** */
15
15
16
+ ///<reference path="../winrt/winrt.d.ts"/>
17
+
16
18
declare module WinJS {
17
19
function strictProcessing ( ) : void ;
20
+
21
+ export module Application {
22
+ export var onsettings : EventListener ;
23
+ }
24
+
18
25
module Binding {
19
26
function as ( data : any ) : any ;
20
- class List {
21
- constructor ( data ?: any [ ] ) ;
22
- public push ( item : any ) : any ;
23
- public indexOf ( item : any ) : number ;
24
- public splice ( start : number , howMany ?: number , item ?: any [ ] ) : any [ ] ;
25
- public createFiltered ( predicate : ( x : any ) => boolean ) : List ;
26
- public createGrouped ( keySelector : ( x : any ) => any , dataSelector : ( x :any ) => any , groupSorter : ( left :any , right :any ) => number ) : List ;
27
- public groups : any ;
27
+ function processAll ( rootElement ?: any , dataContext ?: any , skipRoot ?: boolean , bindingCache ?: any ) : any ;
28
+ function define ( data : any ) : any ;
29
+ function expandProperties ( data : any ) : any ;
30
+ function converter ( method : any ) : any ;
31
+
32
+ export var optimizeBindingReferences : boolean ;
33
+ export var mixin : any ;
34
+ export var bind : any ;
35
+ export var oneTime : any ;
36
+
37
+ export function initializer ( customInit : any ) : any ;
38
+ export var setAttribute : any ;
39
+
40
+ class List < T > {
41
+ constructor ( data ?: T [ ] , options ?: { binding : boolean ; proxy : boolean ; } ) ;
42
+ public push ( item : T ) : number ;
43
+ public indexOf ( item : T , fromIndex ?: number ) : number ;
44
+ public splice ( start : number , howMany ?: number , ...items : T [ ] ) : T [ ] ;
45
+ public createFiltered ( predicate : ( x : T ) => boolean ) : List < T > ;
46
+ public createGrouped < U > ( keySelector : ( x : T ) => string , dataSelector : ( x :T ) => U , groupSorter ?: ( left :string , right :string ) => number ) : List < T > ;
47
+ public createSorted ( sorter : ( left :T , right :T ) => number ) : List < T > ;
48
+ public groups : List < any > ;
28
49
public dataSource : any ;
29
- public getAt ( index : number ) : any ;
30
- public createSorted ( sorter : ( left , right ) => number ) ;
31
- public forEach ( callback : ( val : any , index : number , array : any [ ] ) => void , thisArg ?: any ) ;
32
- public every ( callback : ( val : any , index : number , array : any [ ] ) => boolean , thisArg ?: any ) : boolean ;
50
+ public getAt ( index : number ) : T ;
51
+ public forEach ( callback : ( val : T , index : number , array : T [ ] ) => void , thisArg ?: any ) : void ;
52
+ public every ( callback : ( val : T , index : number , array : T [ ] ) => boolean , thisArg ?: any ) : boolean ;
33
53
public join ( separator : string ) : string ;
34
- public map ( callback : ( val : any , index : number , array : any [ ] ) => any , thisArg ?: any ) : any [ ] ;
35
- public move ( index : number , newIndex : number ) ;
36
- public pop ( ) : any ;
54
+ public map < U > ( callback : ( val : T , index : number , array : T [ ] ) => U , thisArg ?: any ) : U [ ] ;
55
+ public move ( index : number , newIndex : number ) : void ;
56
+ public pop ( ) : T ;
37
57
public reduce ( callback : ( previousValue : any , currentValue : any , currentIndex : number , array : any [ ] ) => any , initialValue ?: any ) : any ;
38
58
public reduceRight ( callback : ( previousValue : any , currentValue : any , currentIndex : number , array : any [ ] ) => any , initialValue ?: any ) : any ;
39
- public reverse ( ) ;
40
- public setAt ( index : number , newValue : number ) ;
41
- public shift ( ) : any ;
42
- public slice ( begin : number , end : number ) : WinJS . Binding . List ;
43
- public some ( callback : ( val : any , index : number , array : any [ ] ) => boolean , thisArg ?: any ) : boolean ;
44
- public sort ( sortFunction : ( left , right ) => number ) ;
45
- public unshift ( value : any ) : number ;
59
+ public reverse ( ) : void ;
60
+ public setAt ( index : number , newValue : T ) : void ;
61
+ public shift ( ) : T ;
62
+ public slice ( begin : number , end : number ) : List < T > ;
63
+ public some ( callback : ( val : T , index : number , array : T [ ] ) => boolean , thisArg ?: any ) : boolean ;
64
+ public sort ( sortFunction : ( left : T , right : T ) => number ) : void ;
65
+ public filter ( callback : ( val : T , index : number , array : T [ ] ) => boolean , thisArg ?: any ) : T [ ] ;
66
+ public unshift ( value : T ) : number ;
46
67
public length : number ;
47
- public notifyMutated ( index : number ) ;
48
-
68
+ public notifyMutated ( index : number ) : void ;
49
69
}
50
70
class Template {
51
71
public element : HTMLElement ;
@@ -61,7 +81,7 @@ declare module WinJS {
61
81
( dataContext : any , container ?: HTMLElement ) : WinJS . Promise < HTMLElement > ;
62
82
value ( href : string , dataContext : any , container ?: HTMLElement ) : WinJS . Promise < HTMLElement > ;
63
83
} ;
64
- public renderItem ( item : any , recycled ?: HTMLElement ) ;
84
+ public renderItem ( item : any , recycled ?: HTMLElement ) : void ;
65
85
}
66
86
67
87
@@ -73,7 +93,7 @@ declare module WinJS {
73
93
module Class {
74
94
function define ( constructor : any , instanceMembers : any ) : any ;
75
95
function derive ( baseClass : any , constructor : any , instanceMembers : any ) : any ;
76
- function mix ( constructor : any , mixin : any ) : any ;
96
+ function mix ( constructor : any , ... mixin : any [ ] ) : any ;
77
97
}
78
98
function xhr ( options : { type ?: string ; url ?: string ; user ?: string ; password ?: string ; headers ?: any ; data ?: any ; responseType ?: string ; } ) : WinJS . Promise < XMLHttpRequest > ;
79
99
module Application {
@@ -100,15 +120,21 @@ declare module WinJS {
100
120
class ErrorFromName {
101
121
constructor ( name : string , message ?: string ) ;
102
122
}
103
- class Promise < T > {
123
+ class Promise < T > implements Windows . Foundation . IPromise < T > {
104
124
constructor ( init : ( c : any , e : any , p : any ) => void ) ;
105
- then < U > ( success ?: ( value : T ) => Promise < U > , error ?: ( error : any ) => Promise < U > , progress ?: ( progress : any ) => void ) : Promise < U > ;
106
- then < U > ( success ?: ( value : T ) => Promise < U > , error ?: ( error : any ) => U , progress ?: ( progress : any ) => void ) : Promise < U > ;
107
- then < U > ( success ?: ( value : T ) => U , error ?: ( error : any ) => Promise < U > , progress ?: ( progress : any ) => void ) : Promise < U > ;
108
- then < U > ( success ?: ( value : T ) => U , error ?: ( error : any ) => U , progress ?: ( progress : any ) => void ) : Promise < U > ;
125
+ then < U > ( success ?: ( value : T ) => Windows . Foundation . IPromise < U > , error ?: ( error : any ) => Windows . Foundation . IPromise < U > , progress ?: ( progress : any ) => void ) : Windows . Foundation . IPromise < U > ;
126
+ then < U > ( success ?: ( value : T ) => Windows . Foundation . IPromise < U > , error ?: ( error : any ) => U , progress ?: ( progress : any ) => void ) : Windows . Foundation . IPromise < U > ;
127
+ then < U > ( success ?: ( value : T ) => U , error ?: ( error : any ) => Windows . Foundation . IPromise < U > , progress ?: ( progress : any ) => void ) : Windows . Foundation . IPromise < U > ;
128
+ then < U > ( success ?: ( value : T ) => U , error ?: ( error : any ) => U , progress ?: ( progress : any ) => void ) : Windows . Foundation . IPromise < U > ;
109
129
done < U > ( success ?: ( value : T ) => any , error ?: ( error : any ) => any , progress ?: ( progress : any ) => void ) : void ;
110
- static join : any ;
111
- static timeout : any ;
130
+
131
+ cancel ( ) : void ;
132
+
133
+ static join ( values : any [ ] ) : Promise < any [ ] > ;
134
+ static timeout ( timeout : number ) : Promise < void > ;
135
+ static as ( ) : Promise < any > ;
136
+ static as < U > ( obj : U ) : Promise < U > ;
137
+ static wrapError < U > ( obj : U ) : Promise < U > ;
112
138
}
113
139
module Navigation {
114
140
var history : any ;
@@ -119,16 +145,30 @@ declare module WinJS {
119
145
function addEventListener ( type : string , listener : EventListener , capture : boolean ) : void ;
120
146
function back ( ) : void ;
121
147
function forward ( ) : void ;
122
- function navigate ( location : any , initialState : any ) ;
123
- function navigate ( location : any ) ;
148
+ function navigate ( location : any , initialState : any ) : WinJS . Promise < boolean > ;
149
+ function navigate ( location : any ) : WinJS . Promise < boolean > ;
124
150
function removeEventListener ( type : string , listener : EventListener , capture : boolean ) : void ;
125
151
var onbeforenavigate : CustomEvent ;
126
152
var onnavigated : CustomEvent ;
127
153
var onnavigating : CustomEvent ;
128
154
}
155
+
156
+ export module Resources {
157
+ export var processAll : ( element ?: HTMLElement ) => void ;
158
+ export var getString : ( id : string ) => { value : string ; empty ?: boolean ; lang ?: string ; } ;
159
+ export var addEventListener : ( id : string , handler : EventListener , useCapture ?: boolean ) => void ;
160
+ }
161
+
129
162
module Utilities {
130
- function markSupportedForProcessing ( obj : any ) : void ;
131
- enum Key {
163
+ function markSupportedForProcessing < T > ( obj : T ) : T ;
164
+ function createEventProperties ( ...events : string [ ] ) : any ;
165
+
166
+ export function addClass ( element : HTMLElement , className : string ) : void ;
167
+ export function removeClass ( element : HTMLElement , className : string ) : void ;
168
+
169
+ export function hasClass ( element : HTMLElement , className : string ) : boolean ;
170
+
171
+ enum Key {
132
172
backspace ,
133
173
tab ,
134
174
enter ,
@@ -235,9 +275,58 @@ declare module WinJS {
235
275
var ListLayout : any ;
236
276
var GridLayout : any ;
237
277
var Pages : any ;
238
- var Menu : any ;
239
- var setOptions : any ;
278
+ var setOptions : any ;
279
+
280
+ export var Animation : any ;
281
+
282
+ var DOMEventMixin : any ;
283
+
284
+ class Flyout {
285
+ constructor ( element : HTMLElement , options : any ) ;
286
+ element : Element ;
287
+ }
288
+
289
+ module Fragments {
290
+ var renderCopy : any ;
291
+ }
292
+
293
+ export class HtmlControl {
294
+ constructor ( element : HTMLElement , options : { uri : string ; } ) ;
295
+ }
296
+
297
+ interface IItem {
298
+ data : any ;
299
+ }
300
+
301
+ interface ISelection {
302
+ clear ( ) : WinJS . Promise < void > ;
303
+ count ( ) : number ;
304
+ getItems ( ) : WinJS . Promise < IItem [ ] > ;
305
+ }
306
+
307
+ class ListView {
308
+ element : Element ;
309
+ elementFromIndex ( index : number ) : Element ;
310
+ indexOfElement ( element : Element ) : number ;
311
+ selection : ISelection ;
312
+ }
313
+
314
+ class Menu {
315
+ constructor ( element : HTMLElement , options : any ) ;
316
+ element : Element ;
317
+ }
318
+
319
+ export class MenuCommand {
320
+ constructor ( element : HTMLElement , options : any ) ;
321
+ }
322
+
323
+ export class SettingsFlyout {
324
+ static populateSettings ( e : any ) : any ;
325
+ static showSettings ( id : string , path : any ) : any ;
326
+ }
240
327
}
328
+
329
+ export function xhr ( options : { type : string ; url : string ; } ) : WinJS . Promise < any > ; // user: string; password: string; headers: any; data: any; responseType: string;
241
330
}
242
331
243
332
interface Element {
0 commit comments