mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat: Add has‑symbols (#44917)
This commit is contained in:
parent
f56bdcfc32
commit
281fd86039
5
types/has-symbols/has-symbols-tests.ts
Normal file
5
types/has-symbols/has-symbols-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import hasNativeSymbols = require('has-symbols');
|
||||
import hasSymbolSham = require('has-symbols/shams');
|
||||
|
||||
hasNativeSymbols(); // $ExpectType boolean
|
||||
hasSymbolSham(); // $ExpectType boolean
|
||||
13
types/has-symbols/index.d.ts
vendored
Normal file
13
types/has-symbols/index.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Type definitions for has-symbols 1.0
|
||||
// Project: https://github.com/ljharb/has-symbols#readme
|
||||
// Definitions by: Jordan Harband <https://github.com/ljharb>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Returns `true` only if the environment has native `Symbol` support.
|
||||
*
|
||||
* Not polyfillable, not forgeable.
|
||||
*/
|
||||
declare function hasNativeSymbols(): boolean;
|
||||
export = hasNativeSymbols;
|
||||
6
types/has-symbols/shams.d.ts
vendored
Normal file
6
types/has-symbols/shams.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Returns `true` if the environment has a `Symbol` sham
|
||||
* that mostly follows the spec.
|
||||
*/
|
||||
declare function hasSymbolSham(): boolean;
|
||||
export = hasSymbolSham;
|
||||
19
types/has-symbols/tsconfig.json
Normal file
19
types/has-symbols/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["ES2015"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"has-symbols-tests.ts",
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
1
types/has-symbols/tslint.json
Normal file
1
types/has-symbols/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user