diff --git a/types/negative-array/index.d.ts b/types/negative-array/index.d.ts new file mode 100644 index 0000000000..1308de4d9c --- /dev/null +++ b/types/negative-array/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for negative-array 2.0 +// Project: https://github.com/sindresorhus/negative-array#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = negativeArray; + +declare function negativeArray(array: T[]): T[]; diff --git a/types/negative-array/negative-array-tests.ts b/types/negative-array/negative-array-tests.ts new file mode 100644 index 0000000000..9ca07b4a69 --- /dev/null +++ b/types/negative-array/negative-array-tests.ts @@ -0,0 +1,5 @@ +import negativeArray = require('negative-array'); + +const unicorn = negativeArray(['pony', 'cake', 'rainbow']); + +unicorn[-1]; diff --git a/types/negative-array/tsconfig.json b/types/negative-array/tsconfig.json new file mode 100644 index 0000000000..be024c1c31 --- /dev/null +++ b/types/negative-array/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "negative-array-tests.ts" + ] +} diff --git a/types/negative-array/tslint.json b/types/negative-array/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/negative-array/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }