SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface RunOptions

    Options for IScript.run.

    Extends ITransaction.OperationOptions, so a caller can name the resulting transaction (description) - this is the label the UI shows for undo/redo - and control autoSelect. When description is omitted the label falls to the entry's JSDoc summary, then to defaultDescription, then to the entry's name.

    interface RunOptions {
        applyResult?: boolean;
        args?: Record<string, any>;
        author?: Author;
        autoSelect?: boolean | ITypes.SelectOptions;
        defaultDescription?: string;
        description?: string;
        expectedCommitId?: string;
        logger?: ILogger;
        logTimeoutMs?: number;
        readOnly?: boolean;
        render?: LogRenderer;
    }

    Hierarchy (View Summary)

    Index
    applyResult?: boolean

    Writes the entry's return value into the current selection.

    false
    

    The user-invoked macro affordance: a macro run from the UI that returns a value (or an ICell/ICellRange) puts it where the user is. IScript.executeMacro sets it; IScript.run does not, because a programmatic caller's return value is its answer - run("wb.getRange('A1:B2').getValues()") is a read, and pasting its result at the selection would make every read an edit.

    args?: Record<string, any>

    Arguments exposed to the script via ctx.args.

    author?: Author

    Who authored this change. Recorded on the commit (ICommit.getAuthor).

    the store's author, else null (unattributed)

    autoSelect?: boolean | ITypes.SelectOptions

    If true or set then this will select the affect item after the transaction is complete.

    If this is set to true then any restore will also select.

    defaultDescription?: string

    The label to use when neither the caller nor the code names the change — a FLOOR, not an override.

    description outranks the entry's JSDoc summary, which is right for a caller naming a specific change and wrong for a host supplying a generic default: passing "Agent Update" as the description throws away the summary of every documented script it runs. Hence two options and one order — description, then the summary, then this, then the entry's name.

    description?: string

    A human description.

    'determined by the set operation and locale'
    
    expectedCommitId?: string

    Optimistic concurrency guard. If set, the operation only begins if the store's current commit id matches; otherwise a TransactionConflictError is thrown.

    The check happens atomically as the root transaction begins — there is no window between check and commit. If any transaction is already open the check fails with reason open (the head could move beneath the operation).

    logger?: ILogger

    Output channel; defaults to a console logger. A host may pass a BufferLogger to capture.

    logTimeoutMs?: number

    How long a finished run waits for what it logged to settle, in milliseconds. 0 waits indefinitely.

    log(promise) prints what the promise settles to, so a run is not done until its log is. A value still unsettled when this elapses prints as [pending]; nothing is thrown and the rest of the log is kept.

    10 seconds
    
    readOnly?: boolean

    Declares the operation read-only: any state update within it throws.

    false
    

    Writes are tracked automatically — a batch that performs no updates never creates a commit (no new commit id, no events, no undo entry) whether or not this is set. The flag is purely an assertion for callers that want the guarantee enforced. Nested transactions inherit it; they cannot opt back out.

    render?: LogRenderer

    Renders an SDK object logged by the script as its markdown report.

    Injected because the renderer registry lives in @sheetxl/query, which depends on this package. Hosts pass a closure over renderMarkdown and its workbook; without it, logged objects fall back to JSON.