• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1interface SymbolConstructor {
2    /**
3     * A reference to the prototype.
4     */
5    readonly prototype: Symbol;
6
7    /**
8     * Returns a new unique Symbol value.
9     * @param  description Description of the new Symbol object.
10     */
11    (description?: string | number): symbol;
12
13    /**
14     * Returns a Symbol object from the global symbol registry matching the given key if found.
15     * Otherwise, returns a new symbol with this key.
16     * @param key key to search for.
17     */
18    for(key: string): symbol;
19
20    /**
21     * Returns a key from the global symbol registry matching the given Symbol if found.
22     * Otherwise, returns a undefined.
23     * @param sym Symbol to find the key for.
24     */
25    keyFor(sym: symbol): string | undefined;
26}
27
28declare var Symbol: SymbolConstructor;