import type { ReadonlyJSONValue } from '../../shared/src/json.ts'; import type { MaybePromise } from '../../shared/src/types.ts'; import type { Hash } from './hash.ts'; import type { PullResponseV1, PullResponseV1Internal } from './puller.ts'; import type { ReadTransactionImpl, WriteTransaction } from './transactions.ts'; export type BeginPullResult = { requestID: string; syncHead: Hash; ok: boolean; }; export type Poke = { baseCookie: ReadonlyJSONValue; pullResponse: PullResponseV1; }; export type PokeInternal = { baseCookie: ReadonlyJSONValue; pullResponse: PullResponseV1Internal; }; export type MutatorReturn = MaybePromise; /** * The type used to describe the mutator definitions passed into [Replicache](classes/Replicache) * constructor as part of the {@link ReplicacheOptions}. * * See {@link ReplicacheOptions} {@link ReplicacheOptions.mutators | mutators} for more * info. */ export type MutatorDefs = { [key: string]: (tx: WriteTransaction, args?: any) => MutatorReturn; }; export type MakeMutator MutatorReturn> = F extends (tx: WriteTransaction, ...args: infer Args) => infer Ret ? (...args: Args) => ToPromise : never; /** * Base options for {@link PullOptions} and {@link PushOptions} */ export interface RequestOptions { /** * When there are pending pull or push requests this is the _minimum_ amount * of time to wait until we try another pull/push. */ minDelayMs?: number; /** * When there are pending pull or push requests this is the _maximum_ amount * of time to wait until we try another pull/push. */ maxDelayMs?: number; } export type MakeMutators = { readonly [P in keyof T]: MakeMutator; }; export type ToPromise

= P extends Promise ? P : Promise

; export type QueryInternal = (body: (tx: ReadTransactionImpl) => MaybePromise) => Promise; /** * The reason {@link onUpdateNeeded} was called. */ export type UpdateNeededReason = { type: 'NewClientGroup'; } | { type: 'VersionNotSupported'; versionType?: 'push' | 'pull' | 'schema' | undefined; }; //# sourceMappingURL=types.d.ts.map