import type { Validate } from './utils'; export type { TypeOrPromiseLike, Validate } from './utils'; export interface RunQuestion { message: string; name: K; type?: string; validate?: Validate; } /** * @summary Run a form description * @function * @public * * @param {Object[]} form - form description * @param {Object} [options={}] - options * @param {Object} [options.override] - overrides * * @returns {Promise} answers * * @example * form.run [ * message: 'Processor' * name: 'processorType' * type: 'list' * choices: [ 'Z7010', 'Z7020' ] * , * message: 'Coprocessor cores' * name: 'coprocessorCore' * type: 'list' * choices: [ '16', '64' ] * ], * * # coprocessorCore will always be 64 * # Notice that the question will not be asked at all * override: * coprocessorCore: '64' * * .then (answers) -> * console.log(answers) */ export declare const run: | object | undefined = undefined>(form: Array>, options?: { override?: Override; }) => Promise : Record & Override>; export interface AskOptions { message: string; type?: string; name?: string; default?: T; choices?: Array<{ name: string; value: T; }>; validate?: Validate; } /** * @summary Run a single form question * @function * @public * * @param {Object} question - form question * @returns {Promise<*>} answer * * @example * form.ask * message: 'Processor' * type: 'list' * choices: [ 'Z7010', 'Z7020' ] * .then (processor) -> * console.log(processor) */ export declare const ask: (question: AskOptions) => Promise;