@roc-db/indexed-db 0.2.0-pre.1 → 0.2.0-pre.2

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.
@@ -0,0 +1,18 @@
1
+ export declare const createIndexedDBAdapter: ({ operations, entities, dbName, }: {
2
+ operations: any;
3
+ entities: any;
4
+ dbName?: string | undefined;
5
+ }) => {
6
+ _name: string;
7
+ _entityKinds: Entities[number]["shape"]["entity"]["value"];
8
+ _operationNames: Operations[number]["operationName"];
9
+ _operations: Operations;
10
+ _entites: Entities;
11
+ createRef: (entity: any) => string;
12
+ changeSet: (changeSetRef: any) => /*elided*/ any & {
13
+ [x: string]: any;
14
+ };
15
+ syncOptimisticMutation: (mutation: any) => any;
16
+ } & {
17
+ [x: string]: any;
18
+ };
@@ -0,0 +1 @@
1
+ export declare const begin: (request: any, engineOpts: any) => Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ import { type CreateEntityFunction } from "roc-db";
2
+ import type { IndexedDBEngine } from "../types/IndexedDBEngine";
3
+ export declare const createEntity: CreateEntityFunction<IndexedDBEngine>;
@@ -0,0 +1 @@
1
+ export declare const deleteEntity: (txn: any, ref: any, cascade?: boolean) => Promise<boolean>;
@@ -0,0 +1,4 @@
1
+ import type { EndFunction } from "roc-db";
2
+ import type { IndexedDBEngine } from "../types/IndexedDBEngine";
3
+ import type { WriteRequest } from "roc-db/src/types/WriteRequest";
4
+ export declare const end: EndFunction<WriteRequest, IndexedDBEngine, [], any>;
@@ -0,0 +1,3 @@
1
+ import type { WriteRequest } from "roc-db";
2
+ import type { IndexedDBEngine } from "../types/IndexedDBEngine";
3
+ export declare const findDebounceMutation: (request: WriteRequest, engine: IndexedDBEngine, now: number) => Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ import type { Ref } from "roc-db";
2
+ import type { IndexedDBReadTransaction } from "../types/IndexedDBReadTransaction";
3
+ export declare const getChangeSetMutations: (txn: IndexedDBReadTransaction, changeSetRef: Ref) => Promise<unknown>;
@@ -0,0 +1,11 @@
1
+ export { begin } from "./begin";
2
+ export { createEntity } from "./createEntity";
3
+ export { deleteEntity } from "./deleteEntity";
4
+ export { end } from "./end";
5
+ export { getChangeSetMutations } from "./getChangeSetMutations";
6
+ export { findDebounceMutation } from "./findDebounceMutation";
7
+ export { patchEntity } from "./patchEntity";
8
+ export { readEntity } from "./readEntity";
9
+ export { readMutation } from "./readMutation";
10
+ export { saveMutation } from "./saveMutation";
11
+ export { updateEntity } from "./updateEntity";
@@ -0,0 +1,7 @@
1
+ import type { IndexedDBReadTransaction } from "../types/IndexedDBReadTransaction";
2
+ export declare const patchEntity: (txn: IndexedDBReadTransaction, ref: any, { data, children, parents, ancestors }: {
3
+ data?: {} | undefined;
4
+ children?: {} | undefined;
5
+ parents?: {} | undefined;
6
+ ancestors?: {} | undefined;
7
+ }) => Promise<any>;
@@ -0,0 +1 @@
1
+ export declare const readEntity: (txn: any, ref: any) => any;
@@ -0,0 +1 @@
1
+ export declare const readMutation: (engineOpts: any, ref: any) => Promise<unknown>;
@@ -0,0 +1 @@
1
+ export declare const saveMutation: (txn: any, finalizedMutation: any) => Promise<unknown>;
@@ -0,0 +1,6 @@
1
+ export declare const updateEntity: (txn: any, ref: any, { data, children, parents, ancestors }: {
2
+ data?: {} | undefined;
3
+ children?: {} | undefined;
4
+ parents?: {} | undefined;
5
+ ancestors?: {} | undefined;
6
+ }) => Promise<unknown>;
@@ -0,0 +1 @@
1
+ export { createIndexedDBAdapter } from "./createIndexedDBAdapter";
@@ -0,0 +1,5 @@
1
+ export type IndexedDBEngine = {
2
+ dbName: string;
3
+ db: IDBDatabase;
4
+ txn: IDBTransaction;
5
+ };
@@ -0,0 +1,4 @@
1
+ import type { ReadTransaction } from "roc-db";
2
+ import type { IndexedDBEngine } from "./IndexedDBEngine";
3
+ export type IndexedDBReadTransaction = ReadTransaction<any, IndexedDBEngine, [
4
+ ], any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roc-db/indexed-db",
3
- "version": "0.2.0-pre.1",
3
+ "version": "0.2.0-pre.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -16,13 +16,13 @@
16
16
  },
17
17
  "dependencies": {},
18
18
  "devDependencies": {
19
- "@roc-db/test-utils": "0.2.0-pre.1",
19
+ "@roc-db/test-utils": "0.2.0-pre.2",
20
20
  "fake-indexeddb": "6.0.0",
21
- "roc-db": "0.2.0-pre.1",
21
+ "roc-db": "0.2.0-pre.2",
22
22
  "zod": "3.24.2"
23
23
  },
24
24
  "peerDependencies": {
25
- "roc-db": "0.2.0-pre.1",
25
+ "roc-db": "0.2.0-pre.2",
26
26
  "zod": "3.24.2"
27
27
  },
28
28
  "keywords": [],