Skip to content

Commit

Permalink
prompts: Add missing onRender method to PromptObject
Browse files Browse the repository at this point in the history
The new dependency on `kleur` has been merged; see microsoft/DefinitelyTyped-tools#573.

This method is mentioned in the `README`: https://github.com/terkelg/prompts/blob/a0c1777ae86d04e46cb42eb3af69ca74ae5d79e2/readme.md#-prompt-objects
  • Loading branch information
boneskull committed Dec 1, 2022
1 parent 86cb20c commit 9bf2c0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types/prompts/index.d.ts
Expand Up @@ -6,6 +6,7 @@
// theweirdone <https://github.com/theweirdone>
// whoaa512 <https://github.com/whoaa512>
// John Reilly <https://github.com/johnnyreilly>
// Christopher Hiller <https://github.com/boneskull>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9

Expand All @@ -14,6 +15,7 @@
export = prompts;

import { Readable, Writable } from 'stream';
import { Kleur } from 'kleur';

declare function prompts<T extends string = string>(
questions: prompts.PromptObject<T> | Array<prompts.PromptObject<T>>,
Expand Down Expand Up @@ -83,6 +85,7 @@ declare namespace prompts {
format?: PrevCaller<T, void> | undefined;
validate?: PrevCaller<T, boolean | string | Promise<boolean | string>> | undefined;
onState?: PrevCaller<T, void> | undefined;
onRender?: ((kleur: Kleur) => void) | undefined;
min?: number | PrevCaller<T, number | Falsy> | undefined;
max?: number | PrevCaller<T, number | Falsy> | undefined;
float?: boolean | PrevCaller<T, boolean | Falsy> | undefined;
Expand Down
6 changes: 6 additions & 0 deletions types/prompts/package.json
@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"kleur": "^3.0.3"
}
}

0 comments on commit 9bf2c0f

Please sign in to comment.