mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add definitions for isaacs node read
This commit is contained in:
parent
62eedc3121
commit
a2502b4487
18
read/read-tests.ts
Normal file
18
read/read-tests.ts
Normal 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
24
read/read.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user