import { type EsmTypesResolverOptions } from "../core/esm-types-resolver"; import type { Sandlot, SandlotOptions } from "../types"; import { type EsbuildNativeBundlerOptions } from "./bundler"; import { type EsbuildWasmNodeBundlerOptions } from "./wasm-bundler"; import { type TypecheckerOptions } from "../core/typechecker"; import { type NodeExecutorOptions } from "./executor"; import { type IPersistor } from "../core/persistor"; export interface CreateNodeSandlotOptions extends Omit { /** * Custom bundler options, or a pre-configured bundler instance. * * Set to `"wasm"` to use the WASM bundler (for testing consistency with browser). * You can also pass `{ wasm: true, ...options }` for WASM bundler with custom options. * * @default EsbuildNativeBundler (fastest, uses native esbuild binary) */ bundler?: EsbuildNativeBundlerOptions | (EsbuildWasmNodeBundlerOptions & { wasm: true; }) | SandlotOptions["bundler"] | "wasm"; /** * 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 NodeExecutor. */ executor?: NodeExecutorOptions | SandlotOptions["executor"] | false; /** * Unified cache provider. * Defaults to InMemoryPersistor if not provided. */ persistor?: IPersistor; } /** * Create a Sandlot instance pre-configured for Node.js/Bun/Deno environments. * * This is a convenience function that sets up sensible defaults: * - EsbuildNativeBundler for bundling (uses native esbuild) * - Typechecker for type checking (fetches libs from CDN) * - EsmTypesResolver for npm type resolution * - NodeExecutor for code execution * * @example Basic usage * ```ts * const sandlot = await createNodeSandlot(); * const sandbox = await sandlot.createSandbox(); * ``` * * @example With shared modules * ```ts * import express from "express"; * * const sandlot = await createNodeSandlot({ * sharedModules: { * express, * }, * }); * ``` * * @example Disable type checking for faster builds * ```ts * const sandlot = await createNodeSandlot({ * typechecker: false, * }); * ``` * * @example Use WASM bundler for testing consistency with browser * ```ts * const sandlot = await createNodeSandlot({ * bundler: "wasm", * }); * ``` */ export declare function createNodeSandlot(options?: CreateNodeSandlotOptions): Promise; //# sourceMappingURL=preset.d.ts.map