pamoja for TypeScript - v0.2.0
    Preparing search index...

    Interface RunOptions

    How a node runs until it is told to stop.

    interface RunOptions {
        battery?: () => | number
        | { charge: number; charging: boolean }
        | Promise<number | { charge: number; charging: boolean }>;
        onError?: (error: unknown) => unknown;
        onTick?: (tick: Tick) => unknown;
        signal?: AbortSignal;
        ticks?: number;
        wait?: (ms: number, signal?: AbortSignal) => Promise<void>;
    }
    Index
    battery?: () => | number
    | { charge: number; charging: boolean }
    | Promise<number | { charge: number; charging: boolean }>

    Reads the battery before each wait, as a charge from 0 to 1 or a charge and whether the panel is charging; a node without one samples at the active cadence.

    onError?: (error: unknown) => unknown

    Hears a tick that failed. The loop carries on at the same cadence; without one, the failure ends the loop and run rejects with it.

    onTick?: (tick: Tick) => unknown

    Hears each tick, such as to log it or to act on an alert.

    signal?: AbortSignal

    Stops the loop; the tick under way finishes first.

    ticks?: number

    How many ticks to run before returning; the loop runs until stopped unless given.

    wait?: (ms: number, signal?: AbortSignal) => Promise<void>

    Waits between ticks; a timer unless given, which a test replaces to run at once.