import type { LoadedConfig } from './config/index.ts'; export type ViewOptions = { colors?: boolean; }; /** * The base class for all View classes * * Do not override the constructor, just provide start/done/error methods. * * These classes should be used as one or more of the exported views for * commands that need to know when the processing starts, handle errors in * various ways, etc. Fancy stuff. * * For simple use cases, usually better to create a {@link ViewFn} instead. */ export declare class ViewClass { options: ViewOptions; config: LoadedConfig; constructor(options: ViewOptions, config: LoadedConfig); start(): void; done(_result: T, _opts: { time: number; }): Promise; error(_err: unknown): void; } export type ViewFn = (result: T, options: ViewOptions, conf: LoadedConfig) => unknown; export type View = ViewFn | typeof ViewClass; export declare const isViewClass: (view: View) => view is typeof ViewClass; export type Views = View | Record>;