import { type EsmTypesResolverOptions } from "../core/esm-types-resolver"; import type { Sandlot, SandlotOptions } from "../types"; import { type EsbuildWasmBundlerOptions } from "./bundler"; import { type TypecheckerOptions } from "../core/typechecker"; import { type MainThreadExecutorOptions } from "./main-thread-executor"; import { type IframeExecutorOptions } from "./iframe-executor"; import { type IPersistor } from "../core/persistor"; export interface CreateBrowserSandlotOptions 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). * Set to `"iframe"` to use IframeExecutor with default options. * Defaults to MainThreadExecutor. * * Note: IframeExecutor does NOT support shared modules. Use MainThreadExecutor * (the default) if you need shared modules like React. */ executor?: MainThreadExecutorOptions | IframeExecutorOptions | SandlotOptions["executor"] | "iframe" | false; /** * Unified cache provider. * Defaults to InMemoryPersistor if not provided. * * For persistent caching across page reloads, use createIndexedDBPersistor(). */ persistor?: IPersistor; } /** * Create a Sandlot instance pre-configured for browser environments. * * This is a convenience function that sets up sensible defaults: * - EsbuildWasmBundler for bundling * - Typechecker for type checking * - FetchTypesResolver for npm type resolution * * @example Basic usage * ```ts * const sandlot = await createBrowserSandlot(); * const sandbox = await sandlot.createSandbox(); * ``` * * @example With shared modules * ```ts * import React from "react"; * import ReactDOM from "react-dom/client"; * * const sandlot = await createBrowserSandlot({ * sharedModules: { * react: React, * "react-dom/client": ReactDOM, * }, * }); * ``` * * @example Disable type checking for faster builds * ```ts * const sandlot = await createBrowserSandlot({ * typechecker: false, * }); * ``` */ export declare function createBrowserSandlot(options?: CreateBrowserSandlotOptions): Promise; //# sourceMappingURL=preset.d.ts.map