import { FsInfo, FsDirectoryEntry, FsMkdirOptions, FsChange, Subscription, FsPickOptions, FsPickResult, FsReadOptions, FsReadResult, FsMetadata, FsWatchOptions, FsWriteOptions, FsWriteResult } from '@napplet/core'; /** * Napplet NAP fs sdk entrypoint. * * @module */ /** * @napplet/nap/fs -- SDK helpers wrapping window.napplet.fs. * * These convenience functions delegate to `window.napplet.fs.*` at call time. * The shim must be imported somewhere to install the global. */ /** * Discover visible roots, coarse root permissions, and runtime limits. * * @returns Promise resolving to the runtime's filesystem discovery data */ declare function fsInfo(): Promise; /** * Ask the runtime to let the user select one file. * * @param options Optional picker hints * @returns Promise resolving to picked virtual filesystem paths */ declare function fsPickFile(options?: FsPickOptions): Promise; /** * Ask the runtime to let the user select one or more files. * * @param options Optional picker hints * @returns Promise resolving to picked virtual filesystem paths */ declare function fsPickFiles(options?: FsPickOptions): Promise; /** * Ask the runtime to let the user select one directory. * * @param options Optional picker hints * @returns Promise resolving to picked virtual filesystem paths */ declare function fsPickDirectory(options?: FsPickOptions): Promise; /** * Ask the runtime to let the user select or name one file destination. * * @param options Optional picker hints * @returns Promise resolving to picked virtual filesystem paths */ declare function fsPickSaveFile(options?: FsPickOptions): Promise; /** * Read coarse metadata for a visible file or directory. * * @param path Virtual absolute path of the entry * @returns Promise resolving to the entry metadata */ declare function fsStat(path: string): Promise; /** * List the direct children of a visible directory. Ordering is unspecified. * * @param path Virtual absolute path of the directory * @returns Promise resolving to the directory entries */ declare function fsList(path: string): Promise; /** * Read bytes from a visible file. * * @param path Virtual absolute path of the file * @param options Optional range read controls * @returns Promise resolving to the read result */ declare function fsRead(path: string, options?: FsReadOptions): Promise; /** * Write bytes to a visible file. `data` is RFC 4648 standard padded base64 text. * * @param path Virtual absolute path of the file * @param data Decoded bytes encoded as standard padded base64 text * @param options Optional write mode and preconditions * @returns Promise resolving to the write result */ declare function fsWrite(path: string, data: string, options?: FsWriteOptions): Promise; /** * Create a directory. * * @param path Virtual absolute path of the directory to create * @param options Optional recursive parent creation * @returns Promise resolving once the runtime acknowledges the creation */ declare function fsMkdir(path: string, options?: FsMkdirOptions): Promise; /** * Remove a file or directory. * * @param path Virtual absolute path of the entry to remove * @param recursive Remove a non-empty directory and its authorized descendants * @returns Promise resolving once the runtime acknowledges the removal */ declare function fsRemove(path: string, recursive?: boolean): Promise; /** * Move or rename a file or directory. * * @param fromPath Virtual absolute source path * @param toPath Virtual absolute destination path * @returns Promise resolving once the runtime acknowledges the move */ declare function fsMove(fromPath: string, toPath: string): Promise; /** * Start an advisory watch on a visible path. * * @param path Virtual absolute path to watch * @param options Optional recursive descendant coverage * @returns Promise resolving to the runtime-generated watch id */ declare function fsWatch(path: string, options?: FsWatchOptions): Promise; /** * Stop a watch. Unknown ids may be treated as successful no-ops by the runtime. * * @param watchId Runtime-generated watch id * @returns Promise resolving once the runtime acknowledges the request */ declare function fsUnwatch(watchId: string): Promise; /** * Register for runtime-pushed filesystem change events. * * @param handler Called with each advisory change * @returns A Subscription with `close()` to stop listening */ declare function fsOnChanged(handler: (change: FsChange) => void): Subscription; export { fsInfo, fsList, fsMkdir, fsMove, fsOnChanged, fsPickDirectory, fsPickFile, fsPickFiles, fsPickSaveFile, fsRead, fsRemove, fsStat, fsUnwatch, fsWatch, fsWrite };