import { IOFormat } from '../io-util.js'; export type InputProcessor = { /** * Return the type of input this processor retrieved. This should not be called until after * data has been read via `read` so throwing an exception before that is acceptable. */ readonly ioFormat: IOFormat; /** * This is called before calling `read` to determine if there is input from this processor. * The processor should return `false` to indicate `read` should not be called or `true` * if calling `read` can be expected to return data. */ hasInput(): boolean | Promise; /** * Actually read the input. This should not be called if `hasInput` returned false and should * ensure further calls to `ioFormat` return appropriate data. */ read(): Promise; }; export declare const fileInputProcessor: (filename?: string) => InputProcessor; export declare const stdinInputProcessor: () => InputProcessor; /** * Build an input processor given the necessary functions for doing so. */ export declare function inputProcessor(hasInput: () => boolean | Promise, read: () => Promise, ioFormat?: IOFormat): InputProcessor; export type CommandLineInputCommand = { hasCommandLineInput(): boolean; getInputFromCommandLine(): Promise; }; /** * Shortcut for building an InputProcessor that can build complex input from the command line * arguments using standard methods in `command` defined in `CommandLineInputCommand`. */ export declare function commandLineInputProcessor(command: CommandLineInputCommand): InputProcessor; export type UserInputCommand = { getInputFromUser(): Promise; }; /** * Shortcut for building an InputProcessor that queries the user for complex input using a * Q & A session using standard methods in `command` defined in `UserInputCommand`. This should * always be the last one in the list since input processors are checked in order and this can * always provide data. */ export declare function userInputProcessor(command: UserInputCommand): InputProcessor; export declare function userInputProcessor(readFn: () => Promise): InputProcessor; export declare const combinedInputProcessor: (inputProcessor: InputProcessor, ...moveInputProcessors: InputProcessor[]) => InputProcessor; //# sourceMappingURL=input-processor.d.ts.map