1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | interface IteratorResult<T> {
|
22 | done: boolean;
|
23 | value?: T;
|
24 | }
|
25 |
|
26 | interface Iterator<T> {
|
27 | next(value?: any): IteratorResult<T>;
|
28 | return?(value?: any): IteratorResult<T>;
|
29 | throw?(e?: any): IteratorResult<T>;
|
30 | }
|
31 |
|
32 | interface ForEachable<T> {
|
33 | forEach(callbackfn: (value: T) => void): void;
|
34 | }
|
35 |
|
36 | interface Map<K, V> {
|
37 | clear(): void;
|
38 | delete(key: K): boolean;
|
39 | forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
40 | get(key: K): V;
|
41 | has(key: K): boolean;
|
42 | set(key: K, value?: V): Map<K, V>;
|
43 | entries(): Iterator<[K, V]>;
|
44 | keys(): Iterator<K>;
|
45 | values(): Iterator<V>;
|
46 | size: number;
|
47 | }
|
48 |
|
49 | interface MapConstructor {
|
50 | new <K, V>(): Map<K, V>;
|
51 | new <K, V>(iterable: ForEachable<[K, V]>): Map<K, V>;
|
52 | prototype: Map<any, any>;
|
53 | }
|
54 |
|
55 | declare var Map: MapConstructor;
|
56 |
|
57 | interface Set<T> {
|
58 | add(value: T): Set<T>;
|
59 | clear(): void;
|
60 | delete(value: T): boolean;
|
61 | forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
62 | has(value: T): boolean;
|
63 | entries(): Iterator<[T, T]>;
|
64 | keys(): Iterator<T>;
|
65 | values(): Iterator<T>;
|
66 | size: number;
|
67 | }
|
68 |
|
69 | interface SetConstructor {
|
70 | new <T>(): Set<T>;
|
71 | new <T>(iterable: ForEachable<T>): Set<T>;
|
72 | prototype: Set<any>;
|
73 | }
|
74 |
|
75 | declare var Set: SetConstructor;
|
76 |
|
77 | interface WeakMap<K, V> {
|
78 | delete(key: K): boolean;
|
79 | clear(): void;
|
80 | get(key: K): V;
|
81 | has(key: K): boolean;
|
82 | set(key: K, value?: V): WeakMap<K, V>;
|
83 | }
|
84 |
|
85 | interface WeakMapConstructor {
|
86 | new <K, V>(): WeakMap<K, V>;
|
87 | new <K, V>(iterable: ForEachable<[K, V]>): WeakMap<K, V>;
|
88 | prototype: WeakMap<any, any>;
|
89 | }
|
90 |
|
91 | declare var WeakMap: WeakMapConstructor;
|
92 |
|
93 | interface WeakSet<T> {
|
94 | delete(value: T): boolean;
|
95 | clear(): void;
|
96 | add(value: T): WeakSet<T>;
|
97 | has(value: T): boolean;
|
98 | }
|
99 |
|
100 | interface WeakSetConstructor {
|
101 | new <T>(): WeakSet<T>;
|
102 | new <T>(iterable: ForEachable<T>): WeakSet<T>;
|
103 | prototype: WeakSet<any>;
|
104 | }
|
105 |
|
106 | declare var WeakSet: WeakSetConstructor;
|
107 |
|
108 | declare module "es6-collections" {
|
109 | var Map: MapConstructor;
|
110 | var Set: SetConstructor;
|
111 | var WeakMap: WeakMapConstructor;
|
112 | var WeakSet: WeakSetConstructor;
|
113 | } |
\ | No newline at end of file |