import type { QuickJSContext } from 'quickjs-emscripten-core'; /** 1-based position in the submitted code where the guest error was thrown. */ export type GuestPosition = { line: number; column: number; }; export type SandboxResult = { result?: unknown; error?: string; errorPosition?: GuestPosition; }; export type ExecutionBudget = { /** * Run `work()` as a host call: its latency is exempt from the compute budget (`timeoutMs`). * While the call is in flight the idle timer is paused and the remaining compute budget is * frozen, resuming where it stopped when the call settles — so time spent off in the host * isn't charged as guest compute and the budget is never refreshed per call. */ hostCall(work: () => Promise): Promise; /** Rejects when a wall-clock deadline fires */ aborted: Promise; /** The message of the deadline that fired, or `undefined` while the run is still in budget */ expiredMessage(): string | undefined; dispose(): void; }; export type SetupSandboxContext = (context: QuickJSContext, budget: ExecutionBudget) => void | (() => void); export type RunInSandboxOptions = { timeoutMs?: number; maxLifetimeMs?: number; setupContext?: SetupSandboxContext; authoredCode?: string; }; export type SandboxHostFunction = (input: unknown) => Promise | unknown; //# sourceMappingURL=types.d.ts.map