forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
microsoft.ajax.d.ts
3725 lines (3273 loc) · 162 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 ObjectConstructor {
/**
* 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 ArrayConstructor {
//#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<T>(array: T[], element: T): void;
/**
* Copies all the elements of the specified array to the end of an Array object.
*/
addRange<T>(array: T[], items: T[]): void;
/**
* Removes all elements from an Array object.
*/
clear<T>(array: T[]): void;
/**
* Creates a shallow copy of an Array object.
*/
clone<T>(array: T[]): T[];
/**
* Determines whether an element is in an Array object.
*/
contains<T>(array: T[], element: T): boolean;
/**
* Removes the first element from an Array object.
*/
dequeue<T>(array: T[]): T;
/**
* Adds an element to the end of an Array object. Use the add function instead of the Array.enqueue function.
*/
enqueue<T>(array: T[], element: T): void;
/**
* Performs a specified action on each element of an Array object.
*/
forEach<T>(array: T[], method: (element: T, index: number, array: T[]) => void, instance: any): void;
/**
* Searches for the specified element of an Array object and returns its index.
*/
indexOf<T>(array: T[], item: T, startIndex?: number): number;
/**
* Inserts a value at the specified location in an Array object.
*/
insert<T>(array: T[], index: number, item: T): void;
/**
* Creates an Array object from a string representation.
*/
parse<T>(value: string): T[];
/**
* Removes the first occurrence of an element in an Array object.
*/
remove<T>(array: T[], item: T): boolean;
/**
* Removes an element at the specified location in an Array object.
*/
removeAt<T>(array: T[], 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;
}
interface NumberConstructor {
/**
* 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(format: 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(format: string): string;
}
interface DateConstructor {
/**
* 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, formats?: string[]): Date;
parseLocale(value: string, ...formats: string[]): Date;
/**
* 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, formats?: string[]): string;
parseInvariant(value: string, ...formats: string[]): string;
}
/**
* 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 FunctionConstructor {
//#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 ErrorConstructor {
//#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;
//#endregion
}
interface 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;
}
interface String {
//#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;
/**
* 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) 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 StringConstructor {
/**
* 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;
}
/**
* 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 BooleanConstructor {
//#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: HTMLElement, eventName: string, handler: (e: Sys.UI.DomEvent) => void, 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: HTMLElement, events: { [event: string]: (e: Sys.UI.DomEvent) => void }, 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: HTMLElement): void;
/**
* Provides a shortcut to the getElementById method of the HTMLElement 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 HTMLElement
*/
declare function $get(id: string, element?: HTMLElement): HTMLElement;
/**
* 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: HTMLElement, eventName: string, handler: (e: Sys.UI.DomEvent) => void): 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 extends Component, IContainer {
//#region Constructors
constructor(): void;
//#endregion
//#region Events
/**
* Raised after all scripts have been loaded but before objects are created.
*/
add_init(handler: (sender: Application, eventArgs: EventArgs) => void): void;
/**
* Raised after all scripts have been loaded but before objects are created.
*/
remove_init(handler: (sender: Application, eventArgs: EventArgs) => void): void;
/**
* Raised after all scripts have been loaded and after the objects in the application have been created and initialized.
*/
add_load(handler: (sender: Application, eventArgs: ApplicationLoadEventArgs) => void): void;
/**
* Raised after all scripts have been loaded and after the objects in the application have been created and initialized.
*/
remove_load(handler: (sender: Application, eventArgs: ApplicationLoadEventArgs) => void): void;
/**
* Occurs when the user clicks the browser's Back or Forward button.
*/
add_navigate(handler: (sender: Application, eventArgs: HistoryEventArgs) => void): void;
/**
* Occurs when the user clicks the browser's Back or Forward button.
*/
remove_navigate(handler: (sender: Application, eventArgs: HistoryEventArgs) => void): void;
/**
* Raised before all objects in the client application are disposed, typically when the DOM window.unload event is raised.
*/
add_unload(handler: Function): void;
/**
* Raised before all objects in the client application are disposed, typically when the DOM window.unload event is raised.
*/
remove_unload(handler: Function): void;
//#endregion
//#region Methods
/**
* Registers a component with the application and initializes it if the component is not already initialized.
*/
addComponent(component: any): void;
/**
* Instructs the application to start creating components.
*/
beginCreateComponents(): void;
/**
* Creates a history point and adds it to the browser's history stack.
*/
addHistoryPoint(state: Object, title?: string): void;
/**
* Called by the Sys.Application.beginUpdate Method to indicate that the process of setting component properties of the application has begun.
*/
beginUpdate(): void;
/**
* Releases resources and dependencies held by the client application.
*/
dispose(): void;
/**
* Releases resources and dependencies associated with an element and its child nodes.
* @param element
* The element to dispose.
* @param childNodesOnly
* A boolean value used to determine whether to dispose of the element and its child nodes or to dispose only its child nodes.
*/
disposeElement(element: Element, childNodesOnly: boolean): void;
/**
* Instructs the application to finalize component creation.
*/
endCreateComponents(): void;
/**
* Called by the Sys.Application.endCreateComponents Method to indicate that the process of updating the application has completed.
*/
endUpdate(): void;
/**
* Returns the specified Component object. This member is static and can be invoked without creating an instance of the class.
* @return A Component object that contains the component requested by ID, if found; otherwise, null.
*/
findComponent(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.
* @return A Component object that contains the component requested by ID, if found; otherwise, null.
*/
findComponent(id: string, parent?: HTMLElement): Sys.Component;
/**
* Returns an array of all components that have been registered with the application by using the addComponent method. This member is static and can be invoked without creating an instance of the class.
*/
getComponents(): Sys.Component[];
/**
* This function supports the client-script infrastructure and is not intended to be used directly from your code.
*/
initialize(): void;
/**
* Called by a referenced script to indicate that it has been loaded. This API is obsolete. You no longer need to call this method in order to notify the Microsoft Ajax Library that the JavaScript file has been loaded.
*/
notifyScriptLoaded(): void;
/**
* Raises the load event. This member is static and can be invoked without creating an instance of the class.
*/
raiseLoad(): void;
/**
* Raises the Sys.INotifyPropertyChange.propertyChanged event.
*/
raisePropertyChanged(propertyName: string): void;
/**
* Registers with the application an object that will require disposing. This member is static and can be invoked without creating an instance of the class.
*/
registerDisposableObject(object: any): void;
/**
* Removes the object from the application and disposes the object if it is disposable. This member is static and can be invoked without creating an instance of the class.
*/
removeComponent(component: Component): void;
/**
* Unregisters a disposable object from the application. This member is static and can be invoked without creating an instance of the class.
*/
unregisterDisposableObject(object: any): void;
/**
* Called by the Sys.Application.endUpdate method as a placeholder for additional logic.
*/
updated(): void;
//#endregion
//#region Properties
/**
* Gets or sets a value that indicates whether the Web application supports history point management.
*/
get_enableHistory(): boolean;
/**
* Gets or sets a value that indicates whether the Web application supports history point management.
* @param value
* true to allow the Web application to support history points, or false to not allow history points.
*/
set_enableHistory(value: boolean): void;
/**
* Gets a value that indicates whether the application is in the process of creating components. This member is static and can be invoked without creating an instance of the class.
*/
get_isCreatingComponents(): boolean;
/**
* Gets a value that indicates whether the application is in the process of disposing its resources. This member is static and can be invoked without creating an instance of the class.
*/
get_isDisposing(): boolean;
//#endregion
}
var Application: Application;
/**
* Provides information about the current Web browser.
* The Sys.Browser object determines which browser is being used and provides some information about it. You can use this object to help customize your code to the unique requirements or capabilities of the browser.
* @see {@link http://msdn.microsoft.com/en-us/library/cc679064(v=vs.100).aspx}
*/
interface Browser {
//#region Fields
/**
* Gets an object that represents the user agent of the browser.
*/
agent: any;
/**
* Gets a value that indicates the document compatibility mode of the browser.
* @return
*
*/
documentMode: number;
/*
* Gets a value that indicates whether the browser supports debug statements.
* @return
* True if the browser supports debug statements
*/
hasDebuggerStatement: boolean;
/**
* Gets the name of the browser.
* @return
* The name of the browser
*/
name: string;
/*
* Gets the version number of the browser.
* @return
* The version of the browser
*/
version: number;
//#endregion
}
export function Browser(): Sys.Browser;
/**
* Provides the base class for the Control and Behavior classes, and for any other object whose lifetime should be managed by the ASP.NET AJAX client library.
* @see {@link http://msdn.microsoft.com/en-us/library/bb397516(v=vs.100).aspx}
*/
class Component {
//#region Constructors
/**
* When overridden in a derived class, initializes an instance of that class and registers it with the application as a disposable object.
*/
constructor();
//#endregion
//#region Events
/**
* Raised when the dispose method is called for a component.
*/
add_disposing(handler: Function): void;
/**
* Raised when the dispose method is called for a component.
*/
remove_disposing(handler: Function): void;
/**
* Raised when the raisePropertyChanged method of the current Component object is called.
*/
add_propertyChanged(handler: Function): void;
/**
* Raised when the raisePropertyChanged method of the current Component object is called.
*/
remove_propertyChanged(handler: Function): void;
//#endregion
//#region Methods
/**
* Called by the create method to indicate that the process of setting properties of a component instance has begun.
*/
beginUpdate(): void;
/**
* Creates and initializes a component of the specified type. This method is static and can be called without creating an instance of the class.
* @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.
*/
static create(type: Type, properties?: any, events?: any, references?: any, element?: HTMLElement): Sys.Component;
/**
* Called by the create method to indicate that the process of setting properties of a component instance has finished.
* This method is called by the create method ($create).
* Sets the isUpdating property of the current Component object to false, calls the initialize method if it has not already been called, and then calls the updated method.
*/
endUpdate(): void;
/**
* Initializes the current Component object.
* The initialize method sets the isInitialized property of the current Component object to true. This function is called by the create method ($create) and overridden in derived classes to initialize the component.
*/
initialize(): void;
/**
* Raises the propertyChanged event for the specified property.
* @param propertyName
* The name of the property that changed.
*/
raisePropertyChanged(propertyName: string): void;
/**
* Called by the endUpdate method as a placeholder for additional logic in derived classes.
* Override the updated method in a derived class to add custom post-update logic.
*/
updated(): void;
/**
* Raises the disposing event of the current Component and removes the component from the application.
*/
dispose(): void;
//#endregion
//#region Properties
/**
* Gets an EventHandlerList object that contains references to all the event handlers that are mapped to the current component's events.
* This member supports the client-script infrastructure and is not intended to be used directly from your code.
* @return
* An EventHandlerList object that contains references to all the events and handlers for this component.
*/
get_events(): any;
/**
* Gets the ID of the current Component object.
* @return
* The id
*/
get_id(): string;
/**
* Sets the ID of the current Component object.
* @param value A string that contains the ID of the component.
*/
set_id(value: string): void;
/**
* Gets a value indicating whether the current Component object is initialized.
* @return
* true if the current Component is initialized; otherwise, false.
*/
get_isInitialized(): boolean;
/**
* Gets a value indicating whether the current Component object is updating.
* @return
* true if the current Component object is updating; otherwise, false.
*/
get_isUpdating(): boolean;
//#endregion
}
/**
* Represents a culture definition that can be applied to objects that accept a culture-related setting.
* @see {@link http://msdn.microsoft.com/en-us/library/bb384004(v=vs.100).aspx}
*/
class CultureInfo {
//#region Constructors
/**
* Initializes a new instance of the Sys.CultureInfo class.
* @param name
* The culture value (locale) that represents a language and region.
* @param numberFormat
* A culture-sensitive numeric formatting string.
* @param dateTimeFormat
* A culture-sensitive date formatting string.
*/
constructor(name: string, numberFormat: string, dateTimeFormat: string);
//#endregion
//#region Properties
/**
* Gets an object that contains an array of culture-sensitive formatting and parsing strings values that can be applied to Number type extensions.
* Use the numberFormat field to retrieve an object that contains an array of formatting strings that are based on the current culture or on the invariant culture.
* Each formatting string can be used to specify how to format Number type extensions.
* @return An object that contains an array of culture-sensitive formatting strings.
*/
numberFormat: string[];
/**
* Gets the culture value (locale) that represents a language and region.
* @return The culture value (locale) that represents a language and region.
*/
name: string;
/**
* Gets the globalization values of the invariant culture as sent by the server. This member is static and can be invoked without creating an instance of the class.
* The InvariantCulture field contains the following fields associated with the invariant (culture-independent) culture: name, dateTimeFormat, and numberFormat.
* @return A CultureInfo object.
*/
static InvariantCulture: CultureInfo;