import type { VolumeSnapshot } from "../engine-types"; import type { MemoryHandlerOptions } from "../memory-handler"; import type { PrebundleData } from "../packages/prebundle/types"; export interface NodepodOptions { files?: Record; env?: Record; workdir?: string; swUrl?: string; onServerReady?: (port: number, url: string) => void; /** Show a small "nodepod" watermark link in preview iframes. Defaults to true. */ watermark?: boolean; /** Memory optimization settings. Omit to use defaults. */ memory?: MemoryHandlerOptions; /** Cache installed node_modules in IndexedDB for faster re-boots. Default: true. */ enableSnapshotCache?: boolean; /** domains allowed through the cors proxy. merged with built-in defaults * (npm, github, esm.sh etc). pass null to allow everything */ allowedFetchDomains?: string[] | null; /** * Pre-bundled package data to load at boot time. Packages in these * bundles are written directly to the VFS during install, skipping * registry fetches and module transforms entirely. */ prebundles?: PrebundleData[]; } export interface TerminalTheme { background?: string; foreground?: string; cursor?: string; selectionBackground?: string; black?: string; red?: string; green?: string; yellow?: string; blue?: string; magenta?: string; cyan?: string; white?: string; brightBlack?: string; brightRed?: string; brightGreen?: string; brightYellow?: string; brightBlue?: string; brightMagenta?: string; brightCyan?: string; brightWhite?: string; } export interface TerminalOptions { Terminal: any; FitAddon?: any; WebglAddon?: any; theme?: TerminalTheme; fontSize?: number; fontFamily?: string; prompt?: (cwd: string) => string; } export interface StatResult { isFile: boolean; isDirectory: boolean; size: number; mtime: number; } export type Snapshot = VolumeSnapshot; export interface SnapshotOptions { /** Exclude node_modules and other auto-installable dirs. Default: true */ shallow?: boolean; /** Auto-install deps from package.json after restoring a shallow snapshot. Default: true */ autoInstall?: boolean; } export interface SpawnOptions { cwd?: string; env?: Record; signal?: AbortSignal; }