replicache
Advanced tools
Comparing version 12.0.2 to 12.1.0
@@ -148,2 +148,13 @@ /** The values that can be represented in JSON */ | ||
/** | ||
* Factory function for creating {@link Store} instances. | ||
* | ||
* The name is used to identify the store. If the same name is used for multiple | ||
* stores, they should share the same data. It is also desirable to have these | ||
* stores share an {@link RWLock}. | ||
* | ||
* @experimental This type is experimental and might be removed or changed | ||
* in the future without following semver versioning. Please be cautious. | ||
*/ | ||
declare type CreateStore = (name: string) => Store; | ||
/** | ||
* This interface is used so that we can release the lock when the transaction | ||
@@ -168,3 +179,4 @@ * is done. | ||
/** | ||
* @experimental | ||
* @experimental This interface is experimental and might be removed or changed | ||
* in the future without following semver versioning. Please be cautious. | ||
*/ | ||
@@ -178,2 +190,25 @@ interface Write extends Read { | ||
/** | ||
* A named in-memory Store implementation. | ||
* | ||
* Two (or more) named memory stores with the same name will share the same | ||
* underlying storage. They will also share the same read/write locks, so that | ||
* only one write transaction can be running at the same time. | ||
* | ||
* @experimental This class is experimental and might be removed or changed | ||
* in the future without following semver versioning. Please be cautious. | ||
*/ | ||
declare class MemStore implements Store { | ||
private readonly _map; | ||
private readonly _rwLock; | ||
private _closed; | ||
constructor(name: string); | ||
read(): Promise<Read>; | ||
withRead<R>(fn: (read: Read) => R | Promise<R>): Promise<R>; | ||
write(): Promise<Write>; | ||
withWrite<R>(fn: (write: Write) => R | Promise<R>): Promise<R>; | ||
close(): Promise<void>; | ||
get closed(): boolean; | ||
} | ||
/** | ||
* The definition of a single index. | ||
@@ -791,8 +826,17 @@ */ | ||
/** | ||
* Allows implementing the underlying storage layer completely in JavaScript. | ||
* Allows implementing the underlying storage layer in JavaScript. | ||
* | ||
* @experimental This option is experimental and will be removed in the | ||
* future. | ||
* | ||
* @deprecated Use {@link experimentalCreateKVStore} instead. | ||
*/ | ||
experimentalKVStore?: Store | undefined; | ||
/** | ||
* Allows providing a custom implementation of the underlying storage layer. | ||
* | ||
* @experimental This option is experimental and might be removed or changed | ||
* in the future without following semver versioning. Please be cautious. | ||
*/ | ||
experimentalKVStore?: Store | undefined; | ||
experimentalCreateKVStore?: CreateStore | undefined; | ||
/** | ||
@@ -870,3 +914,3 @@ * Defines the indexes, if any, to use on the data. | ||
*/ | ||
declare function deleteAllReplicacheData(): Promise<{ | ||
declare function deleteAllReplicacheData(createKVStore: CreateStore): Promise<{ | ||
dropped: string[]; | ||
@@ -949,2 +993,9 @@ errors: unknown[]; | ||
/** | ||
* Factory function to create the persisted stores. Defaults to use `new | ||
* IDBStore(name)`. | ||
*/ | ||
private readonly _createStore; | ||
/** | ||
/** | ||
* This is the name Replicache uses for the IndexedDB database where data is | ||
@@ -1234,2 +1285,2 @@ * stored. | ||
export { AsyncIterableIteratorToArray, ClientID, ClientStateNotFoundReason, ClientStateNotFoundResponse, CreateIndexDefinition, Diff as ExperimentalDiff, DiffOperation as ExperimentalDiffOperation, DiffOperationAdd as ExperimentalDiffOperationAdd, DiffOperationChange as ExperimentalDiffOperationChange, DiffOperationDel as ExperimentalDiffOperationDel, IndexDiff as ExperimentalIndexDiff, Read as ExperimentalKVRead, Store as ExperimentalKVStore, Write as ExperimentalKVWrite, NoIndexDiff as ExperimentalNoIndexDiff, WatchCallbackForOptions as ExperimentalWatchCallbackForOptions, WatchIndexCallback as ExperimentalWatchIndexCallback, WatchIndexOptions as ExperimentalWatchIndexOptions, WatchNoIndexCallback as ExperimentalWatchNoIndexCallback, WatchNoIndexOptions as ExperimentalWatchNoIndexOptions, WatchOptions as ExperimentalWatchOptions, GetIndexScanIterator, GetScanIterator, HTTPRequestInfo, IndexDefinition, IndexDefinitions, IndexKey, IterableUnion, JSONObject, JSONValue, KeyTypeForScanOptions, LogLevel, LogSink, MaybePromise, Mutation, MutatorDefs, PatchOperation, PendingMutation, Poke, PullError, PullRequest, PullResponse, PullResponseOK, Puller, PullerResult, PushError, PushRequest, Pusher, ReadTransaction, ReadonlyJSONObject, ReadonlyJSONValue, Replicache, ReplicacheOptions, RequestOptions, ScanIndexOptions, ScanNoIndexOptions, ScanOptionIndexedStartKey, ScanOptions, ScanResult, SubscribeOptions, TEST_LICENSE_KEY, TransactionClosedError, WriteTransaction, consoleLogSink, deleteAllReplicacheData, filterAsyncIterable, isScanIndexOptions, makeIDBName, makeScanResult, mergeAsyncIterables, version }; | ||
export { AsyncIterableIteratorToArray, ClientID, ClientStateNotFoundReason, ClientStateNotFoundResponse, CreateIndexDefinition, CreateStore as ExperimentalCreateKVStore, Diff as ExperimentalDiff, DiffOperation as ExperimentalDiffOperation, DiffOperationAdd as ExperimentalDiffOperationAdd, DiffOperationChange as ExperimentalDiffOperationChange, DiffOperationDel as ExperimentalDiffOperationDel, IndexDiff as ExperimentalIndexDiff, Read as ExperimentalKVRead, Store as ExperimentalKVStore, Write as ExperimentalKVWrite, MemStore as ExperimentalMemKVStore, NoIndexDiff as ExperimentalNoIndexDiff, WatchCallbackForOptions as ExperimentalWatchCallbackForOptions, WatchIndexCallback as ExperimentalWatchIndexCallback, WatchIndexOptions as ExperimentalWatchIndexOptions, WatchNoIndexCallback as ExperimentalWatchNoIndexCallback, WatchNoIndexOptions as ExperimentalWatchNoIndexOptions, WatchOptions as ExperimentalWatchOptions, GetIndexScanIterator, GetScanIterator, HTTPRequestInfo, IndexDefinition, IndexDefinitions, IndexKey, IterableUnion, JSONObject, JSONValue, KeyTypeForScanOptions, LogLevel, LogSink, MaybePromise, Mutation, MutatorDefs, PatchOperation, PendingMutation, Poke, PullError, PullRequest, PullResponse, PullResponseOK, Puller, PullerResult, PushError, PushRequest, Pusher, ReadTransaction, ReadonlyJSONObject, ReadonlyJSONValue, Replicache, ReplicacheOptions, RequestOptions, ScanIndexOptions, ScanNoIndexOptions, ScanOptionIndexedStartKey, ScanOptions, ScanResult, SubscribeOptions, TEST_LICENSE_KEY, TransactionClosedError, WriteTransaction, consoleLogSink, deleteAllReplicacheData, filterAsyncIterable, isScanIndexOptions, makeIDBName, makeScanResult, mergeAsyncIterables, version }; |
{ | ||
"name": "replicache", | ||
"description": "Realtime sync for any backend stack", | ||
"version": "12.0.2", | ||
"version": "12.1.0", | ||
"repository": "github:rocicorp/replicache", | ||
@@ -6,0 +6,0 @@ "license": "https://roci.dev/terms.html", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
383192
2600