import { ProgressHandle, ProgressOptions, SpinnerHandle } from "../schema/activity.mjs"; import { WriteFn } from "./writer.mjs"; import { ActivityPolicy, OutputStream } from "./contracts.mjs"; //#region src/core/output/renderers.d.ts /** * Paired write functions for the two standard output streams. * * @internal */ interface OutputWriters { /** Write function targeting standard output. */ readonly stdout: WriteFn; /** Write function targeting standard error. */ readonly stderr: WriteFn; } /** * Spinner handle paired with its optional teardown function. * * @internal */ interface SpinnerRenderResult { /** The spinner handle exposed to command handlers. */ readonly handle: SpinnerHandle; /** Defined only when the mode requires cleanup (TTY or static); `undefined` for noop. */ readonly cleanup: (() => void) | undefined; } /** * Progress handle paired with its optional teardown function. * * @internal */ interface ProgressRenderResult { /** The progress handle exposed to command handlers. */ readonly handle: ProgressHandle; /** Defined only when the mode requires cleanup (TTY or static); `undefined` for noop. */ readonly cleanup: (() => void) | undefined; } /** Select the concrete {@linkcode WriteFn} for a given stream label. @internal */ declare function resolveWriterForStream(writers: OutputWriters, stream: OutputStream): WriteFn; /** Create a spinner handle matching the resolved {@linkcode ActivityPolicy} mode. @internal */ declare function createSpinnerHandleFromPolicy(policy: ActivityPolicy, text: string, stderr: WriteFn): SpinnerRenderResult; /** Create a progress handle matching the resolved {@linkcode ActivityPolicy} mode. @internal */ declare function createProgressHandleFromPolicy(policy: ActivityPolicy, options: ProgressOptions, stderr: WriteFn): ProgressRenderResult; //#endregion export { type OutputWriters, type ProgressRenderResult, type SpinnerRenderResult, createProgressHandleFromPolicy, createSpinnerHandleFromPolicy, resolveWriterForStream };