forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
microsoft.ajax.d.ts
4039 lines (3539 loc) · 179 KB
/
microsoft.ajax.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for Microsoft ASP.NET Ajax client side library
// Project: http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx
// Definitions by: Patrick Magee <https://github.com/pjmagee/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//#region Global Namespace
/**
* Global Namespace
* This section includes members or types that extend the ECMAScript (JavaScript) Global object and other core objects.
* @see {@link http://msdn.microsoft.com/en-us/library/bb310818(v=vs.100).aspx}
*/
//#region JavaScript Base Type Extensions
/**
* Provides extended reflection-like functionality to the base ECMAScript (JavaScript) Object object.
* Object Type Extensions
* @see {@link http://msdn.microsoft.com/en-us/library/bb397554(v=vs.100).aspx}
*/
interface Object {
/**
* Formats a number by using the invariant culture.
*/
getType(instance: any): Type;
/**
* Returns a string that identifies the run-time type name of an object.
*/
getTypeName(instance: any): string;
}
/**
* Provides extensions to the base ECMAScript (JavaScript) Array functionality by adding static methods.
* Array Type Extensions
* @see {@link http://msdn.microsoft.com/en-us/library/bb383786(v=vs.100).aspx}
*/
interface Array<T> {
//#region lib.d.ts
new (arrayLength?: number): any[];
new <T>(arrayLength: number): T[];
new <T>(...items: T[]): T[];
(arrayLength?: number): any[];
<T>(arrayLength: number): T[];
<T>(...items: T[]): T[];
isArray(arg: any): boolean;
prototype: Array<any>;
///**
// * Returns a string representation of an array.
// */
//toString(): string;
//toLocaleString(): string;
///**
// * Combines two or more arrays.
// * @param items Additional items to add to the end of array1.
// */
//concat<U extends T[]>(...items: U[]): T[];
///**
// * Combines two or more arrays.
// * @param items Additional items to add to the end of array1.
// */
//concat(...items: T[]): T[];
///**
// * Adds all the elements of an array separated by the specified separator string.
// * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
// */
//join(separator?: string): string;
///**
// * Removes the last element from an array and returns it.
// */
//pop(): T;
///**
// * Appends new elements to an array, and returns the new length of the array.
// * @param items New elements of the Array.
// */
//push(...items: T[]): number;
///**
// * Reverses the elements in an Array.
// */
//reverse(): T[];
///**
// * Removes the first element from an array and returns it.
// */
//shift(): T;
///**
// * Returns a section of an array.
// * @param start The beginning of the specified portion of the array.
// * @param end The end of the specified portion of the array.
// */
//slice(start?: number, end?: number): T[];
///**
// * Sorts an array.
// * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
// */
//sort(compareFn?: (a: T, b: T) => number): T[];
///**
// * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
// * @param start The zero-based location in the array from which to start removing elements.
// */
//splice(start: number): T[];
///**
// * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
// * @param start The zero-based location in the array from which to start removing elements.
// * @param deleteCount The number of elements to remove.
// * @param items Elements to insert into the array in place of the deleted elements.
// */
//splice(start: number, deleteCount: number, ...items: T[]): T[];
///**
// * Inserts new elements at the start of an array.
// * @param items Elements to insert at the start of the Array.
// */
//unshift(...items: T[]): number;
///**
// * Returns the index of the first occurrence of a value in an array.
// * @param searchElement The value to locate in the array.
// * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
// */
//indexOf(searchElement: T, fromIndex?: number): number;
///**
// * Returns the index of the last occurrence of a specified value in an array.
// * @param searchElement The value to locate in the array.
// * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
// */
//lastIndexOf(searchElement: T, fromIndex?: number): number;
///**
// * Determines whether all the members of an array satisfy the specified test.
// * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
//every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
///**
// * Determines whether the specified callback function returns true for any element of an array.
// * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
//some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
///**
// * Performs the specified action for each element in an array.
// * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
//forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
///**
// * Calls a defined callback function on each element of an array, and returns an array that contains the results.
// * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
//map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
///**
// * Returns the elements of an array that meet the condition specified in a callback function.
// * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
//filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[];
///**
// * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
//reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
///**
// * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
//reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
///**
// * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
//reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
///**
// * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
//reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
///**
// * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
// */
//length: number;
//[n: number]: T;
//#endregion
//#region Extensions
/**
* Adds an element to the end of an Array object. This function is static and is invoked without creating an instance of the object.
* @param array
* The array to add the item to.
* @param item
*
*/
add(array: any[], element: any): void;
/**
* Copies all the elements of the specified array to the end of an Array object.
*/
addRange(array: any, items: any): void;
/**
* Removes all elements from an Array object.
*/
clear(): void;
/**
* Creates a shallow copy of an Array object.
*/
clone(): any[];
/**
* Determines whether an element is in an Array object.
*/
contains(element: any): boolean;
/**
* Removes the first element from an Array object.
*/
dequeue(): any;
/**
* Adds an element to the end of an Array object. Use the add function instead of the Array.enqueue function.
*/
enqueue(element: any): void;
/**
* Performs a specified action on each element of an Array object.
*/
forEach(array: any[], method: Function, instance: any[]): void;
/**
* Searches for the specified element of an Array object and returns its index.
*/
indexOf(array: any[], item: any, startIndex?: number): number;
/**
* Inserts a value at the specified location in an Array object.
*/
insert(array: any[], index: number, item: any): any;
/**
* Creates an Array object from a string representation.
*/
parse(value: string): any[];
/**
* Removes the first occurrence of an element in an Array object.
*/
remove(array: any[], item: any): boolean;
/**
* Removes an element at the specified location in an Array object.
*/
removeAt(array: any[], index: number): void;
//#endregion
}
/**
* Extends the base ECMAScript (JavaScript) Number functionality with static and instance methods.
* Number Type Extensions
* @see {@link http://msdn.microsoft.com/en-us/library/bb310835(v=vs.100).aspx}
*/
interface Number {
/**
* Formats a number by using the invariant culture.
*/
format(format: string): string;
/**
* Formats a number by using the current culture.
*/
localeFormat(format: string): string;
/**
* Returns a numeric value from a string representation of a number. This function is static and can be called without creating an instance of the object.
*/
parseInvariant(format: string): number;
/**
* Creates a numeric value from a locale-specific string.
*/
parseLocale(format: string): number;
}
/**
* Provides extensions to the base ECMAScript (JavaScript) Date object.
* Date Type Extensions
* @see {@link http://msdn.microsoft.com/en-us/library/bb310850(v=vs.100).aspx}
*/
interface Date {
/**
* Formats a date by using the invariant (culture-independent) culture.
*/
format(value: string): string;
/**
* Formats a date by using the current culture. This function is static and can be invoked without creating an instance of the object.
*/
localeFormat(value: string): string;
/**
* Creates a date from a locale-specific string by using the current culture. This function is static and can be invoked without creating an instance of the object.
* @exception (Debug) formats contains an invalid format.
* @param value
* A locale-specific string that represents a date.
* @param formats
* (Optional) An array of custom formats.
*/
parseLocale(value: string): string;
parseLocale(value: string, formats?: string[]): string;
parseLocale(value: string, ...formats: string[]): string;
/**
* Creates a date from a string by using the invariant culture. This function is static and can be invoked without creating an instance of the object.
* @return If value is a valid string representation of a date in the invariant format, an object of type Date; otherwise, null.
* @param value
* A locale-specific string that represents a date.
* @param formats
* (Optional) An array of custom formats.
*/
parseInvariant(value: string): string;
parseInvariant(value: string, formats?: string[]): string;
parseInvariant(value: string, ...formats: string[]): string;
}
declare module MicrosoftAjaxBaseTypeExtensions {
/**
* Provides static functions that extend the built-in ECMAScript (JavaScript) Function type by including exception
* details and support for application-compilation modes (debug or release).
* @see {@link http://msdn.microsoft.com/en-us/library/dd409270(v=vs.100).aspx}
*/
interface Function {
//#region lib.d.ts
/**
* Creates a new function.
* @param args A list of arguments the function accepts.
*/
new (...args: string[]): Function;
(...args: string[]): Function;
prototype: Function;
//#endregion
//#region Extensions
/**
* Creates a delegate function that retains the context first used during an objects creation.
* @see {@link http://msdn.microsoft.com/en-us/library/dd393582(v=vs.100).aspx }
*/
createCallback(method: Function, ...context: any[]): Function;
/**
* Creates a callback function that retains the parameter initially used during an object's creation.
* @see {@link http://msdn.microsoft.com/en-us/library/dd409287(v=vs.100).aspx }
*/
createDelegate(instance: any, method: Function): Function;
/**
* A function that does nothing.
* @see {@link http://msdn.microsoft.com/en-us/library/dd393667(v=vs.100).aspx }
*/
emptyMethod(): Function;
/**
* Validates the parameters to a method are as expected.
* @see {@link http://msdn.microsoft.com/en-us/library/dd393712(v=vs.100).aspx }
*/
validateParameters(parameters: any, expectedParameters: Object[], validateParameterCount?: boolean): any;
//#endregion
}
/**
* Provides static functions that extend the built-in ECMAScript (JavaScript) Error type by including exception details and support for application-compilation modes (debug or release).
* Error Type Extensions
* @see {@link http://msdn.microsoft.com/en-us/library/bb310947(v=vs.100).aspx}
*/
interface Error {
//#region lib.d.ts
name: string;
message: string;
new (message?: string): Error;
(message?: string): Error;
prototype: Error;
//#endregion
//#region Extensions
/**
* Creates an Error object that represents the Sys.ParameterCountException exception.
*/
parameterCount(message?: string): Error;
/**
* Creates an Error object that represents the Sys.NotImplementedException exception.
*/
notImplemented(message?: string): Error;
/**
* Creates an Error object that represents the Sys.ArgumentException exception.
*/
argument(paramName?: any, message?: string): Error;
/**
* Creates an Error object that represents the Sys.ArgumentNullException exception.
*/
argumentNull(paramName?: any, message?: string): Error;
/**
* Creates an Error object that represents the Sys.ArgumentOutOfRangeException exception.
*/
argumentOutOfRange(paramName?: string, actualValue?: any, message?: string): Error;
/**
* Creates an Error object that represents the Sys.ArgumentTypeException exception.
*/
argumentType(paramName?: string, actualType?: any, expectedType?: any, message?: string): Error;
/**
* Creates an Error object that represents the Sys.ArgumentUndefinedException exception.
*/
argumentUndefined(paramName?: string, message?: string): Error;
/**
* Creates an Error object that can contain additional error information.
*/
create(message?: string, errorInfo?: Object): Error;
/**
* Creates an Error object that represents the Sys.FormatException exception.
*/
format(message?: string): Error;
/**
* Creates an Error object that represents the Sys.InvalidOperationException exception.
*/
invalidOperation(message?: string): Error;
/**
* Updates the fileName and lineNumber properties of an Error instance to indicate where the error was thrown instead of where the error was created. Use this function if you are creating custom error types.
*/
popStackFrame(): void;
//#endregion
}
/**
* Provides extensions to the base ECMAScript (JavaScript) String object by including static and instance methods.
* String Type Extensions
* @see {@link http://msdn.microsoft.com/en-us/library/bb397472(v=vs.100).aspx}
*/
interface String {
//#region lib.d.ts
new (value?: any): String;
(value?: any): string;
prototype: String;
fromCharCode(...codes: number[]): string;
/** Returns a string representation of a string. */
toString(): string;
/**
* Returns the character at the specified index.
* @param pos The zero-based index of the desired character.
*/
charAt(pos: number): string;
/**
* Returns the Unicode value of the character at the specified location.
* @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.
*/
charCodeAt(index: number): number;
/**
* Returns a string that contains the concatenation of two or more strings.
* @param strings The strings to append to the end of the string.
*/
concat(...strings: string[]): string;
/**
* Returns the position of the first occurrence of a substring.
* @param searchString The substring to search for in the string
* @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
*/
indexOf(searchString: string, position?: number): number;
/**
* Returns the last occurrence of a substring in the string.
* @param searchString The substring to search for.
* @param position The index at which to begin searching. If omitted, the search begins at the end of the string.
*/
lastIndexOf(searchString: string, position?: number): number;
/**
* Determines whether two strings are equivalent in the current locale.
* @param that String to compare to target string
*/
localeCompare(that: string): number;
/**
* Matches a string with a regular expression, and returns an array containing the results of that search.
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
*/
match(regexp: string): string[];
/**
* Matches a string with a regular expression, and returns an array containing the results of that search.
* @param regexp A regular expression object that contains the regular expression pattern and applicable flags.
*/
match(regexp: RegExp): string[];
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A String object or string literal that represents the regular expression
* @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj.
*/
replace(searchValue: string, replaceValue: string): string;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A String object or string literal that represents the regular expression
* @param replaceValue A function that returns the replacement text.
*/
replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
* @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj.
*/
replace(searchValue: RegExp, replaceValue: string): string;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
* @param replaceValue A function that returns the replacement text.
*/
replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string;
/**
* Finds the first substring match in a regular expression search.
* @param regexp The regular expression pattern and applicable flags.
*/
search(regexp: string): number;
/**
* Finds the first substring match in a regular expression search.
* @param regexp The regular expression pattern and applicable flags.
*/
search(regexp: RegExp): number;
/**
* Returns a section of a string.
* @param start The index to the beginning of the specified portion of stringObj.
* @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.
* If this value is not specified, the substring continues to the end of stringObj.
*/
slice(start?: number, end?: number): string;
/**
* Split a string into substrings using the specified separator and return them as an array.
* @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
* @param limit A value used to limit the number of elements returned in the array.
*/
split(separator: string, limit?: number): string[];
/**
* Split a string into substrings using the specified separator and return them as an array.
* @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
* @param limit A value used to limit the number of elements returned in the array.
*/
split(separator: RegExp, limit?: number): string[];
/**
* Returns the substring at the specified location within a String object.
* @param start The zero-based index number indicating the beginning of the substring.
* @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.
* If end is omitted, the characters from start through the end of the original string are returned.
*/
substring(start: number, end?: number): string;
/** Converts all the alphabetic characters in a string to lowercase. */
toLowerCase(): string;
/** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
toLocaleLowerCase(): string;
/** Converts all the alphabetic characters in a string to uppercase. */
toUpperCase(): string;
/** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */
toLocaleUpperCase(): string;
/** Returns the length of a String object. */
length: number;
// IE extensions
/**
* Gets a substring beginning at the specified location and having the specified length.
* @param from The starting position of the desired substring. The index of the first character in the string is zero.
* @param length The number of characters to include in the returned substring.
*/
substr(from: number, length?: number): string;
[index: number]: string;
//#endregion
//#region Extensions
/**
* Formats a number by using the invariant culture.
* @returns true if the end of the String object matches suffix; otherwise, false.
*/
endsWith(suffix: string): boolean;
/**
* Replaces each format item in a String object with the text equivalent of a corresponding object's value.
* @returns A copy of the string with the formatting applied.
*/
format(format: string, ...args: any[]): string;
/**
* Replaces the format items in a String object with the text equivalent of a corresponding object's value. The current culture is used to format dates and numbers.
* @returns A copy of the string with the formatting applied.
*/
localeFormat(format: string, ...args: any[]): string;
/**
* Removes leading and trailing white-space characters from a String object.
* @returns A copy of the string with all white-space characters removed from the start and end of the string.
*/
trim(): string;
/**
* Removes trailing white-space characters from a String object.
* @returns A copy of the string with all white-space characters removed from the end of the string.
*/
trimEnd(): string;
/**
* Removes leading white-space characters from a String object.
* @returns A copy of the string with all white-space characters removed from the start of the string.
*/
trimStart(): string;
//#endregion
}
/**
* Provides extensions to the base ECMAScript (JavaScript) Boolean object.
* Boolean Type Extensions
* @see {@link http://msdn.microsoft.com/en-us/library/bb397557(v=vs.100).aspx}
*/
interface Boolean {
//#region lib.d.ts
new (value?: any): Boolean;
(value?: any): boolean;
prototype: Boolean;
//#endregion
//#region Extensions
/**
* Converts a string representation of a logical value to its Boolean object equivalent.
*/
parse(value: string): Boolean;
//#endregion
}
}
//#endregion
//#region ASP.NET Types
/**
* Provides a typing and type-reflection system for ECMAScript (JavaScript) object-oriented programming functionality.
* Type Class
* @see {@link http://msdn.microsoft.com/en-us/library/bb397568(v=vs.100).aspx}
*/
declare class Type {
/**
* Invokes a base method with specified arguments.
* @returns A value of the class that the base method returns. If the base method does not return a value, no value is returned.
*/
callBaseMethod(instance: any, name: string, baseArguments?: any[]): any;
/**
* Creates a callback method, given the function to callback and the parameter to pass to it.
* @return
* The callback function.
*
* @param method
* The function for which the callback method will be created.
* @param context
* The parameter to pass to the function. This parameter can be null, but it cannot be omitted.
*/
static createCallback(method: Function, context: Object): Function;
/**
* Creates a delegate function that keeps the context from its creation. The context defines the object instance to which the this keyword points.
* @param instance
* The object instance that will be the context for the function. This parameter can be null.
* @param method
* The function from which the delegate is created.
* @return The delegate function.
*/
static createDelegate(instance: Object, method: Function): Function;
/**
* Returns the base implementation of a method from the base class of the specified instance.
* @param instance
* The instance for which the base method is requested.
* @param name
* The name of the method to retrieve as a reference.
*/
getBaseMethod(instance: Object, name: string): any;
/**
* Returns the base class of the instance.
* Use the getBaseType method to retrieve the base class of the instance.
*/
getBaseType(): Type;
/**
* Returns an Array object that contains the list of interfaces that the type implements.
* Use the getInterfaces function to return a list of objects that define the interfaces on a type object.
* This enables you to enumerate the array to determine the object's interfaces.
*
* @return An Array object that contains the list of interfaces that the type implements.
*/
getInterfaces(): any[];
/**
* Returns the name of the type of the instance.
* @return A string representing the fully qualified name of the type of the instance.
* @example Object.getType(c[i]).getName()
*/
getName(): string;
/**
* Returns an Array object containing references to all the root namespaces of the client application. This method is static and is invoked without creating an instance of the object.
* Use the getRootNamespaces function to return an array containing references to all the root namespaces of the client application.
* @return An object containing references to all the root namespaces of the client application.
*/
static getRootNamespaces(): any;
/**
* Determines whether a class implements a specified interface type.
* @param interfaceType
* The interface to test.
* @return true if the class implements interfaceType; otherwise, false.
*/
implementsInterface(interfaceType: Type): boolean;
/**
* Determines whether an instance inherits from a specified class.
* @param parentType
* The fully qualified name of the class to test as a base class for the current instance.
* @return true if the instance inherits from parentType; otherwise, false.
*/
inheritsFrom(parentType: string): boolean;
/**
* Initializes the base class and its members in the context of a given instance, which provides the model for inheritance and for initializing base members.
* @param instance
* The instance to initialize the base class for. Usually this.
* @param baseArguments
* (Optional) The arguments for the base constructor. Can be null.
*/
initializeBase(instance: any, baseArguments?: any[]): any;
/**
* Returns a value that indicates whether the specified type is a class. This method is static and can be invoked without creating an instance of the object.
* @param type
* The type to test.
* @return true if the specified type is a class; otherwise, false.
*/
static isClass(type: any): boolean;
/**
* Indicates whether the specified type is an enumeration.
* @param type
* The type to test.
* @return true if the type is an enumeration; otherwise, false.
*/
static isEnum(type: any): boolean;
/**
* Get a value that indicates whether the specified type is an integer of flags.
* @param
* The type to test.
* @return true if the type is an integer of flags; otherwise, false.
*/
static isFlags(type: any): boolean;
/**
* Determines whether an instance implements an interface.
* @param typeInstanceVar
* The instance on which the interface is tested.
* @return
*/
isImplementedBy(typeInstanceVar: any): boolean;
/**
* Returns a value that indicates whether an object is an instance of a specified class or of one of its derived classes.
* @param instance
* The object to test.
* @return true if instance is an instance of the class; false if instance does not implement the interface, or if it is undefined or null.
*/
isInstanceOfType(instance: any): boolean;
/**
* Returns a value that indicates whether the specified type is an interface. This is a static member that is invoked directly without creating an instance of the class.
* @param type
* The type to test.
* @return true if the specified type is an interface; otherwise, false.
*/
static isInterface(type: any): boolean;
/**
* Returns a value that indicates whether the specified object is a namespace. This is a static member that is invoked directly without creating an instance of the class.
* @param object
* The object to test.
* @return true if the specified object is a namespace; otherwise, false.
*/
static isNamespace(object: any): boolean;
/**
* Returns an instance of the type specified by a type name. This is a static member that is invoked directly without creating an instance of its class.
* @param typeName
* A string that represents a fully qualified class name. Can be null.
* @param ns
* (Optional) The namespace that contains the class.
* @return The class represented by typeName, or null if a class that matches typeName does not occur in the namespace.
*/
static parse(typeName: string, ns?: string): any;
/**
* Registers a class as defined by a constructor with an optional base type and interface type.
* @param typeName
* A string that represents the fully qualified name of the type.
* @param baseType
* (Optional) The base type.
* @param interfaceTypes
* (Optional) An unbounded array of interface type definitions that the type implements.
* @return The registered type.
*/
registerClass(typeName: string, baseType?: any, interfaceTypes?: any[]): any;
/**
* Registers an enumeration.
* @param name
* The fully-qualified name of the enumeration.
* @param flags
* (Optional) true if the enumeration is a collection of flags; otherwise, false.
*/
registerEnum(name: string, flags?: boolean): void;
/**
* Registers an interface defined by a constructor.
* @param typeName
* A string that represents the fully qualified name of the class to be registered as an interface.
* @return The registered interface.
*/
registerInterface(typeName: string): any;
/**
* Creates a namespace. This member is static and can be invoked without creating an instance of the class.
* @param namespacePath
* A string that represents the fully qualified namespace to register.
*/
static registerNamespace(namespacePath: string): void;
/**
* Copies members from the base class to the prototype associated with the derived class, and continues this process up the inheritance chain. This enables you to reflect on the inherited members of a derived type.
* Use the resolveInheritance method to reflect on the inherited members of a derived type.
* You invoke this method from the type that you want to reflect on.
* The resolveInheritance method copies members from the base class to the prototype associated with the derived class, and continues this process up the inheritance chain.
* If the derived type overrides a base type member, the base type member is not copied to the derived type's prototype.
* After invoking a derived type's resolveInheritance method, you can examine the members of the derived type to discover all members, which includes inherited members.
*/
resolveInheritance(): void;
}
//#endregion
//#region Shortcuts to commonly used APIs
/**
* Creates and initializes a component of the specified type. This method is static and can be called without creating an instance of the class.
* @see {@link http://msdn.microsoft.com/en-us/library/bb397487(v=vs.100).aspx}
*
* @param type
* The type of the component to create.
* @param properties
* (Optional) A JSON object that describes the properties and their values.
* @param events
* (Optional) A JSON object that describes the events and their handlers.
* @param references
* (Optional) A JSON object that describes the properties that are references to other components.
* @param element
* (Optional) The DOM element that the component should be attached to.
* @returns A new instance of a component that uses the specified parameters.
*/
declare function $create(type: Type, properties?: any, events?: any, references?: any, element?: HTMLElement): Sys.Component;
/**
* Returns the specified Component object. This member is static and can be invoked without creating an instance of the class.
* @see {@link http://msdn.microsoft.com/en-us/library/bb397441(v=vs.100).aspx}
* @param id A string that contains the ID of the component to find.
* @param parent (Optional) The component or element that contains the component to find.
* @return A Component object that contains the component requested by ID, if found; otherwise, null.
*/
declare function $find(id: string, parent?: Sys.Component): Sys.Component;
/**
* Returns the specified Component object. This member is static and can be invoked without creating an instance of the class.
* @see {@link http://msdn.microsoft.com/en-us/library/bb397441(v=vs.100).aspx}
* @param id A string that contains the ID of the component to find.
* @param parent (Optional) The component or element that contains the component to find.
* @return A Component object that contains the component requested by ID, if found; otherwise, null.
*/
declare function $find(id: string, parent?: HTMLElement): Sys.Component;
/*
* Provides a shortcut to the addHandler method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class.
* @see {@link http://msdn.microsoft.com/en-us/library/bb311019(v=vs.100).aspx}
* @param element The DOM element that exposes the event.
* @param eventName The name of the event.
* @param handler The event handler to add.
* @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed.
*/
declare function $addHandler(element: Sys.UI.DomElement, eventName: string, handler: Function, autoRemove?: boolean): void;
/**
* Provides a shortcut to the addHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class.
* @see {@link http://msdn.microsoft.com/en-us/library/bb384012(v=vs.100).aspx}
* @param element The DOM element that exposes the event.
* @param events A dictionary of events and their handlers.
* @param handlerOwner (Optional) The object instance that is the context for the delegates that should be created from the handlers.
* @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed.
*/
declare function $addHandlers(element: Sys.UI.DomElement, events: any, handlerOwner?: any, autoRemove?: boolean): void;
/**
* Provides a shortcut to the clearHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class.
* For details about the method that this shortcut represents, see Sys.UI.DomEvent clearHandlers Method.
* @see {@link http://msdn.microsoft.com/en-us/library/bb310959(v=vs.100).aspx}
* @param The DOM element that exposes the events.
*/
declare function $clearHandlers(element: Sys.UI.DomElement): void;
/**
* Provides a shortcut to the getElementById method of the Sys.UI.DomElement class. This member is static and can be invoked without creating an instance of the class.
* @see {@link http://msdn.microsoft.com/en-us/library/bb397717(v=vs.100).aspx}
* @param id
* The ID of the DOM element to find.
* @param element
* The parent element to search. The default is the document element.
* @return
* The Sys.UI.DomElement
*/
declare function $get(id: string): any; // Examples use HTMLElement and DomElement
declare function $get(id: string, element?: HTMLElement): HTMLElement;
declare function $get(id: string, element?: Sys.UI.DomElement): Sys.UI.DomElement;
/**
* Provides a shortcut to the removeHandler method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class.
* @see {@link http://msdn.microsoft.com/en-us/library/bb397510(v=vs.100).aspx}
* @param element The DOM element that exposes the event.
* @param eventName The name of the DOM event.
* @param handler The event handler to remove.
*/
declare function $removeHandler(element: any, eventName: string, handler: Function): void;
declare function $removeHandler(element: HTMLElement, eventName: string, handler: Function): void;
declare function $removeHandler(element: Sys.UI.DomElement, eventName: string, handler: Function): void;
//#endregion
//#endregion
//#region Sys Namespace
/**
* Represents the root namespace for the Microsoft Ajax Library, which contains all fundamental classes and base classes.
* @see {@link http://msdn.microsoft.com/en-us/library/bb397702(v=vs.100).aspx}
*/
declare module Sys {
//#region Classes
/**
* Provides a run-time object that exposes client events and manages client components that are registered with the application.
* The members of this object are available globally after the client application has been initialized.
* The members can be invoked without creating an instance of the class.
* @see {@link http://msdn.microsoft.com/en-us/library/bb384161(v=vs.100).aspx}
*/
interface Application {
//#region Constructors
constructor(): void;
//#endregion
//#region Events
/**
* Raised after all scripts have been loaded but before objects are created.
*/
add_init(handler: Function): void;
/**
* Raised after all scripts have been loaded but before objects are created.
*/
remove_init(handler: Function): void;
/**
* Raised after all scripts have been loaded and after the objects in the application have been created and initialized.
*/
add_load(handler: Function): void;
/**
* Raised after all scripts have been loaded and after the objects in the application have been created and initialized.
*/