diff --git a/types/parse-key/index.d.ts b/types/parse-key/index.d.ts new file mode 100644 index 0000000000..a63945f736 --- /dev/null +++ b/types/parse-key/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for parse-key 0.2 +// Project: https://github.com/thlorenz/parse-key +// Definitions by: Nathan Bierema +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface KeyObject { + name: string; + ctrl: boolean; + meta: boolean; + shift: boolean; + alt: boolean; + sequence: string; +} + +declare function parse(s: string): KeyObject; +export = parse; diff --git a/types/parse-key/parse-key-tests.ts b/types/parse-key/parse-key-tests.ts new file mode 100644 index 0000000000..176545b825 --- /dev/null +++ b/types/parse-key/parse-key-tests.ts @@ -0,0 +1,9 @@ +import parseKey = require('parse-key'); + +const visibilityKey = parseKey('ctrl-c'); +visibilityKey.name; +visibilityKey.ctrl; +visibilityKey.alt; +visibilityKey.meta; +visibilityKey.sequence; +visibilityKey.shift; diff --git a/types/parse-key/tsconfig.json b/types/parse-key/tsconfig.json new file mode 100644 index 0000000000..d64f580096 --- /dev/null +++ b/types/parse-key/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "parse-key-tests.ts" + ] +} diff --git a/types/parse-key/tslint.json b/types/parse-key/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/parse-key/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }