@types/cli-interact
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Installation

npm install --save @types/cli-interact

Summary

This package contains type definitions for cli-interact (https://github.com/zhami/cli-interact).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cli-interact.

index.d.ts

import { BasicOptions } from "readline-sync";

export interface ChoiceOptions {
    allowNoAnswer?: boolean | undefined;
    returnNumeric?: boolean | undefined;
}

export interface NumberOptions {
    allowNoAnswer?: boolean | undefined;
    requireInteger?: boolean | undefined;
}

export function getChar(promptText: string, allowedCharsAsString: string, flagAllowNoAnswer?: boolean): string;
export function getChoice(title: string, choices: string[], opts: ChoiceOptions & { returnNumeric: true }): number;
export function getChoice(title: string, choices: string[], opts?: ChoiceOptions): string;
export function getChoiceByChar(title: string, choices: string[], flagAllowNoAnswer?: boolean): string;
export function getInteger(promptText: string): number;
export function getIPversion(flagAllowNoAnswer?: boolean): string;
export function getNumber(promptText: string, opts?: boolean | NumberOptions): number;
export function getYesNo(title: string, flagAllowNoAnswer: true): boolean | undefined;
export function getYesNo(title: string, flagAllowNoAnswer?: false): boolean;
export function question(prompt: string, options?: BasicOptions): string;

Additional Details

Credits

These definitions were written by Florian Keller.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/cli-interact

Weekly Downloads

311

Version

0.1.4

License

MIT

Unpacked Size

4.98 kB

Total Files

5

Last publish

Collaborators

  • types