-
-
Notifications
You must be signed in to change notification settings - Fork 92
/
bi-map.d.ts
52 lines (44 loc) · 1.25 KB
/
bi-map.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
/**
* Mnemonist BiMap Typings
* ========================
*/
export class InverseMap<K, V> implements Iterable<[K, V]> {
// Members
size: number;
inverse: BiMap<V, K>;
// Constructor
constructor(original: BiMap<K, V>);
// Methods
clear(): void;
set(key: K, value: V): this;
delete(key: K): boolean;
has(key: K): boolean;
get(key: K): V | undefined;
forEach(callback: (value: V, key: K, map: this) => void, scope?: any): void;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
entries(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
inspect(): any;
}
export default class BiMap<K, V> implements Iterable<[K, V]> {
// Members
size: number;
inverse: InverseMap<V, K>;
// Constructor
constructor();
// Methods
clear(): void;
set(key: K, value: V): this;
delete(key: K): boolean;
has(key: K): boolean;
get(key: K): V | undefined;
forEach(callback: (value: V, key: K, map: this) => void, scope?: any): void;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
entries(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
inspect(): any;
// Statics
static from<I, J>(iterable: Iterable<[I, J]> | {[key: string]: J}): BiMap<I, J>;
}