@fireproof/core 0.14.8 → 0.15.0-dev

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,7 +1,6 @@
1
1
  import { ClockHead, DocUpdate } from './types';
2
- type ApplyHeadWorkerFunction = (id: string, newHead: ClockHead, prevHead: ClockHead, updates: DocUpdate[] | null) => Promise<void>;
2
+ type ApplyHeadWorkerFunction = (newHead: ClockHead, prevHead: ClockHead) => Promise<void>;
3
3
  type ApplyHeadTask = {
4
- id: string;
5
4
  newHead: ClockHead;
6
5
  prevHead: ClockHead;
7
6
  updates: DocUpdate[] | null;
@@ -11,9 +11,10 @@ export declare class CRDTClock {
11
11
  constructor();
12
12
  setHead(head: ClockHead): void;
13
13
  applyHead(newHead: ClockHead, prevHead: ClockHead, updates?: DocUpdate[] | null): Promise<void>;
14
- int_applyHead(taskId: string, newHead: ClockHead, prevHead: ClockHead): Promise<void>;
14
+ processUpdates(updatesAcc: DocUpdate[], all: boolean, prevHead: ClockHead): Promise<void>;
15
15
  notifyWatchers(updates: DocUpdate[]): void;
16
16
  onTick(fn: (updates: DocUpdate[]) => void): void;
17
17
  onTock(fn: () => void): void;
18
18
  onZoom(fn: () => void): void;
19
+ int_applyHead(newHead: ClockHead, prevHead: ClockHead): Promise<void>;
19
20
  }
@@ -24,6 +24,13 @@ export declare class Database {
24
24
  }[];
25
25
  clock: ClockHead;
26
26
  }>;
27
+ allDocuments(): Promise<{
28
+ rows: {
29
+ key: string;
30
+ value: Doc;
31
+ }[];
32
+ clock: ClockHead;
33
+ }>;
27
34
  subscribe(listener: ListenerFn | NoUpdateListenerFn, updates?: boolean): () => void;
28
35
  query(field: string | MapFn, opts?: QueryOpts): Promise<{
29
36
  rows: import("./types").IndexRow[];
@@ -8,17 +8,17 @@ export declare class DataStore extends DataStoreBase {
8
8
  save(car: AnyBlock): Promise<void>;
9
9
  remove(cid: AnyLink): Promise<void>;
10
10
  }
11
- export declare class RemoteWAL extends RemoteWALBase {
11
+ export declare class MetaStore extends MetaStoreBase {
12
12
  tag: string;
13
13
  store: Map<string, string>;
14
14
  headerKey(branch: string): string;
15
- load(branch?: string): Promise<WALState | null>;
16
- save(state: WALState, branch?: string): Promise<void>;
15
+ load(branch?: string): Promise<DbMeta[] | null>;
16
+ save(meta: DbMeta, branch?: string): Promise<null>;
17
17
  }
18
- export declare class MetaStore extends MetaStoreBase {
18
+ export declare class RemoteWAL extends RemoteWALBase {
19
19
  tag: string;
20
20
  store: Map<string, string>;
21
21
  headerKey(branch: string): string;
22
- load(branch?: string): Promise<DbMeta[] | null>;
23
- save(meta: DbMeta, branch?: string): Promise<null>;
22
+ load(branch?: string): Promise<WALState | null>;
23
+ save(state: WALState, branch?: string): Promise<void>;
24
24
  }
@@ -1,6 +1,5 @@
1
1
  import { ToString } from '@ipld/dag-json';
2
2
  import { AnyBlock, AnyLink, DbMeta } from './types';
3
- import type { Loader } from './loader';
4
3
  export declare const STORAGE_VERSION: string;
5
4
  declare abstract class VersionedStore {
6
5
  STORAGE_VERSION: string;
@@ -20,8 +19,8 @@ type DataSaveOpts = {
20
19
  export declare abstract class DataStore {
21
20
  tag: string;
22
21
  STORAGE_VERSION: string;
23
- loader: Loader;
24
- constructor(loader: Loader);
22
+ name: string;
23
+ constructor(name: string);
25
24
  abstract load(cid: AnyLink): Promise<AnyBlock>;
26
25
  abstract save(car: AnyBlock, opts?: DataSaveOpts): Promise<void | AnyLink>;
27
26
  abstract remove(cid: AnyLink): Promise<void>;
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.14.8";
1
+ export declare const PACKAGE_VERSION = "0.15.0-dev";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireproof/core",
3
- "version": "0.14.8",
3
+ "version": "0.15.0-dev",
4
4
  "description": "Live database for the web.",
5
5
  "main": "./dist/browser/fireproof.cjs",
6
6
  "module": "./dist/browser/fireproof.esm.js",
@@ -127,15 +127,9 @@
127
127
  "@ipld/car": "^5.2.0",
128
128
  "@ipld/dag-cbor": "^9.0.3",
129
129
  "@ipld/dag-json": "^10.1.2",
130
- "@ipld/dag-ucan": "^3.3.2",
131
130
  "@ipld/unixfs": "^2.1.1",
132
131
  "@peculiar/webcrypto": "^1.4.3",
133
- "@ucanto/core": "^8.2.0",
134
- "@ucanto/interface": "^8.1.0",
135
- "@web3-storage/clock": "^0.3.0",
136
- "@web3-storage/w3up-client": "^8.0.1",
137
132
  "charwise": "^3.0.1",
138
- "cross-fetch": "^4.0.0",
139
133
  "idb": "^7.1.1",
140
134
  "ipfs-unixfs-exporter": "^13.1.7",
141
135
  "multiformats": "^12.0.1",