forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multiplexjs.d.ts
2551 lines (1876 loc) · 93.2 KB
/
multiplexjs.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 Multiplex.js 0.9
// Project: http://github.com/multiplex/multiplex.js
// Definitions by: Kamyar Nazeri <http://github.com/KamyarNazeri>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var multiplex: multiplex.MultiplexStatic;
// Support AMD require
declare module 'multiplex' {
export = multiplex;
}
// Collapse multiplex into mx
import mx = multiplex;
// ES6 compatibility
interface Array<T> extends multiplex.Iterable<T> { }
interface String extends multiplex.Iterable<string> { }
declare module multiplex {
/**
* ES6 Iterable
*/
interface Iterable<T> {
"@@iterator"(): Iterator<T>
}
interface Iterator<T> {
next(): IteratorResult<T>;
return?(value?: any): IteratorResult<T>;
throw?(e?: any): IteratorResult<T>;
}
interface IteratorResult<T> {
done: boolean;
value?: T;
}
/**
* Supports a simple iteration over a collection.
*/
interface Enumerator<T> {
/**
* Advances the enumerator to the next element of the collection.
*/
next(): boolean;
/**
* Gets the element in the collection at the current position of the enumerator.
*/
current: T;
}
interface EnumeratorConstructor {
new <T>(generator: (yielder: (value: T) => T) => any): Enumerator<T>;
}
/**
* Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
* Enumerable uses ES6 Iteration protocol.
*/
interface Enumerable<T> extends Iterable<T> {
/**
* Returns an enumerator that iterates through the collection.
*/
getEnumerator(): Enumerator<T>;
}
interface EnumerableConstructor {
/**
* Exposes the enumerator, which supports an iteration over the specified Enumerable object.
* @param obj An Iterable object. eg. Enumerable, Array, String, Set, Map, Iterable & Generators
*/
new <T>(obj: Iterable<T>): Enumerable<T>;
/**
* Defines an enumerator, which supports an iteration over the specified Generator function.
* @param factory An Enumerator factory function.
*/
new <T>(factory: () => Enumerator<T>): Enumerable<T>;
/**
* Defines an enumerator, which supports an iteration over the items of the specified Array-like object.
* An Array-like object is an object which has the "length" property and indexed properties access, eg. jQuery
* @param obj An Array-like object.
*/
new <T>(obj: ArrayLike<T>): Enumerable<T>;
/**
* Defines an enumerator, which supports an iteration over the arguments local variable available within all functions.
* @param obj arguments local variable available within all functions.
*/
new (obj: IArguments): Enumerable<any>;
/**
* Defines an enumerator, which supports an iteration over the properties of the specified object.
* @param obj A regular Object.
*/
new (obj: Object): Enumerable<KeyValuePair<string, any>>;
/**
* Returns an empty Enumerable.
*/
empty<T>(): Enumerable<T>;
/**
* Detects if an object is Enumerable.
* @param obj An object to check its Enumerability.
*/
is(obj: any): boolean;
/**
* Generates a sequence of integral numbers within a specified range.
* @param start The value of the first integer in the sequence.
* @param count The number of sequential integers to generate.
*/
range(start: number, count: number): Enumerable<number>;
/**
* Generates a sequence that contains one repeated value.
* @param element The value to be repeated.
* @param count The number of times to repeat the value in the generated sequence.
*/
repeat<T>(element: T, count: number): Enumerable<T>;
}
/**
* Defines a method that a type implements to compare two objects.
*/
interface Comparer<T> {
/**
* Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
* returns An integer that indicates the relative values of x and y, as shown in the following table:
* Less than zero x is less than y.
* Zero x equals y.
* Greater than zero x is greater than y..
* @param x The first object to compare.
* @param y The second object to compare.
*/
compare(x: T, y: T): number;
}
interface ComparerConstructor {
/**
* Returns a default sort order comparer for the type specified by the generic argument.
*/
defaultComparer: Comparer<any>;
/**
* Creates a comparer by using the specified comparison.
* @param comparison The comparison to use.
*/
create<T>(comparison: (x: T, y: T) => number): Comparer<T>;
}
/**
* Provides a base class for implementations of the EqualityComparer.
*/
interface EqualityComparer<T> {
/**
* Determines whether the specified objects are equal.
* @param x The first object of type Object to compare.
* @param y The second object of type Object to compare.
*/
equals(x: T, y: T): boolean;
/**
* Returns a hash code for the specified object.
* @param obj The Object for which a hash code is to be returned.
*/
hash(obj: T): number
}
interface EqualityComparerConstructor {
/**
* Gets a default equality comparer for the type specified by the generic argument.
*/
defaultComparer: EqualityComparer<any>;
/**
* Creates an EqualityComparer by using the specified equality and hashCodeProvider.
* @param hashCodeProvider The hashCodeProvider to use for a hash code is to be returned.
* @param equality The equality function.
*/
create<T>(hashCodeProvider: (obj: T) => number, equality: (x: T, y: T) => boolean): EqualityComparer<T>;
}
/**
* Initializes a new instance of the abstract Collection class.
*/
interface Collection<T> extends Enumerable<T> {
/**
* Gets the number of elements contained in the Collection.
*/
count(): number;
/**
* Copies the Collection to an existing one-dimensional Array, starting at the specified array index.
* @param array The one-dimensional Array that is the destination of the elements copied from Dictionary keys.
* @param arrayIndex The zero-based index in array at which copying begins.
*/
copyTo(array: T[], arrayIndex: number): void
}
interface CollectionConstructor {
/**
* Initializes a new instance of the Collection class that is empty.
*/
new <T>(): Collection<T>
/**
* Initializes a new instance of the Collection class that is wrapper around the specified Enumerable.
* @param value The Iterable to wrap.
*/
new <T>(value: Iterable<T>): Collection<T>
}
/**
* Initializes a new instance of the abstract Collection class.
*/
interface ReadOnlyCollection<T> extends Collection<T> {
/**
* Gets the element at the specified index.
* @param index The zero-based index of the element to get.
*/
[index: number]: T;
/**
* Gets the element at the specified index.
* @param index The zero-based index of the element to get.
*/
get(index: number): T
/**
* Determines whether the ReadOnlyCollection contains a specific value.
* @param item The object to locate in the ReadOnlyCollection.
*/
contains(item: T): boolean
/**
* Searches for the specified object and returns the zero-based index of the first occurrence within the entire ReadOnlyCollection.
* @param item The object to locate in the ReadOnlyCollection.
*/
indexOf(item: T): number
}
interface ReadOnlyCollectionConstructor {
/**
* Initializes a new instance of the ReadOnlyCollection class that is a read-only wrapper around the specified list.
* @param list The list to wrap.
*/
new <T>(list: List<T>): ReadOnlyCollection<T>
}
/**
* Represents a strongly typed list of objects that can be accessed by index.
*/
interface List<T> extends Collection<T> {
/**
* Gets the element at the specified index.
* @param index The zero-based index of the element to get.
*/
[index: number]: T;
/**
* Adds an object to the end of the List.
* @param item The object to be added to the end of the List.
*/
add(item: T): void
/**
* Adds the elements of the specified collection to the end of the List.
* @param collection The collection whose elements should be added to the end of the List.
*/
addRange(collection: Iterable<T>): void
/**
* Returns a read-only wrapper for the current list.
*/
asReadOnly(): ReadOnlyCollection<T>
/**
* Searches the entire sorted List for an element using the default comparer and returns the zero-based index of the element.
* Returns The zero-based index of item in the sorted List, if item is found; otherwise, a negative number
* that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element,
* the bitwise complement of List.count().
* @param item The object to locate. The value can be null for reference types.
*/
binarySearch(item: T): number
/**
* Searches the entire sorted List for an element using the specified comparer and returns the zero-based index of the element.
* returns The zero-based index of item in the sorted List, if item is found; otherwise, a negative number
* that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element,
* the bitwise complement of List.count().
* @param item The object to locate. The value can be null for reference types.
* @param comparer The Comparer implementation to use when comparing elements.
*/
binarySearch(item: T, comparer: Comparer<T>): number
/**
* Searches a range of elements in the sorted List for an element using the specified comparer and returns the zero-based index of the element.
* returns The zero-based index of item in the sorted List, if item is found; otherwise, a negative number
* that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element,
* the bitwise complement of List.count().
* @param item The object to locate. The value can be null for reference types.
* @param index The zero-based starting index of the range to search.
* @param count The length of the range to search.
* @param comparer The Comparer implementation to use when comparing elements.
*/
binarySearch(item: T, index: number, count: number, comparer: Comparer<T>): number
/**
* Removes all items from the List.
*/
clear(): void
/**
* Determines whether the List contains elements that match the conditions defined by the specified predicate.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
exists(match: (item: T) => boolean): boolean
/**
* Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire List.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
find(match: (item: T) => boolean): T
/**
* Retrieves all the elements that match the conditions defined by the specified predicate.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
findAll(match: (item: T) => boolean): List<T>
/**
* Searches for an element that matches the conditions defined by the specified predicate,
* and returns the zero-based index of the first occurrence within the entire List, if found; otherwise, –1.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
findIndex(match: (item: T) => boolean): number
/**
* Searches for an element that matches the conditions defined by the specified predicate,
* and returns the zero-based index of the first occurrence within the range of elements
* in the List that extends from the specified index to the last element, if found; otherwise, –1.
* @param startIndex The zero-based starting index of the search.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
findIndex(startIndex: number, match: (item: T) => boolean): number
/**
* Searches for an element that matches the conditions defined by the specified predicate,
* and returns the zero-based index of the first occurrence within the range of elements
* in the List that starts at the specified index and contains the specified number of elements, if found; otherwise, –1.
* @param startIndex The zero-based starting index of the search.
* @param count The number of elements in the section to search.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
findIndex(startIndex: number, count: number, match: (item: T) => boolean): number
/**
* Searches for an element that matches the conditions defined by the specified predicate,
* and returns the last occurrence within the entire List.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
findLast(match: (item: T) => boolean): T
/**
* Searches for an element that matches the conditions defined by the specified predicate,
* and returns the zero-based index of the last occurrence within the entire List, if found; otherwise, –1.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
findLastIndex(match: (item: T) => boolean): number
/**
* Searches for an element that matches the conditions defined by the specified predicate,
* and returns the zero-based index of the last occurrence within the range of elements
* in the List that extends from the first element to the specified index, if found; otherwise, –1.
* @param startIndex The zero-based starting index of the search.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
findLastIndex(startIndex: number, match: (item: T) => boolean): number
/**
* Searches for an element that matches the conditions defined by the specified predicate,
* and returns the zero-based index of the last occurrence within the range of elements
* in the List that contains the specified number of elements and ends at the specified index, if found; otherwise, –1.
* @param startIndex The zero-based starting index of the search.
* @param count The number of elements in the section to search.
* @param match The predicate function that defines the conditions of the elements to search for.
*/
findLastIndex(startIndex: number, count: number, match: (item: T) => boolean): number
/**
* Performs the specified action on each element of the List.
* @param action The action function to perform on each element of the List.
*/
forEach(action: (item: T) => void): void
/**
* Gets the element at the specified index.
* @param index The zero-based index of the element to get.
*/
get(index: number): T
/**
* Creates a shallow copy of a range of elements in the source List.
* @param index The zero-based List index at which the range starts.
* @param count The number of elements in the range.
*/
getRange(index: number, count: number): List<T>
/**
* Searches for the specified object and returns the zero-based index of the first occurrence within the entire List, if found; otherwise, –1.
* @param item The object to locate in the List.
*/
indexOf(item: T): number
/**
* Searches for the specified object and returns the zero-based index of the first occurrence within
* the range of elements in the List that extends from the specified index to the last element, if found; otherwise, –1.
* @param item The object to locate in the List.
* @param index The zero-based starting index of the search. 0 (zero) is valid in an empty list.
*/
indexOf(item: T, index: number): number
/**
* Inserts an element into the List at the specified index.
* @param index The zero-based index at which item should be inserted.
* @param item The object to insert. The value can be null for reference types.
*/
insert(index: number, item: T): void
/**
* Inserts the elements of a collection into the List at the specified index.
* @param index The zero-based index at which item should be inserted.
* @param collection The collection whose elements should be inserted into the List.
*/
insertRange(index: number, collection: Iterable<T>): void
/**
* Gets an Array wrapper around the List.
*/
items(): T[]
/**
* Searches for the specified object and returns the zero-based index of the last occurrence within the entire List, if found; otherwise, –1.
* @param item The object to locate in the List.
*/
lastIndexOf(item: T): number
/**
* Searches for the specified object and returns the zero-based index of the last occurrence
* within the range of elements in the List that extends from the specified index to the last element if found; otherwise, –1.
* @param item The object to locate in the List.
* @param index The zero-based starting index of the search. 0 (zero) is valid in an empty list.
*/
lastIndexOf(item: T, index: number): number
/**
* Removes the first occurrence of a specific object from the List.
* @param item The object to remove from the List.
*/
remove(item: T): boolean
/**
* Removes all the elements that match the conditions defined by the specified predicate.
* @param match The predicate function that defines the conditions of the elements to remove.
*/
removeAll(match: (item: T) => boolean): number
/**
* Removes the element at the specified index of the List.
* @param index The zero-based index of the element to remove.
*/
removeAt(index: number): void
/**
* Removes a range of elements from the List.
* @param index The zero-based index of the element to remove.
* @param count The number of elements to remove.
*/
removeRange(index: number, count: number): void
/**
* Reverses the order of the elements in the entire List
*/
reverse(): any
/**
* Reverses the order of the elements in the entire List
* @param index The zero-based starting index of the range to reverse.
* @param count The number of elements in the range to reverse.
*/
reverse(index: number, count: number): void
/**
* Sets the element at the specified index.
* @param index The zero-based index of the element to set.
* @param item The object to be added at the specified index.
*/
set(index: number, value: T): void
/**
* Sorts the elements in the entire List using the default comparer.
*/
sort(): void
/**
* Sorts the elements in the entire List using the specified Comparison.
* @param comparison The comparison function to use when comparing elements.
*/
sort(comparison: (x: T, y: T) => number): void
/**
* Sorts the elements in the entire List using the specified comparer.
* @param comparer The Comparer implementation to use when comparing elements.
*/
sort(comparer: Comparer<T>): void
/**
* Sorts the elements in a range of elements in List using the specified comparer.
* @param index The zero-based starting index of the range to sort.
* @param count The length of the range to sort.
* @param comparer The Comparer implementation to use when comparing elements.
*/
sort(index: number, count: number, comparer: Comparer<T>): void
/**
* Copies the elements of the List to a new array.
*/
toArray(): T[]
/**
* Determines whether every element in the List matches the conditions defined by the specified predicate.
* @param match The Predicate function that defines the conditions to check against the elements.
*/
trueForAll(match: (item: T) => boolean): boolean
}
interface ListConstructor {
/**
* Initializes a new instance of the List class that is empty.
*/
new <T>(): List<T>
/**
* Initializes a new instance of the List class that is empty and has the specified initial capacity.
* @param capacity The number of elements that the new list can initially store.
*/
new <T>(capacity: number): List<T>
/**
* Initializes a new instance of the List class that contains elements copied from the specified arguments
* @param args Arbitrary number of arguments to copy to the new list.
*/
new <T>(...args: T[]): List<T>
/**
* Initializes a new instance of the List class that contains elements copied from the specified collection
* and has sufficient capacity to accommodate the number of elements copied.
* @param collection The collection whose elements are copied to the new list.
*/
new <T>(collection: Iterable<T>): List<T>
}
/**
* Represents a collection of key/value pairs that are sorted by key based on the associated Comparer implementation.
*/
interface SortedList<TKey, TValue> extends Collection<KeyValuePair<TKey, TValue>> {
/**
* Adds an element with the specified key and value into the SortedList.
* @param key The key of the element to add.
* @param value The value of the element to add. The value can be null for reference types.
*/
add(key: TKey, value: TValue): void
/**
* Gets the value associated with the specified key.
* @param key The key whose value to get.
*/
get(key: TKey): TValue
/**
* Gets or sets the number of elements that the SortedList can contain.
* @param value The number of elements that the SortedList can contain.
*/
capacity(value?: number): number
/**
* Removes all elements from the SortedList.
*/
clear(): void
/**
* Gets the Comparer for the sorted list.
*/
comparer(): Comparer<TKey>
/**
* Determines whether the SortedList contains a specific key.
* @param key The key to locate in the SortedList.
*/
containsKey(key: TKey): boolean
/**
* Determines whether the SortedList contains a specific value.
* @param value The value to locate in the SortedList.
*/
containsValue(value: TValue): boolean
/**
* Gets a collection containing the keys in the SortedList, in sorted order.
*/
keys(): Collection<TKey>
/**
* Gets a collection containing the values in the SortedLis.
*/
values(): Collection<TValue>
/**
* Searches for the specified key and returns the zero-based index within the entire SortedList.
* @param key The key to locate in the SortedList.
*/
indexOfKey(key: TKey): number
/**
* Searches for the specified value and returns the zero-based index of the first occurrence within the entire SortedList.
* @param value The value to locate in the SortedList.
*/
indexOfValue(value: TValue): number
/**
* Removes the element with the specified key from the SortedList.
* Returns true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original SortedList.
* @param key The key of the element to remove.
*/
remove(key: TKey): boolean
/**
* Removes the element at the specified index of the SortedList.
* @param index The zero-based index of the element to remove.
*/
removeAt(index: number): void
/**
* Sets the value associated with the specified key.
* @param key The key whose value to get or set.
* @param value The value associated with the specified key.
*/
set(key: TKey, value: TValue): void
/**
* Sets the capacity to the actual number of elements in the SortedList, if that number is less than 90 percent of current capacity.
*/
trimExcess(): void
/**
* Gets the value associated with the specified key.
* @param key The key whose value to get.
* @param callback When this method returns, callback method is called with the value
* associated with the specified key, if the key is found; otherwise, null for the type of the value parameter.
*/
tryGetValue(key: TKey, callback: (value: TValue) => void): boolean
}
interface SortedListConstructor {
/**
* Initializes a new instance of the SortedList class that is empty,
* has the default initial capacity, and uses the default Comparer.
*/
new <TKey, TValue>(): SortedList<TKey, TValue>
/**
* Initializes a new instance of the SortedList class that contains elements copied from the specified Dictionary,
* has sufficient capacity to accommodate the number of elements copied, and uses the default Comparer.
* @param dictionary The Dictionary whose elements are copied to the new SortedList.
*/
new <TKey, TValue>(dictionary: Dictionary<TKey, TValue>): SortedList<TKey, TValue>
/**
* Initializes a new instance of the SortedList class that is empty,
* has the default initial capacity, and uses the specified Comparer.
* @param comparer The Comparer implementation to use when comparing keys.-or-null to use the default Comparer for the type of the key.
*/
new <TKey, TValue>(comparer: Comparer<TKey>): SortedList<TKey, TValue>
/**
* Initializes a new instance of the SortedList class that is empty,
* has the specified initial capacity, and uses the default Comparer.
* @param capacity The initial number of elements that the SortedList can contain.
*/
new <TKey, TValue>(capacity: number): SortedList<TKey, TValue>
/**
* Initializes a new instance of the SortedList class that contains elements copied from the specified Dictionary,
* has sufficient capacity to accommodate the number of elements copied, and uses the specified Comparer.
* @param dictionary The Dictionary whose elements are copied to the new SortedList.
* @param comparer The Comparer implementation to use when comparing keys.-or-null to use the default Comparer for the type of the key.
*/
new <TKey, TValue>(dictionary: Dictionary<TKey, TValue>, comparer: Comparer<TKey>): SortedList<TKey, TValue>
/**
* Initializes a new instance of the SortedList class that is empty,
* has the specified initial capacity, and uses the specified Comparer.
* @param capacity The initial number of elements that the SortedList can contain.
* @param comparer The Comparer implementation to use when comparing keys.-or-null to use the default Comparer for the type of the key.
*/
new <TKey, TValue>(capacity: number, comparer: Comparer<TKey>): SortedList<TKey, TValue>
}
/**
* Defines a key/value pair that can be set or retrieved.
*/
interface KeyValuePair<TKey, TValue> {
/**
* Gets the key in the key/value pair.
*/
key: TKey;
/**
* Gets the value in the key/value pair.
*/
value: TValue;
}
interface KeyValuePairConstructor {
/**
* Initializes a new instance of the KeyValuePair with the specified key and value.
* @param key The object defined in each key/value pair.
* @param value The definition associated with key.
*/
new <TKey, TValue>(key: TKey, value: TValue): KeyValuePair<TKey, TValue>
}
/**
* Represents a collection of keys and values.
*/
interface Dictionary<TKey, TValue> extends Collection<KeyValuePair<TKey, TValue>> {
/**
* Adds an element with the provided key and value to the Dictionary.
* @param key The object to use as the key of the element to add.
* @param value The object to use as the value of the element to add.
*/
add(key: TKey, value: TValue): void
/**
* Removes all keys and values from the Dictionary.
*/
clear(): void
/**
* Determines whether the Dictionary contains the specified key.
* @param key The key to locate in the Dictionary.
*/
containsKey(key: TKey): boolean
/**
* Determines whether the Dictionary contains a specific value.
* @param value The value to locate in the Dictionary.
*/
containsValue(value: TValue): boolean
/**
* Copies the Dictionary keys to an existing one-dimensional Array, starting at the specified array index.
* @param array The one-dimensional Array that is the destination of the elements copied from Dictionary keys.
* @param arrayIndex The zero-based index in array at which copying begins.
*/
copyTo(array: TKey[], arrayIndex: number): void
copyTo(array: KeyValuePair<TKey, TValue>[], arrayIndex: number): void
/**
* Gets a Collection containing the keys of the Dictionary.
*/
keys(): Collection<TKey>
/**
* Gets a Collection containing the values in the Dictionary.
*/
values(): Collection<TValue>
/**
* Gets element with the specified key.
* @param key The key of the element to get.
*/
get(key: TKey): TValue
/**
* Sets the element with the specified key.
* @param key The key of the element to set.
* @param value The object to use as the value of the element to set.
*/
set(key: TKey, value: TValue): void
/**
* Gets the value associated with the specified key.
* @param key The key whose value to get.
* @param callback When this method returns, callback method is called with the value
* associated with the specified key, if the key is found; otherwise, null for the type of the value parameter.
*/
tryGetValue(key: TKey, callback: (value: TValue) => void): boolean
/**
* Removes the element with the specified key from the Dictionary.
* @param key The key of the element to remove.
*/
remove(key: TKey): boolean
}
interface DictionaryConstructor {
/**
* Initializes a new instance of the Dictionary class that is empty,
*/
new <TKey, TValue>(): Dictionary<TKey, TValue>
/**
* Initializes a new instance of the Dictionary class that contains elements copied
* from the specified Dictionary and uses the default equality comparer for the key type.
* @param dictionary The Dictionary whose elements are copied to the new Dictionary.
*/
new <TKey, TValue>(dictionary: Dictionary<TKey, TValue>): Dictionary<TKey, TValue>
/**
* Initializes a new instance of the Dictionary class that is empty, and uses the specified EqualityComparer.
* @param comparer The EqualityComparer implementation to use when comparing keys.
*/
new <TKey, TValue>(comparer: EqualityComparer<TKey>): Dictionary<TKey, TValue>
/**
* Initializes a new instance of the Dictionary class that is empty, has the specified initial capacity, and uses the default equality comparer for the key type.
* @param capacity The initial number of elements that the Dictionary can contain.
*/
new <TKey, TValue>(capacity: number): Dictionary<TKey, TValue>
/**
* Initializes a new instance of the Dictionary that is empty, has the specified initial capacity, and uses the specified EqualityComparer.
* @param capacity The initial number of elements that the Dictionary can contain.
* @param comparer The EqualityComparer implementation to use when comparing keys.
*/
new <TKey, TValue>(capacity: number, comparer: EqualityComparer<TKey>): Dictionary<TKey, TValue>
/**
* Initializes a new instance of the Dictionary class that contains elements copied
* from the specified Dictionary and uses the specified EqualityComparer.
* @param dictionary The Dictionary whose elements are copied to the new Dictionary.
* @param comparer The EqualityComparer implementation to use when comparing keys.
*/
new <TKey, TValue>(dictionary: Dictionary<TKey, TValue>, comparer: EqualityComparer<TKey>): Dictionary<TKey, TValue>
}
/**
* Represents a set of values.
*/
interface HashSet<T> extends Collection<T> {
/**
* Adds an element to the current set.
* @param item The element to add to the set.
*/
add(item: T): boolean
/**
* Removes all elements from a HashSet object.
*/
clear(): void
/**
* Copies the elements of a HashSet object to an array.
* @param array The one-dimensional array that is the destination of the elements copied from the HashSet object.
*/