/** * Core runtime types for cross-platform compatibility */ export interface FileStat { size: number; isFile: boolean; isDirectory: boolean; createdAt: Date; modifiedAt: Date; accessedAt: Date; } export interface CPUInfo { model: string; speed: number; times: { user: number; nice: number; sys: number; idle: number; irq: number; }; } export interface NetworkInterface { address: string; netmask: string; family: string; mac: string; internal: boolean; cidr: string | null; scopeid?: number; } export interface NetworkInterfaces { [key: string]: NetworkInterface[]; } export type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; export interface FileSystem { readFile(path: string, encoding?: BufferEncoding): Promise; writeFile(path: string, data: string, encoding?: BufferEncoding): Promise; readDir(path: string): Promise; exists(path: string): Promise; mkdir(path: string, options?: { recursive?: boolean; }): Promise; rm(path: string, options?: { recursive?: boolean; }): Promise; stat(path: string): Promise; watch(path: string, callback: (event: string, filename: string | null) => void): void; rename(oldPath: string, newPath: string): Promise; } export interface Path { join(...paths: string[]): string; resolve(...paths: string[]): string; dirname(path: string): string; basename(path: string): string; extname(path: string): string; isAbsolute(path: string): boolean; normalize(path: string): string; relative(from: string, to: string): string; } export interface OS { platform(): Promise; homedir(): Promise; tmpdir(): Promise; hostname(): Promise; cpus(): Promise>; totalmem(): Promise; freemem(): Promise; arch(): Promise; type(): Promise; release(): Promise; networkInterfaces(): Promise; } export interface Process { env: Record; cwd(): Promise; exit(code?: number): void; readonly pid: number; readonly platform: string; readonly argv: string[]; readonly execPath: string; getEnvironmentVariable(key: string): Promise; setEnvironmentVariable(key: string, value: string): Promise; } export interface ChildProcess { exec(command: string): Promise<{ stdout: string; stderr: string; }>; spawn(command: string, args: string[]): Promise; execFile(file: string, args: string[]): Promise<{ stdout: string; stderr: string; }>; } export interface SpawnResult { pid: number; stdout: string; stderr: string; exitCode: number; } export declare enum RuntimeType { NODE = "node", TAURI = "tauri" } export interface Runtime { runtimeType: RuntimeType; fs: FileSystem; path: Path; os: OS; process: Process; childProcess: ChildProcess; }