forked from docsforadobe/Types-for-Adobe
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathJavaScript.d.ts
2708 lines (2269 loc) · 90.4 KB
/
JavaScript.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
/**
* The $ object provides a number of debugging facilities and informational methods.
*/
interface $ {
/**
* The ExtendScript build information.
*/
readonly build: string
/**
* The ExtendScript build date.
*/
readonly buildDate: Date
/**
* The character used as the decimal point character in formatted numeric output.
*/
decimalPoint: string
/**
* The name of the current ExtendScript engine, if set.
*/
readonly engineName: string
/**
* The most recent run-time error information.
* Assigning error text to this property generates a run-time error; however, the preferred way to generate a run-time error is to throw an Error object.
*/
error: Error
/**
* The file name of the current script.
*/
readonly fileName: string
/**
* Gets or sets low-level debug output flags.
* A logical AND of bit flag values:
* 0x0002 (2): Displays each line with its line number as it is executed.
* 0x0040 (64): Enables excessive garbage collection. Usually, garbage collection starts when the number of objects has increased by a certain amount since the last garbage collection. This flag causes ExtendScript to garbage collect after almost every statement. This impairs performance severely, but is useful when you suspect that an object gets released too soon.
* 0x0080 (128): Displays all calls with their arguments and the return value.
* 0x0100 (256): Enables extended error handling (see strict).
* 0x0200 (512): Enables the localization feature of the toString method. Equivalent to the localize property.
*/
flags: number
/**
* A reference to the global object, which contains the JavaScript global namespace.
*/
readonly global: any
/**
* A high-resolution timer, measuring the time in microseconds. The timer starts when ExtendScript is
* initialized during the application startup sequence. Every read access resets the timer to Zero.
*/
readonly hiresTimer: number
/**
* The path for include files for the current script.
*/
readonly includePath: string
/**
* The current debugging level, which enables or disables the JavaScript debugger.
* One of 0 (no debugging), 1 (break on runtime errors), or 2 (full debug mode).
*/
level: number
/**
* The current line number of the currently executing script.
*/
readonly line: number
/**
* Gets or sets the current locale.
* The string contains five characters in the form LL_RR, where LL is an ISO 639 language specifier, and RR is an ISO 3166 region specifier.Initially, this is the value that the application or the platform returns for the current user. You can set it to temporarily change the locale for testing. To return to the application or platform setting, set to undefined, null, or the empty string.
*/
locale: string
/**
* Set to true to enable the extended localization features of the built-in toString() method.
*/
localize: boolean
/**
* The ExtendScript memory cache size, in bytes.
*/
memCache: number
/**
* The current operating system version information.
*/
readonly os: string
/**
* An array of objects containing information about the display screens attached to your computer.
* Each object has the properties left, top, right, bottom, which contain the four corners of each screen in global coordinates.A property primary is true if that object describes the primary display.
*/
readonly screens: object[]
/**
* The current stack trace.
*/
readonly stack: string
/**
* Sets or clears strict mode for object modification.
* When true, any attempt to write to a read-only property causes a runtime error. Some objects do not permit the creation of new properties when true.
*/
strict: any
/**
* The version number of the ExtendScript engine.
* Formatted as a three-part number and description; for example: "3.92.95 (debug)".
*/
readonly version: string
/**
* Shows an About box for the ExtendScript component, and returns the text for the box.
*/
about(): string
/**
* Breaks execution at the current position.
* @param condition A string containing a JavaScript statement to be used as a condition. If the statement evaluates to true or nonzero when this point is reached, execution stops.
*/
bp(condition?: any): void
/**
* Invokes the platform-specific color selection dialog, and returns the selected color.
* @param color The color to be preselected in the dialog, as 0xRRGGBB, or -1 for the platform default.
*/
colorPicker(color: number): number
/**
* Loads and evaluates a file.
* @param file The file to load.
* @param timeout An optional timeout in milliseconds.
*/
evalFile(file: File, timeout?: number): any
/**
* Initiates garbage collection in the ExtendScript engine.
*/
gc(): void
/**
* Retrieves the value of an environment variable.
* @param name The name of the variable.
*/
getenv(name: string): string
/**
* Sets the value of an environment variable.
* @param name The name of the variable.
* @param value The value of the variable.
*/
setenv(name: string, value: string): void
/**
* Suspends the calling thread for a number of milliseconds.
* During a sleep period, checks at 100 millisecond intervals to see whether the sleep should be terminated. This can happen if there is a break request, or if the script timeout has expired.
* @param msecs Number of milliseconds to sleep.
*/
sleep(msecs: number): void
/**
* Converts this object to a string.
*/
toString(): string
/**
* Prints text to the Console.
* @param text The text to print. All arguments are concatenated.
*/
write(text: any): void
/**
* Prints text to the Console, and adds a newline character.
* @param text The text to print. All arguments are concatenated.
*/
writeln(text: any): void
}
declare const $: $
interface ObjectConstructor {
readonly prototype: Object
/**
* Creates and returns a new object of a given type.
* @param what The object type.
*/
new (what: any): Object
(): any
(what: any): any
/**
* Reports whether an object is still valid.
* @param what The object to check.
*/
isValid(what: Object): boolean
}
declare const Object: ObjectConstructor
/**
* The base class of all JavaScript objects.
*/
interface Object {
/**
* Points to the constructor function that created this object.
* Note that this property is treated as an XML element in the XML class.
*/
readonly constructor: Function
/**
* Points to the prototype object for this object.
* Note that this property is treated as an XML element in the XML class.
*/
readonly prototype: Object
/**
* Retrieves and returns the Reflection object associated with this method or a property.
* Note that this property is treated as an XML element in the XML class.
*/
readonly reflect: Reflection
/**
* Reports whether a given property is defined with an instance or within the prototype chain.
* @param name The name of the property to check.
*/
hasOwnProperty(name: string): boolean
/**
* Checks whether the given object is a prototype of this object.
* @param what The object to check.
*/
isPrototypeOf(what: Object): boolean
/**
* Reports whether a given property is enumerable.
* @param name The name of the property to check.
*/
propertyIsEnumerable(name: string): boolean
/**
* Creates and returns a string representing this object, localized for the current locale. See toString().
*/
toLocaleString(): string
/**
* Creates and returns a string representation of this object.
* This function serializes the object, so that it can, for example, be passed between engines. Pass the returned string back to eval() to recreate the object. Works only with built-in classes.
*/
toSource(): string
/**
* Creates and returns a string representing this object.
* Many objects (such as Date) override this method in favor of their own implementation. If an object has no string value and no user-defined toString() method, the default method returns [object type], where type is the object type or the name of the constructor function that created the object.
*/
toString(): string
/**
* Removes the watch function of a property.
* @param name The name of the property to unwatch.
*/
unwatch(name: string): void
/**
* Retrieves and returns the primitive value of this object.
* If the object has no primitive value, returns the object itself.Note that you rarely need to call this method yourself.The JavaScript interpreter automatically invokes it when encountering an object where a primitive value is expected.
*/
valueOf(): Object
/**
* Adds a watch function to a property, which is called when the value changes.
* This function can accept, modify, or reject a new value that the user, application, or a script has attempted to place in a property.
* @param name The name of the property to watch.
* @param func The function to be called when the value of this property changes. This function must three arguments, and return as its result the value to be stored in the property. The arguments are: name: the name of the property that changes. oldValue: The old property value. newValue: The new property value that was specified.
*/
watch(name: string, func: Function): void
}
interface ArrayConstructor {
readonly prototype: Array<any>
/**
* Creates and returns a new array.
* Takes any number of parameters, which become the elements of the array, or a single value which becomes the length of an empty array. Note that you cannot create a one-element array, as the single parameter value is interpreted as the length. Returns the new array.
* @param arrayLength If no other parameters are passed, the initial length of the empty array. Otherwise, the first element.
* @param values If there is more than one parameter, the array is initialized with the given parameters.
*/
new (arrayLength?: number): any[]
new <T>(arrayLength: number): T[]
new <T>(...values: T[]): T[]
(arrayLength?: number): any[]
<T>(arrayLength: number): T[]
<T>(...values: T[]): T[]
}
declare const Array: ArrayConstructor
/**
* An array with integer indexing and a length property.
*/
interface Array<T> {
[n: number]: T
/**
* The length of the array
*/
length: number
/**
* Returns a new array created by concatenating the given values to the end of the original array.
* The original array is unchanged.If an array is provided as a parameter to concat(), each of its elements are appended as separate array elements at the end of the new array.Returns a new array, the result of concatenation the given values to the end of the original array.
* @param values Any number of values to be added to the end of the array. Can also be arrays.
*/
concat(...values: T[][]): T[]
/**
* Joins all elements of the array into a string; optionally, each element is separated by delimiter.
* Returns the string containing the joined elements and delimiters.
* @param delimiter A string used to separate each element of the array. If omitted, the array elements are separated with a comma.
*/
join(delimiter?: string): string
/**
* Removes the last element from the array, decreases the length by 1, and returns the value of the element.
* Returns the value of the deleted array element.
*/
pop(): T | undefined
/**
* Places one or more values onto the end of the array and increases length by n.
* Returns the new length of the array.
* @param values Any number of values to be pushed onto the end of the array.
*/
push(...values: T[]): number
/**
* Reverses the order of the elements in the array.
* Returns the reversed array.
*/
reverse(): T[]
/**
* Removes the first element from the array, decreases the length by 1, and returns the value of the element.
* Returns the value of the deleted array element.
*/
shift(): T | undefined
/**
* Creates a new array, which contains a subset of the original array's elements.
* The slice begins with the index start, and continues up to, but not including the index, end.If start or end is a negative number, the indexed is resolved counting backwards from the end of the array resulting in the element array[array. length + negativeIndex]. Returns a new array containing elements array[start] through array[end-1].
*/
slice(start?: number, end?: number): T[]
/**
* Sorts the elements of the array in place, using the given function to compare to elements.
* If no function is provided, the elements are sorted alphabetically.Returns no return value.
* @param userFunction A user-supplied function of the form userFunction(a, b) which returns less than 0 if a is greater than b, 0 if a and b are equal, and greater than 0 if b is greater than a.
*/
sort(userFunction?: (a: T, b: T) => number): this
/**
* Removes num elements from the array beginning with index, start.
* Optionally insert new elements beginning at index start.To ensure contiguity, elements are moved up to fill in any gaps.Returns a new array containing any elements deleted from the original array.
* @param start The index of the first element to remove. Negative values are relative to the end of the array.
* @param deleteCount The number of array elements to remove, including start. If omitted, all elements from array index start to the end of the array are removed.
* @param values A list of one or more values to be added to the array starting at index start. Must specify a value for num, to use this argument.
*/
splice(start: number, deleteCount?: number, ...values: T[]): T[]
/**
* Converts an array to a string and returns the string (localized).
*/
toLocaleString(): string
/**
* Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with built-in classes.
*/
toSource(): string
/**
* Converts an array to a string and returns the string.
* Yields the same result as array. join() when called without a parameter.Returns a comma-separated list of all the elements of the array.
*/
toString(): string
/**
* Adds one or more elements to the beginning of the array.
* Returns the new array length.
* @param values The values of one or more elements to be added to the beginning of the array.
*/
unshift(...values: T[]): number
}
/**
* A global object containing a set of math functions and constants.
*/
interface Math {
/**
* Euler's constant and the base of natural logarithms.
*/
readonly E: number
/**
* The natural logarithm of 10.
*/
readonly LN10: number
/**
* The natural logarithm of 2.
*/
readonly LN2: number
/**
* The base 10 logarithm of e.
*/
readonly LOG10E: number
/**
* The base 2 logarithm of e.
*/
readonly LOG2E: number
/**
* The ratio of the circumference of a circle to its diameter.
*/
readonly PI: number
/**
* The reciprocal of the square root of 1/2.
*/
readonly SQRT1_2: number
/**
* The square root of 2.
*/
readonly SQRT2: number
/**
* Returns the absolute value of a number.
* @param x A number.
*/
abs(x: number): number
/**
* Returns the arc cosine(in radians) of a number.
* @param x A number.
*/
acos(x: number): number
/**
* Returns the arc sin(in radians) of a number.
* @param x A number.
*/
asin(x: number): number
/**
* Returns the arc tangent(in radians) of a number.
* @param x A number.
*/
atan(x: number): number
/**
* Returns the arc tangent of the quotient of its arguments (y/x).
* @param y A number.
* @param x A number.
*/
atan2(y: number, x: number): number
/**
* Rounds the number up to the nearest integer.
* @param x A number.
*/
ceil(x: number): number
/**
* Returns the cosine of an angle provided in radians.
* @param x An angle, in radians.
*/
cos(x: number): number
/**
* Returns Math.E raised to the power of a number.
* @param x A number.
*/
exp(x: number): number
/**
* Rounds a number down to the nearest integer.
* @param x A number.
*/
floor(x: number): number
/**
* Returns the natural logarithm of a number.
* @param x A number.
*/
log(x: number): number
/**
* Returns the largest of zero or more numbers.
* @param rest Numbers.
*/
max(...rest: number[]): number
/**
* Returns the smallest of zero or more numbers.
* @param rest Numbers.
*/
min(...rest: number[]): number
/**
* Returns x raised to the power of y.
* @param x Numbers.
* @param y
*/
pow(x: number, y: number): number
/**
* Returns a pseudo-random number from 0.0 up to but not including 1.0.
*/
random(): number
/**
* Rounds a number to the nearest integer.
* @param x A number.
*/
round(x: number): number
/**
* Returns the sine of an angle provided in radians.
* @param x An angle, in radians.
*/
sin(x: number): number
/**
* Returns the square root of a number.
* @param x A number.
*/
sqrt(x: number): number
/**
* Returns the tangent of an angle provided in radians.
* @param x An angle, in radians.
*/
tan(x: number): number
}
declare const Math: Math
interface DateConstructor {
readonly prototype: Date
/**
* Returns a new Date object holding the current date and time.
* If parameters are supplied, returns a new Date object holding the supplied date and time.
* @param year The year expressed in four digits.
* @param month An integer value from 0 (Jan) to 11 (Dec).
* @param day An integer value from 1 to 31, If this argument is not supplied, its value is set to 0.
* @param hours An integer value from 0 (midnight) to 23 (11 PM). If this argument is not supplied, its value is set to 0.
* @param min An integer value from 0 to 59. If this argument is not supplied, its value is set to 0.
* @param sec An Integer value from 0 to 59. If this argument is not supplied, its value is set to 0.
* @param ms An integer value from 0 to 999. If this argument is not supplied, its value is set to 0.
*/
new (): Date
new (value: number): Date
new (value: string): Date
new (
year: number,
month: number,
day?: number,
hours?: number,
min?: number,
sec?: number,
ms?: number,
): Date
/**
* Parses a string, returning a new Date object. The string should be similar to the string returned bt toString().
* @param text The string to parse.
*/
parse(text: string): Date
/**
* Returns the number of milliseconds between midnight January 1, 1970, UTC, and the specified time.
* @param year The year expressed in four digits, for example, 2001. To indicate for a year from 1900 to 1999, you can specify a value from 0 to 99.
* @param month An integer value from 0 (Jan) to 11 (Dec).
* @param day An integer value from 1 to 31, If this argument is not supplied, its value is set to 0.
* @param hours An integer value from 0 (midnight) to 23 (11 PM). If this argument is not supplied, its value is set to 0.
* @param min An integer value from 0 to 59. If this argument is not supplied, its value is set to 0.
* @param sec An Integer value from 0 to 59. If this argument is not supplied, its value is set to 0.
* @param ms An integer value from 0 to 999. If this argument is not supplied, its value is set to 0.
*/
UTC(
year: number,
month?: number,
day?: number,
hours?: number,
min?: number,
sec?: number,
ms?: number,
): Date
}
declare const Date: DateConstructor
/**
* A date/time object.
*/
interface Date {
/**
* Returns the day of the month of the specified Date object in local time.
*/
getDate(): number
/**
* Returns the day of the week for the specified Date object in local time.
* This is an integer from 0 (Sunday) to 6 (Saturday).Returns the day of the week for date.
*/
getDay(): number
/**
* Returns the four digit year of the specified Date object in local time.
*/
getFullYear(): number
/**
* Returns the hour of the specified Date object in local time.
*/
getHours(): number
/**
* Returns the milliseconds of the specified Date object in local time.
*/
getMilliseconds(): number
/**
* Returns the minutes of the specified Date object in local time.
*/
getMinutes(): number
/**
* Returns the month of the specified Date object in local time.
*/
getMonth(): number
/**
* Returns the seconds of the specified Date object in local time.
*/
getSeconds(): number
/**
* Returns the number of milliseconds since midnight January 1,1970 UTC for the specified Date object.
*/
getTime(): number
/**
* Returns the difference in minutes between the computer's local time and UTC.
*/
getTimezoneOffset(): number
/**
* Returns the day of the month of the specified Date object according to UTC.
*/
getUTCDate(): number
/**
* Returns the day of the week for the specified Date object according to UTC.
*/
getUTCDay(): number
/**
* Returns the four digit year of the specified Date object according to UTC.
*/
getUTCFullYear(): number
/**
* Returns the hour of the specified Date object according to UTC.
*/
getUTCHours(): number
/**
* Returns the milliseconds of the specified Date object according to UTC.
*/
getUTCMilliseconds(): number
/**
* Returns the minutes of the specified Date object according to UTC.
*/
getUTCMinutes(): number
/**
* Returns the month of the specified Date object according to UTC.
*/
getUTCMonth(): number
/**
* Returns the seconds of the specified Date object according to UTC.
*/
getUTCSeconds(): number
/**
* Returns the year of the specified Date object, as a difference from 1900, in local time.
*/
getYear(): number
/**
* Sets the day of the month of a specified Date object according to local time.
* Returns the number of milliseconds between the new date and midnight, January 1, 1970.
* @param date An integer from 1 to 31 indicating the day of the month.
*/
setDate(date: number): number
/**
* Sets the year of a specified Date object according to local time.
* This method can also set month and date if those arguments are specified. Returns the number of milliseconds between the new date and midnight, January 1, 1970.
* @param year A four-digit integer value indicating the year to set.
*/
setFullYear(year: number): number
/**
* Sets the hours of a specified Date object according to local time.
* Returns the number of milliseconds between the new date and midnight, January 1, 1970.
* @param hour An integer value from 0 (midnight) to 23 (11 PM).
*/
setHours(hour: number): number
/**
* Sets the milliseconds of a specified Date object according to local time.
* Returns the number of milliseconds between the new date and midnight, January 1, 1970.
* @param ms An integer value from 0 to 999.
*/
setMilliseconds(ms: number): number
/**
* Sets the minutes of a specified Date object according to local time.
* Returns the number of milliseconds between the new date and midnight, January 1, 1970.
* @param minutes An integer value from 0 to 59.
*/
setMinutes(minutes: number): number
/**
* Sets the month of a specified Date object according to local time.
* Returns the number of milliseconds between the new date and midnight, January 1, 1970.
* @param month An integer value from 0 (Jan) to 11 (Dec).
*/
setMonth(month: number): number
/**
* Sets the seconds of a specified Date object according to local time.
* Returns the number of milliseconds between the new date and midnight, January 1, 1970.
* @param seconds An integer value from 0 to 59.
*/
setSeconds(seconds: number): number
/**
* Sets the date of a specified Date object in milliseconds since midnight, January 1, 1970.
* Returns the value of ms.
* @param ms An integer indicating the number of milliseconds between the date set and midnight, January 1, 1970.
*/
setTime(ms: number): number
/**
* Sets the date of a specified Date object according to universal time.
* Returns the number of milliseconds between the new date and midnight, January 1, 1970 in UTC time.
* @param date An integer from 1 to 31 indicating the day of the month.
*/
setUTCDate(date: number): number
/**
* Sets the year of a specified Date object according to UTC, can also set the month and date.
* Returns the number of milliseconds between the date set and midnight, January 1, 1970, in UTC.
* @param year The year expressed in four digits.
*/
setUTCFullYear(year: number): number
/**
* Sets the hours of a specified Date object according to UTC.
* Returns the number of milliseconds between the date set and midnight, January 1, 1970, in UTC.
* @param hours An integer value from 0 (midnight) to 23 (11 PM) indicating the hour to be set.
*/
setUTCHours(hours: number): number
/**
* Sets the milliseconds of a specified Date object according to UTC.
* Returns the number of milliseconds between the date set and midnight, January 1, 1970, in UTC.
* @param ms An integer value in the range of 0 to 999 indicating the number of milliseconds to set.
*/
setUTCMilliseconds(ms: number): number
/**
* Sets the minutes of a specified Date object according to UTC.
* Returns the number of milliseconds between the date set and midnight, January 1, 1970, in UTC.
* @param min An integer value in the range 0 to 59 indicating the number of minutes to be set.
*/
setUTCMinutes(min: number): number
/**
* Sets the month of a specified Date object according to UTC.
* Returns the number of milliseconds between the date set and midnight, January 1, 1970, in UTC.
* @param month An integer value in the range 0 (Jan.) to 11 (Dec.) indicating the month to set.
*/
setUTCMonth(month: number): number
/**
* Sets the seconds of a specified Date object according to UTC.
* Returns the number of milliseconds between the date set and midnight, January 1, 1970, in UTC.
* @param sec An integer value in the range 0 to 59 indicating the number of seconds to set.
*/
setUTCSeconds(sec: number): number
/**
* Sets the year of a specified Date object according to local time, as a difference between the current year and 1900.
* Returns the number of milliseconds between the date set and midnight, January 1, 1970.
* @param year An integer value indicating the year to set. The method interprets a 1- or 2- digit value to mean the 1900s; for example, 13 is interpreted to mean 1913.
*/
setYear(year: number): number
/**
* Returns the date as a string.
*/
toDateString(): string
/**
* Returns the date and time adjusted to GMT (UTC) as a string.
*/
toGMTString(): string
/**
* Returns the date as a localized string.
*/
toLocaleDateString(): string
/**
* Returns a string value representing the date and time stored in the Date object in human readable format (localized).
*/
toLocaleString(): string
/**
* Returns the time as a localized string.
*/
toLocaleTimeString(): string
/**
* Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with built-in classes.
*/
toSource(): string
/**
* Returns a string value representing the date and time stored in the Date object in human readable format.
* Returns the following string is an example of the format returned by this method: Mon Aug 13, 10:54:21 GMT-0700 2001.
*/
toString(): string
/**
* Returns the time as a string.
*/
toTimeString(): string
/**
* Returns the date and time adjusted to UTC as a string.
*/
toUTCString(): string
/**
* The valueOf() method returns the number of milliseconds that have passed since midnight, Returns an integer.
*/
valueOf(): number
}
interface FunctionConstructor {
readonly prototype: Function
/**
* The Function constructor parses the argument list and creates a Function object.
* @param arguments The list of formal arguments, separated by commas. The formal arguments can also be supplied one by one; in this case, the last argument to the Function constructor is considered to be the function body.
* @param body The body of the function to create.
*/
new (arguments: string, body: string): Function
(arguments: string, body: string): Function
}
declare const Function: FunctionConstructor
/**
* Wraps a built-in or JavaScript function.
*/
interface Function {
/**
* The function arguments, packed into an array.
* This property is deprecated; use the arguments property within the function body.
*/
arguments: object
/**
* The number of formal arguments.
* This property is deprecated; use the length property instead.
*/
readonly arity: number
/**
* The number of formal arguments.
*/
readonly length: number
/**
* The function name.
*/
readonly name: string
/**
* Apply a this object and an argument list to a function.
* This function is different from call(); here, the arguments are suppliedas an Array object.
* @param thisObj The object to be used as this.
* @param args An array of arguments.
*/
apply(thisObj: object, args: any): any
/**
* Apply a this object and arguments to a function.
* This function is different from apply(); here, the arguments are supplied one by one.
* @param thisObj The object to be used as this.
* @param arguments The first agument to the function. Add as many as needed.
*/
call(thisObj: object, ...arguments: any[]): any
/**
* Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with JavaScript functions.
*/
toSource(): string
/**
* Returns the function definition as a string.
*/
toString(): string
}
interface StringConstructor {
readonly prototype: String
/**
* Returns a string representation of the value given as an argument.
* @param value A number, variable, or object to convert to a string.
*/
new (value?: any): String
(value: any): string
/**
* Returns a string created by concatenation one or more characters specified as ASCII values.
* @param value1 One or more ASCII values.
*/
fromCharCode(value1: number): string
}
declare const String: StringConstructor
/**
* A character string. Each character is adressable by index.
*/
interface String {
/**
* The length of the string.
*/
readonly length: number
/**
* Get character at index.
*/
readonly [index: number]: string
/**
* Returns a string consisting of this string enclosed in a <a> tag.
* @param name The text to be stored in the anchors' name attribute.
*/
anchor(name: string): string
/**
* Returns a string consisting of this string enclosed in a <big> tag.
*/
big(): string
/**
* Returns a string consisting of this string enclosed in a <blink> tag.
*/
blink(): string
/**
* Returns a string consisting of this string enclosed in a <b> tag.
*/
bold(): string
/**
* Returns the character at the specified index.
* @param index An integer between 0 and string.length -1, specifying the character to return.
*/
charAt(index: number): string
/**
* Returns the Unicode value of the character at the given index.
* @param index An integer between 0 and string.length -1, specifying the character.
*/
charCodeAt(index: number): number