import type { ApolloCache, DefaultContext, FetchResult, MutationFunction, RefetchQueriesInclude } from '@apollo/client'; import type { TypedDocumentNode } from '@graphql-typed-document-node/core'; import type { Handler, SpreadHandler, VoidHandler } from '../../utils/types'; export interface CarbonMutationOptions { variables?: TVariables; ignoreResults?: boolean; refetchQueries?: RefetchQueriesInclude; optimisticResponse?: Handler; update?: SpreadHandler<[ response: ApolloCache, result: Omit, 'context'> ], void>; context?: TContext; } export interface CarbonMutationResult { data?: TResult | null; error?: Error; loading: boolean; reset: VoidHandler; } export declare type UseCarbonMutationResult = [ MutationFunction, CarbonMutationResult ]; /** * Executes a Carbon GraphQL query against the Source Experience API * * Internally, this method invokes Apollo's useQuery() hook, passing in the custom client * created for use by Carbon. * * @param document the document that should be generated * @param options the options for the document to generate * @returns results of executing the query */ export declare function useCarbonMutation(document: TypedDocumentNode, options?: CarbonMutationOptions): UseCarbonMutationResult;