import * as readline from 'node:readline'; import MuteStream from 'mute-stream'; export type InquirerReadline = readline.ReadLine & { output: MuteStream; input: NodeJS.ReadableStream; clearLine: (dir: 0 | 1 | -1) => void; }; export declare class CancelablePromise extends Promise { cancel: () => void; } export type Prettify = { [K in keyof T]: T[K]; } & {}; export type PartialDeep = T extends object ? { [P in keyof T]?: PartialDeep; } : T; export type Context = { input?: NodeJS.ReadableStream; output?: NodeJS.WritableStream; clearPromptOnDone?: boolean; }; export type Prompt = (config: Config, context?: Context) => CancelablePromise; /** * Utility types used for writing tests * * Equal checks that A and B are the same type, and returns * either `true` or `false`. * * You can use it in combination with `Expect` to write type * inference unit tests: * * ```ts * type t = Expect< * Equal, { a?: string }> * > * ``` */ export type Equal = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? true : false; export type Expect = T; export type Not = T extends true ? false : true;