mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[parse-key] Add parse-key types (#47044)
This commit is contained in:
parent
d9e47130b5
commit
8210bd361a
16
types/parse-key/index.d.ts
vendored
Normal file
16
types/parse-key/index.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Type definitions for parse-key 0.2
|
||||
// Project: https://github.com/thlorenz/parse-key
|
||||
// Definitions by: Nathan Bierema <https://github.com/Methuselah96>
|
||||
// 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;
|
||||
9
types/parse-key/parse-key-tests.ts
Normal file
9
types/parse-key/parse-key-tests.ts
Normal file
@ -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;
|
||||
23
types/parse-key/tsconfig.json
Normal file
23
types/parse-key/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/parse-key/tslint.json
Normal file
1
types/parse-key/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user