import type { ByteSource } from '../../io/types.ts'; import { IOResult } from '../../io/types.ts'; import { type Policies } from '../../policy/index.ts'; import type { CallStack } from '../../shell/call_stack.ts'; import type { PathSpec } from '../../types.ts'; import type { TSNodeLike } from '../../shell/types.ts'; import type { Session } from '../session/session.ts'; import { ExecutionNode } from '../types.ts'; import type { ExecuteNodeFn } from './jobs.ts'; type Result = [ByteSource | null, IOResult, ExecutionNode]; export declare class BreakSignal extends Error { readonly stdout: ByteSource | null; readonly io: IOResult; readonly levels: number; constructor(stdout?: ByteSource | null, io?: IOResult, levels?: number); } export declare class ContinueSignal extends Error { readonly stdout: ByteSource | null; readonly io: IOResult; readonly levels: number; constructor(stdout?: ByteSource | null, io?: IOResult, levels?: number); } export declare function handleIf(executeNode: ExecuteNodeFn, branches: readonly [TSNodeLike, TSNodeLike[]][], elseBody: TSNodeLike[] | null, session: Session, stdin?: ByteSource | null, callStack?: CallStack | null): Promise; export declare function handleFor(executeNode: ExecuteNodeFn, variable: string, values: readonly (string | PathSpec)[], body: readonly TSNodeLike[], session: Session, stdin?: ByteSource | null, callStack?: CallStack | null, policies?: Policies | null): Promise; export type CforEval = (expr: TSNodeLike | null, dflt: number) => Promise; /** * Run bash's C-style for: ((init; cond; update)) around a body. * * `evalExpr` evaluates one expression slot to its integer value (the * default when the slot is empty) and throws ArithError with the * offending expression text on an invalid expression, or ReadonlyError * when it assigns to a readonly variable; bash aborts the loop with * status 1, keeping the output of iterations that ran. The update * expression still runs after `continue`, per bash. */ export declare function handleCfor(executeNode: ExecuteNodeFn, exprs: readonly (TSNodeLike | null)[], body: readonly TSNodeLike[], evalExpr: CforEval, session: Session, stdin?: ByteSource | null, callStack?: CallStack | null): Promise; export declare function handleWhile(executeNode: ExecuteNodeFn, condition: TSNodeLike, body: readonly TSNodeLike[], session: Session, stdin?: ByteSource | null, callStack?: CallStack | null): Promise; export declare function handleUntil(executeNode: ExecuteNodeFn, condition: TSNodeLike, body: readonly TSNodeLike[], session: Session, stdin?: ByteSource | null, callStack?: CallStack | null): Promise; export declare function handleCase(executeNode: ExecuteNodeFn, word: string, items: readonly [readonly string[], readonly TSNodeLike[], string][], session: Session, stdin?: ByteSource | null, callStack?: CallStack | null): Promise; /** * Run bash's select loop: menu to stderr, choice read from stdin. * * Each iteration prompts with PS3's default `#? `, reads one line, * stores it raw in REPLY, and sets the variable to the chosen value * (empty for an out-of-range or non-numeric reply, like bash). An * empty reply redisplays the menu without running the body; EOF ends * the loop. */ export declare function handleSelect(executeNode: ExecuteNodeFn, variable: string, values: readonly (string | PathSpec)[], body: readonly TSNodeLike[], session: Session, stdin?: ByteSource | null, callStack?: CallStack | null, policies?: Policies | null): Promise; export declare class ReturnSignal extends Error { readonly exitCode: number; readonly stderr: Uint8Array; constructor(exitCode: number, stderr?: Uint8Array); } export {}; //# sourceMappingURL=control.d.ts.map