import type { DocumentNode, FormattedExecutionResult, GraphQLFormattedError } from "graphql"; import type { ApolloLink } from "@apollo/client/link"; import type { DeepPartial, DocumentTransform } from "@apollo/client/utilities"; import type { StreamInfoTrie } from "@apollo/client/utilities/internal"; export declare namespace Incremental { type Path = ReadonlyArray; interface PendingResult { id: string; path: Incremental.Path; label?: string; } /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ interface Handler = Record> { isIncrementalResult: (result: ApolloLink.Result) => result is Chunk; prepareRequest: (request: ApolloLink.Request) => ApolloLink.Request; extractErrors: (result: ApolloLink.Result) => readonly GraphQLFormattedError[] | undefined | void; startRequest: >(request: Incremental.StartRequestOptions) => IncrementalRequest; readonly documentTransform?: DocumentTransform; } /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ interface StartRequestOptions { query: DocumentNode; } interface IncrementalRequest, TData> { hasNext: boolean; /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ readonly streamInfo?: StreamInfoTrie; /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ getPendingWithInfo?: () => Array; handle: (cacheData: TData | DeepPartial | undefined | null, chunk: Chunk) => FormattedExecutionResult; } /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ interface PendingDeferResultWithInfo { type: "defer"; delivered: boolean; path: Incremental.Path; label: string | undefined; } /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ interface PendingStreamResultWithInfo { type: "stream"; path: Incremental.Path; } /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ type PendingItemWithInfo = PendingDeferResultWithInfo | PendingStreamResultWithInfo; /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ interface StreamFieldInfo { isFirstChunk: boolean; isLastChunk: boolean; } } //# sourceMappingURL=types.d.ts.map