diff --git a/types/has-symbols/has-symbols-tests.ts b/types/has-symbols/has-symbols-tests.ts new file mode 100644 index 0000000000..efda60537d --- /dev/null +++ b/types/has-symbols/has-symbols-tests.ts @@ -0,0 +1,5 @@ +import hasNativeSymbols = require('has-symbols'); +import hasSymbolSham = require('has-symbols/shams'); + +hasNativeSymbols(); // $ExpectType boolean +hasSymbolSham(); // $ExpectType boolean diff --git a/types/has-symbols/index.d.ts b/types/has-symbols/index.d.ts new file mode 100644 index 0000000000..2aac60484d --- /dev/null +++ b/types/has-symbols/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for has-symbols 1.0 +// Project: https://github.com/ljharb/has-symbols#readme +// Definitions by: Jordan Harband +// 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; diff --git a/types/has-symbols/shams.d.ts b/types/has-symbols/shams.d.ts new file mode 100644 index 0000000000..97657c6bdf --- /dev/null +++ b/types/has-symbols/shams.d.ts @@ -0,0 +1,6 @@ +/** + * Returns `true` if the environment has a `Symbol` sham + * that mostly follows the spec. + */ +declare function hasSymbolSham(): boolean; +export = hasSymbolSham; diff --git a/types/has-symbols/tsconfig.json b/types/has-symbols/tsconfig.json new file mode 100644 index 0000000000..41537781db --- /dev/null +++ b/types/has-symbols/tsconfig.json @@ -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" + ] +} diff --git a/types/has-symbols/tslint.json b/types/has-symbols/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/has-symbols/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }