diff --git a/types/ssh-key-decrypt/index.d.ts b/types/ssh-key-decrypt/index.d.ts new file mode 100644 index 0000000000..7e6a7f2eaf --- /dev/null +++ b/types/ssh-key-decrypt/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for ssh-key-decrypt 0.1 +// Project: https://github.com/isaacs/ssh-key-decrypt#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = decrypt; + +declare function decrypt(data: string | Buffer, passphrase: string, outEnc?: 'buffer'): Buffer; +declare function decrypt(data: string | Buffer, passphrase: string, outEnc: BufferEncoding): string; diff --git a/types/ssh-key-decrypt/ssh-key-decrypt-tests.ts b/types/ssh-key-decrypt/ssh-key-decrypt-tests.ts new file mode 100644 index 0000000000..06c1c6637e --- /dev/null +++ b/types/ssh-key-decrypt/ssh-key-decrypt-tests.ts @@ -0,0 +1,8 @@ +import decrypt = require('ssh-key-decrypt'); + +decrypt('', ''); // $ExpectType Buffer +decrypt(new Buffer(''), ''); // $ExpectType Buffer +decrypt('', '', 'buffer'); // $ExpectType Buffer +decrypt(new Buffer(''), '', 'buffer'); // $ExpectType Buffer +decrypt('', '', 'latin1'); // $ExpectType string +decrypt(new Buffer(''), '', 'latin1'); // $ExpectType string diff --git a/types/ssh-key-decrypt/tsconfig.json b/types/ssh-key-decrypt/tsconfig.json new file mode 100644 index 0000000000..906a06cae4 --- /dev/null +++ b/types/ssh-key-decrypt/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ssh-key-decrypt-tests.ts" + ] +} diff --git a/types/ssh-key-decrypt/tslint.json b/types/ssh-key-decrypt/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ssh-key-decrypt/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }