diff --git a/types/env-editor/env-editor-tests.ts b/types/env-editor/env-editor-tests.ts new file mode 100644 index 0000000000..c03cacc38b --- /dev/null +++ b/types/env-editor/env-editor-tests.ts @@ -0,0 +1,8 @@ +import * as envEditor from 'env-editor'; + +// $ExpectType Editor +envEditor.get('sublime'); +// $ExpectType Editor +envEditor.default(); +// $ExpectType Editor[] +envEditor.all(); diff --git a/types/env-editor/index.d.ts b/types/env-editor/index.d.ts new file mode 100644 index 0000000000..8bf9e6d68f --- /dev/null +++ b/types/env-editor/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for env-editor 0.3 +// Project: https://github.com/sindresorhus/env-editor#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default function(): Editor; +export function get(editor: string): Editor; +export function all(): Editor[]; + +export interface Editor { + id: string; + name: string; + bin: string; + isTerminalEditor: boolean; + paths: string[]; + keywords: string[]; +} diff --git a/types/env-editor/tsconfig.json b/types/env-editor/tsconfig.json new file mode 100644 index 0000000000..6d137bf389 --- /dev/null +++ b/types/env-editor/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", + "env-editor-tests.ts" + ] +} diff --git a/types/env-editor/tslint.json b/types/env-editor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/env-editor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }