diff --git a/.travis.yml b/.travis.yml index 0a5ead6..f98fed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: node_js node_js: + - '12' - '10' - '8' - - '6' - - '4' diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..a842e4c --- /dev/null +++ b/index.d.ts @@ -0,0 +1,6 @@ +import {ReadonlyDeep} from 'type-fest'; +import globalsJson = require('./globals.json'); + +declare const globals: ReadonlyDeep; + +export = globals; diff --git a/index.test-d.ts b/index.test-d.ts new file mode 100644 index 0000000..4cd2356 --- /dev/null +++ b/index.test-d.ts @@ -0,0 +1,7 @@ +import {expectType, expectError} from 'tsd'; +import {ReadonlyDeep} from 'type-fest'; +import globals = require('.'); + +expectType>(globals); +expectType(globals.builtin.Array); +expectError((globals.builtin.Array = true)); diff --git a/package.json b/package.json index dfe459b..88b548d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "sindresorhus.com" }, "engines": { - "node": ">=4" + "node": ">=8" }, "scripts": { "test": "xo && ava" @@ -29,13 +29,22 @@ "eslint", "environments" ], + "dependencies": { + "type-fest": "^0.6.0" + }, "devDependencies": { - "ava": "0.21.0", - "xo": "0.18.0" + "ava": "^2.2.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" }, "xo": { "ignores": [ "get-browser-globals.js" ] + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } } }