/** * Sandbox Component * * JSX component that creates and provides a Sandbox instance to its children. * Uses useData for async initialization and useOnUnmount for cleanup. */ import type React from "react"; import type { SandboxProvider, Mount, Permissions, ResourceLimits, Sandbox as SandboxHandle } from "./types.js"; export interface SandboxProps { /** The sandbox provider to use (e.g. localProvider()). */ provider: SandboxProvider; /** Workspace path, or true for auto temp directory. Default: true. */ workspace?: string | true; /** Host↔sandbox path mappings. */ mounts?: Mount[]; /** Advisory permissions. */ allow?: Permissions; /** Environment variables. Functions are resolved at creation time. */ env?: Record string)>; /** Post-creation setup callback. Runs after sandbox creation, before tools are available. */ setup?: (sandbox: SandboxHandle) => Promise; /** Pre-destroy teardown callback. Runs while sandbox is still alive — readFile, readDir, exec all work. */ teardown?: (sandbox: SandboxHandle) => Promise; /** Resource constraints. */ limits?: ResourceLimits; /** Whether to persist sandbox state in snapshots. Default: false. */ persist?: boolean; children: React.ReactNode; } /** * Creates a sandbox instance and provides it to children via context. * * @example * ```tsx * * * * * * * * ``` */ export declare function Sandbox({ provider, workspace, mounts, allow, env, setup, teardown, limits, children, }: SandboxProps): React.ReactElement; //# sourceMappingURL=component.d.ts.map