import type { OperationVariables } from "@apollo/client"; import { ApolloLink, ApolloClient as OrigApolloClient, Observable } from "@apollo/client"; import type { InMemoryCache } from "./WrappedInMemoryCache.js"; import type { ProgressEvent, QueryEvent } from "./DataTransportAbstraction.js"; import { sourceSymbol } from "../bundleInfo.js"; import type { ReadableStreamLinkEvent } from "../ReadableStreamLink.js"; type SimulatedQueryInfo = { controller: ReadableStreamDefaultController; options: OrigApolloClient.WatchQueryOptions; }; /** @public */ export declare namespace ApolloClient { /** @public */ interface Options extends Omit { cache: InMemoryCache; } } declare class ApolloClientBase extends OrigApolloClient { /** * Information about the current package and it's export names, for use in error messages. * * @internal */ static readonly info: { pkg: string; }; [sourceSymbol]: string; constructor(options: ApolloClient.Options); setLink(newLink: ApolloLink): void; } declare class ApolloClientClientBaseImpl extends ApolloClientBase { constructor(options: ApolloClient.Options); private simulatedStreamingQueries; onQueryStarted({ options, id }: Extract): void; onQueryProgress: (event: ProgressEvent) => void; /** * Can be called when the stream closed unexpectedly while there might still be unresolved * simulated server-side queries going on. * Those queries will be cancelled and then re-run in the browser. */ rerunSimulatedQueries: () => void; rerunSimulatedQuery: (queryInfo: SimulatedQueryInfo) => void; } declare const skipDataTransportKey: unique symbol; interface InternalContext { [skipDataTransportKey]?: boolean; } /** * Apply to a context to prevent this operation from being transported over the SSR data transport mechanism. * @public */ export declare function skipDataTransport>(context: T): T & InternalContext; declare class ApolloClientSSRImpl extends ApolloClientClientBaseImpl { watchQueryQueue: { push: (value: { event: Extract; observable: Observable>; }) => void; register: (callback: ((value: { event: Extract; observable: Observable>; }) => void) | null) => void; }; pushEventStream(options: OrigApolloClient.WatchQueryOptions): ReadableStreamDefaultController; watchQuery(options: OrigApolloClient.WatchQueryOptions): import("@apollo/client").ObservableQuery; } declare const ApolloClient_base: typeof ApolloClientBase; /** * A version of `ApolloClient` to be used with streaming SSR or in React Server Components. * * For more documentation, please see {@link https://www.apollographql.com/docs/react/api/core/ApolloClient | the Apollo Client API documentation}. * * @public */ export declare class ApolloClient extends ApolloClient_base implements Partial { /** @internal */ onQueryStarted?: ApolloClientSSRImpl["onQueryStarted"]; /** @internal */ onQueryProgress?: ApolloClientSSRImpl["onQueryProgress"]; /** @internal */ rerunSimulatedQueries?: ApolloClientSSRImpl["rerunSimulatedQueries"]; /** @internal */ rerunSimulatedQuery?: ApolloClientSSRImpl["rerunSimulatedQuery"]; /** @internal */ watchQueryQueue?: ApolloClientSSRImpl["watchQueryQueue"]; } export {}; //# sourceMappingURL=WrappedApolloClient.d.ts.map