TomTom Maps for JavaScript
    Preparing search index...

    Type Alias SandboxExecutor

    Pluggable strategy for executing sandbox code, chosen by environment: in a browser the default runs the code in a locked-down iframe worker, off the main thread, and without a DOM it runs in the host realm. Every executor honours this exact contract.

    run MUST resolve to { value } or { error } and never reject. Execution failures are reported as { error } via formatSandboxExecutionError.

    type SandboxExecutor = {
        destroy?(): void;
        run<Result = unknown>(
            code: string,
            paramNames: readonly string[],
            args: readonly unknown[],
            verb: string,
        ): Promise<{ value: Result } | { error: string }>;
    }
    Index
    • Releases any held resources (iframe / worker). No-op for the main-thread executor.

      Returns void

    • Type Parameters

      • Result = unknown

      Parameters

      • code: string
      • paramNames: readonly string[]
      • args: readonly unknown[]
      • verb: string

      Returns Promise<{ value: Result } | { error: string }>