UNPKG

fs-zoo

Version:

File system abstractions and implementations

21 lines (20 loc) 1.4 kB
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>; write(path: string, options?: crud.CrudPutOptions): Promise<WritableStream>; dir(path: string, options?: Pick<crud.CrudPutOptions, 'throwIf'>): Promise<void>; put(path: string, data: Uint8Array, options?: crud.CrudPutOptions): Promise<void>; read(path: string): Promise<ReadableStream>; file(path: string): Promise<File>; del(path: string, silent?: boolean): Promise<void>; info(path: string): Promise<crud.CrudResourceInfo>; drop(path: string, silent?: boolean): Promise<void>; scan(path: string): AsyncIterableIterator<crud.CrudCollectionEntry>; list(path: string): Promise<crud.CrudCollectionEntry[]>; from(path: string): Promise<crud.CrudApi>; }