@fireproof/core 0.13.5-dev → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { Transaction } from "./transaction";
2
- import { ClockHead, DocUpdate } from "./types";
1
+ import { Transaction } from './transaction';
2
+ import { ClockHead, DocUpdate } from './types';
3
3
  type ApplyHeadWorkerFunction = (id: string, tblocks: Transaction | null, newHead: ClockHead, prevHead: ClockHead, updates: DocUpdate[] | null) => Promise<void>;
4
4
  type ApplyHeadTask = {
5
5
  id: string;
@@ -3,9 +3,9 @@ import type { DocUpdate, ClockHead } from './types';
3
3
  import { ApplyHeadQueue } from './apply-head-queue';
4
4
  export declare class CRDTClock {
5
5
  head: ClockHead;
6
- zoomers: Set<(() => void)>;
7
- watchers: Set<((updates: DocUpdate[]) => void)>;
8
- emptyWatchers: Set<(() => void)>;
6
+ zoomers: Set<() => void>;
7
+ watchers: Set<(updates: DocUpdate[]) => void>;
8
+ emptyWatchers: Set<() => void>;
9
9
  blocks: TransactionBlockstore | null;
10
10
  applyHeadQueue: ApplyHeadQueue;
11
11
  constructor();
@@ -1,6 +1,7 @@
1
+ import { Block } from 'multiformats/block';
1
2
  import { LoggingFetcher, Transaction } from './transaction';
2
3
  import type { TransactionBlockstore } from './transaction';
3
- import type { DocUpdate, ClockHead, AnyLink, DocValue, BulkResult, ChangesOptions } from './types';
4
+ import type { DocUpdate, ClockHead, AnyLink, DocValue, BulkResult, ChangesOptions, BlockFetcher } from './types';
4
5
  export declare function applyBulkUpdateToCrdt(tblocks: Transaction, head: ClockHead, updates: DocUpdate[], options?: object): Promise<BulkResult>;
5
6
  export declare function getValueFromCrdt(blocks: TransactionBlockstore, head: ClockHead, key: string): Promise<DocValue>;
6
7
  export declare function readFiles(blocks: TransactionBlockstore | LoggingFetcher, { doc }: DocValue): void;
@@ -8,6 +9,11 @@ export declare function clockChangesSince(blocks: TransactionBlockstore | Loggin
8
9
  result: DocUpdate[];
9
10
  head: ClockHead;
10
11
  }>;
11
- export declare function getAllEntries(blocks: TransactionBlockstore, head: ClockHead): AsyncGenerator<DocUpdate, void, unknown>;
12
+ export declare function getAllEntries(blocks: TransactionBlockstore | LoggingFetcher, head: ClockHead): AsyncGenerator<DocUpdate, void, unknown>;
12
13
  export declare function clockVis(blocks: TransactionBlockstore, head: ClockHead): AsyncGenerator<string, void, unknown>;
13
14
  export declare function doCompact(blocks: TransactionBlockstore, head: ClockHead): Promise<AnyLink | undefined>;
15
+ export declare function getThatBlock({ bytes }: {
16
+ cid: string;
17
+ bytes: string;
18
+ }): Promise<Block<unknown, 113, 18, 1>>;
19
+ export declare function getBlock(blocks: BlockFetcher, cidString: string): Promise<Block<unknown, 113, 18, 1>>;
@@ -17,6 +17,8 @@ export declare class CRDT {
17
17
  head: ClockHead;
18
18
  }>;
19
19
  vis(): Promise<string>;
20
+ getBlock(cidString: string): Promise<import("multiformats/dist/types/src/block").Block<unknown, 113, 18, 1>>;
21
+ getThatBlock(): Promise<import("multiformats/dist/types/src/block").Block<unknown, 113, 18, 1>>;
20
22
  get(key: string): Promise<import("./types").DocValue | null>;
21
23
  changes(since?: ClockHead, opts?: ChangesOptions): Promise<{
22
24
  result: DocUpdate[];
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.13.5-dev";
1
+ export declare const PACKAGE_VERSION = "0.14.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireproof/core",
3
- "version": "0.13.5-dev",
3
+ "version": "0.14.0",
4
4
  "description": "Live database for the web",
5
5
  "main": "./dist/browser/fireproof.cjs",
6
6
  "module": "./dist/browser/fireproof.esm.js",