@fireproof/core 0.14.2 → 0.14.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,7 @@
1
- import { Transaction } from './transaction';
2
1
  import { ClockHead, DocUpdate } from './types';
3
- type ApplyHeadWorkerFunction = (id: string, tblocks: Transaction | null, newHead: ClockHead, prevHead: ClockHead, updates: DocUpdate[] | null) => Promise<void>;
2
+ type ApplyHeadWorkerFunction = (id: string, newHead: ClockHead, prevHead: ClockHead, updates: DocUpdate[] | null) => Promise<void>;
4
3
  type ApplyHeadTask = {
5
4
  id: string;
6
- tblocks: Transaction | null;
7
5
  newHead: ClockHead;
8
6
  prevHead: ClockHead;
9
7
  updates: DocUpdate[] | null;
@@ -1,4 +1,4 @@
1
- import { TransactionBlockstore, Transaction } from './transaction';
1
+ import { TransactionBlockstore } from './transaction';
2
2
  import type { DocUpdate, ClockHead } from './types';
3
3
  import { ApplyHeadQueue } from './apply-head-queue';
4
4
  export declare class CRDTClock {
@@ -10,8 +10,8 @@ export declare class CRDTClock {
10
10
  applyHeadQueue: ApplyHeadQueue;
11
11
  constructor();
12
12
  setHead(head: ClockHead): void;
13
- applyHead(tblocks: Transaction | null, newHead: ClockHead, prevHead: ClockHead, updates?: DocUpdate[] | null): Promise<void>;
14
- int_applyHead(taskId: string, tblocks: Transaction | null, newHead: ClockHead, prevHead: ClockHead, updates?: DocUpdate[] | null): Promise<void>;
13
+ applyHead(newHead: ClockHead, prevHead: ClockHead, updates?: DocUpdate[] | null): Promise<void>;
14
+ int_applyHead(taskId: string, newHead: ClockHead, prevHead: ClockHead): Promise<void>;
15
15
  notifyWatchers(updates: DocUpdate[]): void;
16
16
  onTick(fn: (updates: DocUpdate[]) => void): void;
17
17
  onTock(fn: () => void): void;
@@ -0,0 +1,24 @@
1
+ import { AnyBlock, AnyLink, DbMeta } from './types';
2
+ import { DataStore as DataStoreBase, MetaStore as MetaStoreBase } from './store';
3
+ import { RemoteWAL as RemoteWALBase, WALState } from './remote-wal';
4
+ export declare class DataStore extends DataStoreBase {
5
+ tag: string;
6
+ store: Map<string, Uint8Array>;
7
+ load(cid: AnyLink): Promise<AnyBlock>;
8
+ save(car: AnyBlock): Promise<void>;
9
+ remove(cid: AnyLink): Promise<void>;
10
+ }
11
+ export declare class RemoteWAL extends RemoteWALBase {
12
+ tag: string;
13
+ store: Map<string, string>;
14
+ headerKey(branch: string): string;
15
+ load(branch?: string): Promise<WALState | null>;
16
+ save(state: WALState, branch?: string): Promise<void>;
17
+ }
18
+ export declare class MetaStore extends MetaStoreBase {
19
+ tag: string;
20
+ store: Map<string, string>;
21
+ headerKey(branch: string): string;
22
+ load(branch?: string): Promise<DbMeta[] | null>;
23
+ save(meta: DbMeta, branch?: string): Promise<null>;
24
+ }
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.14.2";
1
+ export declare const PACKAGE_VERSION = "0.14.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireproof/core",
3
- "version": "0.14.2",
3
+ "version": "0.14.4",
4
4
  "description": "Live database for the web.",
5
5
  "main": "./dist/browser/fireproof.cjs",
6
6
  "module": "./dist/browser/fireproof.esm.js",
@@ -17,12 +17,18 @@
17
17
  "types": "./dist/types/fireproof.d.ts",
18
18
  "script": "./dist/browser/fireproof.iife.js",
19
19
  "default": "./dist/node/fireproof.esm.js"
20
+ },
21
+ "./memory": {
22
+ "import": "./dist/memory/fireproof.esm.js",
23
+ "types": "./dist/types/fireproof.d.ts",
24
+ "default": "./dist/memory/fireproof.esm.js"
20
25
  }
21
26
  },
22
27
  "browser": "./dist/fireproof.browser.iife.js",
23
28
  "types": "./dist/types/fireproof.d.ts",
24
29
  "files": [
25
30
  "dist/node",
31
+ "dist/memory",
26
32
  "dist/browser",
27
33
  "dist/types"
28
34
  ],