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

    Interface ScriptContext

    The execution context passed as the second argument to a script entry (export default function (workbook, ctx)).

    These five members are the run context on every transport — and the implicit globals of an inline snippet: wb, log, warn, error, args.

    interface ScriptContext {
        args?: Record<string, any>;
        wb: IWorkbook;
        error(...args: any[]): void;
        log(...args: any[]): void;
        warn(...args: any[]): void;
    }
    Index
    args?: Record<string, any>

    Optional caller-supplied arguments (CLI: everything after --; MCP: the args object).

    The workbook the script is running against.

    • Diagnostics: something wrong. Travels separately from log.

      Parameters

      • ...args: any[]

      Returns void

    • The reporting channel - findings and results.

      Parameters

      • ...args: any[]

      Returns void

      Variadic and value-taking, like console.log: log('rows:', n) and log(range.getStats()) both work. An SDK object (workbook, sheet, range, cell, stats, regions, style) renders as its markdown report - the same report returning it would produce.

    • Diagnostics: something surprising but survivable. Travels separately from log.

      Parameters

      • ...args: any[]

      Returns void