Add definitions for isaacs node read

This commit is contained in:
Tim JK 2015-10-28 17:16:40 +13:00
parent 62eedc3121
commit a2502b4487
2 changed files with 42 additions and 0 deletions

18
read/read-tests.ts Normal file
View File

@ -0,0 +1,18 @@
/// <reference path="read.d.ts" />
import read = require('read');
var opts: read.Options;
opts = {
prompt: 'please enter...',
silent: true,
replace: '*',
timeout: 1500,
default: 'nothing',
edit: false,
terminal: true,
input: {x: 'thing'},
output: {y: 'thang'}
};
read(opts, function (error, result, isDefault) { });

24
read/read.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
// Type definitions for read
// Project: https://github.com/isaacs/read
// Definitions by: Tim JK <https://github.com/timjk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'read' {
function Read(options: Read.Options, callback: (error: any, result: string, isDefault: boolean) => any): void;
module Read {
interface Options {
prompt?: string;
silent?: boolean;
replace?: string;
timeout?: number;
default?: string;
edit?: boolean;
terminal?: boolean;
input?: any;
output?: any;
}
}
export = Read;
}