mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
19 lines
362 B
TypeScript
19 lines
362 B
TypeScript
import WeakMap = require('es6-weak-map');
|
|
|
|
new WeakMap<{}, string>();
|
|
|
|
const tuples: Array<[number, string]> = [ [0, 'foo'], [1, 'bar'] ];
|
|
new WeakMap<number, string>(tuples);
|
|
|
|
const map = new WeakMap<{}, string>();
|
|
const obj = {};
|
|
|
|
map.set(obj, 'foo');
|
|
map.get(obj);
|
|
map.has(obj);
|
|
map.delete(obj);
|
|
map.get(obj);
|
|
map.has(obj);
|
|
map.set(obj, 'bar');
|
|
map.has(obj);
|