UNPKG

fs-zoo

Version:

File system abstractions and implementations

14 lines (13 loc) 859 B
import type { CasApi, CasGetOptions } from '../cas/types'; import type { CrudApiExtended, CrudResourceInfo } from '../crud/types'; export declare class CrudCasBase<Hash> implements CasApi<Hash> { protected readonly crud: CrudApiExtended; protected readonly hash: (blob: Uint8Array) => Promise<Hash>; protected readonly hash2Loc: (hash: Hash) => string; protected readonly hashEqual: (h1: Hash, h2: Hash) => boolean; constructor(crud: CrudApiExtended, hash: (blob: Uint8Array) => Promise<Hash>, hash2Loc: (hash: Hash) => string, hashEqual: (h1: Hash, h2: Hash) => boolean); readonly put: (blob: Uint8Array) => Promise<Hash>; readonly get: (hash: Hash, options?: CasGetOptions) => Promise<Uint8Array>; readonly del: (hash: Hash, silent?: boolean) => Promise<void>; readonly info: (hash: Hash) => Promise<CrudResourceInfo>; }