agentlang
Version:
The easiest way to build the most reliable AI agents - enterprise-grade teams of AI agents that collaborate with each other and humans
116 lines • 3.74 kB
TypeScript
/**
* Browser filesystem implementation using Lightning FS
*/
import { ExtendedFileSystem, FileStat } from './interfaces.js';
/**
* Browser filesystem implementation using Lightning FS
*/
export declare class LightningFileSystem implements ExtendedFileSystem {
private fs;
private initialized;
/**
* Initialize Lightning FS
* @param options Lightning FS options
* @returns Promise that resolves when Lightning FS is initialized
*/
initialize(options?: {
name?: string;
wipe?: boolean;
persistentStorage?: boolean;
}): Promise<void>;
/**
* Ensure Lightning FS is initialized
*/
private ensureInitialized;
/**
* Read a file as text
* @param filePath path to the file
* @returns Promise resolving to file content as string
*/
readFile(filePath: string): Promise<string>;
/**
* Read a file as binary
* @param filePath Path to the file
* @returns Promise resolving to file content as Buffer
*/
readFileBuffer(filePath: string): Promise<Buffer>;
/**
* Write content to a file
* @param filePath Path to the file
* @param data Content to write (string or Buffer)
* @returns Promise that resolves when write is complete
*/
writeFile(filePath: string, data: string | Buffer): Promise<void>;
/**
* Check if a file or directory exists
* @param filePath Path to check
* @returns Promise resolving to boolean indicate existence
*/
exists(filePath: string): Promise<boolean>;
/**
* Create a directory
* @param dirPath Directory path to create
* @returns Promise that resolves when directory is created
*/
mkdir(dirPath: string): Promise<void>;
/**
* List files in a directory
* @param dirPath Directory path
* @returns Promise resolving to an array of file names
*/
readdir(dirPath: string): Promise<string[]>;
/**
* Get stats for a file or directory
* @param filePath Path to check
* @returns Promise resolving to stats object
*/
stat(filePath: string): Promise<FileStat>;
/**
* Remove a file
* @param filePath Path to the file
* @returns Promise that resolves when a file is removed
*/
unlink(filePath: string): Promise<void>;
/**
* Remove a directory
* @param dirPath Path to the directory
* @returns Promise that resolves when directory is removed
*/
rmdir(dirPath: string): Promise<void>;
/**
* Copy a file
* @param src Source path
* @param dest Destination path
* @returns Promise that resolves when copy is complete
*/
copyFile(src: string, dest: string): Promise<void>;
/**
* Move a file
* @param src Source path
* @param dest Destination path
* @returns Promise that resolves when move is complete
*/
moveFile(src: string, dest: string): Promise<void>;
/**
* Ensure a directory exists, creating it and any parent directories if needed
* @param dirPath Directory path
* @returns Promise that resolves when directory exists
*/
ensureDir(dirPath: string): Promise<void>;
/**
* Remove a directory and all its contents recursively
* @param dirPath Directory path
* @returns Promise that resolves when directory is removed
*/
removeDir(dirPath: string): Promise<void>;
}
/**
* Create a new Lightning FS instance
* @param options Configuration options
* @returns Promise resolving to LightningFileSystem instance
*/
export declare function createLightningFS(options?: {
name?: string;
wipe?: boolean;
}): Promise<ExtendedFileSystem>;
//# sourceMappingURL=lightning-fs.d.ts.map