@anfenn/dync 1.0.27 → 1.0.28

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,4 +1,4 @@
1
- import { a as SyncApi, k as SyncState } from '../types-yJuzCcux.cjs';
1
+ import { a as SyncApi, k as SyncState } from '../types-9I2fmDbU.cjs';
2
2
  import '../dexie-T9m1mP1h.cjs';
3
3
  import 'dexie';
4
4
  import '../types-CSbIAfu2.cjs';
@@ -1,4 +1,4 @@
1
- import { a as SyncApi, k as SyncState } from '../types-BLw25Wlc.js';
1
+ import { a as SyncApi, k as SyncState } from '../types-DLFva7gq.js';
2
2
  import '../dexie-BFPA0JU2.js';
3
3
  import 'dexie';
4
4
  import '../types-CSbIAfu2.js';
@@ -94,35 +94,9 @@ interface SyncOptions {
94
94
  onAfterMissingRemoteRecordDuringUpdate?: MissingRemoteRecordDuringUpdateCallback;
95
95
  conflictResolutionStrategy?: ConflictResolutionStrategy;
96
96
  }
97
- /**
98
- * Configuration options for creating a Dync instance.
99
- *
100
- * @example Per-table sync mode
101
- * ```ts
102
- * const db = new Dync<Store>({
103
- * databaseName: 'my-app',
104
- * storageAdapter: new SQLiteAdapter(driver),
105
- * sync: { todos: todoSyncApi },
106
- * });
107
- * ```
108
- *
109
- * @example Batch sync mode
110
- * ```ts
111
- * const db = new Dync<Store>({
112
- * databaseName: 'my-app',
113
- * storageAdapter: new SQLiteAdapter(driver),
114
- * sync: { syncTables: ['todos'], push, pull },
115
- * });
116
- * ```
117
- */
118
97
  interface DyncOptions<TStoreMap extends Record<string, any> = Record<string, any>> {
119
98
  databaseName: string;
120
99
  storageAdapter: StorageAdapter;
121
- /**
122
- * Sync configuration - either per-table APIs or batch sync.
123
- * Per-table: `{ tableName: { add, update, remove, list } }`
124
- * Batch: `{ syncTables: [...], push, pull }`
125
- */
126
100
  sync: Partial<Record<keyof TStoreMap, ApiFunctions>> | BatchSync;
127
101
  options?: SyncOptions;
128
102
  }
@@ -136,7 +110,6 @@ type FirstLoadProgressCallback = (progress: FirstLoadProgress) => void;
136
110
  type SyncApi = {
137
111
  enable: (enabled: boolean) => Promise<void>;
138
112
  startFirstLoad: (onProgress?: FirstLoadProgressCallback) => Promise<void>;
139
- /** Current sync state - use useSyncState() hook for reactive updates in React */
140
113
  readonly state: SyncState;
141
114
  resolveConflict: (localId: string, keepLocal: boolean) => Promise<void>;
142
115
  onStateChange: (fn: (state: SyncState) => void) => () => void;
@@ -94,35 +94,9 @@ interface SyncOptions {
94
94
  onAfterMissingRemoteRecordDuringUpdate?: MissingRemoteRecordDuringUpdateCallback;
95
95
  conflictResolutionStrategy?: ConflictResolutionStrategy;
96
96
  }
97
- /**
98
- * Configuration options for creating a Dync instance.
99
- *
100
- * @example Per-table sync mode
101
- * ```ts
102
- * const db = new Dync<Store>({
103
- * databaseName: 'my-app',
104
- * storageAdapter: new SQLiteAdapter(driver),
105
- * sync: { todos: todoSyncApi },
106
- * });
107
- * ```
108
- *
109
- * @example Batch sync mode
110
- * ```ts
111
- * const db = new Dync<Store>({
112
- * databaseName: 'my-app',
113
- * storageAdapter: new SQLiteAdapter(driver),
114
- * sync: { syncTables: ['todos'], push, pull },
115
- * });
116
- * ```
117
- */
118
97
  interface DyncOptions<TStoreMap extends Record<string, any> = Record<string, any>> {
119
98
  databaseName: string;
120
99
  storageAdapter: StorageAdapter;
121
- /**
122
- * Sync configuration - either per-table APIs or batch sync.
123
- * Per-table: `{ tableName: { add, update, remove, list } }`
124
- * Batch: `{ syncTables: [...], push, pull }`
125
- */
126
100
  sync: Partial<Record<keyof TStoreMap, ApiFunctions>> | BatchSync;
127
101
  options?: SyncOptions;
128
102
  }
@@ -136,7 +110,6 @@ type FirstLoadProgressCallback = (progress: FirstLoadProgress) => void;
136
110
  type SyncApi = {
137
111
  enable: (enabled: boolean) => Promise<void>;
138
112
  startFirstLoad: (onProgress?: FirstLoadProgressCallback) => Promise<void>;
139
- /** Current sync state - use useSyncState() hook for reactive updates in React */
140
113
  readonly state: SyncState;
141
114
  resolveConflict: (localId: string, keepLocal: boolean) => Promise<void>;
142
115
  onStateChange: (fn: (state: SyncState) => void) => () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anfenn/dync",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "private": false,
5
5
  "description": "Write once, run IndexedDB & SQLite with sync anywhere - React, React Native, Expo, Capacitor, Electron & Node.js",
6
6
  "keywords": [
package/src/types.ts CHANGED
@@ -122,35 +122,9 @@ export interface SyncOptions {
122
122
  conflictResolutionStrategy?: ConflictResolutionStrategy;
123
123
  }
124
124
 
125
- /**
126
- * Configuration options for creating a Dync instance.
127
- *
128
- * @example Per-table sync mode
129
- * ```ts
130
- * const db = new Dync<Store>({
131
- * databaseName: 'my-app',
132
- * storageAdapter: new SQLiteAdapter(driver),
133
- * sync: { todos: todoSyncApi },
134
- * });
135
- * ```
136
- *
137
- * @example Batch sync mode
138
- * ```ts
139
- * const db = new Dync<Store>({
140
- * databaseName: 'my-app',
141
- * storageAdapter: new SQLiteAdapter(driver),
142
- * sync: { syncTables: ['todos'], push, pull },
143
- * });
144
- * ```
145
- */
146
125
  export interface DyncOptions<TStoreMap extends Record<string, any> = Record<string, any>> {
147
126
  databaseName: string;
148
127
  storageAdapter: StorageAdapter;
149
- /**
150
- * Sync configuration - either per-table APIs or batch sync.
151
- * Per-table: `{ tableName: { add, update, remove, list } }`
152
- * Batch: `{ syncTables: [...], push, pull }`
153
- */
154
128
  sync: Partial<Record<keyof TStoreMap, ApiFunctions>> | BatchSync;
155
129
  options?: SyncOptions;
156
130
  }
@@ -167,7 +141,7 @@ export type FirstLoadProgressCallback = (progress: FirstLoadProgress) => void;
167
141
  export type SyncApi = {
168
142
  enable: (enabled: boolean) => Promise<void>;
169
143
  startFirstLoad: (onProgress?: FirstLoadProgressCallback) => Promise<void>;
170
- /** Current sync state - use useSyncState() hook for reactive updates in React */
144
+ // Current sync state - use useSyncState() hook for reactive updates in React
171
145
  readonly state: SyncState;
172
146
  resolveConflict: (localId: string, keepLocal: boolean) => Promise<void>;
173
147
  onStateChange: (fn: (state: SyncState) => void) => () => void;