import type { MutationObserverOptions, MutationObserverResult } from '@tanstack/query-core'; import type { ReactiveController, ReactiveControllerHost } from 'lit'; import type { QueryClientHost } from '../mixins/query-client.mixin.js'; export type { MutationObserverOptions, MutationObserverResult }; /** * A Lit ReactiveController that wraps MutationObserver from @tanstack/query-core. * Mirrors the QueryController pattern for consistency. * * @example * class MyController { * #mutation = new MutationController(host, { * mutationFn: (variables) => api.doSomething(variables), * }) * * async submit(data: MyData) { * return this.#mutation.mutate(data) * } * * get isPending() { * return this.#mutation.result?.isPending ?? false * } * } */ export declare class MutationController implements ReactiveController { #private; protected host: ReactiveControllerHost & QueryClientHost; result?: MutationObserverResult; constructor(host: ReactiveControllerHost & QueryClientHost, options: MutationObserverOptions); /** * Trigger the mutation with the given variables. * Returns a promise that resolves with the mutation result data. */ mutate(variables: TVariables): Promise; /** * Reset the mutation back to its idle state. */ reset(): void; hostConnected(): void; hostDisconnected(): void; }