@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.
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/{types-yJuzCcux.d.cts → types-9I2fmDbU.d.cts} +0 -27
- package/dist/{types-BLw25Wlc.d.ts → types-DLFva7gq.d.ts} +0 -27
- package/package.json +1 -1
- package/src/types.ts +1 -27
package/dist/react/index.d.cts
CHANGED
package/dist/react/index.d.ts
CHANGED
|
@@ -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
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
|
-
|
|
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;
|