CrudCasBase.d.ts 899 B

1234567891011121314
  1. import type { CasApi, CasGetOptions } from '../cas/types';
  2. import type { CrudApi, CrudResourceInfo } from '../crud/types';
  3. import type { FsLocation } from '../fsa-to-node/types';
  4. export declare class CrudCasBase<Hash> implements CasApi<Hash> {
  5. protected readonly crud: CrudApi;
  6. protected readonly hash: (blob: Uint8Array) => Promise<Hash>;
  7. protected readonly hash2Loc: (hash: Hash) => FsLocation;
  8. protected readonly hashEqual: (h1: Hash, h2: Hash) => boolean;
  9. constructor(crud: CrudApi, hash: (blob: Uint8Array) => Promise<Hash>, hash2Loc: (hash: Hash) => FsLocation, hashEqual: (h1: Hash, h2: Hash) => boolean);
  10. readonly put: (blob: Uint8Array) => Promise<Hash>;
  11. readonly get: (hash: Hash, options?: CasGetOptions) => Promise<Uint8Array>;
  12. readonly del: (hash: Hash, silent?: boolean) => Promise<void>;
  13. readonly info: (hash: Hash) => Promise<CrudResourceInfo>;
  14. }