[ssh-key-decrypt] add typings

This commit is contained in:
Dimitri Benin 2017-08-24 18:01:59 +02:00
parent 76a13f1ad8
commit 2275ea35ed
4 changed files with 42 additions and 0 deletions

11
types/ssh-key-decrypt/index.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
// Type definitions for ssh-key-decrypt 0.1
// Project: https://github.com/isaacs/ssh-key-decrypt#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export = decrypt;
declare function decrypt(data: string | Buffer, passphrase: string, outEnc?: 'buffer'): Buffer;
declare function decrypt(data: string | Buffer, passphrase: string, outEnc: BufferEncoding): string;

View File

@ -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

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }