Add types for env-editor

This commit is contained in:
Dimitri Benin
2018-12-17 20:09:03 +01:00
parent 6def4dbaaa
commit c7272de6ff
4 changed files with 49 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import * as envEditor from 'env-editor';
// $ExpectType Editor
envEditor.get('sublime');
// $ExpectType Editor
envEditor.default();
// $ExpectType Editor[]
envEditor.all();
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for env-editor 0.3
// Project: https://github.com/sindresorhus/env-editor#readme
// Definitions by: BendingBender <https://github.com/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[];
}
+23
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }