mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Fixed capitalization of OptionTypes and extra parens around functions
This commit is contained in:
Vendored
+30
-10
@@ -3,22 +3,22 @@
|
||||
// Definitions by: Tristan Jones <https://github.com/jonestristand>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type optionType = string | number | RegExp | ((input: string) => boolean);
|
||||
type OptionType = string | number | RegExp | ((input: string) => boolean);
|
||||
|
||||
interface BasicOptions {
|
||||
prompt?: any;
|
||||
hideEchoBack?: boolean;
|
||||
mask?: string;
|
||||
limit?: optionType | optionType[];
|
||||
limit?: OptionType | OptionType[];
|
||||
limitMessage?: string;
|
||||
defaultInput?: string;
|
||||
trueValue?: optionType | optionType[];
|
||||
falseValue?: optionType | optionType[];
|
||||
trueValue?: OptionType | OptionType[];
|
||||
falseValue?: OptionType | OptionType[];
|
||||
caseSensitive?: boolean;
|
||||
keepWhitespace?: boolean;
|
||||
encoding?: string;
|
||||
bufferSize?: number;
|
||||
print?: ((display: string, encoding: string) => void);
|
||||
print?: (display: string, encoding: string) => void;
|
||||
history?: boolean;
|
||||
cd?: boolean;
|
||||
charlist?: string;
|
||||
@@ -29,7 +29,7 @@ interface BasicOptions {
|
||||
exists?: any;
|
||||
isFile?: boolean;
|
||||
isDirectory?: boolean;
|
||||
validate?: ((path: string) => boolean | string);
|
||||
validate?: (path: string) => boolean | string;
|
||||
create?: boolean;
|
||||
guide?: boolean;
|
||||
}
|
||||
@@ -47,9 +47,9 @@ export function questionInt(query?: any, options?: BasicOptions): number;
|
||||
export function questionFloat(query?: any, options?: BasicOptions): number;
|
||||
export function questionPath(query?: any, options?: BasicOptions): string;
|
||||
|
||||
export function promptCL(commandHandler?: { [id: string]: ((...args: string[]) => void) } | ((command: string, ...args: string[]) => void), options?: BasicOptions): string[];
|
||||
export function promptLoop(inputHandler: ((value: string) => boolean), options?: BasicOptions): void;
|
||||
export function promptCLLoop(commandHandler?: { [id: string]: ((...args: string[]) => boolean | void) } | ((command: string, ...args: string[]) => boolean | void), options?: BasicOptions): void;
|
||||
export function promptCL(commandHandler?: { [id: string]: (...args: string[]) => void } | ((command: string, ...args: string[]) => void), options?: BasicOptions): string[];
|
||||
export function promptLoop(inputHandler: (value: string) => boolean, options?: BasicOptions): void;
|
||||
export function promptCLLoop(commandHandler?: { [id: string]: (...args: string[]) => boolean | void } | ((command: string, ...args: string[]) => boolean | void), options?: BasicOptions): void;
|
||||
export function promptSimShell(options?: BasicOptions): string;
|
||||
|
||||
export function keyInYN(query?: any, options?: BasicOptions): boolean | string;
|
||||
@@ -60,8 +60,28 @@ export function keyInSelect(items: string[], query?: any, options?: BasicOptions
|
||||
export function getRawInput(): string;
|
||||
|
||||
// Deprecated
|
||||
|
||||
/**
|
||||
* @deprecated Use the bufferSize option instead: readlineSync.setDefaultOptions({bufferSize: value});
|
||||
*/
|
||||
export function setBufferSize(value: number): void;
|
||||
|
||||
/**
|
||||
* @deprecated Use the encoding option instead: readlineSync.setDefaultOptions({encoding: value});
|
||||
*/
|
||||
export function setEncoding(value: string): void;
|
||||
|
||||
/**
|
||||
* @deprecated Use the mask option instead: readlineSync.setDefaultOptions({mask: value});
|
||||
*/
|
||||
export function setMask(value: string): void;
|
||||
export function setPrint(value: ((display: string, encoding: string) => void)): void;
|
||||
|
||||
/**
|
||||
* @deprecated Use the print option instead: readlineSync.setDefaultOptions({print: value});
|
||||
*/
|
||||
export function setPrint(value: (display: string, encoding: string) => void): void;
|
||||
|
||||
/**
|
||||
* @deprecated Use the prompt option instead: readlineSync.setDefaultOptions({prompt: value});
|
||||
*/
|
||||
export function setPrompt(value: any): void;
|
||||
@@ -107,4 +107,3 @@ readlineSync.setEncoding('utf-16');
|
||||
readlineSync.setMask('%');
|
||||
|
||||
readlineSync.setBufferSize(128);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user