@types/inquirer
Advanced tools
Comparing version 8.1.1 to 8.1.2
@@ -16,24 +16,24 @@ // Type definitions for inquirer 8.1 | ||
// TypeScript Version: 4.2 | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import { Observable } from "rxjs"; | ||
import Choice = require("./lib/objects/choice"); | ||
import Choices = require("./lib/objects/choices"); | ||
import Separator = require("./lib/objects/separator"); | ||
import "./lib/prompts/base"; | ||
import "./lib/prompts/checkbox"; | ||
import "./lib/prompts/confirm"; | ||
import "./lib/prompts/editor"; | ||
import "./lib/prompts/expand"; | ||
import "./lib/prompts/input"; | ||
import "./lib/prompts/list"; | ||
import "./lib/prompts/number"; | ||
import "./lib/prompts/password"; | ||
import "./lib/prompts/rawlist"; | ||
import "./lib/utils/events"; | ||
import "./lib/utils/paginator"; | ||
import "./lib/utils/readline"; | ||
import "./lib/utils/screen-manager"; | ||
import "./lib/utils/utils"; | ||
import BottomBar = require("./lib/ui/bottom-bar"); | ||
import PromptUI = require("./lib/ui/prompt"); | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
import { Observable } from 'rxjs'; | ||
import Choice = require('./lib/objects/choice'); | ||
import Choices = require('./lib/objects/choices'); | ||
import Separator = require('./lib/objects/separator'); | ||
import './lib/prompts/base'; | ||
import './lib/prompts/checkbox'; | ||
import './lib/prompts/confirm'; | ||
import './lib/prompts/editor'; | ||
import './lib/prompts/expand'; | ||
import './lib/prompts/input'; | ||
import './lib/prompts/list'; | ||
import './lib/prompts/number'; | ||
import './lib/prompts/password'; | ||
import './lib/prompts/rawlist'; | ||
import './lib/utils/events'; | ||
import './lib/utils/paginator'; | ||
import './lib/utils/readline'; | ||
import './lib/utils/screen-manager'; | ||
import './lib/utils/utils'; | ||
import BottomBar = require('./lib/ui/bottom-bar'); | ||
import PromptUI = require('./lib/ui/prompt'); | ||
@@ -111,3 +111,3 @@ /** | ||
*/ | ||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; | ||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; | ||
@@ -214,3 +214,3 @@ /** | ||
*/ | ||
interface Answers extends Record<string, any> { } | ||
interface Answers extends Record<string, any> {} | ||
@@ -223,3 +223,3 @@ /** | ||
*/ | ||
type Validator<T extends Answers = Answers> = Question<T>["validate"]; | ||
type Validator<T extends Answers = Answers> = Question<T>['validate']; | ||
@@ -232,3 +232,3 @@ /** | ||
*/ | ||
type Transformer<T extends Answers = Answers> = InputQuestionOptions<T>["transformer"]; | ||
type Transformer<T extends Answers = Answers> = InputQuestionOptions<T>['transformer']; | ||
@@ -255,3 +255,6 @@ /** | ||
*/ | ||
type AsyncDynamicQuestionProperty<T, TAnswers extends Answers = Answers> = DynamicQuestionProperty<T | Promise<T>, TAnswers>; | ||
type AsyncDynamicQuestionProperty<T, TAnswers extends Answers = Answers> = DynamicQuestionProperty< | ||
T | Promise<T>, | ||
TAnswers | ||
>; | ||
@@ -343,3 +346,3 @@ /** | ||
*/ | ||
type?: "choice" | undefined; | ||
type?: 'choice' | undefined; | ||
@@ -410,3 +413,3 @@ /** | ||
*/ | ||
type: "separator"; | ||
type: 'separator'; | ||
@@ -485,4 +488,4 @@ /** | ||
type DistinctChoice<TAnswers extends Answers = Answers, TChoiceMap = AllChoiceMap<TAnswers>> = | ||
string | | ||
TChoiceMap[keyof TChoiceMap]; | ||
| string | ||
| TChoiceMap[keyof TChoiceMap]; | ||
@@ -532,3 +535,3 @@ /** | ||
*/ | ||
type?: "input" | undefined; | ||
type?: 'input' | undefined; | ||
} | ||
@@ -542,3 +545,3 @@ | ||
*/ | ||
interface NumberQuestionOptions<T extends Answers = Answers> extends InputQuestionOptions<T> { } | ||
interface NumberQuestionOptions<T extends Answers = Answers> extends InputQuestionOptions<T> {} | ||
@@ -555,3 +558,3 @@ /** | ||
*/ | ||
type: "number"; | ||
type: 'number'; | ||
} | ||
@@ -582,12 +585,15 @@ | ||
*/ | ||
type: "password"; | ||
type: 'password'; | ||
} | ||
/** | ||
* Provides options for a question for the `ListPrompt`. | ||
* Represents a list-based question that can loop. | ||
* | ||
* @template T | ||
* The type of the answers. | ||
* | ||
* @template TChoiceMap | ||
* The valid choices for the question. | ||
*/ | ||
interface ListQuestionOptions<T extends Answers = Answers> extends ListQuestionOptionsBase<T, ListChoiceMap<T>> { | ||
interface LoopableListQuestionOptionsBase<T, TChoiceMap> extends ListQuestionOptionsBase<T, TChoiceMap> { | ||
/** | ||
@@ -605,2 +611,11 @@ * A value indicating whether choices in a list should be looped. | ||
*/ | ||
interface ListQuestionOptions<T extends Answers = Answers> | ||
extends LoopableListQuestionOptionsBase<T, ListChoiceMap<T>> {} | ||
/** | ||
* Provides options for a question for the `ListPrompt`. | ||
* | ||
* @template T | ||
* The type of the answers. | ||
*/ | ||
interface ListQuestion<T extends Answers = Answers> extends ListQuestionOptions<T> { | ||
@@ -610,3 +625,3 @@ /** | ||
*/ | ||
type: "list"; | ||
type: 'list'; | ||
} | ||
@@ -620,3 +635,3 @@ | ||
*/ | ||
interface RawListQuestionOptions<T extends Answers = Answers> extends ListQuestionOptions<T> { } | ||
interface RawListQuestionOptions<T extends Answers = Answers> extends ListQuestionOptions<T> {} | ||
@@ -633,3 +648,3 @@ /** | ||
*/ | ||
type: "rawlist"; | ||
type: 'rawlist'; | ||
} | ||
@@ -643,3 +658,4 @@ | ||
*/ | ||
interface ExpandQuestionOptions<T extends Answers = Answers> extends ListQuestionOptionsBase<T, ExpandChoiceMap<T>> { } | ||
interface ExpandQuestionOptions<T extends Answers = Answers> | ||
extends ListQuestionOptionsBase<T, ExpandChoiceMap<T>> {} | ||
@@ -656,3 +672,3 @@ /** | ||
*/ | ||
type: "expand"; | ||
type: 'expand'; | ||
} | ||
@@ -666,3 +682,4 @@ | ||
*/ | ||
interface CheckboxQuestionOptions<T extends Answers = Answers> extends ListQuestionOptionsBase<T, CheckboxChoiceMap<T>> { } | ||
interface CheckboxQuestionOptions<T extends Answers = Answers> | ||
extends LoopableListQuestionOptionsBase<T, CheckboxChoiceMap<T>> {} | ||
@@ -679,3 +696,3 @@ /** | ||
*/ | ||
type: "checkbox"; | ||
type: 'checkbox'; | ||
} | ||
@@ -689,3 +706,3 @@ | ||
*/ | ||
interface ConfirmQuestionOptions<T extends Answers = Answers> extends Question<T> { } | ||
interface ConfirmQuestionOptions<T extends Answers = Answers> extends Question<T> {} | ||
@@ -702,3 +719,3 @@ /** | ||
*/ | ||
type: "confirm"; | ||
type: 'confirm'; | ||
} | ||
@@ -712,3 +729,3 @@ | ||
*/ | ||
interface EditorQuestionOptions<T extends Answers = Answers> extends Question<T> { } | ||
interface EditorQuestionOptions<T extends Answers = Answers> extends Question<T> {} | ||
@@ -725,3 +742,3 @@ /** | ||
*/ | ||
type: "editor"; | ||
type: 'editor'; | ||
} | ||
@@ -793,3 +810,3 @@ | ||
*/ | ||
type QuestionTypeName = DistinctQuestion["type"]; | ||
type QuestionTypeName = DistinctQuestion['type']; | ||
@@ -827,3 +844,3 @@ /** | ||
*/ | ||
type PromptState = LiteralUnion<"pending" | "idle" | "loading" | "answered" | "done">; | ||
type PromptState = LiteralUnion<'pending' | 'idle' | 'loading' | 'answered' | 'done'>; | ||
@@ -864,3 +881,3 @@ /** | ||
*/ | ||
new(question: any, readLine: ReadlineInterface, answers: Answers): PromptBase; | ||
new (question: any, readLine: ReadlineInterface, answers: Answers): PromptBase; | ||
} | ||
@@ -867,0 +884,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { Answers, CheckboxChoiceOptions, ExpandChoiceOptions, ListChoiceOptions } from "../.."; | ||
import { Answers, CheckboxChoiceOptions, ExpandChoiceOptions, ListChoiceOptions } from '../..'; | ||
@@ -9,10 +9,8 @@ /** | ||
*/ | ||
declare class Choice<T extends Answers = Answers> implements | ||
ListChoiceOptions<T>, | ||
CheckboxChoiceOptions<T>, | ||
ExpandChoiceOptions { | ||
declare class Choice<T extends Answers = Answers> | ||
implements ListChoiceOptions<T>, CheckboxChoiceOptions<T>, ExpandChoiceOptions { | ||
/** | ||
* @inheritdoc | ||
*/ | ||
type?: "choice" | undefined; | ||
type?: 'choice' | undefined; | ||
@@ -19,0 +17,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { AllChoiceMap, Answers, KeyUnion, UnionToIntersection } from "../.."; | ||
import Choice = require("./choice"); | ||
import Separator = require("./separator"); | ||
import { AllChoiceMap, Answers, KeyUnion, UnionToIntersection } from '../..'; | ||
import Choice = require('./choice'); | ||
import Separator = require('./separator'); | ||
@@ -19,3 +19,3 @@ /** | ||
*/ | ||
type RealChoice<T> = Exclude<DistinctChoice<T>, { type: Separator["type"] }>; | ||
type RealChoice<T> = Exclude<DistinctChoice<T>, { type: Separator['type'] }>; | ||
@@ -113,3 +113,5 @@ /** | ||
*/ | ||
pluck<TProperty extends ChoiceProperty<T>>(property: TProperty | ChoiceProperty<T>): Array<(RealChoice<T> & { [key: string]: undefined })[TProperty]>; | ||
pluck<TProperty extends ChoiceProperty<T>>( | ||
property: TProperty | ChoiceProperty<T>, | ||
): Array<(RealChoice<T> & { [key: string]: undefined })[TProperty]>; | ||
@@ -145,3 +147,6 @@ /** | ||
*/ | ||
forEach(callbackfn: (value: Choice<T> | Separator, index: number, array: Array<Choice<T> | Separator>) => void, thisArg?: any): void; | ||
forEach( | ||
callbackfn: (value: Choice<T> | Separator, index: number, array: Array<Choice<T> | Separator>) => void, | ||
thisArg?: any, | ||
): void; | ||
@@ -164,3 +169,10 @@ /** | ||
*/ | ||
filter<TElement extends Choice<T> | Separator>(callbackfn: (value: Choice<T> | Separator, index: number, array: Array<Choice<T> | Separator>) => value is TElement, thisArg?: any): TElement[]; | ||
filter<TElement extends Choice<T> | Separator>( | ||
callbackfn: ( | ||
value: Choice<T> | Separator, | ||
index: number, | ||
array: Array<Choice<T> | Separator>, | ||
) => value is TElement, | ||
thisArg?: any, | ||
): TElement[]; | ||
@@ -181,3 +193,6 @@ /** | ||
*/ | ||
find(predicate: (value: Choice<T> | Separator, index: number, obj: Array<Choice<T> | Separator>) => boolean, thisArg?: any): Choice<T> | Separator; | ||
find( | ||
predicate: (value: Choice<T> | Separator, index: number, obj: Array<Choice<T> | Separator>) => boolean, | ||
thisArg?: any, | ||
): Choice<T> | Separator; | ||
@@ -184,0 +199,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { SeparatorOptions } from "../.."; | ||
import { SeparatorOptions } from '../..'; | ||
@@ -10,3 +10,3 @@ /** | ||
*/ | ||
readonly type: "separator"; | ||
readonly type: 'separator'; | ||
@@ -13,0 +13,0 @@ /** |
@@ -1,5 +0,5 @@ | ||
import { Interface as ReadLineInterface } from "readline"; | ||
import { Observable } from "rxjs"; | ||
import inquirer = require("../.."); | ||
import ScreenManager = require("../utils/screen-manager"); | ||
import { Interface as ReadLineInterface } from 'readline'; | ||
import { Observable } from 'rxjs'; | ||
import inquirer = require('../..'); | ||
import ScreenManager = require('../utils/screen-manager'); | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,5 +0,5 @@ | ||
import inquirer = require("../.."); | ||
import Prompt = require("./base"); | ||
import { Interface as ReadLineInterface } from "readline"; | ||
import Paginator = require("../utils/paginator"); | ||
import inquirer = require('../..'); | ||
import Prompt = require('./base'); | ||
import { Interface as ReadLineInterface } from 'readline'; | ||
import Paginator = require('../utils/paginator'); | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import Prompt = require("./base"); | ||
import { Answers, ConfirmQuestionOptions } from "../.."; | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import Prompt = require('./base'); | ||
import { Answers, ConfirmQuestionOptions } from '../..'; | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,5 +0,5 @@ | ||
import Prompt = require("./base"); | ||
import { Subject, Subscription } from "rxjs"; | ||
import inquirer = require("../.."); | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import Prompt = require('./base'); | ||
import { Subject, Subscription } from 'rxjs'; | ||
import inquirer = require('../..'); | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,5 +0,5 @@ | ||
import Paginator = require("../utils/paginator"); | ||
import Prompt = require("./base"); | ||
import inquirer = require("../.."); | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import Paginator = require('../utils/paginator'); | ||
import Prompt = require('./base'); | ||
import inquirer = require('../..'); | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -121,3 +121,3 @@ /** | ||
*/ | ||
protected validateChoices(choices: ExpandPrompt<TQuestion>["opt"]["choices"]): void; | ||
protected validateChoices(choices: ExpandPrompt<TQuestion>['opt']['choices']): void; | ||
@@ -136,3 +136,3 @@ /** | ||
*/ | ||
protected generateChoicesString(choices: ExpandPrompt<TQuestion>["opt"]["choices"], defaultChoice: any): string; | ||
protected generateChoicesString(choices: ExpandPrompt<TQuestion>['opt']['choices'], defaultChoice: any): string; | ||
@@ -148,5 +148,5 @@ /** | ||
*/ | ||
protected renderChoices(choices: ExpandPrompt<TQuestion>["opt"]["choices"], pointer: string): string; | ||
protected renderChoices(choices: ExpandPrompt<TQuestion>['opt']['choices'], pointer: string): string; | ||
} | ||
export = ExpandPrompt; |
@@ -1,4 +0,4 @@ | ||
import Prompt = require("./base"); | ||
import inquirer = require("../.."); | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import Prompt = require('./base'); | ||
import inquirer = require('../..'); | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,5 +0,5 @@ | ||
import Prompt = require("./base"); | ||
import { Answers, ListQuestionOptions } from "../.."; | ||
import Paginator = require("../utils/paginator"); | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import Prompt = require('./base'); | ||
import { Answers, ListQuestionOptions } from '../..'; | ||
import Paginator = require('../utils/paginator'); | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import InputPrompt = require("./input"); | ||
import { Answers, NumberQuestionOptions } from "../.."; | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import InputPrompt = require('./input'); | ||
import { Answers, NumberQuestionOptions } from '../..'; | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import Prompt = require("./base"); | ||
import inquirer = require("../.."); | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import Prompt = require('./base'); | ||
import inquirer = require('../..'); | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,5 +0,5 @@ | ||
import inquirer = require("../.."); | ||
import Prompt = require("./base"); | ||
import Paginator = require("../utils/paginator"); | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import inquirer = require('../..'); | ||
import Prompt = require('./base'); | ||
import Paginator = require('../utils/paginator'); | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -92,3 +92,3 @@ /** | ||
*/ | ||
protected onArrowKey(type: "up" | "down"): void; | ||
protected onArrowKey(type: 'up' | 'down'): void; | ||
@@ -95,0 +95,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import inquirer = require("../.."); | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
import inquirer = require('../..'); | ||
@@ -4,0 +4,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { ThroughStream } from "through"; | ||
import inquirer = require("../.."); | ||
import UI = require("./baseUI"); | ||
import { ThroughStream } from 'through'; | ||
import inquirer = require('../..'); | ||
import UI = require('./baseUI'); | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { defer, Observable } from "rxjs"; | ||
import inquirer = require("../.."); | ||
import UI = require("./baseUI"); | ||
import { defer, Observable } from 'rxjs'; | ||
import inquirer = require('../..'); | ||
import UI = require('./baseUI'); | ||
@@ -60,3 +60,5 @@ /** | ||
*/ | ||
protected processQuestion(question: inquirer.DistinctQuestion<inquirer.Answers>): Observable<inquirer.ui.FetchedAnswer>; | ||
protected processQuestion( | ||
question: inquirer.DistinctQuestion<inquirer.Answers>, | ||
): Observable<inquirer.ui.FetchedAnswer>; | ||
@@ -72,3 +74,5 @@ /** | ||
*/ | ||
protected fetchAnswer(question: inquirer.ui.FetchedQuestion<inquirer.Answers>): Observable<inquirer.ui.FetchedAnswer>; | ||
protected fetchAnswer( | ||
question: inquirer.ui.FetchedQuestion<inquirer.Answers>, | ||
): Observable<inquirer.ui.FetchedAnswer>; | ||
@@ -84,3 +88,5 @@ /** | ||
*/ | ||
protected setDefaultType(question: inquirer.DistinctQuestion<inquirer.Answers>): Observable<inquirer.DistinctQuestion<inquirer.Answers>>; | ||
protected setDefaultType( | ||
question: inquirer.DistinctQuestion<inquirer.Answers>, | ||
): Observable<inquirer.DistinctQuestion<inquirer.Answers>>; | ||
@@ -96,5 +102,7 @@ /** | ||
*/ | ||
protected filterIfRunnable(question: inquirer.DistinctQuestion<inquirer.Answers>): Observable<inquirer.DistinctQuestion<inquirer.Answers>>; | ||
protected filterIfRunnable( | ||
question: inquirer.DistinctQuestion<inquirer.Answers>, | ||
): Observable<inquirer.DistinctQuestion<inquirer.Answers>>; | ||
} | ||
export = PromptUI; |
@@ -1,3 +0,3 @@ | ||
import { Interface as ReadlineInterface, Key } from "readline"; | ||
import { Observable } from "rxjs"; | ||
import { Interface as ReadlineInterface, Key } from 'readline'; | ||
import { Observable } from 'rxjs'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import ScreenManager = require("./screen-manager"); | ||
import ScreenManager = require('./screen-manager'); | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { Interface as ReadlineInterface } from "readline"; | ||
import { Interface as ReadlineInterface } from 'readline'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { Interface as ReadLineInterface } from "readline"; | ||
import { Interface as ReadLineInterface } from 'readline'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { Answers, DistinctQuestion, KeyUnion, UnionToIntersection } from "../.."; | ||
import { Observable } from "rxjs"; | ||
import { Answers, DistinctQuestion, KeyUnion, UnionToIntersection } from '../..'; | ||
import { Observable } from 'rxjs'; | ||
@@ -27,4 +27,5 @@ /** | ||
prop: QuestionProperty, | ||
answers: Answers): Observable<DistinctQuestion>; | ||
answers: Answers, | ||
): Observable<DistinctQuestion>; | ||
export { }; | ||
export {}; |
{ | ||
"name": "@types/inquirer", | ||
"version": "8.1.1", | ||
"version": "8.1.2", | ||
"description": "TypeScript definitions for inquirer", | ||
@@ -76,4 +76,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/inquirer", | ||
}, | ||
"typesPublisherContentHash": "05ecdf8ae294c9016465171ee9bc7fd45a0c64c19be66f55da81af751e340aac", | ||
"typesPublisherContentHash": "0c74efcbf3ccfd225352fb1c327f54b7a4d7fc61f503342ad5966425aff9c8b0", | ||
"typeScriptVersion": "4.2" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 07 Sep 2021 09:31:22 GMT | ||
* Last updated: Tue, 21 Sep 2021 18:31:39 GMT | ||
* Dependencies: [@types/rxjs](https://npmjs.com/package/@types/rxjs), [@types/through](https://npmjs.com/package/@types/through) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71757
26
2407