import { type Event, type EventCallable, type Store } from "effector"; import type { OperationVariables } from "@apollo/client"; import type { Query } from "./query/query.js"; export interface TriggerProtocol { "@@trigger": () => { setup: EventCallable; teardown: EventCallable; fired: Event | Event; }; } type Trigger = Event | TriggerProtocol; interface KeepFreshOptions { /** * Controls whether the automatic refresh is enabled. * * By default, `keepFresh` will be always enabled. */ enabled?: Store; /** * A list of triggers to start the query and launch a network request. * * Can either be a `Event` or a `TriggerProtocol` * ({@link https://withease.pages.dev/protocols/trigger | see documentation}). */ triggers: Trigger[]; } /** * Enables automatic refreshes for your query, * ensuring that the data stays up-to-date * in response to specific events or triggers. * * @remarks * - By default, `keepFresh` is always enabled. You can optionally control its enabled state using the `enabled` option. * - The query will be refetched when any of the specified triggers fire. * * @param query - The Query you want to keep fresh. * @param options - Options for customizing the refresh behavior. */ export declare function keepFresh(query: Query, { enabled, triggers }: KeepFreshOptions): void; export {};