diff --git a/packages/replicache-doc/.gitignore b/packages/replicache-doc/.gitignore index b52205e81..d32898454 100644 --- a/packages/replicache-doc/.gitignore +++ b/packages/replicache-doc/.gitignore @@ -20,3 +20,4 @@ yarn-debug.log* yarn-error.log* api +docs/api diff --git a/packages/replicache-doc/docs/api/classes/IDBNotFoundError.md b/packages/replicache-doc/docs/api/classes/IDBNotFoundError.md deleted file mode 100644 index dbcce4277..000000000 --- a/packages/replicache-doc/docs/api/classes/IDBNotFoundError.md +++ /dev/null @@ -1,157 +0,0 @@ -# Class: IDBNotFoundError - -This Error is thrown when we detect that the IndexedDB has been -removed. This does not normally happen but can happen during development if -the user has DevTools open and deletes the IndexedDB from there. - -## Extends - -- `Error` - -## Constructors - -### new IDBNotFoundError() - -> **new IDBNotFoundError**(`message`?): [`IDBNotFoundError`](IDBNotFoundError.md) - -#### Parameters - -##### message? - -`string` - -#### Returns - -[`IDBNotFoundError`](IDBNotFoundError.md) - -#### Inherited from - -`Error.constructor` - -### new IDBNotFoundError() - -> **new IDBNotFoundError**(`message`?, `options`?): [`IDBNotFoundError`](IDBNotFoundError.md) - -#### Parameters - -##### message? - -`string` - -##### options? - -`ErrorOptions` - -#### Returns - -[`IDBNotFoundError`](IDBNotFoundError.md) - -#### Inherited from - -`Error.constructor` - -## Properties - -### cause? - -> `optional` **cause**: `unknown` - -#### Inherited from - -`Error.cause` - -*** - -### message - -> **message**: `string` - -#### Inherited from - -`Error.message` - -*** - -### name - -> **name**: `string` = `'IDBNotFoundError'` - -#### Overrides - -`Error.name` - -*** - -### stack? - -> `optional` **stack**: `string` - -#### Inherited from - -`Error.stack` - -*** - -### prepareStackTrace()? - -> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` - -Optional override for formatting stack traces - -#### Parameters - -##### err - -`Error` - -##### stackTraces - -`CallSite`[] - -#### Returns - -`any` - -#### See - -https://v8.dev/docs/stack-trace-api#customizing-stack-traces - -#### Inherited from - -`Error.prepareStackTrace` - -*** - -### stackTraceLimit - -> `static` **stackTraceLimit**: `number` - -#### Inherited from - -`Error.stackTraceLimit` - -## Methods - -### captureStackTrace() - -> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` - -Create .stack property on a target object - -#### Parameters - -##### targetObject - -`object` - -##### constructorOpt? - -`Function` - -#### Returns - -`void` - -#### Inherited from - -`Error.captureStackTrace` diff --git a/packages/replicache-doc/docs/api/classes/PullError.md b/packages/replicache-doc/docs/api/classes/PullError.md deleted file mode 100644 index a5ee6276c..000000000 --- a/packages/replicache-doc/docs/api/classes/PullError.md +++ /dev/null @@ -1,139 +0,0 @@ -# Class: PullError - -This error is thrown when the puller fails for any reason. - -## Extends - -- `Error` - -## Constructors - -### new PullError() - -> **new PullError**(`causedBy`?): [`PullError`](PullError.md) - -#### Parameters - -##### causedBy? - -`Error` - -#### Returns - -[`PullError`](PullError.md) - -#### Overrides - -`Error.constructor` - -## Properties - -### cause? - -> `optional` **cause**: `unknown` - -#### Inherited from - -`Error.cause` - -*** - -### causedBy? - -> `optional` **causedBy**: `Error` - -*** - -### message - -> **message**: `string` - -#### Inherited from - -`Error.message` - -*** - -### name - -> **name**: `string` = `'PullError'` - -#### Overrides - -`Error.name` - -*** - -### stack? - -> `optional` **stack**: `string` - -#### Inherited from - -`Error.stack` - -*** - -### prepareStackTrace()? - -> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` - -Optional override for formatting stack traces - -#### Parameters - -##### err - -`Error` - -##### stackTraces - -`CallSite`[] - -#### Returns - -`any` - -#### See - -https://v8.dev/docs/stack-trace-api#customizing-stack-traces - -#### Inherited from - -`Error.prepareStackTrace` - -*** - -### stackTraceLimit - -> `static` **stackTraceLimit**: `number` - -#### Inherited from - -`Error.stackTraceLimit` - -## Methods - -### captureStackTrace() - -> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` - -Create .stack property on a target object - -#### Parameters - -##### targetObject - -`object` - -##### constructorOpt? - -`Function` - -#### Returns - -`void` - -#### Inherited from - -`Error.captureStackTrace` diff --git a/packages/replicache-doc/docs/api/classes/PushError.md b/packages/replicache-doc/docs/api/classes/PushError.md deleted file mode 100644 index ca62a9c30..000000000 --- a/packages/replicache-doc/docs/api/classes/PushError.md +++ /dev/null @@ -1,139 +0,0 @@ -# Class: PushError - -This error is thrown when the pusher fails for any reason. - -## Extends - -- `Error` - -## Constructors - -### new PushError() - -> **new PushError**(`causedBy`?): [`PushError`](PushError.md) - -#### Parameters - -##### causedBy? - -`Error` - -#### Returns - -[`PushError`](PushError.md) - -#### Overrides - -`Error.constructor` - -## Properties - -### cause? - -> `optional` **cause**: `unknown` - -#### Inherited from - -`Error.cause` - -*** - -### causedBy? - -> `optional` **causedBy**: `Error` - -*** - -### message - -> **message**: `string` - -#### Inherited from - -`Error.message` - -*** - -### name - -> **name**: `string` = `'PushError'` - -#### Overrides - -`Error.name` - -*** - -### stack? - -> `optional` **stack**: `string` - -#### Inherited from - -`Error.stack` - -*** - -### prepareStackTrace()? - -> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` - -Optional override for formatting stack traces - -#### Parameters - -##### err - -`Error` - -##### stackTraces - -`CallSite`[] - -#### Returns - -`any` - -#### See - -https://v8.dev/docs/stack-trace-api#customizing-stack-traces - -#### Inherited from - -`Error.prepareStackTrace` - -*** - -### stackTraceLimit - -> `static` **stackTraceLimit**: `number` - -#### Inherited from - -`Error.stackTraceLimit` - -## Methods - -### captureStackTrace() - -> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` - -Create .stack property on a target object - -#### Parameters - -##### targetObject - -`object` - -##### constructorOpt? - -`Function` - -#### Returns - -`void` - -#### Inherited from - -`Error.captureStackTrace` diff --git a/packages/replicache-doc/docs/api/classes/Replicache.md b/packages/replicache-doc/docs/api/classes/Replicache.md deleted file mode 100644 index 11f358a30..000000000 --- a/packages/replicache-doc/docs/api/classes/Replicache.md +++ /dev/null @@ -1,842 +0,0 @@ -# Class: Replicache\ - -## Type Parameters - -• **MD** *extends* [`MutatorDefs`](../type-aliases/MutatorDefs.md) = \{\} - -## Constructors - -### new Replicache() - -> **new Replicache**\<`MD`\>(`options`): [`Replicache`](Replicache.md)\<`MD`\> - -#### Parameters - -##### options - -[`ReplicacheOptions`](../interfaces/ReplicacheOptions.md)\<`MD`\> - -#### Returns - -[`Replicache`](Replicache.md)\<`MD`\> - -## Accessors - -### auth - -#### Get Signature - -> **get** **auth**(): `string` - -The authorization token used when doing a push request. - -##### Returns - -`string` - -#### Set Signature - -> **set** **auth**(`value`): `void` - -##### Parameters - -###### value - -`string` - -##### Returns - -`void` - -*** - -### clientGroupID - -#### Get Signature - -> **get** **clientGroupID**(): `Promise`\<`string`\> - -The client group ID for this instance of Replicache. Instances of -Replicache will have the same client group ID if and only if they have -the same name, mutators, indexes, schema version, format version, and -browser profile. - -##### Returns - -`Promise`\<`string`\> - -*** - -### clientID - -#### Get Signature - -> **get** **clientID**(): `string` - -The client ID for this instance of Replicache. Each instance of Replicache -gets a unique client ID. - -##### Returns - -`string` - -*** - -### closed - -#### Get Signature - -> **get** **closed**(): `boolean` - -Whether the Replicache database has been closed. Once Replicache has been -closed it no longer syncs and you can no longer read or write data out of -it. After it has been closed it is pretty much useless and should not be -used any more. - -##### Returns - -`boolean` - -*** - -### getAuth - -#### Get Signature - -> **get** **getAuth**(): `undefined` \| `null` \| () => [`MaybePromise`](../type-aliases/MaybePromise.md)\<`undefined` \| `null` \| `string`\> - -This gets called when we get an HTTP unauthorized (401) response from the -push or pull endpoint. Set this to a function that will ask your user to -reauthenticate. - -##### Returns - -`undefined` \| `null` \| () => [`MaybePromise`](../type-aliases/MaybePromise.md)\<`undefined` \| `null` \| `string`\> - -#### Set Signature - -> **set** **getAuth**(`value`): `void` - -##### Parameters - -###### value - -`undefined` | `null` | () => [`MaybePromise`](../type-aliases/MaybePromise.md)\<`undefined` \| `null` \| `string`\> - -##### Returns - -`void` - -*** - -### idbName - -#### Get Signature - -> **get** **idbName**(): `string` - -This is the name Replicache uses for the IndexedDB database where data is -stored. - -##### Returns - -`string` - -*** - -### mutate - -#### Get Signature - -> **get** **mutate**(): [`MakeMutators`](../type-aliases/MakeMutators.md)\<`MD`\> - -The mutators that was registered in the constructor. - -##### Returns - -[`MakeMutators`](../type-aliases/MakeMutators.md)\<`MD`\> - -*** - -### name - -#### Get Signature - -> **get** **name**(): `string` - -The name of the Replicache database. Populated by [ReplicacheOptions#name](../interfaces/ReplicacheOptions.md#name). - -##### Returns - -`string` - -*** - -### onClientStateNotFound - -#### Get Signature - -> **get** **onClientStateNotFound**(): `null` \| () => `void` - -`onClientStateNotFound` is called when the persistent client has been -garbage collected. This can happen if the client has no pending mutations -and has not been used for a while. - -The default behavior is to reload the page (using `location.reload()`). Set -this to `null` or provide your own function to prevent the page from -reloading automatically. - -##### Returns - -`null` \| () => `void` - -#### Set Signature - -> **set** **onClientStateNotFound**(`value`): `void` - -##### Parameters - -###### value - -`null` | () => `void` - -##### Returns - -`void` - -*** - -### online - -#### Get Signature - -> **get** **online**(): `boolean` - -A rough heuristic for whether the client is currently online. Note that -there is no way to know for certain whether a client is online - the next -request can always fail. This property returns true if the last sync attempt succeeded, -and false otherwise. - -##### Returns - -`boolean` - -*** - -### onOnlineChange - -#### Get Signature - -> **get** **onOnlineChange**(): `null` \| (`online`) => `void` - -`onOnlineChange` is called when the [online](Replicache.md#online) property changes. See -[online](Replicache.md#online) for more details. - -##### Returns - -`null` \| (`online`) => `void` - -#### Set Signature - -> **set** **onOnlineChange**(`value`): `void` - -##### Parameters - -###### value - -`null` | (`online`) => `void` - -##### Returns - -`void` - -*** - -### onSync - -#### Get Signature - -> **get** **onSync**(): `null` \| (`syncing`) => `void` - -`onSync(true)` is called when Replicache transitions from no push or pull -happening to at least one happening. `onSync(false)` is called in the -opposite case: when Replicache transitions from at least one push or pull -happening to none happening. - -This can be used in a React like app by doing something like the following: - -```js -const [syncing, setSyncing] = useState(false); -useEffect(() => { - rep.onSync = setSyncing; -}, [rep]); -``` - -##### Returns - -`null` \| (`syncing`) => `void` - -#### Set Signature - -> **set** **onSync**(`value`): `void` - -##### Parameters - -###### value - -`null` | (`syncing`) => `void` - -##### Returns - -`void` - -*** - -### onUpdateNeeded - -#### Get Signature - -> **get** **onUpdateNeeded**(): `null` \| (`reason`) => `void` - -`onUpdateNeeded` is called when a code update is needed. - -A code update can be needed because: -- the server no longer supports the pushVersion, - pullVersion or [schemaVersion](Replicache.md#schemaversion) of the current code. -- a new Replicache client has created a new client group, because its code - has different mutators, indexes, schema version and/or format version - from this Replicache client. This is likely due to the new client having - newer code. A code update is needed to be able to locally sync with this - new Replicache client (i.e. to sync while offline, the clients can can - still sync with each other via the server). - -The default behavior is to reload the page (using `location.reload()`). Set -this to `null` or provide your own function to prevent the page from -reloading automatically. You may want to provide your own function to -display a toast to inform the end user there is a new version of your app -available and prompting them to refresh. - -##### Returns - -`null` \| (`reason`) => `void` - -#### Set Signature - -> **set** **onUpdateNeeded**(`value`): `void` - -##### Parameters - -###### value - -`null` | (`reason`) => `void` - -##### Returns - -`void` - -*** - -### profileID - -#### Get Signature - -> **get** **profileID**(): `Promise`\<`string`\> - -The browser profile ID for this browser profile. Every instance of Replicache -browser-profile-wide shares the same profile ID. - -##### Returns - -`Promise`\<`string`\> - -*** - -### puller - -#### Get Signature - -> **get** **puller**(): [`Puller`](../type-aliases/Puller.md) - -The function to use to pull data from the server. - -##### Returns - -[`Puller`](../type-aliases/Puller.md) - -#### Set Signature - -> **set** **puller**(`value`): `void` - -##### Parameters - -###### value - -[`Puller`](../type-aliases/Puller.md) - -##### Returns - -`void` - -*** - -### pullInterval - -#### Get Signature - -> **get** **pullInterval**(): `null` \| `number` - -The duration between each periodic [pull](Replicache.md#pull). Setting this to `null` -disables periodic pull completely. Pull will still happen if you call -[pull](Replicache.md#pull) manually. - -##### Returns - -`null` \| `number` - -#### Set Signature - -> **set** **pullInterval**(`value`): `void` - -##### Parameters - -###### value - -`null` | `number` - -##### Returns - -`void` - -*** - -### pullURL - -#### Get Signature - -> **get** **pullURL**(): `string` - -The URL to use when doing a pull request. - -##### Returns - -`string` - -#### Set Signature - -> **set** **pullURL**(`value`): `void` - -##### Parameters - -###### value - -`string` - -##### Returns - -`void` - -*** - -### pushDelay - -#### Get Signature - -> **get** **pushDelay**(): `number` - -The delay between when a change is made to Replicache and when Replicache -attempts to push that change. - -##### Returns - -`number` - -#### Set Signature - -> **set** **pushDelay**(`value`): `void` - -##### Parameters - -###### value - -`number` - -##### Returns - -`void` - -*** - -### pusher - -#### Get Signature - -> **get** **pusher**(): [`Pusher`](../type-aliases/Pusher.md) - -The function to use to push data to the server. - -##### Returns - -[`Pusher`](../type-aliases/Pusher.md) - -#### Set Signature - -> **set** **pusher**(`value`): `void` - -##### Parameters - -###### value - -[`Pusher`](../type-aliases/Pusher.md) - -##### Returns - -`void` - -*** - -### pushURL - -#### Get Signature - -> **get** **pushURL**(): `string` - -The URL to use when doing a push request. - -##### Returns - -`string` - -#### Set Signature - -> **set** **pushURL**(`value`): `void` - -##### Parameters - -###### value - -`string` - -##### Returns - -`void` - -*** - -### requestOptions - -#### Get Signature - -> **get** **requestOptions**(): `Required`\<[`RequestOptions`](../interfaces/RequestOptions.md)\> - -The options used to control the [pull](Replicache.md#pull) and push request behavior. This -object is live so changes to it will affect the next pull or push call. - -##### Returns - -`Required`\<[`RequestOptions`](../interfaces/RequestOptions.md)\> - -*** - -### schemaVersion - -#### Get Signature - -> **get** **schemaVersion**(): `string` - -The schema version of the data understood by this application. - -##### Returns - -`string` - -## Methods - -### close() - -> **close**(): `Promise`\<`void`\> - -Closes this Replicache instance. - -When closed all subscriptions end and no more read or writes are allowed. - -#### Returns - -`Promise`\<`void`\> - -*** - -### experimentalPendingMutations() - -> **experimentalPendingMutations**(): `Promise`\ - -**`Experimental`** - -List of pending mutations. The order of this is from oldest to newest. - -Gives a list of local mutations that have `mutationID` > -`syncHead.mutationID` that exists on the main client group. - - This method is experimental and may change in the future. - -#### Returns - -`Promise`\ - -*** - -### experimentalWatch() - -#### Call Signature - -> **experimentalWatch**(`callback`): () => `void` - -**`Experimental`** - -Watches Replicache for changes. - -The `callback` gets called whenever the underlying data changes and the -`key` changes matches the `prefix` of [ExperimentalWatchIndexOptions](../type-aliases/ExperimentalWatchIndexOptions.md) or -[ExperimentalWatchNoIndexOptions](../type-aliases/ExperimentalWatchNoIndexOptions.md) if present. If a change -occurs to the data but the change does not impact the key space the -callback is not called. In other words, the callback is never called with -an empty diff. - -This gets called after commit (a mutation or a rebase). - - This method is under development and its semantics will -change. - -##### Parameters - -###### callback - -[`ExperimentalWatchNoIndexCallback`](../type-aliases/ExperimentalWatchNoIndexCallback.md) - -##### Returns - -`Function` - -###### Returns - -`void` - -#### Call Signature - -> **experimentalWatch**\<`Options`\>(`callback`, `options`?): () => `void` - -**`Experimental`** - -Watches Replicache for changes. - -The `callback` gets called whenever the underlying data changes and the -`key` changes matches the `prefix` of [ExperimentalWatchIndexOptions](../type-aliases/ExperimentalWatchIndexOptions.md) or -[ExperimentalWatchNoIndexOptions](../type-aliases/ExperimentalWatchNoIndexOptions.md) if present. If a change -occurs to the data but the change does not impact the key space the -callback is not called. In other words, the callback is never called with -an empty diff. - -This gets called after commit (a mutation or a rebase). - - This method is under development and its semantics will -change. - -##### Type Parameters - -• **Options** *extends* [`ExperimentalWatchOptions`](../type-aliases/ExperimentalWatchOptions.md) - -##### Parameters - -###### callback - -[`ExperimentalWatchCallbackForOptions`](../type-aliases/ExperimentalWatchCallbackForOptions.md)\<`Options`\> - -###### options? - -`Options` - -##### Returns - -`Function` - -###### Returns - -`void` - -*** - -### poke() - -> **poke**(`poke`): `Promise`\<`void`\> - -**`Experimental`** - -Applies an update from the server to Replicache. -Throws an error if cookie does not match. In that case the server thinks -this client has a different cookie than it does; the caller should disconnect -from the server and re-register, which transmits the cookie the client actually -has. - - This method is under development and its semantics will change. - -#### Parameters - -##### poke - -[`Poke`](../type-aliases/Poke.md) - -#### Returns - -`Promise`\<`void`\> - -*** - -### pull() - -> **pull**(`now`?): `Promise`\<`void`\> - -Pull pulls changes from the [pullURL](Replicache.md#pullurl). If there are any changes local -changes will get replayed on top of the new server state. - -If the server endpoint fails pull will be continuously retried with an -exponential backoff. - -#### Parameters - -##### now? - -If true, pull will happen immediately and ignore - [RequestOptions.minDelayMs](../interfaces/RequestOptions.md#mindelayms) as well as the exponential backoff in - case of errors. - -###### now - -`boolean` = `false` - -#### Returns - -`Promise`\<`void`\> - -A promise that resolves when the next pull completes. In case of -errors the first error will reject the returned promise. Subsequent errors -will not be reflected in the promise. - -*** - -### push() - -> **push**(`now`?): `Promise`\<`void`\> - -Push pushes pending changes to the [pushURL](Replicache.md#pushurl). - -You do not usually need to manually call push. If [pushDelay](Replicache.md#pushdelay) is -non-zero (which it is by default) pushes happen automatically shortly after -mutations. - -If the server endpoint fails push will be continuously retried with an -exponential backoff. - -#### Parameters - -##### now? - -If true, push will happen immediately and ignore - [pushDelay](Replicache.md#pushdelay), [RequestOptions.minDelayMs](../interfaces/RequestOptions.md#mindelayms) as well as the - exponential backoff in case of errors. - -###### now - -`boolean` = `false` - -#### Returns - -`Promise`\<`void`\> - -A promise that resolves when the next push completes. In case of -errors the first error will reject the returned promise. Subsequent errors -will not be reflected in the promise. - -*** - -### query() - -> **query**\<`R`\>(`body`): `Promise`\<`R`\> - -Query is used for read transactions. It is recommended to use transactions -to ensure you get a consistent view across multiple calls to `get`, `has` -and `scan`. - -#### Type Parameters - -• **R** - -#### Parameters - -##### body - -(`tx`) => `R` \| `Promise`\<`R`\> - -#### Returns - -`Promise`\<`R`\> - -*** - -### subscribe() - -> **subscribe**\<`R`\>(`body`, `options`): () => `void` - -Subscribe to the result of a [query](Replicache.md#query). The `body` function is -evaluated once and its results are returned via `onData`. - -Thereafter, each time the the result of `body` changes, `onData` is fired -again with the new result. - -`subscribe()` goes to significant effort to avoid extraneous work -re-evaluating subscriptions: - -1. subscribe tracks the keys that `body` accesses each time it runs. `body` - is only re-evaluated when those keys change. -2. subscribe only re-fires `onData` in the case that a result changes by - way of the `isEqual` option which defaults to doing a deep JSON value - equality check. - -Because of (1), `body` must be a pure function of the data in Replicache. -`body` must not access anything other than the `tx` parameter passed to it. - -Although subscribe is as efficient as it can be, it is somewhat constrained -by the goal of returning an arbitrary computation of the cache. For even -better performance (but worse dx), see [experimentalWatch](Replicache.md#experimentalwatch). - -If an error occurs in the `body` the `onError` function is called if -present. Otherwise, the error is logged at log level 'error'. - -To cancel the subscription, call the returned function. - -#### Type Parameters - -• **R** - -#### Parameters - -##### body - -(`tx`) => `Promise`\<`R`\> - -The function to evaluate to get the value to pass into - `onData`. - -##### options - -Options is either a function or an object. If it is a - function it is equivalent to passing it as the `onData` property of an - object. - -[`SubscribeOptions`](../interfaces/SubscribeOptions.md)\<`R`\> | (`result`) => `void` - -#### Returns - -`Function` - -##### Returns - -`void` diff --git a/packages/replicache-doc/docs/api/classes/TransactionClosedError.md b/packages/replicache-doc/docs/api/classes/TransactionClosedError.md deleted file mode 100644 index 1a8cc6533..000000000 --- a/packages/replicache-doc/docs/api/classes/TransactionClosedError.md +++ /dev/null @@ -1,127 +0,0 @@ -# Class: TransactionClosedError - -This error is thrown when you try to call methods on a closed transaction. - -## Extends - -- `Error` - -## Constructors - -### new TransactionClosedError() - -> **new TransactionClosedError**(): [`TransactionClosedError`](TransactionClosedError.md) - -#### Returns - -[`TransactionClosedError`](TransactionClosedError.md) - -#### Overrides - -`Error.constructor` - -## Properties - -### cause? - -> `optional` **cause**: `unknown` - -#### Inherited from - -`Error.cause` - -*** - -### message - -> **message**: `string` - -#### Inherited from - -`Error.message` - -*** - -### name - -> **name**: `string` - -#### Inherited from - -`Error.name` - -*** - -### stack? - -> `optional` **stack**: `string` - -#### Inherited from - -`Error.stack` - -*** - -### prepareStackTrace()? - -> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` - -Optional override for formatting stack traces - -#### Parameters - -##### err - -`Error` - -##### stackTraces - -`CallSite`[] - -#### Returns - -`any` - -#### See - -https://v8.dev/docs/stack-trace-api#customizing-stack-traces - -#### Inherited from - -`Error.prepareStackTrace` - -*** - -### stackTraceLimit - -> `static` **stackTraceLimit**: `number` - -#### Inherited from - -`Error.stackTraceLimit` - -## Methods - -### captureStackTrace() - -> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` - -Create .stack property on a target object - -#### Parameters - -##### targetObject - -`object` - -##### constructorOpt? - -`Function` - -#### Returns - -`void` - -#### Inherited from - -`Error.captureStackTrace` diff --git a/packages/replicache-doc/docs/api/functions/deleteAllReplicacheData.md b/packages/replicache-doc/docs/api/functions/deleteAllReplicacheData.md deleted file mode 100644 index 2ba89abc6..000000000 --- a/packages/replicache-doc/docs/api/functions/deleteAllReplicacheData.md +++ /dev/null @@ -1,22 +0,0 @@ -# Function: ~~deleteAllReplicacheData()~~ - -> **deleteAllReplicacheData**(`opts`?): `Promise`\<\{ `dropped`: `string`[]; `errors`: `unknown`[]; \}\> - -Deletes all IndexedDB data associated with Replicache. - -Returns an object with the names of the successfully dropped databases -and any errors encountered while dropping. - -## Parameters - -### opts? - -[`DropDatabaseOptions`](../type-aliases/DropDatabaseOptions.md) - -## Returns - -`Promise`\<\{ `dropped`: `string`[]; `errors`: `unknown`[]; \}\> - -## Deprecated - -Use `dropAllDatabases` instead. diff --git a/packages/replicache-doc/docs/api/functions/dropAllDatabases.md b/packages/replicache-doc/docs/api/functions/dropAllDatabases.md deleted file mode 100644 index 9d64eb64f..000000000 --- a/packages/replicache-doc/docs/api/functions/dropAllDatabases.md +++ /dev/null @@ -1,18 +0,0 @@ -# Function: dropAllDatabases() - -> **dropAllDatabases**(`opts`?): `Promise`\<\{ `dropped`: `string`[]; `errors`: `unknown`[]; \}\> - -Deletes all IndexedDB data associated with Replicache. - -Returns an object with the names of the successfully dropped databases -and any errors encountered while dropping. - -## Parameters - -### opts? - -[`DropDatabaseOptions`](../type-aliases/DropDatabaseOptions.md) - -## Returns - -`Promise`\<\{ `dropped`: `string`[]; `errors`: `unknown`[]; \}\> diff --git a/packages/replicache-doc/docs/api/functions/dropDatabase.md b/packages/replicache-doc/docs/api/functions/dropDatabase.md deleted file mode 100644 index bf03241a4..000000000 --- a/packages/replicache-doc/docs/api/functions/dropDatabase.md +++ /dev/null @@ -1,19 +0,0 @@ -# Function: dropDatabase() - -> **dropDatabase**(`dbName`, `opts`?): `Promise`\<`void`\> - -Deletes a single Replicache database. - -## Parameters - -### dbName - -`string` - -### opts? - -[`DropDatabaseOptions`](../type-aliases/DropDatabaseOptions.md) - -## Returns - -`Promise`\<`void`\> diff --git a/packages/replicache-doc/docs/api/functions/filterAsyncIterable.md b/packages/replicache-doc/docs/api/functions/filterAsyncIterable.md deleted file mode 100644 index fd8147bc3..000000000 --- a/packages/replicache-doc/docs/api/functions/filterAsyncIterable.md +++ /dev/null @@ -1,27 +0,0 @@ -# Function: filterAsyncIterable() - -> **filterAsyncIterable**\<`V`\>(`iter`, `predicate`): `AsyncIterable`\<`V`\> - -Filters an async iterable. - -This utility function is provided because it is useful when using -[makeScanResult](makeScanResult.md). It can be used to filter out tombstones (delete entries) -for example. - -## Type Parameters - -• **V** - -## Parameters - -### iter - -[`IterableUnion`](../type-aliases/IterableUnion.md)\<`V`\> - -### predicate - -(`v`) => `boolean` - -## Returns - -`AsyncIterable`\<`V`\> diff --git a/packages/replicache-doc/docs/api/functions/getDefaultPuller.md b/packages/replicache-doc/docs/api/functions/getDefaultPuller.md deleted file mode 100644 index 5cb498199..000000000 --- a/packages/replicache-doc/docs/api/functions/getDefaultPuller.md +++ /dev/null @@ -1,21 +0,0 @@ -# Function: getDefaultPuller() - -> **getDefaultPuller**(`rep`): [`Puller`](../type-aliases/Puller.md) - -This creates a default puller which uses HTTP POST to send the pull request. - -## Parameters - -### rep - -#### auth - -`string` - -#### pullURL - -`string` - -## Returns - -[`Puller`](../type-aliases/Puller.md) diff --git a/packages/replicache-doc/docs/api/functions/getDefaultPusher.md b/packages/replicache-doc/docs/api/functions/getDefaultPusher.md deleted file mode 100644 index d4bb0edea..000000000 --- a/packages/replicache-doc/docs/api/functions/getDefaultPusher.md +++ /dev/null @@ -1,21 +0,0 @@ -# Function: getDefaultPusher() - -> **getDefaultPusher**(`rep`): [`Pusher`](../type-aliases/Pusher.md) - -This creates a default pusher which uses HTTP POST to send the push request. - -## Parameters - -### rep - -#### auth - -`string` - -#### pushURL - -`string` - -## Returns - -[`Pusher`](../type-aliases/Pusher.md) diff --git a/packages/replicache-doc/docs/api/functions/isScanIndexOptions.md b/packages/replicache-doc/docs/api/functions/isScanIndexOptions.md deleted file mode 100644 index b940fa4ea..000000000 --- a/packages/replicache-doc/docs/api/functions/isScanIndexOptions.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: isScanIndexOptions() - -> **isScanIndexOptions**(`options`): `options is ScanIndexOptions` - -Type narrowing of [ScanOptions](../type-aliases/ScanOptions.md). - -## Parameters - -### options - -[`ScanOptions`](../type-aliases/ScanOptions.md) - -## Returns - -`options is ScanIndexOptions` diff --git a/packages/replicache-doc/docs/api/functions/makeIDBName.md b/packages/replicache-doc/docs/api/functions/makeIDBName.md deleted file mode 100644 index da2af9cf6..000000000 --- a/packages/replicache-doc/docs/api/functions/makeIDBName.md +++ /dev/null @@ -1,23 +0,0 @@ -# Function: makeIDBName() - -> **makeIDBName**(`name`, `schemaVersion`?): `string` - -Returns the name of the IDB database that will be used for a particular Replicache instance. - -## Parameters - -### name - -`string` - -The name of the Replicache instance (i.e., the `name` field of `ReplicacheOptions`). - -### schemaVersion? - -`string` - -The schema version of the database (i.e., the `schemaVersion` field of `ReplicacheOptions`). - -## Returns - -`string` diff --git a/packages/replicache-doc/docs/api/functions/makeScanResult.md b/packages/replicache-doc/docs/api/functions/makeScanResult.md deleted file mode 100644 index 66b3e05b4..000000000 --- a/packages/replicache-doc/docs/api/functions/makeScanResult.md +++ /dev/null @@ -1,50 +0,0 @@ -# Function: makeScanResult() - -> **makeScanResult**\<`Options`\>(`options`, `getScanIterator`): [`ScanResult`](../interfaces/ScanResult.md)\<[`KeyTypeForScanOptions`](../type-aliases/KeyTypeForScanOptions.md)\<`Options`\>, [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -A helper function that makes it easier to implement [ReadTransaction.scan](../interfaces/ReadTransaction.md#scan) -with a custom backend. - -If you are implementing a custom backend and have an in memory pending async -iterable we provide two helper functions to make it easier to merge these -together. [mergeAsyncIterables](mergeAsyncIterables.md) and [filterAsyncIterable](filterAsyncIterable.md). - -For example: - -```ts -const scanResult = makeScanResult( - options, - options.indexName - ? () => { - throw Error('not implemented'); - } - : fromKey => { - const persisted: AsyncIterable> = ...; - const pending: AsyncIterable> = ...; - const iter = await mergeAsyncIterables(persisted, pending); - const filteredIter = await filterAsyncIterable( - iter, - entry => entry[1] !== undefined, - ); - return filteredIter; - }, -); -``` - -## Type Parameters - -• **Options** *extends* [`ScanOptions`](../type-aliases/ScanOptions.md) - -## Parameters - -### options - -`Options` - -### getScanIterator - -`Options` *extends* [`ScanIndexOptions`](../type-aliases/ScanIndexOptions.md) ? [`GetIndexScanIterator`](../type-aliases/GetIndexScanIterator.md) : [`GetScanIterator`](../type-aliases/GetScanIterator.md) - -## Returns - -[`ScanResult`](../interfaces/ScanResult.md)\<[`KeyTypeForScanOptions`](../type-aliases/KeyTypeForScanOptions.md)\<`Options`\>, [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> diff --git a/packages/replicache-doc/docs/api/functions/mergeAsyncIterables.md b/packages/replicache-doc/docs/api/functions/mergeAsyncIterables.md deleted file mode 100644 index 74f17c861..000000000 --- a/packages/replicache-doc/docs/api/functions/mergeAsyncIterables.md +++ /dev/null @@ -1,39 +0,0 @@ -# Function: mergeAsyncIterables() - -> **mergeAsyncIterables**\<`A`, `B`\>(`iterableBase`, `iterableOverlay`, `compare`): `AsyncIterable`\<`A` \| `B`\> - -Merges an iterable on to another iterable. - -The two iterables need to be ordered and the `compare` function is used to -compare two different elements. - -If two elements are equal (`compare` returns `0`) then the element from the -second iterable is picked. - -This utility function is provided because it is useful when using -[makeScanResult](makeScanResult.md). It can be used to merge an in memory pending async -iterable on to a persistent async iterable for example. - -## Type Parameters - -• **A** - -• **B** - -## Parameters - -### iterableBase - -[`IterableUnion`](../type-aliases/IterableUnion.md)\<`A`\> - -### iterableOverlay - -[`IterableUnion`](../type-aliases/IterableUnion.md)\<`B`\> - -### compare - -(`a`, `b`) => `number` - -## Returns - -`AsyncIterable`\<`A` \| `B`\> diff --git a/packages/replicache-doc/docs/api/index.md b/packages/replicache-doc/docs/api/index.md deleted file mode 100644 index f98c29309..000000000 --- a/packages/replicache-doc/docs/api/index.md +++ /dev/null @@ -1,108 +0,0 @@ -# Replicache - -## Classes - -- [IDBNotFoundError](classes/IDBNotFoundError.md) -- [PullError](classes/PullError.md) -- [PushError](classes/PushError.md) -- [Replicache](classes/Replicache.md) -- [TransactionClosedError](classes/TransactionClosedError.md) - -## Interfaces - -- [AsyncIterableIteratorToArray](interfaces/AsyncIterableIteratorToArray.md) -- [KVRead](interfaces/KVRead.md) -- [KVStore](interfaces/KVStore.md) -- [KVWrite](interfaces/KVWrite.md) -- [LogSink](interfaces/LogSink.md) -- [ReadTransaction](interfaces/ReadTransaction.md) -- [ReplicacheOptions](interfaces/ReplicacheOptions.md) -- [RequestOptions](interfaces/RequestOptions.md) -- [ScanResult](interfaces/ScanResult.md) -- [SubscribeOptions](interfaces/SubscribeOptions.md) -- [WriteTransaction](interfaces/WriteTransaction.md) - -## Type Aliases - -- [ClientGroupID](type-aliases/ClientGroupID.md) -- [ClientID](type-aliases/ClientID.md) -- [ClientStateNotFoundResponse](type-aliases/ClientStateNotFoundResponse.md) -- [Cookie](type-aliases/Cookie.md) -- [CreateIndexDefinition](type-aliases/CreateIndexDefinition.md) -- [CreateKVStore](type-aliases/CreateKVStore.md) -- [DeepReadonly](type-aliases/DeepReadonly.md) -- [DeepReadonlyObject](type-aliases/DeepReadonlyObject.md) -- [DropDatabaseOptions](type-aliases/DropDatabaseOptions.md) -- [DropKVStore](type-aliases/DropKVStore.md) -- [ExperimentalDiff](type-aliases/ExperimentalDiff.md) -- [ExperimentalDiffOperation](type-aliases/ExperimentalDiffOperation.md) -- [ExperimentalDiffOperationAdd](type-aliases/ExperimentalDiffOperationAdd.md) -- [ExperimentalDiffOperationChange](type-aliases/ExperimentalDiffOperationChange.md) -- [ExperimentalDiffOperationDel](type-aliases/ExperimentalDiffOperationDel.md) -- [ExperimentalIndexDiff](type-aliases/ExperimentalIndexDiff.md) -- [ExperimentalNoIndexDiff](type-aliases/ExperimentalNoIndexDiff.md) -- [ExperimentalWatchCallbackForOptions](type-aliases/ExperimentalWatchCallbackForOptions.md) -- [ExperimentalWatchIndexCallback](type-aliases/ExperimentalWatchIndexCallback.md) -- [ExperimentalWatchIndexOptions](type-aliases/ExperimentalWatchIndexOptions.md) -- [ExperimentalWatchNoIndexCallback](type-aliases/ExperimentalWatchNoIndexCallback.md) -- [ExperimentalWatchNoIndexOptions](type-aliases/ExperimentalWatchNoIndexOptions.md) -- [ExperimentalWatchOptions](type-aliases/ExperimentalWatchOptions.md) -- [GetIndexScanIterator](type-aliases/GetIndexScanIterator.md) -- [GetScanIterator](type-aliases/GetScanIterator.md) -- [HTTPRequestInfo](type-aliases/HTTPRequestInfo.md) -- [IndexDefinition](type-aliases/IndexDefinition.md) -- [IndexDefinitions](type-aliases/IndexDefinitions.md) -- [IndexKey](type-aliases/IndexKey.md) -- [IterableUnion](type-aliases/IterableUnion.md) -- [JSONObject](type-aliases/JSONObject.md) -- [JSONValue](type-aliases/JSONValue.md) -- [KeyTypeForScanOptions](type-aliases/KeyTypeForScanOptions.md) -- [KVStoreProvider](type-aliases/KVStoreProvider.md) -- [LogLevel](type-aliases/LogLevel.md) -- [MakeMutator](type-aliases/MakeMutator.md) -- [MakeMutators](type-aliases/MakeMutators.md) -- [MaybePromise](type-aliases/MaybePromise.md) -- [Mutation](type-aliases/Mutation.md) -- [MutatorDefs](type-aliases/MutatorDefs.md) -- [MutatorReturn](type-aliases/MutatorReturn.md) -- [PatchOperation](type-aliases/PatchOperation.md) -- [PendingMutation](type-aliases/PendingMutation.md) -- [Poke](type-aliases/Poke.md) -- [Puller](type-aliases/Puller.md) -- [PullerResult](type-aliases/PullerResult.md) -- [PullRequest](type-aliases/PullRequest.md) -- [PullResponse](type-aliases/PullResponse.md) -- [Pusher](type-aliases/Pusher.md) -- [PusherResult](type-aliases/PusherResult.md) -- [PushRequest](type-aliases/PushRequest.md) -- [PushResponse](type-aliases/PushResponse.md) -- [ReadonlyJSONObject](type-aliases/ReadonlyJSONObject.md) -- [ReadonlyJSONValue](type-aliases/ReadonlyJSONValue.md) -- [ScanIndexOptions](type-aliases/ScanIndexOptions.md) -- [ScanNoIndexOptions](type-aliases/ScanNoIndexOptions.md) -- [ScanOptionIndexedStartKey](type-aliases/ScanOptionIndexedStartKey.md) -- [ScanOptions](type-aliases/ScanOptions.md) -- [TransactionEnvironment](type-aliases/TransactionEnvironment.md) -- [TransactionLocation](type-aliases/TransactionLocation.md) -- [TransactionReason](type-aliases/TransactionReason.md) -- [UpdateNeededReason](type-aliases/UpdateNeededReason.md) -- [VersionNotSupportedResponse](type-aliases/VersionNotSupportedResponse.md) - -## Variables - -- [consoleLogSink](variables/consoleLogSink.md) -- [~~TEST\_LICENSE\_KEY~~](variables/TEST_LICENSE_KEY.md) -- [version](variables/version.md) - -## Functions - -- [~~deleteAllReplicacheData~~](functions/deleteAllReplicacheData.md) -- [dropAllDatabases](functions/dropAllDatabases.md) -- [dropDatabase](functions/dropDatabase.md) -- [filterAsyncIterable](functions/filterAsyncIterable.md) -- [getDefaultPuller](functions/getDefaultPuller.md) -- [getDefaultPusher](functions/getDefaultPusher.md) -- [isScanIndexOptions](functions/isScanIndexOptions.md) -- [makeIDBName](functions/makeIDBName.md) -- [makeScanResult](functions/makeScanResult.md) -- [mergeAsyncIterables](functions/mergeAsyncIterables.md) diff --git a/packages/replicache-doc/docs/api/interfaces/AsyncIterableIteratorToArray.md b/packages/replicache-doc/docs/api/interfaces/AsyncIterableIteratorToArray.md deleted file mode 100644 index af84e357a..000000000 --- a/packages/replicache-doc/docs/api/interfaces/AsyncIterableIteratorToArray.md +++ /dev/null @@ -1,101 +0,0 @@ -# Interface: AsyncIterableIteratorToArray\ - -An interface that adds a [toArray](AsyncIterableIteratorToArray.md#toarray) method to `AsyncIterableIterator`. - -Usage: - -```ts -const keys: string[] = await rep.scan().keys().toArray(); -``` - -## Extends - -- `AsyncIterableIterator`\<`V`\> - -## Type Parameters - -• **V** - -## Methods - -### \[asyncIterator\]() - -> **\[asyncIterator\]**(): `AsyncIterableIterator`\<`V`\> - -#### Returns - -`AsyncIterableIterator`\<`V`\> - -#### Inherited from - -`AsyncIterableIterator.[asyncIterator]` - -*** - -### next() - -> **next**(...`__namedParameters`): `Promise`\<`IteratorResult`\<`V`, `any`\>\> - -#### Parameters - -##### \_\_namedParameters - -\[\] | \[`any`\] - -#### Returns - -`Promise`\<`IteratorResult`\<`V`, `any`\>\> - -#### Inherited from - -`AsyncIterableIterator.next` - -*** - -### return()? - -> `optional` **return**(`value`?): `Promise`\<`IteratorResult`\<`V`, `any`\>\> - -#### Parameters - -##### value? - -`any` - -#### Returns - -`Promise`\<`IteratorResult`\<`V`, `any`\>\> - -#### Inherited from - -`AsyncIterableIterator.return` - -*** - -### throw()? - -> `optional` **throw**(`e`?): `Promise`\<`IteratorResult`\<`V`, `any`\>\> - -#### Parameters - -##### e? - -`any` - -#### Returns - -`Promise`\<`IteratorResult`\<`V`, `any`\>\> - -#### Inherited from - -`AsyncIterableIterator.throw` - -*** - -### toArray() - -> **toArray**(): `Promise`\<`V`[]\> - -#### Returns - -`Promise`\<`V`[]\> diff --git a/packages/replicache-doc/docs/api/interfaces/KVRead.md b/packages/replicache-doc/docs/api/interfaces/KVRead.md deleted file mode 100644 index 2c5147418..000000000 --- a/packages/replicache-doc/docs/api/interfaces/KVRead.md +++ /dev/null @@ -1,74 +0,0 @@ -# Interface: KVRead - -**`Experimental`** - -This interface is experimental and might be removed or changed -in the future without following semver versioning. Please be cautious. - -## Extends - -- `Release` - -## Extended by - -- [`KVWrite`](KVWrite.md) - -## Properties - -### closed - -> **closed**: `boolean` - -**`Experimental`** - -## Methods - -### get() - -> **get**(`key`): `Promise`\<`undefined` \| [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -**`Experimental`** - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`undefined` \| [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -*** - -### has() - -> **has**(`key`): `Promise`\<`boolean`\> - -**`Experimental`** - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`boolean`\> - -*** - -### release() - -> **release**(): `void` - -**`Experimental`** - -#### Returns - -`void` - -#### Inherited from - -`Release.release` diff --git a/packages/replicache-doc/docs/api/interfaces/KVStore.md b/packages/replicache-doc/docs/api/interfaces/KVStore.md deleted file mode 100644 index 4d7b932fe..000000000 --- a/packages/replicache-doc/docs/api/interfaces/KVStore.md +++ /dev/null @@ -1,49 +0,0 @@ -# Interface: KVStore - -Store defines a transactional key/value store that Replicache stores all data -within. - -For correct operation of Replicache, implementations of this interface must -provide [strict -serializable](https://jepsen.io/consistency/models/strict-serializable) -transactions. - -Informally, read and write transactions must behave like a ReadWrite Lock - -multiple read transactions are allowed in parallel, or one write. -Additionally writes from a transaction must appear all at one, atomically. - -## Properties - -### closed - -> **closed**: `boolean` - -## Methods - -### close() - -> **close**(): `Promise`\<`void`\> - -#### Returns - -`Promise`\<`void`\> - -*** - -### read() - -> **read**(): `Promise`\<[`KVRead`](KVRead.md)\> - -#### Returns - -`Promise`\<[`KVRead`](KVRead.md)\> - -*** - -### write() - -> **write**(): `Promise`\<[`KVWrite`](KVWrite.md)\> - -#### Returns - -`Promise`\<[`KVWrite`](KVWrite.md)\> diff --git a/packages/replicache-doc/docs/api/interfaces/KVWrite.md b/packages/replicache-doc/docs/api/interfaces/KVWrite.md deleted file mode 100644 index 6175dc4b6..000000000 --- a/packages/replicache-doc/docs/api/interfaces/KVWrite.md +++ /dev/null @@ -1,134 +0,0 @@ -# Interface: KVWrite - -**`Experimental`** - -This interface is experimental and might be removed or changed -in the future without following semver versioning. Please be cautious. - -## Extends - -- [`KVRead`](KVRead.md) - -## Properties - -### closed - -> **closed**: `boolean` - -**`Experimental`** - -#### Inherited from - -[`KVRead`](KVRead.md).[`closed`](KVRead.md#closed) - -## Methods - -### commit() - -> **commit**(): `Promise`\<`void`\> - -**`Experimental`** - -#### Returns - -`Promise`\<`void`\> - -*** - -### del() - -> **del**(`key`): `Promise`\<`void`\> - -**`Experimental`** - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`void`\> - -*** - -### get() - -> **get**(`key`): `Promise`\<`undefined` \| [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -**`Experimental`** - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`undefined` \| [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -#### Inherited from - -[`KVRead`](KVRead.md).[`get`](KVRead.md#get) - -*** - -### has() - -> **has**(`key`): `Promise`\<`boolean`\> - -**`Experimental`** - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`boolean`\> - -#### Inherited from - -[`KVRead`](KVRead.md).[`has`](KVRead.md#has) - -*** - -### put() - -> **put**(`key`, `value`): `Promise`\<`void`\> - -**`Experimental`** - -#### Parameters - -##### key - -`string` - -##### value - -[`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -#### Returns - -`Promise`\<`void`\> - -*** - -### release() - -> **release**(): `void` - -**`Experimental`** - -#### Returns - -`void` - -#### Inherited from - -[`KVRead`](KVRead.md).[`release`](KVRead.md#release) diff --git a/packages/replicache-doc/docs/api/interfaces/LogSink.md b/packages/replicache-doc/docs/api/interfaces/LogSink.md deleted file mode 100644 index 6a3280611..000000000 --- a/packages/replicache-doc/docs/api/interfaces/LogSink.md +++ /dev/null @@ -1,35 +0,0 @@ -# Interface: LogSink - -## Methods - -### flush()? - -> `optional` **flush**(): `Promise`\<`void`\> - -#### Returns - -`Promise`\<`void`\> - -*** - -### log() - -> **log**(`level`, `context`, ...`args`): `void` - -#### Parameters - -##### level - -[`LogLevel`](../type-aliases/LogLevel.md) - -##### context - -`undefined` | `Context` - -##### args - -...`unknown`[] - -#### Returns - -`void` diff --git a/packages/replicache-doc/docs/api/interfaces/ReadTransaction.md b/packages/replicache-doc/docs/api/interfaces/ReadTransaction.md deleted file mode 100644 index 69d8b352e..000000000 --- a/packages/replicache-doc/docs/api/interfaces/ReadTransaction.md +++ /dev/null @@ -1,221 +0,0 @@ -# Interface: ReadTransaction - -ReadTransactions are used with [Replicache.query](../classes/Replicache.md#query) and -[Replicache.subscribe](../classes/Replicache.md#subscribe) and allows read operations on the -database. - -## Extended by - -- [`WriteTransaction`](WriteTransaction.md) - -## Properties - -### clientID - -> `readonly` **clientID**: `string` - -*** - -### ~~environment~~ - -> `readonly` **environment**: [`TransactionEnvironment`](../type-aliases/TransactionEnvironment.md) - -#### Deprecated - -Use [ReadTransaction.location](ReadTransaction.md#location) instead. - -*** - -### location - -> `readonly` **location**: [`TransactionEnvironment`](../type-aliases/TransactionEnvironment.md) - -## Methods - -### get() - -#### Call Signature - -> **get**(`key`): `Promise`\<`undefined` \| [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -Get a single value from the database. If the `key` is not present this -returns `undefined`. - -Important: The returned JSON is readonly and should not be modified. This -is only enforced statically by TypeScript and there are no runtime checks -for performance reasons. If you mutate the return value you will get -undefined behavior. - -##### Parameters - -###### key - -`string` - -##### Returns - -`Promise`\<`undefined` \| [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -#### Call Signature - -> **get**\<`T`\>(`key`): `Promise`\<`undefined` \| [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`T`\>\> - -##### Type Parameters - -• **T** *extends* [`JSONValue`](../type-aliases/JSONValue.md) - -##### Parameters - -###### key - -`string` - -##### Returns - -`Promise`\<`undefined` \| [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`T`\>\> - -*** - -### has() - -> **has**(`key`): `Promise`\<`boolean`\> - -Determines if a single `key` is present in the database. - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`boolean`\> - -*** - -### isEmpty() - -> **isEmpty**(): `Promise`\<`boolean`\> - -Whether the database is empty. - -#### Returns - -`Promise`\<`boolean`\> - -*** - -### scan() - -#### Call Signature - -> **scan**(`options`): [`ScanResult`](ScanResult.md)\<[`IndexKey`](../type-aliases/IndexKey.md), [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -Gets many values from the database. This returns a [ScanResult](ScanResult.md) which -implements `AsyncIterable`. It also has methods to iterate over the -[keys](ScanResult.md#keys) and [entries](ScanResult.md#entries). - -If `options` has an `indexName`, then this does a scan over an index with -that name. A scan over an index uses a tuple for the key consisting of -`[secondary: string, primary: string]`. - -If the [ScanResult](ScanResult.md) is used after the `ReadTransaction` has been closed -it will throw a [TransactionClosedError](../classes/TransactionClosedError.md). - -Important: The returned JSON is readonly and should not be modified. This -is only enforced statically by TypeScript and there are no runtime checks -for performance reasons. If you mutate the return value you will get -undefined behavior. - -##### Parameters - -###### options - -[`ScanIndexOptions`](../type-aliases/ScanIndexOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<[`IndexKey`](../type-aliases/IndexKey.md), [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -#### Call Signature - -> **scan**(`options`?): [`ScanResult`](ScanResult.md)\<`string`, [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -##### Parameters - -###### options? - -[`ScanNoIndexOptions`](../type-aliases/ScanNoIndexOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<`string`, [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -#### Call Signature - -> **scan**(`options`?): [`ScanResult`](ScanResult.md)\<`string` \| [`IndexKey`](../type-aliases/IndexKey.md), [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -##### Parameters - -###### options? - -[`ScanOptions`](../type-aliases/ScanOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<`string` \| [`IndexKey`](../type-aliases/IndexKey.md), [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -#### Call Signature - -> **scan**\<`V`\>(`options`): [`ScanResult`](ScanResult.md)\<[`IndexKey`](../type-aliases/IndexKey.md), [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Type Parameters - -• **V** *extends* [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -##### Parameters - -###### options - -[`ScanIndexOptions`](../type-aliases/ScanIndexOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<[`IndexKey`](../type-aliases/IndexKey.md), [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -#### Call Signature - -> **scan**\<`V`\>(`options`?): [`ScanResult`](ScanResult.md)\<`string`, [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Type Parameters - -• **V** *extends* [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -##### Parameters - -###### options? - -[`ScanNoIndexOptions`](../type-aliases/ScanNoIndexOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<`string`, [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -#### Call Signature - -> **scan**\<`V`\>(`options`?): [`ScanResult`](ScanResult.md)\<`string` \| [`IndexKey`](../type-aliases/IndexKey.md), [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Type Parameters - -• **V** *extends* [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -##### Parameters - -###### options? - -[`ScanOptions`](../type-aliases/ScanOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<`string` \| [`IndexKey`](../type-aliases/IndexKey.md), [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> diff --git a/packages/replicache-doc/docs/api/interfaces/ReplicacheOptions.md b/packages/replicache-doc/docs/api/interfaces/ReplicacheOptions.md deleted file mode 100644 index 71af206a3..000000000 --- a/packages/replicache-doc/docs/api/interfaces/ReplicacheOptions.md +++ /dev/null @@ -1,274 +0,0 @@ -# Interface: ReplicacheOptions\ - -The options passed to [Replicache](../classes/Replicache.md). - -## Type Parameters - -• **MD** *extends* [`MutatorDefs`](../type-aliases/MutatorDefs.md) - -## Properties - -### auth? - -> `optional` **auth**: `string` - -This is the authorization token used when doing a -[pull](https://doc.replicache.dev/reference/server-pull#authorization) and -[push](https://doc.replicache.dev/reference/server-push#authorization). - -*** - -### clientMaxAgeMs? - -> `optional` **clientMaxAgeMs**: `number` - -The maximum age of a client in milliseconds. If a client hasn't been seen -and has no pending mutations for this long, it will be removed from the -cache. Default is 24 hours. - -This means that this is the maximum time a tab can be in the background -(frozen or in fbcache) and still be able to sync when it comes back to the -foreground. If tab comes back after this time the -onClientStateNotFound callback is called on the Replicache -instance. - -*** - -### indexes? - -> `readonly` `optional` **indexes**: [`IndexDefinitions`](../type-aliases/IndexDefinitions.md) - -Defines the indexes, if any, to use on the data. - -*** - -### kvStore? - -> `optional` **kvStore**: [`KVStoreProvider`](../type-aliases/KVStoreProvider.md) \| `"mem"` \| `"idb"` - -Allows providing a custom implementation of the underlying storage layer. - -*** - -### ~~licenseKey?~~ - -> `optional` **licenseKey**: `string` - -#### Deprecated - -Replicache no longer uses a license key. This option is now -ignored and will be removed in a future release. - -*** - -### logLevel? - -> `optional` **logLevel**: [`LogLevel`](../type-aliases/LogLevel.md) - -Determines how much logging to do. When this is set to `'debug'`, -Replicache will also log `'info'` and `'error'` messages. When set to -`'info'` we log `'info'` and `'error'` but not `'debug'`. When set to -`'error'` we only log `'error'` messages. -Default is `'info'`. - -*** - -### logSinks? - -> `optional` **logSinks**: [`LogSink`](LogSink.md)[] - -Enables custom handling of logs. - -By default logs are logged to the console. If you would like logs to be -sent elsewhere (e.g. to a cloud logging service like DataDog) you can -provide an array of [LogSink](LogSink.md)s. Logs at or above -[ReplicacheOptions.logLevel](ReplicacheOptions.md#loglevel) are sent to each of these [LogSink](LogSink.md)s. -If you would still like logs to go to the console, include -`consoleLogSink` in the array. - -```ts -logSinks: [consoleLogSink, myCloudLogSink], -``` - -*** - -### mutators? - -> `optional` **mutators**: `MD` - -An object used as a map to define the *mutators*. These gets registered at -startup of [Replicache](../classes/Replicache.md). - -*Mutators* are used to make changes to the data. - -#### Example - -The registered *mutations* are reflected on the -[mutate](../classes/Replicache.md#mutate) property of the [Replicache](../classes/Replicache.md) instance. - -```ts -const rep = new Replicache({ - name: 'user-id', - mutators: { - async createTodo(tx: WriteTransaction, args: JSONValue) { - const key = `/todo/${args.id}`; - if (await tx.has(key)) { - throw new Error('Todo already exists'); - } - await tx.set(key, args); - }, - async deleteTodo(tx: WriteTransaction, id: number) { - ... - }, - }, -}); -``` - -This will create the function to later use: - -```ts -await rep.mutate.createTodo({ - id: 1234, - title: 'Make things work offline', - complete: true, -}); -``` - -#### Replays - -*Mutators* run once when they are initially invoked, but they might also be -*replayed* multiple times during sync. As such *mutators* should not modify -application state directly. Also, it is important that the set of -registered mutator names only grows over time. If Replicache syncs and -needed *mutator* is not registered, it will substitute a no-op mutator, but -this might be a poor user experience. - -#### Server application - -During push, a description of each mutation is sent to the server's [push -endpoint](https://doc.replicache.dev/reference/server-push) where it is applied. Once -the *mutation* has been applied successfully, as indicated by the client -view's -[`lastMutationId`](https://doc.replicache.dev/reference/server-pull#lastmutationid) -field, the local version of the *mutation* is removed. See the [design -doc](https://doc.replicache.dev/design#commits) for additional details on -the sync protocol. - -#### Transactionality - -*Mutators* are atomic: all their changes are applied together, or none are. -Throwing an exception aborts the transaction. Otherwise, it is committed. -As with query and subscribe all reads will see a consistent view of -the cache while they run. - -*** - -### name - -> **name**: `string` - -The name of the Replicache database. - -It is important to use user specific names so that if there are multiple -tabs open for different distinct users their data is kept separate. - -For efficiency and performance, a new [Replicache](../classes/Replicache.md) instance will -initialize its state from the persisted state of an existing [Replicache](../classes/Replicache.md) -instance with the same `name`, domain and browser profile. - -Mutations from one [Replicache](../classes/Replicache.md) instance may be pushed using the -[ReplicacheOptions.auth](ReplicacheOptions.md#auth), [ReplicacheOptions.pushURL](ReplicacheOptions.md#pushurl), -[ReplicacheOptions.pullURL](ReplicacheOptions.md#pullurl), [ReplicacheOptions.pusher](ReplicacheOptions.md#pusher), and -[ReplicacheOptions.puller](ReplicacheOptions.md#puller) of another Replicache instance with the same -`name`, domain and browser profile. - -You can use multiple Replicache instances for the same user as long as the -names are unique. e.g. `name: `$userID:$roomID` - -*** - -### puller? - -> `optional` **puller**: [`Puller`](../type-aliases/Puller.md) - -Allows passing in a custom implementation of a [Puller](../type-aliases/Puller.md) function. This -function is called when doing a pull and it is responsible for -communicating with the server. - -Normally, this is just a POST to a URL with a JSON body but you can provide -your own function if you need to do things differently. - -*** - -### pullInterval? - -> `optional` **pullInterval**: `null` \| `number` - -The duration between each pull in milliseconds. Set this to `null` to -prevent pulling in the background. Defaults to 60 seconds. - -*** - -### pullURL? - -> `optional` **pullURL**: `string` - -This is the URL to the server endpoint dealing with pull. See [Pull -Endpoint Reference](https://doc.replicache.dev/reference/server-pull) for more -details. - -If not provided, pull requests will not be made unless a custom -[ReplicacheOptions.puller](ReplicacheOptions.md#puller) is provided. - -*** - -### pushDelay? - -> `optional` **pushDelay**: `number` - -The delay between when a change is made to Replicache and when Replicache -attempts to push that change. - -*** - -### pusher? - -> `optional` **pusher**: [`Pusher`](../type-aliases/Pusher.md) - -Allows passing in a custom implementation of a [Pusher](../type-aliases/Pusher.md) function. This -function is called when doing a push and it is responsible for -communicating with the server. - -Normally, this is just a POST to a URL with a JSON body but you can provide -your own function if you need to do things differently. - -*** - -### pushURL? - -> `optional` **pushURL**: `string` - -This is the URL to the server endpoint dealing with the push updates. See -[Push Endpoint Reference](https://doc.replicache.dev/reference/server-push) for more -details. - -If not provided, push requests will not be made unless a custom -[ReplicacheOptions.pusher](ReplicacheOptions.md#pusher) is provided. - -*** - -### requestOptions? - -> `optional` **requestOptions**: [`RequestOptions`](RequestOptions.md) - -Options to use when doing pull and push requests. - -*** - -### schemaVersion? - -> `optional` **schemaVersion**: `string` - -The schema version of the data understood by this application. This enables -versioning of mutators (in the push direction) and the client view (in the -pull direction). diff --git a/packages/replicache-doc/docs/api/interfaces/RequestOptions.md b/packages/replicache-doc/docs/api/interfaces/RequestOptions.md deleted file mode 100644 index 9ecf713a7..000000000 --- a/packages/replicache-doc/docs/api/interfaces/RequestOptions.md +++ /dev/null @@ -1,19 +0,0 @@ -# Interface: RequestOptions - -## Properties - -### maxDelayMs? - -> `optional` **maxDelayMs**: `number` - -When there are pending pull or push requests this is the _maximum_ amount -of time to wait until we try another pull/push. - -*** - -### minDelayMs? - -> `optional` **minDelayMs**: `number` - -When there are pending pull or push requests this is the _minimum_ amount -of time to wait until we try another pull/push. diff --git a/packages/replicache-doc/docs/api/interfaces/ScanResult.md b/packages/replicache-doc/docs/api/interfaces/ScanResult.md deleted file mode 100644 index d2290533d..000000000 --- a/packages/replicache-doc/docs/api/interfaces/ScanResult.md +++ /dev/null @@ -1,80 +0,0 @@ -# Interface: ScanResult\ - -## Extends - -- `AsyncIterable`\<`V`\> - -## Type Parameters - -• **K** *extends* `ScanKey` - -• **V** - -## Methods - -### \[asyncIterator\]() - -> **\[asyncIterator\]**(): [`AsyncIterableIteratorToArray`](AsyncIterableIteratorToArray.md)\<`V`\> - -The default AsyncIterable. This is the same as [values](ScanResult.md#values). - -#### Returns - -[`AsyncIterableIteratorToArray`](AsyncIterableIteratorToArray.md)\<`V`\> - -#### Overrides - -`AsyncIterable.[asyncIterator]` - -*** - -### entries() - -> **entries**(): [`AsyncIterableIteratorToArray`](AsyncIterableIteratorToArray.md)\ - -Async iterator over the entries of the [scan](ReadTransaction.md#scan) -call. An entry is a tuple of key values. If the -[scan](ReadTransaction.md#scan) is over an index the key is a tuple of -`[secondaryKey: string, primaryKey]` - -#### Returns - -[`AsyncIterableIteratorToArray`](AsyncIterableIteratorToArray.md)\ - -*** - -### keys() - -> **keys**(): [`AsyncIterableIteratorToArray`](AsyncIterableIteratorToArray.md)\<`K`\> - -Async iterator over the keys of the [scan](ReadTransaction.md#scan) -call. If the [scan](ReadTransaction.md#scan) is over an index the key -is a tuple of `[secondaryKey: string, primaryKey]` - -#### Returns - -[`AsyncIterableIteratorToArray`](AsyncIterableIteratorToArray.md)\<`K`\> - -*** - -### toArray() - -> **toArray**(): `Promise`\<`V`[]\> - -Returns all the values as an array. Same as `values().toArray()` - -#### Returns - -`Promise`\<`V`[]\> - -*** - -### values() - -> **values**(): [`AsyncIterableIteratorToArray`](AsyncIterableIteratorToArray.md)\<`V`\> - -Async iterator over the values of the [scan](ReadTransaction.md#scan) call. - -#### Returns - -[`AsyncIterableIteratorToArray`](AsyncIterableIteratorToArray.md)\<`V`\> diff --git a/packages/replicache-doc/docs/api/interfaces/SubscribeOptions.md b/packages/replicache-doc/docs/api/interfaces/SubscribeOptions.md deleted file mode 100644 index cf1e55df2..000000000 --- a/packages/replicache-doc/docs/api/interfaces/SubscribeOptions.md +++ /dev/null @@ -1,79 +0,0 @@ -# Interface: SubscribeOptions\ - -The options passed to [Replicache.subscribe](../classes/Replicache.md#subscribe). - -## Type Parameters - -• **R** - -## Properties - -### isEqual()? - -> `optional` **isEqual**: (`a`, `b`) => `boolean` - -If present this function is used to determine if the value returned by the -body function has changed. If not provided a JSON deep equality check is -used. - -#### Parameters - -##### a - -`R` - -##### b - -`R` - -#### Returns - -`boolean` - -*** - -### onData() - -> **onData**: (`result`) => `void` - -Called when the return value of the body function changes. - -#### Parameters - -##### result - -`R` - -#### Returns - -`void` - -*** - -### onDone()? - -> `optional` **onDone**: () => `void` - -If present, called when the subscription is removed/done. - -#### Returns - -`void` - -*** - -### onError()? - -> `optional` **onError**: (`error`) => `void` - -If present, called when an error occurs. - -#### Parameters - -##### error - -`unknown` - -#### Returns - -`void` diff --git a/packages/replicache-doc/docs/api/interfaces/WriteTransaction.md b/packages/replicache-doc/docs/api/interfaces/WriteTransaction.md deleted file mode 100644 index f9df8eb49..000000000 --- a/packages/replicache-doc/docs/api/interfaces/WriteTransaction.md +++ /dev/null @@ -1,355 +0,0 @@ -# Interface: WriteTransaction - -WriteTransactions are used with *mutators* which are registered using -[ReplicacheOptions.mutators](ReplicacheOptions.md#mutators) and allows read and write operations on the -database. - -## Extends - -- [`ReadTransaction`](ReadTransaction.md) - -## Properties - -### clientID - -> `readonly` **clientID**: `string` - -#### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`clientID`](ReadTransaction.md#clientid) - -*** - -### ~~environment~~ - -> `readonly` **environment**: [`TransactionEnvironment`](../type-aliases/TransactionEnvironment.md) - -#### Deprecated - -Use [ReadTransaction.location](ReadTransaction.md#location) instead. - -#### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`environment`](ReadTransaction.md#environment) - -*** - -### location - -> `readonly` **location**: [`TransactionEnvironment`](../type-aliases/TransactionEnvironment.md) - -#### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`location`](ReadTransaction.md#location) - -*** - -### mutationID - -> `readonly` **mutationID**: `number` - -The ID of the mutation that is being applied. - -*** - -### reason - -> `readonly` **reason**: [`TransactionReason`](../type-aliases/TransactionReason.md) - -The reason for the transaction. This can be `initial`, `rebase` or `authoriative`. - -## Methods - -### del() - -> **del**(`key`): `Promise`\<`boolean`\> - -Removes a `key` and its value from the database. Returns `true` if there was a -`key` to remove. - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`boolean`\> - -*** - -### get() - -#### Call Signature - -> **get**(`key`): `Promise`\<`undefined` \| [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -Get a single value from the database. If the `key` is not present this -returns `undefined`. - -Important: The returned JSON is readonly and should not be modified. This -is only enforced statically by TypeScript and there are no runtime checks -for performance reasons. If you mutate the return value you will get -undefined behavior. - -##### Parameters - -###### key - -`string` - -##### Returns - -`Promise`\<`undefined` \| [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -##### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`get`](ReadTransaction.md#get) - -#### Call Signature - -> **get**\<`T`\>(`key`): `Promise`\<`undefined` \| [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`T`\>\> - -##### Type Parameters - -• **T** *extends* [`JSONValue`](../type-aliases/JSONValue.md) - -##### Parameters - -###### key - -`string` - -##### Returns - -`Promise`\<`undefined` \| [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`T`\>\> - -##### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`get`](ReadTransaction.md#get) - -*** - -### has() - -> **has**(`key`): `Promise`\<`boolean`\> - -Determines if a single `key` is present in the database. - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`boolean`\> - -#### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`has`](ReadTransaction.md#has) - -*** - -### isEmpty() - -> **isEmpty**(): `Promise`\<`boolean`\> - -Whether the database is empty. - -#### Returns - -`Promise`\<`boolean`\> - -#### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`isEmpty`](ReadTransaction.md#isempty) - -*** - -### ~~put()~~ - -> **put**(`key`, `value`): `Promise`\<`void`\> - -#### Parameters - -##### key - -`string` - -##### value - -[`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -#### Returns - -`Promise`\<`void`\> - -#### Deprecated - -Use [WriteTransaction.set](WriteTransaction.md#set) instead. - -*** - -### scan() - -#### Call Signature - -> **scan**(`options`): [`ScanResult`](ScanResult.md)\<[`IndexKey`](../type-aliases/IndexKey.md), [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -Gets many values from the database. This returns a [ScanResult](ScanResult.md) which -implements `AsyncIterable`. It also has methods to iterate over the -[keys](ScanResult.md#keys) and [entries](ScanResult.md#entries). - -If `options` has an `indexName`, then this does a scan over an index with -that name. A scan over an index uses a tuple for the key consisting of -`[secondary: string, primary: string]`. - -If the [ScanResult](ScanResult.md) is used after the `ReadTransaction` has been closed -it will throw a [TransactionClosedError](../classes/TransactionClosedError.md). - -Important: The returned JSON is readonly and should not be modified. This -is only enforced statically by TypeScript and there are no runtime checks -for performance reasons. If you mutate the return value you will get -undefined behavior. - -##### Parameters - -###### options - -[`ScanIndexOptions`](../type-aliases/ScanIndexOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<[`IndexKey`](../type-aliases/IndexKey.md), [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -##### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`scan`](ReadTransaction.md#scan) - -#### Call Signature - -> **scan**(`options`?): [`ScanResult`](ScanResult.md)\<`string`, [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -##### Parameters - -###### options? - -[`ScanNoIndexOptions`](../type-aliases/ScanNoIndexOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<`string`, [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -##### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`scan`](ReadTransaction.md#scan) - -#### Call Signature - -> **scan**(`options`?): [`ScanResult`](ScanResult.md)\<`string` \| [`IndexKey`](../type-aliases/IndexKey.md), [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -##### Parameters - -###### options? - -[`ScanOptions`](../type-aliases/ScanOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<`string` \| [`IndexKey`](../type-aliases/IndexKey.md), [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md)\> - -##### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`scan`](ReadTransaction.md#scan) - -#### Call Signature - -> **scan**\<`V`\>(`options`): [`ScanResult`](ScanResult.md)\<[`IndexKey`](../type-aliases/IndexKey.md), [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Type Parameters - -• **V** *extends* [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -##### Parameters - -###### options - -[`ScanIndexOptions`](../type-aliases/ScanIndexOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<[`IndexKey`](../type-aliases/IndexKey.md), [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`scan`](ReadTransaction.md#scan) - -#### Call Signature - -> **scan**\<`V`\>(`options`?): [`ScanResult`](ScanResult.md)\<`string`, [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Type Parameters - -• **V** *extends* [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -##### Parameters - -###### options? - -[`ScanNoIndexOptions`](../type-aliases/ScanNoIndexOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<`string`, [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`scan`](ReadTransaction.md#scan) - -#### Call Signature - -> **scan**\<`V`\>(`options`?): [`ScanResult`](ScanResult.md)\<`string` \| [`IndexKey`](../type-aliases/IndexKey.md), [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Type Parameters - -• **V** *extends* [`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -##### Parameters - -###### options? - -[`ScanOptions`](../type-aliases/ScanOptions.md) - -##### Returns - -[`ScanResult`](ScanResult.md)\<`string` \| [`IndexKey`](../type-aliases/IndexKey.md), [`DeepReadonly`](../type-aliases/DeepReadonly.md)\<`V`\>\> - -##### Inherited from - -[`ReadTransaction`](ReadTransaction.md).[`scan`](ReadTransaction.md#scan) - -*** - -### set() - -> **set**(`key`, `value`): `Promise`\<`void`\> - -Sets a single `value` in the database. The value will be frozen (using -`Object.freeze`) in debug mode. - -#### Parameters - -##### key - -`string` - -##### value - -[`ReadonlyJSONValue`](../type-aliases/ReadonlyJSONValue.md) - -#### Returns - -`Promise`\<`void`\> diff --git a/packages/replicache-doc/docs/api/type-aliases/ClientGroupID.md b/packages/replicache-doc/docs/api/type-aliases/ClientGroupID.md deleted file mode 100644 index e49ae2294..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ClientGroupID.md +++ /dev/null @@ -1,6 +0,0 @@ -# Type Alias: ClientGroupID - -> **ClientGroupID**: `string` - -The ID describing a group of clients. All clients in the same group share a -persistent storage (IDB). diff --git a/packages/replicache-doc/docs/api/type-aliases/ClientID.md b/packages/replicache-doc/docs/api/type-aliases/ClientID.md deleted file mode 100644 index 8e13f8a47..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ClientID.md +++ /dev/null @@ -1,5 +0,0 @@ -# Type Alias: ClientID - -> **ClientID**: `string` - -The ID describing a client. diff --git a/packages/replicache-doc/docs/api/type-aliases/ClientStateNotFoundResponse.md b/packages/replicache-doc/docs/api/type-aliases/ClientStateNotFoundResponse.md deleted file mode 100644 index 7bba34c79..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ClientStateNotFoundResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# Type Alias: ClientStateNotFoundResponse - -> **ClientStateNotFoundResponse**: `object` - -In certain scenarios the server can signal that it does not know about the -client. For example, the server might have lost all of its state (this might -happen during the development of the server). - -## Type declaration - -### error - -> **error**: `"ClientStateNotFound"` diff --git a/packages/replicache-doc/docs/api/type-aliases/Cookie.md b/packages/replicache-doc/docs/api/type-aliases/Cookie.md deleted file mode 100644 index d1dc838fc..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/Cookie.md +++ /dev/null @@ -1,16 +0,0 @@ -# Type Alias: Cookie - -> **Cookie**: `null` \| `string` \| `number` \| [`ReadonlyJSONValue`](ReadonlyJSONValue.md) & `object` - -A cookie is a value that is used to determine the order of snapshots. It -needs to be comparable. This can be a `string`, `number` or if you want to -use a more complex value, you can use an object with an `order` property. The -value `null` is considered to be less than any other cookie and it is used -for the first pull when no cookie has been set. - -The order is the natural order of numbers and strings. If one of the cookies -is an object then the value of the `order` property is treated as the cookie -when doing comparison. - -If one of the cookies is a string and the other is a number, the number is -fist converted to a string (using `toString()`). diff --git a/packages/replicache-doc/docs/api/type-aliases/CreateIndexDefinition.md b/packages/replicache-doc/docs/api/type-aliases/CreateIndexDefinition.md deleted file mode 100644 index 8082b7092..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/CreateIndexDefinition.md +++ /dev/null @@ -1,9 +0,0 @@ -# Type Alias: CreateIndexDefinition - -> **CreateIndexDefinition**: [`IndexDefinition`](IndexDefinition.md) & `object` - -## Type declaration - -### name - -> **name**: `string` diff --git a/packages/replicache-doc/docs/api/type-aliases/CreateKVStore.md b/packages/replicache-doc/docs/api/type-aliases/CreateKVStore.md deleted file mode 100644 index 98ee57d6d..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/CreateKVStore.md +++ /dev/null @@ -1,19 +0,0 @@ -# Type Alias: CreateKVStore() - -> **CreateKVStore**: (`name`) => [`KVStore`](../interfaces/KVStore.md) - -Factory function for creating [Store](../interfaces/KVStore.md) 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 RWLock. - -## Parameters - -### name - -`string` - -## Returns - -[`KVStore`](../interfaces/KVStore.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/DeepReadonly.md b/packages/replicache-doc/docs/api/type-aliases/DeepReadonly.md deleted file mode 100644 index 2e0f50e91..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/DeepReadonly.md +++ /dev/null @@ -1,9 +0,0 @@ -# Type Alias: DeepReadonly\ - -> **DeepReadonly**\<`T`\>: `T` *extends* `null` \| `boolean` \| `string` \| `number` \| `undefined` ? `T` : [`DeepReadonlyObject`](DeepReadonlyObject.md)\<`T`\> - -Basic deep readonly type. It works for [JSONValue](JSONValue.md). - -## Type Parameters - -• **T** diff --git a/packages/replicache-doc/docs/api/type-aliases/DeepReadonlyObject.md b/packages/replicache-doc/docs/api/type-aliases/DeepReadonlyObject.md deleted file mode 100644 index 6e8ffa6c4..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/DeepReadonlyObject.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: DeepReadonlyObject\ - -> **DeepReadonlyObject**\<`T`\>: `{ readonly [K in keyof T]: DeepReadonly }` - -## Type Parameters - -• **T** diff --git a/packages/replicache-doc/docs/api/type-aliases/DropDatabaseOptions.md b/packages/replicache-doc/docs/api/type-aliases/DropDatabaseOptions.md deleted file mode 100644 index 8a5b659b8..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/DropDatabaseOptions.md +++ /dev/null @@ -1,42 +0,0 @@ -# Type Alias: DropDatabaseOptions - -> **DropDatabaseOptions**: `object` - -Options for `dropDatabase` and `dropAllDatabases`. - -## Type declaration - -### kvStore? - -> `optional` **kvStore**: `"idb"` \| `"mem"` \| [`KVStoreProvider`](KVStoreProvider.md) - -Allows providing a custom implementation of the underlying storage layer. -Default is `'idb'`. - -### logLevel? - -> `optional` **logLevel**: [`LogLevel`](LogLevel.md) - -Determines how much logging to do. When this is set to `'debug'`, -Replicache will also log `'info'` and `'error'` messages. When set to -`'info'` we log `'info'` and `'error'` but not `'debug'`. When set to -`'error'` we only log `'error'` messages. -Default is `'info'`. - -### logSinks? - -> `optional` **logSinks**: [`LogSink`](../interfaces/LogSink.md)[] - -Enables custom handling of logs. - -By default logs are logged to the console. If you would like logs to be -sent elsewhere (e.g. to a cloud logging service like DataDog) you can -provide an array of [LogSink](../interfaces/LogSink.md)s. Logs at or above -[DropDatabaseOptions.logLevel](DropDatabaseOptions.md#loglevel) are sent to each of these [LogSink](../interfaces/LogSink.md)s. -If you would still like logs to go to the console, include -`consoleLogSink` in the array. - -```ts -logSinks: [consoleLogSink, myCloudLogSink], -``` -Default is `[consoleLogSink]`. diff --git a/packages/replicache-doc/docs/api/type-aliases/DropKVStore.md b/packages/replicache-doc/docs/api/type-aliases/DropKVStore.md deleted file mode 100644 index 68d79e1e1..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/DropKVStore.md +++ /dev/null @@ -1,18 +0,0 @@ -# Type Alias: DropKVStore() - -> **DropKVStore**: (`name`) => `Promise`\<`void`\> - -Function for deleting [Store](../interfaces/KVStore.md) instances. - -The name is used to identify the store. If the same name is used for multiple -stores, they should share the same data. - -## Parameters - -### name - -`string` - -## Returns - -`Promise`\<`void`\> diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiff.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiff.md deleted file mode 100644 index 4c9036d64..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiff.md +++ /dev/null @@ -1,10 +0,0 @@ -# Type Alias: ExperimentalDiff - -> **ExperimentalDiff**: [`ExperimentalIndexDiff`](ExperimentalIndexDiff.md) \| [`ExperimentalNoIndexDiff`](ExperimentalNoIndexDiff.md) - -**`Experimental`** - -Describes the changes that happened to Replicache after a -[WriteTransaction](../interfaces/WriteTransaction.md) was committed. - - This type is experimental and may change in the future. diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperation.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperation.md deleted file mode 100644 index e8a95e206..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperation.md +++ /dev/null @@ -1,17 +0,0 @@ -# Type Alias: ExperimentalDiffOperation\ - -> **ExperimentalDiffOperation**\<`Key`\>: [`ExperimentalDiffOperationAdd`](ExperimentalDiffOperationAdd.md)\<`Key`\> \| [`ExperimentalDiffOperationDel`](ExperimentalDiffOperationDel.md)\<`Key`\> \| [`ExperimentalDiffOperationChange`](ExperimentalDiffOperationChange.md)\<`Key`\> - -**`Experimental`** - -The individual parts describing the changes that happened to the Replicache -data. There are three different kinds of operations: -- `add`: A new entry was added. -- `del`: An entry was deleted. -- `change`: An entry was changed. - - This type is experimental and may change in the future. - -## Type Parameters - -• **Key** diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationAdd.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationAdd.md deleted file mode 100644 index 93fdb83b1..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationAdd.md +++ /dev/null @@ -1,23 +0,0 @@ -# Type Alias: ExperimentalDiffOperationAdd\ - -> **ExperimentalDiffOperationAdd**\<`Key`, `Value`\>: `object` - -## Type Parameters - -• **Key** - -• **Value** = [`ReadonlyJSONValue`](ReadonlyJSONValue.md) - -## Type declaration - -### key - -> `readonly` **key**: `Key` - -### newValue - -> `readonly` **newValue**: `Value` - -### op - -> `readonly` **op**: `"add"` diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationChange.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationChange.md deleted file mode 100644 index 7ec369f83..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationChange.md +++ /dev/null @@ -1,27 +0,0 @@ -# Type Alias: ExperimentalDiffOperationChange\ - -> **ExperimentalDiffOperationChange**\<`Key`, `Value`\>: `object` - -## Type Parameters - -• **Key** - -• **Value** = [`ReadonlyJSONValue`](ReadonlyJSONValue.md) - -## Type declaration - -### key - -> `readonly` **key**: `Key` - -### newValue - -> `readonly` **newValue**: `Value` - -### oldValue - -> `readonly` **oldValue**: `Value` - -### op - -> `readonly` **op**: `"change"` diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationDel.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationDel.md deleted file mode 100644 index 5cebe0d71..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalDiffOperationDel.md +++ /dev/null @@ -1,23 +0,0 @@ -# Type Alias: ExperimentalDiffOperationDel\ - -> **ExperimentalDiffOperationDel**\<`Key`, `Value`\>: `object` - -## Type Parameters - -• **Key** - -• **Value** = [`ReadonlyJSONValue`](ReadonlyJSONValue.md) - -## Type declaration - -### key - -> `readonly` **key**: `Key` - -### oldValue - -> `readonly` **oldValue**: `Value` - -### op - -> `readonly` **op**: `"del"` diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalIndexDiff.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalIndexDiff.md deleted file mode 100644 index ec3b022f7..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalIndexDiff.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: ExperimentalIndexDiff - -> **ExperimentalIndexDiff**: readonly [`ExperimentalDiffOperation`](ExperimentalDiffOperation.md)\<[`IndexKey`](IndexKey.md)\>[] - -**`Experimental`** - -This type is experimental and may change in the future. diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalNoIndexDiff.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalNoIndexDiff.md deleted file mode 100644 index 799544ce2..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalNoIndexDiff.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: ExperimentalNoIndexDiff - -> **ExperimentalNoIndexDiff**: readonly [`ExperimentalDiffOperation`](ExperimentalDiffOperation.md)\<`string`\>[] - -**`Experimental`** - -This type is experimental and may change in the future. diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchCallbackForOptions.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchCallbackForOptions.md deleted file mode 100644 index b952fa849..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchCallbackForOptions.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: ExperimentalWatchCallbackForOptions\ - -> **ExperimentalWatchCallbackForOptions**\<`Options`\>: `Options` *extends* [`ExperimentalWatchIndexOptions`](ExperimentalWatchIndexOptions.md) ? [`ExperimentalWatchIndexCallback`](ExperimentalWatchIndexCallback.md) : [`ExperimentalWatchNoIndexCallback`](ExperimentalWatchNoIndexCallback.md) - -## Type Parameters - -• **Options** *extends* [`ExperimentalWatchOptions`](ExperimentalWatchOptions.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchIndexCallback.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchIndexCallback.md deleted file mode 100644 index 28c34b1d9..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchIndexCallback.md +++ /dev/null @@ -1,21 +0,0 @@ -# Type Alias: ExperimentalWatchIndexCallback() - -> **ExperimentalWatchIndexCallback**: (`diff`) => `void` - -**`Experimental`** - -Function that gets passed into [Replicache.experimentalWatch](../classes/Replicache.md#experimentalwatch) when doing a -watch on a secondary index map and gets called when the data in Replicache -changes. - - This type is experimental and may change in the future. - -## Parameters - -### diff - -[`ExperimentalIndexDiff`](ExperimentalIndexDiff.md) - -## Returns - -`void` diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchIndexOptions.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchIndexOptions.md deleted file mode 100644 index 30a6d1f9b..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchIndexOptions.md +++ /dev/null @@ -1,14 +0,0 @@ -# Type Alias: ExperimentalWatchIndexOptions - -> **ExperimentalWatchIndexOptions**: [`ExperimentalWatchNoIndexOptions`](ExperimentalWatchNoIndexOptions.md) & `object` - -Options object passed to [Replicache.experimentalWatch](../classes/Replicache.md#experimentalwatch). This is for an -index watch. - -## Type declaration - -### indexName - -> **indexName**: `string` - -When provided, the `watch` is limited to the changes that apply to the index map. diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchNoIndexCallback.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchNoIndexCallback.md deleted file mode 100644 index d3585dc0f..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchNoIndexCallback.md +++ /dev/null @@ -1,20 +0,0 @@ -# Type Alias: ExperimentalWatchNoIndexCallback() - -> **ExperimentalWatchNoIndexCallback**: (`diff`) => `void` - -**`Experimental`** - -Function that gets passed into [Replicache.experimentalWatch](../classes/Replicache.md#experimentalwatch) and gets -called when the data in Replicache changes. - - This type is experimental and may change in the future. - -## Parameters - -### diff - -[`ExperimentalNoIndexDiff`](ExperimentalNoIndexDiff.md) - -## Returns - -`void` diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchNoIndexOptions.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchNoIndexOptions.md deleted file mode 100644 index bf9a48b26..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchNoIndexOptions.md +++ /dev/null @@ -1,24 +0,0 @@ -# Type Alias: ExperimentalWatchNoIndexOptions - -> **ExperimentalWatchNoIndexOptions**: `object` - -Options object passed to [Replicache.experimentalWatch](../classes/Replicache.md#experimentalwatch). This is for a non -index watch. - -## Type declaration - -### initialValuesInFirstDiff? - -> `optional` **initialValuesInFirstDiff**: `boolean` - -When this is set to `true` (default is `false`), the `watch` callback will -be called once asynchronously when watch is called. The arguments in that -case is a diff where we consider all the existing values in Replicache as -being added. - -### prefix? - -> `optional` **prefix**: `string` - -When provided, the `watch` is limited to changes where the `key` starts -with `prefix`. diff --git a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchOptions.md b/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchOptions.md deleted file mode 100644 index 4d4dfc906..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ExperimentalWatchOptions.md +++ /dev/null @@ -1,9 +0,0 @@ -# Type Alias: ExperimentalWatchOptions - -> **ExperimentalWatchOptions**: [`ExperimentalWatchIndexOptions`](ExperimentalWatchIndexOptions.md) \| [`ExperimentalWatchNoIndexOptions`](ExperimentalWatchNoIndexOptions.md) - -**`Experimental`** - -Options for [Replicache.experimentalWatch](../classes/Replicache.md#experimentalwatch). - - This interface is experimental and may change in the future. diff --git a/packages/replicache-doc/docs/api/type-aliases/GetIndexScanIterator.md b/packages/replicache-doc/docs/api/type-aliases/GetIndexScanIterator.md deleted file mode 100644 index 55c70751b..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/GetIndexScanIterator.md +++ /dev/null @@ -1,34 +0,0 @@ -# Type Alias: GetIndexScanIterator() - -> **GetIndexScanIterator**: (`indexName`, `fromSecondaryKey`, `fromPrimaryKey`) => [`IterableUnion`](IterableUnion.md)\ - -When using [makeScanResult](../functions/makeScanResult.md) this is the type used for the function called when doing a [scan](../interfaces/ReadTransaction.md#scan) with an -`indexName`. - -## Parameters - -### indexName - -`string` - -The name of the index we are scanning over. - -### fromSecondaryKey - -`string` - -The `fromSecondaryKey` is computed by `scan` and is -the secondary key of the first entry to return in the iterator. It is based -on `prefix` and `start.key` of the [ScanIndexOptions](ScanIndexOptions.md). - -### fromPrimaryKey - -The `fromPrimaryKey` is computed by `scan` and is the -primary key of the first entry to return in the iterator. It is based on -`prefix` and `start.key` of the [ScanIndexOptions](ScanIndexOptions.md). - -`string` | `undefined` - -## Returns - -[`IterableUnion`](IterableUnion.md)\ diff --git a/packages/replicache-doc/docs/api/type-aliases/GetScanIterator.md b/packages/replicache-doc/docs/api/type-aliases/GetScanIterator.md deleted file mode 100644 index 8850ebf06..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/GetScanIterator.md +++ /dev/null @@ -1,20 +0,0 @@ -# Type Alias: GetScanIterator() - -> **GetScanIterator**: (`fromKey`) => [`IterableUnion`](IterableUnion.md)\<`Entry`\<[`ReadonlyJSONValue`](ReadonlyJSONValue.md)\>\> - -This is called when doing a [scan](../interfaces/ReadTransaction.md#scan) without an -`indexName`. - -## Parameters - -### fromKey - -`string` - -The `fromKey` is computed by `scan` and is the key of the -first entry to return in the iterator. It is based on `prefix` and -`start.key` of the [ScanNoIndexOptions](ScanNoIndexOptions.md). - -## Returns - -[`IterableUnion`](IterableUnion.md)\<`Entry`\<[`ReadonlyJSONValue`](ReadonlyJSONValue.md)\>\> diff --git a/packages/replicache-doc/docs/api/type-aliases/HTTPRequestInfo.md b/packages/replicache-doc/docs/api/type-aliases/HTTPRequestInfo.md deleted file mode 100644 index a5db6c2b3..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/HTTPRequestInfo.md +++ /dev/null @@ -1,13 +0,0 @@ -# Type Alias: HTTPRequestInfo - -> **HTTPRequestInfo**: `object` - -## Type declaration - -### errorMessage - -> **errorMessage**: `string` - -### httpStatusCode - -> **httpStatusCode**: `number` diff --git a/packages/replicache-doc/docs/api/type-aliases/IndexDefinition.md b/packages/replicache-doc/docs/api/type-aliases/IndexDefinition.md deleted file mode 100644 index ee875bcbd..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/IndexDefinition.md +++ /dev/null @@ -1,30 +0,0 @@ -# Type Alias: IndexDefinition - -> **IndexDefinition**: `object` - -The definition of a single index. - -## Type declaration - -### allowEmpty? - -> `readonly` `optional` **allowEmpty**: `boolean` - -If `true`, indexing empty values will not emit a warning. Defaults to `false`. - -### jsonPointer - -> `readonly` **jsonPointer**: `string` - -A [JSON Pointer](https://tools.ietf.org/html/rfc6901) pointing at the sub -value inside each value to index over. - -For example, one might index over users' ages like so: -`{prefix: '/user/', jsonPointer: '/age'}` - -### prefix? - -> `readonly` `optional` **prefix**: `string` - -The prefix, if any, to limit the index over. If not provided the values of -all keys are indexed. diff --git a/packages/replicache-doc/docs/api/type-aliases/IndexDefinitions.md b/packages/replicache-doc/docs/api/type-aliases/IndexDefinitions.md deleted file mode 100644 index ae5164641..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/IndexDefinitions.md +++ /dev/null @@ -1,10 +0,0 @@ -# Type Alias: IndexDefinitions - -> **IndexDefinitions**: `object` - -An object as a map defining the indexes. The keys are the index names and the -values are the index definitions. - -## Index Signature - -\[`name`: `string`\]: [`IndexDefinition`](IndexDefinition.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/IndexKey.md b/packages/replicache-doc/docs/api/type-aliases/IndexKey.md deleted file mode 100644 index 5832fd0ce..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/IndexKey.md +++ /dev/null @@ -1,6 +0,0 @@ -# Type Alias: IndexKey - -> **IndexKey**: readonly \[`string`, `string`\] - -When using indexes the key is a tuple of the secondary key and the primary -key. diff --git a/packages/replicache-doc/docs/api/type-aliases/IterableUnion.md b/packages/replicache-doc/docs/api/type-aliases/IterableUnion.md deleted file mode 100644 index 0c2484bd2..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/IterableUnion.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: IterableUnion\ - -> **IterableUnion**\<`T`\>: `AsyncIterable`\<`T`\> \| `Iterable`\<`T`\> - -## Type Parameters - -• **T** diff --git a/packages/replicache-doc/docs/api/type-aliases/JSONObject.md b/packages/replicache-doc/docs/api/type-aliases/JSONObject.md deleted file mode 100644 index 0bc983357..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/JSONObject.md +++ /dev/null @@ -1,20 +0,0 @@ -# Type Alias: JSONObject - -> **JSONObject**: `object` - -A JSON object. This is a map from strings to JSON values or `undefined`. We -allow `undefined` values as a convenience... but beware that the `undefined` -values do not round trip to the server. For example: - -``` -// Time t1 -await tx.set('a', {a: undefined}); - -// time passes, in a new transaction -const v = await tx.get('a'); -console.log(v); // either {a: undefined} or {} -``` - -## Index Signature - -\[`key`: `string`\]: `undefined` \| [`JSONValue`](JSONValue.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/JSONValue.md b/packages/replicache-doc/docs/api/type-aliases/JSONValue.md deleted file mode 100644 index 68787b0bc..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/JSONValue.md +++ /dev/null @@ -1,5 +0,0 @@ -# Type Alias: JSONValue - -> **JSONValue**: `null` \| `string` \| `boolean` \| `number` \| [`JSONValue`](JSONValue.md)[] \| [`JSONObject`](JSONObject.md) - -The values that can be represented in JSON diff --git a/packages/replicache-doc/docs/api/type-aliases/KVStoreProvider.md b/packages/replicache-doc/docs/api/type-aliases/KVStoreProvider.md deleted file mode 100644 index 79b94de06..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/KVStoreProvider.md +++ /dev/null @@ -1,15 +0,0 @@ -# Type Alias: KVStoreProvider - -> **KVStoreProvider**: `object` - -Provider for creating and deleting [Store](../interfaces/KVStore.md) instances. - -## Type declaration - -### create - -> **create**: [`CreateKVStore`](CreateKVStore.md) - -### drop - -> **drop**: [`DropKVStore`](DropKVStore.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/KeyTypeForScanOptions.md b/packages/replicache-doc/docs/api/type-aliases/KeyTypeForScanOptions.md deleted file mode 100644 index ae1362f09..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/KeyTypeForScanOptions.md +++ /dev/null @@ -1,10 +0,0 @@ -# Type Alias: KeyTypeForScanOptions\ - -> **KeyTypeForScanOptions**\<`O`\>: `O` *extends* [`ScanIndexOptions`](ScanIndexOptions.md) ? [`IndexKey`](IndexKey.md) : `string` - -If the options contains an `indexName` then the key type is a tuple of -secondary and primary. - -## Type Parameters - -• **O** *extends* [`ScanOptions`](ScanOptions.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/LogLevel.md b/packages/replicache-doc/docs/api/type-aliases/LogLevel.md deleted file mode 100644 index 454e446f4..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/LogLevel.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: LogLevel - -> **LogLevel**: `"error"` \| `"warn"` \| `"info"` \| `"debug"` - -The different log levels. This is used to determine how much logging to do. -`'error'` > `'info'` > `'debug'`... meaning `'error'` has highest priority -and `'debug'` lowest. diff --git a/packages/replicache-doc/docs/api/type-aliases/MakeMutator.md b/packages/replicache-doc/docs/api/type-aliases/MakeMutator.md deleted file mode 100644 index 5209109f5..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/MakeMutator.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: MakeMutator\ - -> **MakeMutator**\<`F`\>: `F` *extends* (`tx`, ...`args`) => infer Ret ? (...`args`) => `ToPromise`\<`Ret`\> : `never` - -## Type Parameters - -• **F** *extends* (`tx`, ...`args`) => [`MutatorReturn`](MutatorReturn.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/MakeMutators.md b/packages/replicache-doc/docs/api/type-aliases/MakeMutators.md deleted file mode 100644 index 321b8979f..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/MakeMutators.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: MakeMutators\ - -> **MakeMutators**\<`T`\>: `{ readonly [P in keyof T]: MakeMutator }` - -## Type Parameters - -• **T** *extends* [`MutatorDefs`](MutatorDefs.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/MaybePromise.md b/packages/replicache-doc/docs/api/type-aliases/MaybePromise.md deleted file mode 100644 index e7d3f02e3..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/MaybePromise.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: MaybePromise\ - -> **MaybePromise**\<`T`\>: `T` \| `Promise`\<`T`\> - -## Type Parameters - -• **T** diff --git a/packages/replicache-doc/docs/api/type-aliases/Mutation.md b/packages/replicache-doc/docs/api/type-aliases/Mutation.md deleted file mode 100644 index 625b0da8e..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/Mutation.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type Alias: Mutation - -> **Mutation**: `MutationV1` diff --git a/packages/replicache-doc/docs/api/type-aliases/MutatorDefs.md b/packages/replicache-doc/docs/api/type-aliases/MutatorDefs.md deleted file mode 100644 index 599effc68..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/MutatorDefs.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: MutatorDefs - -> **MutatorDefs**: `object` - -## Index Signature - -\[`key`: `string`\]: (`tx`, `args`?) => [`MutatorReturn`](MutatorReturn.md)\<[`ReadonlyJSONValue`](ReadonlyJSONValue.md)\> diff --git a/packages/replicache-doc/docs/api/type-aliases/MutatorReturn.md b/packages/replicache-doc/docs/api/type-aliases/MutatorReturn.md deleted file mode 100644 index 439da38a3..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/MutatorReturn.md +++ /dev/null @@ -1,7 +0,0 @@ -# Type Alias: MutatorReturn\ - -> **MutatorReturn**\<`T`\>: [`MaybePromise`](MaybePromise.md)\<`T` \| `void`\> - -## Type Parameters - -• **T** *extends* [`ReadonlyJSONValue`](ReadonlyJSONValue.md) = [`ReadonlyJSONValue`](ReadonlyJSONValue.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/PatchOperation.md b/packages/replicache-doc/docs/api/type-aliases/PatchOperation.md deleted file mode 100644 index cda5d6400..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/PatchOperation.md +++ /dev/null @@ -1,6 +0,0 @@ -# Type Alias: PatchOperation - -> **PatchOperation**: \{ `key`: `string`; `op`: `"put"`; `value`: [`ReadonlyJSONValue`](ReadonlyJSONValue.md); \} \| \{ `key`: `string`; `op`: `"del"`; \} \| \{ `op`: `"clear"`; \} - -This type describes the patch field in a [PullResponse](PullResponse.md) and it is used -to describe how to update the Replicache key-value store. diff --git a/packages/replicache-doc/docs/api/type-aliases/PendingMutation.md b/packages/replicache-doc/docs/api/type-aliases/PendingMutation.md deleted file mode 100644 index fc309fa37..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/PendingMutation.md +++ /dev/null @@ -1,21 +0,0 @@ -# Type Alias: PendingMutation - -> **PendingMutation**: `object` - -## Type declaration - -### args - -> `readonly` **args**: [`ReadonlyJSONValue`](ReadonlyJSONValue.md) - -### clientID - -> `readonly` **clientID**: [`ClientID`](ClientID.md) - -### id - -> `readonly` **id**: `number` - -### name - -> `readonly` **name**: `string` diff --git a/packages/replicache-doc/docs/api/type-aliases/Poke.md b/packages/replicache-doc/docs/api/type-aliases/Poke.md deleted file mode 100644 index 6806c1d03..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/Poke.md +++ /dev/null @@ -1,13 +0,0 @@ -# Type Alias: Poke - -> **Poke**: `object` - -## Type declaration - -### baseCookie - -> **baseCookie**: [`ReadonlyJSONValue`](ReadonlyJSONValue.md) - -### pullResponse - -> **pullResponse**: `PullResponseV1` diff --git a/packages/replicache-doc/docs/api/type-aliases/PullRequest.md b/packages/replicache-doc/docs/api/type-aliases/PullRequest.md deleted file mode 100644 index bc1d77dff..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/PullRequest.md +++ /dev/null @@ -1,6 +0,0 @@ -# Type Alias: PullRequest - -> **PullRequest**: `PullRequestV1` - -The JSON value used as the body when doing a POST to the [pull -endpoint](/reference/server-pull). diff --git a/packages/replicache-doc/docs/api/type-aliases/PullResponse.md b/packages/replicache-doc/docs/api/type-aliases/PullResponse.md deleted file mode 100644 index 7440b84a3..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/PullResponse.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type Alias: PullResponse - -> **PullResponse**: `PullResponseV1` diff --git a/packages/replicache-doc/docs/api/type-aliases/Puller.md b/packages/replicache-doc/docs/api/type-aliases/Puller.md deleted file mode 100644 index cf6d1c957..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/Puller.md +++ /dev/null @@ -1,26 +0,0 @@ -# Type Alias: Puller() - -> **Puller**: (`requestBody`, `requestID`) => `Promise`\<[`PullerResult`](PullerResult.md)\> - -Puller is the function type used to do the fetch part of a pull. - -Puller needs to support dealing with pull request of version 0 and 1. Version -0 is used when doing mutation recovery of old clients. If a -PullRequestV1 is passed in the n a PullerResultV1 should -be returned. We do a runtime assert to make this is the case. - -If you do not support old clients you can just throw if `pullVersion` is `0`, - -## Parameters - -### requestBody - -[`PullRequest`](PullRequest.md) - -### requestID - -`string` - -## Returns - -`Promise`\<[`PullerResult`](PullerResult.md)\> diff --git a/packages/replicache-doc/docs/api/type-aliases/PullerResult.md b/packages/replicache-doc/docs/api/type-aliases/PullerResult.md deleted file mode 100644 index 81fd5aae1..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/PullerResult.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type Alias: PullerResult - -> **PullerResult**: `PullerResultV1` diff --git a/packages/replicache-doc/docs/api/type-aliases/PushRequest.md b/packages/replicache-doc/docs/api/type-aliases/PushRequest.md deleted file mode 100644 index ff1558867..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/PushRequest.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type Alias: PushRequest - -> **PushRequest**: `PushRequestV1` diff --git a/packages/replicache-doc/docs/api/type-aliases/PushResponse.md b/packages/replicache-doc/docs/api/type-aliases/PushResponse.md deleted file mode 100644 index 04a9b6a4a..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/PushResponse.md +++ /dev/null @@ -1,5 +0,0 @@ -# Type Alias: PushResponse - -> **PushResponse**: [`ClientStateNotFoundResponse`](ClientStateNotFoundResponse.md) \| [`VersionNotSupportedResponse`](VersionNotSupportedResponse.md) - -The response from a push can contain information about error conditions. diff --git a/packages/replicache-doc/docs/api/type-aliases/Pusher.md b/packages/replicache-doc/docs/api/type-aliases/Pusher.md deleted file mode 100644 index 4eff37370..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/Pusher.md +++ /dev/null @@ -1,27 +0,0 @@ -# Type Alias: Pusher() - -> **Pusher**: (`requestBody`, `requestID`) => `Promise`\<[`PusherResult`](PusherResult.md)\> - -Pusher is the function type used to do the fetch part of a push. The request -is a POST request where the body is JSON with the type [PushRequest](PushRequest.md). - -The return value should either be a [HTTPRequestInfo](HTTPRequestInfo.md) or a -[PusherResult](PusherResult.md). The reason for the two different return types is that -we didn't use to care about the response body of the push request. The -default pusher implementation checks if the response body is JSON and if it -matches the type PusherResponse. If it does, it is included in the -return value. - -## Parameters - -### requestBody - -[`PushRequest`](PushRequest.md) - -### requestID - -`string` - -## Returns - -`Promise`\<[`PusherResult`](PusherResult.md)\> diff --git a/packages/replicache-doc/docs/api/type-aliases/PusherResult.md b/packages/replicache-doc/docs/api/type-aliases/PusherResult.md deleted file mode 100644 index 5e0fe84ce..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/PusherResult.md +++ /dev/null @@ -1,13 +0,0 @@ -# Type Alias: PusherResult - -> **PusherResult**: `object` - -## Type declaration - -### httpRequestInfo - -> **httpRequestInfo**: [`HTTPRequestInfo`](HTTPRequestInfo.md) - -### response? - -> `optional` **response**: [`PushResponse`](PushResponse.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/ReadonlyJSONObject.md b/packages/replicache-doc/docs/api/type-aliases/ReadonlyJSONObject.md deleted file mode 100644 index bbf82f661..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ReadonlyJSONObject.md +++ /dev/null @@ -1,9 +0,0 @@ -# Type Alias: ReadonlyJSONObject - -> **ReadonlyJSONObject**: `object` - -Like [JSONObject](JSONObject.md) but deeply readonly - -## Index Signature - -\[`key`: `string`\]: `undefined` \| [`ReadonlyJSONValue`](ReadonlyJSONValue.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/ReadonlyJSONValue.md b/packages/replicache-doc/docs/api/type-aliases/ReadonlyJSONValue.md deleted file mode 100644 index d6136b0d3..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ReadonlyJSONValue.md +++ /dev/null @@ -1,5 +0,0 @@ -# Type Alias: ReadonlyJSONValue - -> **ReadonlyJSONValue**: `null` \| `string` \| `boolean` \| `number` \| `ReadonlyArray`\<[`ReadonlyJSONValue`](ReadonlyJSONValue.md)\> \| [`ReadonlyJSONObject`](ReadonlyJSONObject.md) - -Like [JSONValue](JSONValue.md) but deeply readonly diff --git a/packages/replicache-doc/docs/api/type-aliases/ScanIndexOptions.md b/packages/replicache-doc/docs/api/type-aliases/ScanIndexOptions.md deleted file mode 100644 index f2e678bb0..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ScanIndexOptions.md +++ /dev/null @@ -1,45 +0,0 @@ -# Type Alias: ScanIndexOptions - -> **ScanIndexOptions**: `object` - -Options for [scan](../interfaces/ReadTransaction.md#scan) when scanning over an index. When -scanning over and index you need to provide the `indexName` and the `start` -`key` is now a tuple consisting of secondary and primary key - -## Type declaration - -### indexName - -> **indexName**: `string` - -Do a [scan](../interfaces/ReadTransaction.md#scan) over a named index. The `indexName` is -the name of an index defined when creating the [Replicache](../classes/Replicache.md) instance using -[ReplicacheOptions.indexes](../interfaces/ReplicacheOptions.md#indexes). - -### limit? - -> `optional` **limit**: `number` - -Only include up to `limit` results. - -### prefix? - -> `optional` **prefix**: `string` - -Only include results starting with the *secondary* keys starting with `prefix`. - -### start? - -> `optional` **start**: `object` - -When provided the scan starts at this key. - -#### start.exclusive? - -> `optional` **exclusive**: `boolean` - -Whether the `key` is exclusive or inclusive. - -#### start.key - -> **key**: [`ScanOptionIndexedStartKey`](ScanOptionIndexedStartKey.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/ScanNoIndexOptions.md b/packages/replicache-doc/docs/api/type-aliases/ScanNoIndexOptions.md deleted file mode 100644 index 4d5a423af..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ScanNoIndexOptions.md +++ /dev/null @@ -1,36 +0,0 @@ -# Type Alias: ScanNoIndexOptions - -> **ScanNoIndexOptions**: `object` - -Options for [scan](../interfaces/ReadTransaction.md#scan) when scanning over the entire key -space. - -## Type declaration - -### limit? - -> `optional` **limit**: `number` - -Only include up to `limit` results. - -### prefix? - -> `optional` **prefix**: `string` - -Only include keys starting with `prefix`. - -### start? - -> `optional` **start**: `object` - -When provided the scan starts at this key. - -#### start.exclusive? - -> `optional` **exclusive**: `boolean` - -Whether the `key` is exclusive or inclusive. - -#### start.key - -> **key**: `string` diff --git a/packages/replicache-doc/docs/api/type-aliases/ScanOptionIndexedStartKey.md b/packages/replicache-doc/docs/api/type-aliases/ScanOptionIndexedStartKey.md deleted file mode 100644 index 1a4d00da0..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ScanOptionIndexedStartKey.md +++ /dev/null @@ -1,13 +0,0 @@ -# Type Alias: ScanOptionIndexedStartKey - -> **ScanOptionIndexedStartKey**: readonly \[`string`, `string` \| `undefined`\] \| `string` - -The key to start scanning at. - -If you are scanning the primary index (i.e., you did not specify -`indexName`), then pass a single string for this field, which is the key in -the primary index to scan at. - -If you are scanning a secondary index (i.e., you specified `indexName`), then -use the tuple form. In that case, `secondary` is the secondary key to start -scanning at, and `primary` (if any) is the primary key to start scanning at. diff --git a/packages/replicache-doc/docs/api/type-aliases/ScanOptions.md b/packages/replicache-doc/docs/api/type-aliases/ScanOptions.md deleted file mode 100644 index c32a9acb5..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/ScanOptions.md +++ /dev/null @@ -1,5 +0,0 @@ -# Type Alias: ScanOptions - -> **ScanOptions**: [`ScanIndexOptions`](ScanIndexOptions.md) \| [`ScanNoIndexOptions`](ScanNoIndexOptions.md) - -Options for [scan](../interfaces/ReadTransaction.md#scan) diff --git a/packages/replicache-doc/docs/api/type-aliases/TransactionEnvironment.md b/packages/replicache-doc/docs/api/type-aliases/TransactionEnvironment.md deleted file mode 100644 index 810bd15ff..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/TransactionEnvironment.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type Alias: TransactionEnvironment - -> **TransactionEnvironment**: `"client"` \| `"server"` diff --git a/packages/replicache-doc/docs/api/type-aliases/TransactionLocation.md b/packages/replicache-doc/docs/api/type-aliases/TransactionLocation.md deleted file mode 100644 index 10b05894e..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/TransactionLocation.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type Alias: TransactionLocation - -> **TransactionLocation**: [`TransactionEnvironment`](TransactionEnvironment.md) diff --git a/packages/replicache-doc/docs/api/type-aliases/TransactionReason.md b/packages/replicache-doc/docs/api/type-aliases/TransactionReason.md deleted file mode 100644 index b1b176716..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/TransactionReason.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type Alias: TransactionReason - -> **TransactionReason**: `"initial"` \| `"rebase"` \| `"authoritative"` diff --git a/packages/replicache-doc/docs/api/type-aliases/UpdateNeededReason.md b/packages/replicache-doc/docs/api/type-aliases/UpdateNeededReason.md deleted file mode 100644 index 355dca4eb..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/UpdateNeededReason.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type Alias: UpdateNeededReason - -> **UpdateNeededReason**: \{ `type`: `"NewClientGroup"`; \} \| \{ `type`: `"VersionNotSupported"`; `versionType`: `"push"` \| `"pull"` \| `"schema"`; \} diff --git a/packages/replicache-doc/docs/api/type-aliases/VersionNotSupportedResponse.md b/packages/replicache-doc/docs/api/type-aliases/VersionNotSupportedResponse.md deleted file mode 100644 index bb0c648e4..000000000 --- a/packages/replicache-doc/docs/api/type-aliases/VersionNotSupportedResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# Type Alias: VersionNotSupportedResponse - -> **VersionNotSupportedResponse**: `object` - -The server endpoint may respond with a `VersionNotSupported` error if it does -not know how to handle the pullVersion, pushVersion or the -schemaVersion. - -## Type declaration - -### error - -> **error**: `"VersionNotSupported"` - -### versionType? - -> `optional` **versionType**: `"pull"` \| `"push"` \| `"schema"` diff --git a/packages/replicache-doc/docs/api/typedoc-sidebar.cjs b/packages/replicache-doc/docs/api/typedoc-sidebar.cjs deleted file mode 100644 index 7348a56da..000000000 --- a/packages/replicache-doc/docs/api/typedoc-sidebar.cjs +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-check -/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -const typedocSidebar = { items: [{"type":"category","label":"Classes","items":[{"type":"doc","id":"api/classes/IDBNotFoundError","label":"IDBNotFoundError"},{"type":"doc","id":"api/classes/PullError","label":"PullError"},{"type":"doc","id":"api/classes/PushError","label":"PushError"},{"type":"doc","id":"api/classes/Replicache","label":"Replicache"},{"type":"doc","id":"api/classes/TransactionClosedError","label":"TransactionClosedError"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"api/interfaces/AsyncIterableIteratorToArray","label":"AsyncIterableIteratorToArray"},{"type":"doc","id":"api/interfaces/KVRead","label":"KVRead"},{"type":"doc","id":"api/interfaces/KVStore","label":"KVStore"},{"type":"doc","id":"api/interfaces/KVWrite","label":"KVWrite"},{"type":"doc","id":"api/interfaces/LogSink","label":"LogSink"},{"type":"doc","id":"api/interfaces/ReadTransaction","label":"ReadTransaction"},{"type":"doc","id":"api/interfaces/ReplicacheOptions","label":"ReplicacheOptions"},{"type":"doc","id":"api/interfaces/RequestOptions","label":"RequestOptions"},{"type":"doc","id":"api/interfaces/ScanResult","label":"ScanResult"},{"type":"doc","id":"api/interfaces/SubscribeOptions","label":"SubscribeOptions"},{"type":"doc","id":"api/interfaces/WriteTransaction","label":"WriteTransaction"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"api/type-aliases/ClientGroupID","label":"ClientGroupID"},{"type":"doc","id":"api/type-aliases/ClientID","label":"ClientID"},{"type":"doc","id":"api/type-aliases/ClientStateNotFoundResponse","label":"ClientStateNotFoundResponse"},{"type":"doc","id":"api/type-aliases/Cookie","label":"Cookie"},{"type":"doc","id":"api/type-aliases/CreateIndexDefinition","label":"CreateIndexDefinition"},{"type":"doc","id":"api/type-aliases/CreateKVStore","label":"CreateKVStore"},{"type":"doc","id":"api/type-aliases/DeepReadonly","label":"DeepReadonly"},{"type":"doc","id":"api/type-aliases/DeepReadonlyObject","label":"DeepReadonlyObject"},{"type":"doc","id":"api/type-aliases/DropDatabaseOptions","label":"DropDatabaseOptions"},{"type":"doc","id":"api/type-aliases/DropKVStore","label":"DropKVStore"},{"type":"doc","id":"api/type-aliases/ExperimentalDiff","label":"ExperimentalDiff"},{"type":"doc","id":"api/type-aliases/ExperimentalDiffOperation","label":"ExperimentalDiffOperation"},{"type":"doc","id":"api/type-aliases/ExperimentalDiffOperationAdd","label":"ExperimentalDiffOperationAdd"},{"type":"doc","id":"api/type-aliases/ExperimentalDiffOperationChange","label":"ExperimentalDiffOperationChange"},{"type":"doc","id":"api/type-aliases/ExperimentalDiffOperationDel","label":"ExperimentalDiffOperationDel"},{"type":"doc","id":"api/type-aliases/ExperimentalIndexDiff","label":"ExperimentalIndexDiff"},{"type":"doc","id":"api/type-aliases/ExperimentalNoIndexDiff","label":"ExperimentalNoIndexDiff"},{"type":"doc","id":"api/type-aliases/ExperimentalWatchCallbackForOptions","label":"ExperimentalWatchCallbackForOptions"},{"type":"doc","id":"api/type-aliases/ExperimentalWatchIndexCallback","label":"ExperimentalWatchIndexCallback"},{"type":"doc","id":"api/type-aliases/ExperimentalWatchIndexOptions","label":"ExperimentalWatchIndexOptions"},{"type":"doc","id":"api/type-aliases/ExperimentalWatchNoIndexCallback","label":"ExperimentalWatchNoIndexCallback"},{"type":"doc","id":"api/type-aliases/ExperimentalWatchNoIndexOptions","label":"ExperimentalWatchNoIndexOptions"},{"type":"doc","id":"api/type-aliases/ExperimentalWatchOptions","label":"ExperimentalWatchOptions"},{"type":"doc","id":"api/type-aliases/GetIndexScanIterator","label":"GetIndexScanIterator"},{"type":"doc","id":"api/type-aliases/GetScanIterator","label":"GetScanIterator"},{"type":"doc","id":"api/type-aliases/HTTPRequestInfo","label":"HTTPRequestInfo"},{"type":"doc","id":"api/type-aliases/IndexDefinition","label":"IndexDefinition"},{"type":"doc","id":"api/type-aliases/IndexDefinitions","label":"IndexDefinitions"},{"type":"doc","id":"api/type-aliases/IndexKey","label":"IndexKey"},{"type":"doc","id":"api/type-aliases/IterableUnion","label":"IterableUnion"},{"type":"doc","id":"api/type-aliases/JSONObject","label":"JSONObject"},{"type":"doc","id":"api/type-aliases/JSONValue","label":"JSONValue"},{"type":"doc","id":"api/type-aliases/KeyTypeForScanOptions","label":"KeyTypeForScanOptions"},{"type":"doc","id":"api/type-aliases/KVStoreProvider","label":"KVStoreProvider"},{"type":"doc","id":"api/type-aliases/LogLevel","label":"LogLevel"},{"type":"doc","id":"api/type-aliases/MakeMutator","label":"MakeMutator"},{"type":"doc","id":"api/type-aliases/MakeMutators","label":"MakeMutators"},{"type":"doc","id":"api/type-aliases/MaybePromise","label":"MaybePromise"},{"type":"doc","id":"api/type-aliases/Mutation","label":"Mutation"},{"type":"doc","id":"api/type-aliases/MutatorDefs","label":"MutatorDefs"},{"type":"doc","id":"api/type-aliases/MutatorReturn","label":"MutatorReturn"},{"type":"doc","id":"api/type-aliases/PatchOperation","label":"PatchOperation"},{"type":"doc","id":"api/type-aliases/PendingMutation","label":"PendingMutation"},{"type":"doc","id":"api/type-aliases/Poke","label":"Poke"},{"type":"doc","id":"api/type-aliases/Puller","label":"Puller"},{"type":"doc","id":"api/type-aliases/PullerResult","label":"PullerResult"},{"type":"doc","id":"api/type-aliases/PullRequest","label":"PullRequest"},{"type":"doc","id":"api/type-aliases/PullResponse","label":"PullResponse"},{"type":"doc","id":"api/type-aliases/Pusher","label":"Pusher"},{"type":"doc","id":"api/type-aliases/PusherResult","label":"PusherResult"},{"type":"doc","id":"api/type-aliases/PushRequest","label":"PushRequest"},{"type":"doc","id":"api/type-aliases/PushResponse","label":"PushResponse"},{"type":"doc","id":"api/type-aliases/ReadonlyJSONObject","label":"ReadonlyJSONObject"},{"type":"doc","id":"api/type-aliases/ReadonlyJSONValue","label":"ReadonlyJSONValue"},{"type":"doc","id":"api/type-aliases/ScanIndexOptions","label":"ScanIndexOptions"},{"type":"doc","id":"api/type-aliases/ScanNoIndexOptions","label":"ScanNoIndexOptions"},{"type":"doc","id":"api/type-aliases/ScanOptionIndexedStartKey","label":"ScanOptionIndexedStartKey"},{"type":"doc","id":"api/type-aliases/ScanOptions","label":"ScanOptions"},{"type":"doc","id":"api/type-aliases/TransactionEnvironment","label":"TransactionEnvironment"},{"type":"doc","id":"api/type-aliases/TransactionLocation","label":"TransactionLocation"},{"type":"doc","id":"api/type-aliases/TransactionReason","label":"TransactionReason"},{"type":"doc","id":"api/type-aliases/UpdateNeededReason","label":"UpdateNeededReason"},{"type":"doc","id":"api/type-aliases/VersionNotSupportedResponse","label":"VersionNotSupportedResponse"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"api/variables/consoleLogSink","label":"consoleLogSink"},{"type":"doc","id":"api/variables/TEST_LICENSE_KEY","label":"TEST_LICENSE_KEY","className":"typedoc-sidebar-item-deprecated"},{"type":"doc","id":"api/variables/version","label":"version"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"api/functions/deleteAllReplicacheData","label":"deleteAllReplicacheData","className":"typedoc-sidebar-item-deprecated"},{"type":"doc","id":"api/functions/dropAllDatabases","label":"dropAllDatabases"},{"type":"doc","id":"api/functions/dropDatabase","label":"dropDatabase"},{"type":"doc","id":"api/functions/filterAsyncIterable","label":"filterAsyncIterable"},{"type":"doc","id":"api/functions/getDefaultPuller","label":"getDefaultPuller"},{"type":"doc","id":"api/functions/getDefaultPusher","label":"getDefaultPusher"},{"type":"doc","id":"api/functions/isScanIndexOptions","label":"isScanIndexOptions"},{"type":"doc","id":"api/functions/makeIDBName","label":"makeIDBName"},{"type":"doc","id":"api/functions/makeScanResult","label":"makeScanResult"},{"type":"doc","id":"api/functions/mergeAsyncIterables","label":"mergeAsyncIterables"}]}]}; -module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/packages/replicache-doc/docs/api/variables/TEST_LICENSE_KEY.md b/packages/replicache-doc/docs/api/variables/TEST_LICENSE_KEY.md deleted file mode 100644 index 48de8ee9b..000000000 --- a/packages/replicache-doc/docs/api/variables/TEST_LICENSE_KEY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Variable: ~~TEST\_LICENSE\_KEY~~ - -> `const` **TEST\_LICENSE\_KEY**: `"This key only good for automated testing"` = `'This key only good for automated testing'` - -## Deprecated diff --git a/packages/replicache-doc/docs/api/variables/consoleLogSink.md b/packages/replicache-doc/docs/api/variables/consoleLogSink.md deleted file mode 100644 index c8919d920..000000000 --- a/packages/replicache-doc/docs/api/variables/consoleLogSink.md +++ /dev/null @@ -1,5 +0,0 @@ -# Variable: consoleLogSink - -> `const` **consoleLogSink**: [`LogSink`](../interfaces/LogSink.md) - -An implementation of [[LogSink]] that logs using `console.log` etc diff --git a/packages/replicache-doc/docs/api/variables/version.md b/packages/replicache-doc/docs/api/variables/version.md deleted file mode 100644 index f7a4ed0ba..000000000 --- a/packages/replicache-doc/docs/api/variables/version.md +++ /dev/null @@ -1,5 +0,0 @@ -# Variable: version - -> `const` **version**: `string` - -The current version of Replicache.