import type { Channel } from "node:diagnostics_channel"; import type { Output } from "./output/format.ts"; export declare function colorChannel(output: Output, name: string): string; /** * Render one diagnostics event to the given {@link Output}. The single source for how a diagnostics message looks across `ufp diagnostics` and `ufp watch livestream * --diagnostics`: a JSON object per event when `json` is set (so the line is analyzable with `jq`), otherwise a color-coded, timestamped human line. * * @param output - The sink to write the rendered line to (the caller chooses stdout or stderr by how it constructed the `Output`). * @param name - The channel name. * @param message - The published payload (`undefined` for payload-less channels). * @param opts - `json` selects the machine-readable object form over the human line. * * @category CLI */ export declare function renderDiagnostic(output: Output, name: string, message: unknown, opts?: { json?: boolean; }): void; /** * Subscribe to a set of diagnostics channels, routing each published message to `onMessage(name, message)`. Returns a `Disposable` that detaches every handler, so a * caller uses `using feed = subscribeDiagnostics(...)` and the subscriptions tear down at scope exit with no bookkeeping - the same lifetime discipline the rest of the * library uses for its event subscriptions. * * @param selected - The channels to subscribe to. * @param onMessage - Invoked with the channel name and payload on each publication. * * @returns A `Disposable` that unsubscribes every handler when disposed. * * @category CLI */ export declare function subscribeDiagnostics(selected: readonly Channel[], onMessage: (name: string, message: unknown) => void): Disposable; //# sourceMappingURL=diagnostics-feed.d.ts.map