diff --git a/types/is-ssh/index.d.ts b/types/is-ssh/index.d.ts new file mode 100644 index 0000000000..1d41cc2740 --- /dev/null +++ b/types/is-ssh/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for is-ssh 1.3 +// Project: https://github.com/IonicaBizau/node-is-ssh +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * @param input The input url or an array of protocols. + * @returns `true` if the input is a ssh url, `false` otherwise. + */ +declare function isSsh(input: string | string[]): boolean; + +export = isSsh; diff --git a/types/is-ssh/is-ssh-tests.ts b/types/is-ssh/is-ssh-tests.ts new file mode 100644 index 0000000000..0d88e15437 --- /dev/null +++ b/types/is-ssh/is-ssh-tests.ts @@ -0,0 +1,6 @@ +import isSsh = require('is-ssh'); + +isSsh('ssh://user@host.xz:port/path/to/repo.git/'); // $ExpectType boolean +isSsh('ssh://user@host.xz/path/to/repo.git/'); // $ExpectType boolean +isSsh('ssh://host.xz:port/path/to/repo.git/'); // $ExpectType boolean +isSsh('ssh://host.xz/path/to/repo.git/'); // $ExpectType boolean diff --git a/types/is-ssh/tsconfig.json b/types/is-ssh/tsconfig.json new file mode 100644 index 0000000000..30c82a1945 --- /dev/null +++ b/types/is-ssh/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", + "is-ssh-tests.ts" + ] +} diff --git a/types/is-ssh/tslint.json b/types/is-ssh/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-ssh/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }