import { type ClientStateNotFoundResponse, type VersionNotSupportedResponse } from './error-responses.ts'; import { type HTTPRequestInfo } from './http-request-info.ts'; import type { PushRequest } from './sync/push.ts'; export type PusherResult = { response?: PushResponse | undefined; httpRequestInfo: HTTPRequestInfo; }; /** * The response from a push can contain information about error conditions. */ export type PushResponse = ClientStateNotFoundResponse | VersionNotSupportedResponse; export declare function assertPusherResult(v: unknown): asserts v is PusherResult; /** * 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 {@link PushRequest}. * * The return value should either be a {@link HTTPRequestInfo} or a * {@link PusherResult}. 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 {@link PusherResponse}. If it does, it is included in the * return value. */ export type Pusher = (requestBody: PushRequest, requestID: string) => Promise; /** * This error is thrown when the pusher fails for any reason. */ export declare class PushError extends Error { name: string; causedBy?: Error | undefined; constructor(causedBy?: Error); } //# sourceMappingURL=pusher.d.ts.map