Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/inquirer

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/inquirer - npm Package Compare versions

Comparing version 0.0.44 to 6.0.0

147

inquirer/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for Inquirer.js
// Type definitions for Inquirer.js 6.x
// Project: https://github.com/SBoudrias/Inquirer.js

@@ -12,11 +12,13 @@ // Definitions by: Qubo <https://github.com/tkQubo>

// Junyoung Clare Jang <https://github.com/Ailrun>
// Richard Lea <https://github.com/chigix>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="rx" />
// TypeScript Version: 2.8
import through = require('through');
import { Observable } from 'rxjs';
import * as readline from 'readline';
declare namespace inquirer {
type Prompts = { [name: string]: PromptModule };
type Prompts = { [name: string]: prompts.Base };
type ChoiceType = string | objects.ChoiceOption | objects.Separator;

@@ -26,10 +28,7 @@ type Questions<T = Answers> =

| ReadonlyArray<Question<T>>
| Rx.Observable<Question<T>>;
interface OutputStreamOption {
output: NodeJS.WriteStream
}
interface InputStreamOption {
input: NodeJS.ReadStream
}
type StreamOptions = InputStreamOption | OutputStreamOption | (InputStreamOption & OutputStreamOption);
| Observable<Question<T>>;
type StreamOptions = {
input?: NodeJS.ReadStream,
output?: NodeJS.WriteStream,
};

@@ -52,7 +51,5 @@ interface Inquirer {

* @param questions Questions settings array
* @param cb Callback being passed the user answers
* @return
*/
prompt<T>(questions: Questions<T>, cb: (answers: T) => any): ui.Prompt;
prompt<T>(questions: Questions<T>): Promise<T>;
prompt: PromptModule;
prompts: Prompts;

@@ -62,3 +59,3 @@ Separator: objects.SeparatorStatic;

BottomBar: ui.BottomBar;
Prompt: ui.Prompt;
Prompt: ui.PromptUI;
};

@@ -68,4 +65,3 @@ }

interface PromptModule {
<T>(questions: Questions<T>): Promise<T>;
<T>(questions: Questions<T>, cb: (answers: T) => any): ui.Prompt;
<T>(questions: Questions<T>): Promise<T> & { ui: ui.PromptUI };
/**

@@ -76,3 +72,3 @@ * Register a prompt type

*/
registerPrompt(name: string, prompt: PromptModule): ui.Prompt;
registerPrompt(name: string, prompt: prompts.Base): PromptModule;
/**

@@ -120,5 +116,5 @@ * Register the defaults provider prompts

choices?:
| ReadonlyArray<ChoiceType>
| ((answers: T) => ReadonlyArray<ChoiceType>)
| ((answers: T) => Promise<ReadonlyArray<ChoiceType>>);
| ReadonlyArray<ChoiceType>
| ((answers: T) => ReadonlyArray<ChoiceType>)
| ((answers: T) => Promise<ReadonlyArray<ChoiceType>>);
/**

@@ -171,16 +167,71 @@ * Receive the user input and should return true if the value is valid, and an error message (String)

/**
* Corresponding to the answer object creation in:
* https://github.com/SBoudrias/Inquirer.js/blob/ff075f587ef78504f0eae4ee5ca0656432429026/packages/inquirer/lib/ui/prompt.js#L88
*/
interface Answer {
name: string,
answer: any,
}
namespace prompts {
/**
* Base prompt implementation
* Should be extended by prompt types.
*
* @interface Base
*/
interface Base {
new <T>(question: Question<T>, rl: readline.Interface, answers: Answers): Base;
/**
* Start the Inquiry session and manage output value filtering
*
* @returns {Promise<any>}
* @memberof Base
*/
run(): Promise<any>;
/**
* Called when the UI closes. Override to do any specific cleanup necessary
*/
close(): void;
/**
* Generate the prompt question string
*/
getQuestion(): string;
}
}
namespace ui {
/**
* Base interface class other can inherits from
*/
interface Prompt extends BaseUI<Prompts> {
new (promptModule: Prompts): Prompt;
interface BaseUI {
rl: readline.Interface;
new(opt: StreamOptions): BaseUI;
/**
* Handle the ^C exit
* @return {null}
*/
onForceClose(): void;
/**
* Close the interface and cleanup listeners
*/
close(): void;
}
/**
* Base interface class other can inherits from
*/
interface PromptUI extends BaseUI {
process: Observable<Answer>;
new(prompts: Prompts, opt: StreamOptions): PromptUI;
run<T>(questions: Questions<T>): Promise<Answers>;
/**
* Once all prompt are over
*/
onCompletion(): void;
processQuestion<T>(question: Question<T>): any;
fetchAnswer<T>(question: Question<T>): any;
setDefaultType<T>(question: Question<T>): any;
filterIfRunnable<T>(question: Question<T>): any;
processQuestion<T>(question: Question<T>): Observable<Question<T>>;
fetchAnswer<T>(question: Question<T>): Observable<Question<T>>;
setDefaultType<T>(question: Question<T>): Observable<Question<T>>;
filterIfRunnable<T>(question: Question<T>): Observable<Question<T>>;
}

@@ -191,4 +242,4 @@

*/
interface BottomBar extends BaseUI<BottomBarOption> {
new (opt?: BottomBarOption): BottomBar;
interface BottomBar extends BaseUI {
new(opt?: StreamOptions & { bottomBar?: string }): BottomBar;
/**

@@ -199,2 +250,3 @@ * Render the prompt to screen

render(): BottomBar;
clean(): BottomBar;
/**

@@ -207,6 +259,7 @@ * Update the bottom bar content and rerender

/**
* Rerender the prompt
* Write out log data
* @param {String} data - The log data to be output
* @return self
*/
writeLog(data: any): BottomBar;
writeLog(data: string): BottomBar;
/**

@@ -226,32 +279,2 @@ * Make sure line end on a line feed

interface BottomBarOption {
bottomBar?: string;
}
/**
* Base interface class other can inherits from
*/
interface BaseUI<TOpt> {
new (opt: TOpt): void;
/**
* Handle the ^C exit
* @return {null}
*/
onForceClose(): void;
/**
* Close the interface and cleanup listeners
*/
close(): void;
/**
* Handle and propagate keypress events
*/
onKeypress(s: string, key: Key): void;
}
interface Key {
sequence: string;
name: string;
meta: boolean;
shift: boolean;
ctrl: boolean;
}
}

@@ -258,0 +281,0 @@

{
"name": "@types/inquirer",
"version": "0.0.44",
"version": "6.0.0",
"description": "TypeScript definitions for Inquirer.js",

@@ -51,2 +51,7 @@ "license": "MIT",

"githubUsername": "Ailrun"
},
{
"name": "Richard Lea",
"url": "https://github.com/chigix",
"githubUsername": "chigix"
}

@@ -63,7 +68,7 @@ ],

"dependencies": {
"@types/rx": "*",
"@types/through": "*"
"@types/through": "*",
"rxjs": ">=6.4.0"
},
"typesPublisherContentHash": "582a01778888098c7f964f59cd511818b3156ebbc599fa1fc3ef92d639b2dbe0",
"typesPublisherContentHash": "8da80418d175953c9aec2807a9e41263b6122c339458b37a8d75d59793283c20",
"typeScriptVersion": "2.0"
}

@@ -11,7 +11,7 @@ # Installation

Additional Details
* Last updated: Wed, 27 Feb 2019 19:43:12 GMT
* Dependencies: @types/through, @types/rx
* Last updated: Fri, 22 Mar 2019 22:44:32 GMT
* Dependencies: @types/through, @types/rxjs
* Global values: none
# Credits
These definitions were written by Qubo <https://github.com/tkQubo>, Parvez <https://github.com/ppathan>, Jouderian <https://github.com/jouderianjr>, Qibang <https://github.com/bang88>, Jason Dreyzehner <https://github.com/bitjson>, Synarque <https://github.com/synarque>, Justin Rockwood <https://github.com/jrockwood>, Keith Kelly <https://github.com/kwkelly>, Junyoung Clare Jang <https://github.com/Ailrun>.
These definitions were written by Qubo <https://github.com/tkQubo>, Parvez <https://github.com/ppathan>, Jouderian <https://github.com/jouderianjr>, Qibang <https://github.com/bang88>, Jason Dreyzehner <https://github.com/bitjson>, Synarque <https://github.com/synarque>, Justin Rockwood <https://github.com/jrockwood>, Keith Kelly <https://github.com/kwkelly>, Junyoung Clare Jang <https://github.com/Ailrun>, Richard Lea <https://github.com/chigix>.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc