export class StrapkitConfigError extends Error { constructor(message: string); name: "StrapkitConfigError"; } export class StrapkitRuntimeError extends Error { constructor(message: string, cause?: unknown); name: "StrapkitRuntimeError"; cause?: unknown; } export interface StrapkitOptions { apiKey: string; moduleOpts?: Record; terminal?: Terminal; baseUrl?: string; } interface Terminal { write(data: string): void; onData(callback: (data: string) => void): void; cols?: number; rows?: number; } export interface ExecOptions { env?: Record; cwd?: string; stdin?: string; input?: string; args?: string[]; onStdout?: (text: string) => void; onStderr?: (text: string) => void; terminal?: Terminal; } export interface ExecResult { stdout: string; stderr: string; exitCode: number; } export interface TreeEntry { name: string; path: string; type: "file" | "directory"; children?: TreeEntry[]; } export interface PortOpenInfo { addr: string; } export default class Strapkit { constructor(opts: StrapkitOptions); init(): Promise; setApiKey(apiKey: string): void; onPortOpen(callback: (port: number, info: PortOpenInfo) => void): void; write(path: string, contents: string | Uint8Array): Promise; writeMultiple( files: Record, ): Promise; read(path: string): Promise; readdir(path?: string): Promise; isDir(path: string): Promise; readTree(dir?: string): Promise; mkdir(path: string): Promise; rm(path: string): Promise; snapshot(filter?: (path: string) => boolean): Promise>; cacheSave(path: string, key: string): Promise; cacheRestore(path: string, key: string): Promise; cacheHas(path: string, key: string): Promise; cacheClear(path: string): Promise; showPreview(port: number, frameId?: string): Promise; shellExec(command: string): void; exec(script: string, opts?: ExecOptions): Promise; }