import { Blob, Buffer } from "buffer"; import { ReadableStream } from "node:stream/web"; import { RuntimeTransport } from "./base"; import { SandboxFileChmodParams, SandboxFileChownParams, SandboxFileCopyParams, SandboxFileInfo, SandboxFileListOptions, SandboxFileMakeDirOptions, SandboxFileReadOptions, SandboxFileSystemEvent, SandboxFileTransferResult, SandboxFileWriteData, SandboxFileWriteEntry, SandboxFileWriteInfo, SandboxFileBytesWriteOptions, SandboxFileTextWriteOptions, SandboxPresignFileParams, SandboxPresignedUrl, SandboxWatchDirOptions } from "../types/sandbox"; interface RawFileWatchEvent { seq: number; path: string; op: string; timestamp: number; } interface RawFileWatchStatus { id: string; path: string; recursive: boolean; active: boolean; error?: string; createdAt: number; stoppedAt?: number; oldestSeq?: number; lastSeq?: number; eventCount?: number; } interface RuntimeConnectionInfo { sandboxId: string; baseUrl: string; token: string; } declare class RuntimeFileWatchHandle { private readonly transport; private readonly getConnectionInfo; private readonly status; private readonly runtimeProxyOverride?; constructor(transport: RuntimeTransport, getConnectionInfo: () => Promise, status: RawFileWatchStatus, runtimeProxyOverride?: string | undefined); get id(): string; get path(): string; stop(): Promise; events(cursor?: number): AsyncGenerator; } export declare class SandboxWatchDirHandle { private readonly watch; private readonly onExit?; private readonly runPromise; private timeout?; private stopRequested; private exitNotified; constructor(watch: RuntimeFileWatchHandle, onEvent: (event: SandboxFileSystemEvent) => void | Promise, onExit?: ((error?: Error) => void | Promise) | undefined, timeoutMs?: number); stop(): Promise; private run; } export declare class SandboxFilesApi { private readonly transport; private readonly getConnectionInfo; private readonly runtimeProxyOverride?; private readonly defaultRunAs?; constructor(transport: RuntimeTransport, getConnectionInfo: () => Promise, runtimeProxyOverride?: string | undefined, defaultRunAs?: string | undefined); withRunAs(runAs?: string): SandboxFilesApi; exists(path: string): Promise; getInfo(path: string): Promise; list(path: string, options?: SandboxFileListOptions): Promise; read(path: string, options?: SandboxFileReadOptions & { format?: "text"; }): Promise; read(path: string, options: SandboxFileReadOptions & { format: "bytes"; }): Promise; read(path: string, options: SandboxFileReadOptions & { format: "blob"; }): Promise; read(path: string, options: SandboxFileReadOptions & { format: "stream"; }): Promise>; readText(path: string, options?: Omit): Promise; readBytes(path: string, options?: Omit): Promise; write(path: string, data: SandboxFileWriteData): Promise; write(files: SandboxFileWriteEntry[]): Promise; writeText(path: string, data: string, options?: SandboxFileTextWriteOptions): Promise; writeBytes(path: string, data: Uint8Array, options?: SandboxFileBytesWriteOptions): Promise; upload(path: string, data: Buffer | Uint8Array | string): Promise; download(path: string): Promise; makeDir(path: string, options?: SandboxFileMakeDirOptions): Promise; rename(oldPath: string, newPath: string): Promise; remove(path: string, options?: { recursive?: boolean; }): Promise; copy(params: SandboxFileCopyParams): Promise; chmod(params: SandboxFileChmodParams): Promise; chown(params: SandboxFileChownParams): Promise; watchDir(path: string, onEvent: (event: SandboxFileSystemEvent) => void | Promise, options?: SandboxWatchDirOptions): Promise; uploadUrl(path: string, options?: Omit): Promise; downloadUrl(path: string, options?: Omit): Promise; private readWire; private writeSingle; private withRunAsQuery; private withRunAsBody; } export {};