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

    Interface ITaskProgress<TStart, TWarning>

    Interface for tracking long running tasks.

    interface ITaskProgress<TStart = string, TWarning = any> {
        onComplete?(details: TStart | null): void | Promise<void>;
        onError?(error: Error): void | Promise<void>;
        onProgress?(completed: number, total?: number): void;
        onStart?(details: TStart, total?: number): void | Promise<void>;
        onWarning?(message?: string, details?: TWarning): void;
    }

    Type Parameters

    • TStart = string
    • TWarning = any
    Index
    • Called when the task is complete.

      Parameters

      • details: TStart | null

        The details of the task, or null if the task encountered an error.

      Returns void | Promise<void>

      This is called when the task is complete, regardless of whether it completed successfully or encountered an error.

    • May be called if an error has occurred.

      Parameters

      • error: Error

        The error that occurred.

      Returns void | Promise<void>

    • May be called periodically to update the progress.

      Parameters

      • completed: number

        The cumulative amount of work done so far (monotonically increasing).

      • Optionaltotal: number

        If known, the total amount of work, in the same units as completed. Matches the total reported to onStart when one was provided; may be omitted when unknown.

      Returns void

    • Called once the task has actually begun — after any interactive source/destination acquisition (open/save pickers, permission prompts, network handshakes) has resolved.

      Parameters

      • details: TStart

        Details about the task (resolved format, name, size, …).

      • Optionaltotal: number

        If known, the total amount of work to be done, in the same units later reported to onProgress (for reads this is typically the source size in bytes). When provided, a consumer can render a determinate progress bar / percentage; when omitted it should fall back to an indeterminate (spinner) state.

      Returns void | Promise<void>

      If a promise is returned, it will be awaited before proceeding.

      This is deliberately distinct from "the user requested the operation": a spinner started on the request would sit on top of the picker/permission dialog and look hung. onStart is the signal that real work is underway and determinate UI can be shown.

    • May be called if a warning has occurred.

      Parameters

      • Optionalmessage: string

        The warning message.

      • Optionaldetails: TWarning

        Optional details for the warning.

      Returns void