import type { StackDeps } from "../stack/commands.js"; /** A request schema (`@nylorun/core/contracts`), as far as reading a body needs it. */ export interface BodySchema { safeParse(value: unknown): { success: true; data: T; } | { success: false; error: { issues: readonly { path: readonly PropertyKey[]; message: string; }[]; }; }; } /** The text in file `source`, or on standard input for `-`, as it is. */ export declare function readText(deps: StackDeps, source: string): Promise; /** * The JSON body in file `source`, or on standard input for `-`, as `schema` parses it. Fields * named in `readOnly` (a view's, so a `get` can be edited and put back) are dropped first. With * `bodyField`, a view that holds the body in that field (`get`'s whole output) is read as that * field. A body that does not parse is a usage error, before any request. */ export declare function readBody(deps: StackDeps, source: string, schema: BodySchema, readOnly?: readonly string[], bodyField?: string): Promise; /** * A secret piped in on standard input (its trailing newline dropped), so it is never in the * arguments, the shell's history or the process list. `what` names it in the refusals. */ export declare function readSecret(deps: StackDeps, what: string, example: string): Promise; /** `rows` (the first is the header) as columns two spaces apart, with no trailing blanks. */ export declare function printTable(deps: StackDeps, rows: readonly (readonly string[])[]): void; /** `value` as indented JSON on stdout. */ export declare function printJson(deps: StackDeps, value: unknown): void;