fs-zoo
Version:
File system abstractions and implementations
18 lines (17 loc) • 1.31 kB
TypeScript
import type * as fsa from 'memfs/lib/fsa/types';
import type * as crud from '../crud/types';
export declare class FsaCrud implements crud.CrudApi {
protected readonly root: fsa.IFileSystemDirectoryHandle | Promise<fsa.IFileSystemDirectoryHandle>;
constructor(root: fsa.IFileSystemDirectoryHandle | Promise<fsa.IFileSystemDirectoryHandle>);
protected _dir(collection: string[], create: boolean): Promise<[dir: fsa.IFileSystemDirectoryHandle, parent: fsa.IFileSystemDirectoryHandle | undefined]>;
protected _file(collection: string[], id: string): Promise<[dir: fsa.IFileSystemDirectoryHandle, file: fsa.IFileSystemFileHandle]>;
_get(collection: string[], id: string): Promise<File>;
readonly put: (path: string, data?: Uint8Array | undefined, options?: crud.CrudPutOptions) => Promise<void>;
readonly getStream: (path: string) => Promise<ReadableStream>;
readonly del: (path: string, silent?: boolean) => Promise<void>;
readonly info: (path: string) => Promise<crud.CrudResourceInfo>;
readonly drop: (path: string, silent?: boolean) => Promise<void>;
readonly scan: (path: string) => AsyncIterableIterator<crud.CrudCollectionEntry>;
readonly list: (path: string) => Promise<crud.CrudCollectionEntry[]>;
readonly from: (path: string) => Promise<crud.CrudApi>;
}