import type { SessionView } from '../../ops/types.ts'; import type { Session } from './session.ts'; /** * Whether a `name` / `name[sub]` reference names a set value. * * What `test -v` asks. A bare name over an array checks element 0 (the * literal key `"0"` for an associative one), which is GNU's rule; * `name[@]` and `name[*]` ask whether any element is set. An * associative subscript is the key verbatim; an indexed one evaluates * as arithmetic. */ export declare function elementIsSet(session: Session, ref: string): boolean; /** * Assign one element (or a bare name resolved as element 0). * * The element mechanics are computed on a copy and the landing write * goes through the door as the whole variable the write produces, so a * refused write leaves nothing half-applied and a `preSession` rule * sees `m[k]=v` as a write to `m`. The subscript arrives already * expanded: an associative name takes it as the key verbatim, an * indexed one evaluates it as arithmetic. A null subscript is a bare * target, which bash resolves as element 0 of an array and a plain * scalar otherwise. Answers `"ok"`, `"denied"`, `"readonly"`, or * `"subscript"`; a preSession refusal from the door propagates so the * rule's own message reaches the caller. */ export declare function assignElement(session: Session, view: SessionView | null, name: string, subscript: string | null, value: string, append?: boolean): Promise<'ok' | 'denied' | 'readonly' | 'subscript'>; //# sourceMappingURL=elements.d.ts.map