TomTom Maps for JavaScript
    Preparing search index...

    Type Alias SandboxExecutor

    Pluggable strategy for executing sandbox code. The default mainThreadExecutor compiles and runs in the host realm. An alternative executor, such as the iframe-worker one, can run the same code in a locked-down realm off the main thread while honouring 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 }>