TypeScript/src/lib/es2015.symbol.d.ts
Wesley Wigham 616e6e6ca3
Move symbol instance type to es5 to follow PropertyKey (#23864)
* Move symbol instance type to es5

* Accept baseline changes from moving Symbol
2018-05-03 10:50:10 -07:00

28 lines
822 B
TypeScript

interface SymbolConstructor {
/**
* A reference to the prototype.
*/
readonly prototype: Symbol;
/**
* Returns a new unique Symbol value.
* @param description Description of the new Symbol object.
*/
(description?: string | number): symbol;
/**
* Returns a Symbol object from the global symbol registry matching the given key if found.
* Otherwise, returns a new symbol with this key.
* @param key key to search for.
*/
for(key: string): symbol;
/**
* Returns a key from the global symbol registry matching the given Symbol if found.
* Otherwise, returns a undefined.
* @param sym Symbol to find the key for.
*/
keyFor(sym: symbol): string | undefined;
}
declare var Symbol: SymbolConstructor;