@types/prompts
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -1,12 +0,18 @@ | ||
// Type definitions for prompts 2.04 | ||
// Type definitions for prompts 2.4 | ||
// Project: https://github.com/terkelg/prompts | ||
// Definitions by: Berkay GURSOY <https://github.com/Berkays> | ||
// Daniel Perez Alvarez <https://github.com/danielpa9708> | ||
// Daniel Perez Alvarez <https://github.com/unindented> | ||
// Kamontat Chantrachirathumrong <https://github.com/kamontat> | ||
// theweirdone <https://github.com/theweirdone> | ||
// whoaa512 <https://github.com/whoaa512> | ||
// John Reilly <https://github.com/johnnyreilly> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.9 | ||
/// <reference types="node" /> | ||
export = prompts; | ||
import { Readable, Writable } from 'stream'; | ||
declare function prompts<T extends string = string>( | ||
@@ -21,3 +27,3 @@ questions: prompts.PromptObject<T> | Array<prompts.PromptObject<T>>, | ||
function inject(obj: any): void; | ||
function inject(arr: ReadonlyArray<any>): void; | ||
@@ -28,2 +34,8 @@ namespace inject { | ||
function override(obj: { [key: string]: any }): void; | ||
namespace override { | ||
const prototype: {}; | ||
} | ||
namespace prompts { | ||
@@ -53,35 +65,42 @@ function autocomplete(args: PromptObject): any; | ||
// Based upon: https://github.com/terkelg/prompts/blob/d7d2c37a0009e3235b2e88a7d5cdbb114ac271b2/lib/elements/select.js#L29 | ||
interface Choice { | ||
title: string; | ||
value: string; | ||
disable?: boolean; | ||
value?: any; | ||
disabled?: boolean | undefined; | ||
selected?: boolean | undefined; | ||
description?: string | undefined; | ||
} | ||
interface Options { | ||
onSubmit?: (prompt: PromptObject, answer: any, answers: any[]) => void; | ||
onCancel?: (prompt: PromptObject, answers: any) => void; | ||
onSubmit?: ((prompt: PromptObject, answer: any, answers: any[]) => void) | undefined; | ||
onCancel?: ((prompt: PromptObject, answers: any) => void) | undefined; | ||
} | ||
interface PromptObject<T extends string = string> { | ||
type: ValueOrFunc<PromptType> | Falsy; | ||
type: PromptType | Falsy | PrevCaller<T, PromptType | Falsy>; | ||
name: ValueOrFunc<T>; | ||
message?: ValueOrFunc<string>; | ||
initial?: string | number | boolean | Date; | ||
style?: string; | ||
format?: PrevCaller<T, void>; | ||
validate?: PrevCaller<T, void>; | ||
onState?: PrevCaller<T, void>; | ||
min?: number; | ||
max?: number; | ||
float?: boolean; | ||
round?: number; | ||
increment?: number; | ||
seperator?: string; | ||
active?: string; | ||
inactive?: string; | ||
choices?: Choice[]; | ||
hint?: string; | ||
suggest?: ((prev: any, values: any, prompt: PromptObject) => void); | ||
limit?: number; | ||
mask?: string; | ||
message?: ValueOrFunc<string> | undefined; | ||
initial?: InitialReturnValue | PrevCaller<T, InitialReturnValue | Promise<InitialReturnValue>> | undefined; | ||
style?: string | PrevCaller<T, string | Falsy> | undefined; | ||
format?: PrevCaller<T, void> | undefined; | ||
validate?: PrevCaller<T, boolean | string | Promise<boolean | string>> | undefined; | ||
onState?: PrevCaller<T, void> | undefined; | ||
min?: number | PrevCaller<T, number | Falsy> | undefined; | ||
max?: number | PrevCaller<T, number | Falsy> | undefined; | ||
float?: boolean | PrevCaller<T, boolean | Falsy> | undefined; | ||
round?: number | PrevCaller<T, number | Falsy> | undefined; | ||
instructions?: string | boolean | undefined; | ||
increment?: number | PrevCaller<T, number | Falsy> | undefined; | ||
separator?: string | PrevCaller<T, string | Falsy> | undefined; | ||
active?: string | PrevCaller<T, string | Falsy> | undefined; | ||
inactive?: string | PrevCaller<T, string | Falsy> | undefined; | ||
choices?: Choice[] | PrevCaller<T, Choice[] | Falsy> | undefined; | ||
hint?: string | PrevCaller<T, string | Falsy> | undefined; | ||
warn?: string | PrevCaller<T, string | Falsy> | undefined; | ||
suggest?: ((input: any, choices: Choice[]) => Promise<any>) | undefined; | ||
limit?: number | PrevCaller<T, number | Falsy> | undefined; | ||
mask?: string | PrevCaller<T, string | Falsy> | undefined; | ||
stdout?: Writable | undefined; | ||
stdin?: Readable | undefined; | ||
} | ||
@@ -99,5 +118,7 @@ | ||
type PromptType = "text" | "password" | "invisible" | "number" | "confirm" | "list" | "toggle" | "select" | "multiselect" | "autocomplete" | "date"; | ||
type PromptType = "text" | "password" | "invisible" | "number" | "confirm" | "list" | "toggle" | "select" | "multiselect" | "autocomplete" | "date" | "autocompleteMultiselect"; | ||
type ValueOrFunc<T extends string> = T | PrevCaller<T>; | ||
type InitialReturnValue = string | number | boolean | Date; | ||
} |
{ | ||
"name": "@types/prompts", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "TypeScript definitions for prompts", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prompts", | ||
"license": "MIT", | ||
@@ -14,4 +15,4 @@ "contributors": [ | ||
"name": "Daniel Perez Alvarez", | ||
"url": "https://github.com/danielpa9708", | ||
"githubUsername": "danielpa9708" | ||
"url": "https://github.com/unindented", | ||
"githubUsername": "unindented" | ||
}, | ||
@@ -27,6 +28,16 @@ { | ||
"githubUsername": "theweirdone" | ||
}, | ||
{ | ||
"name": "whoaa512", | ||
"url": "https://github.com/whoaa512", | ||
"githubUsername": "whoaa512" | ||
}, | ||
{ | ||
"name": "John Reilly", | ||
"url": "https://github.com/johnnyreilly", | ||
"githubUsername": "johnnyreilly" | ||
} | ||
], | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -38,5 +49,7 @@ "type": "git", | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "7128854958832a687ade646bd176ba99a2e61c9a84b5ec3b025671eb8ac46cec", | ||
"typeScriptVersion": "2.9" | ||
"dependencies": { | ||
"@types/node": "*" | ||
}, | ||
"typesPublisherContentHash": "43d0daf9addb5d790761af34e5be56684c5d22ee2a632d6ce93cf0dd571f34ec", | ||
"typeScriptVersion": "4.1" | ||
} |
@@ -5,13 +5,13 @@ # Installation | ||
# Summary | ||
This package contains type definitions for prompts ( https://github.com/terkelg/prompts ). | ||
This package contains type definitions for prompts (https://github.com/terkelg/prompts). | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prompts | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prompts. | ||
Additional Details | ||
* Last updated: Thu, 02 May 2019 21:13:22 GMT | ||
* Dependencies: none | ||
### Additional Details | ||
* Last updated: Tue, 04 Oct 2022 23:03:32 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Berkay GURSOY <https://github.com/Berkays>, Daniel Perez Alvarez <https://github.com/danielpa9708>, Kamontat Chantrachirathumrong <https://github.com/kamontat>, theweirdone <https://github.com/theweirdone>. | ||
These definitions were written by [Berkay GURSOY](https://github.com/Berkays), [Daniel Perez Alvarez](https://github.com/unindented), [Kamontat Chantrachirathumrong](https://github.com/kamontat), [theweirdone](https://github.com/theweirdone), [whoaa512](https://github.com/whoaa512), and [John Reilly](https://github.com/johnnyreilly). |
Sorry, the diff of this file is not supported yet
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
8098
91
0
1
+ Added@types/node@*
+ Added@types/node@22.5.4(transitive)
+ Addedundici-types@6.19.8(transitive)