TomTom Maps for JavaScript
    Preparing search index...

    Type Alias SandboxExecutor

    Pluggable strategy for executing sandbox code. The default mainThreadExecutor compiles + runs in the host realm; an alternative executor (e.g. 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

    Methods

    Methods

    • Release 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 }>