/** * Worker preset - Cloudflare Worker-optimized Sandlot configuration. * * Similar to createBrowserSandlot but with worker-specific defaults. */ import { type EsmTypesResolverOptions } from "../core/esm-types-resolver"; import type { Sandlot, SandlotOptions } from "../types"; import { type EsbuildWasmBundlerOptions } from "../browser/bundler"; import { type TypecheckerOptions } from "../core/typechecker"; import { type MainThreadExecutorOptions } from "../browser/main-thread-executor"; export interface CreateWorkerSandlotOptions extends Omit { /** * Custom bundler options, or a pre-configured bundler instance. */ bundler?: EsbuildWasmBundlerOptions | SandlotOptions["bundler"]; /** * Custom typechecker options, or a pre-configured typechecker instance. * Set to `false` to disable type checking. */ typechecker?: TypecheckerOptions | SandlotOptions["typechecker"] | false; /** * Custom types resolver options, or a pre-configured resolver instance. * Set to `false` to disable type resolution. */ typesResolver?: EsmTypesResolverOptions | SandlotOptions["typesResolver"] | false; /** * Custom executor options, or a pre-configured executor instance. * Set to `false` to disable execution (sandbox.run() will throw). * Defaults to MainThreadExecutor. * * Note: IframeExecutor is not available in workers. */ executor?: MainThreadExecutorOptions | SandlotOptions["executor"] | false; } /** * Create a Sandlot instance pre-configured for Cloudflare Worker environments. * * This is similar to createBrowserSandlot but optimized for workers: * - Uses MainThreadExecutor (no iframe support in workers) * - Expects nodejs_compat flag to be enabled * * @example Basic usage * ```ts * import { createWorkerSandlot } from "sandlot/worker"; * * const sandlot = await createWorkerSandlot(); * const sandbox = await sandlot.createSandbox(); * ``` * * @example Disable type checking for faster builds * ```ts * const sandlot = await createWorkerSandlot({ * typechecker: false, * }); * ``` */ export declare function createWorkerSandlot(options?: CreateWorkerSandlotOptions): Promise; //# sourceMappingURL=preset.d.ts.map