import type { BoundNodeFor } from '@astrale-os/sdk/client'; import type { SessionRequestOptions } from '@astrale-os/sdk/client/session'; import type { QueryAST } from '@astrale-os/sdk/query'; import type { CallableInputOf, CallableResultOf, MethodOwnerKeyOf, MethodInheritance, ResolvedFunction, ResolvedMethod } from '@astrale-os/sdk/schema'; type ExecutableInheritance = Exclude; type InstanceMethod = ResolvedMethod; type StaticMethod = ResolvedMethod; type Callable = ResolvedFunction | InstanceMethod | StaticMethod; type MethodReceiver = BoundNodeFor>; declare const QUERY_REFRESH: unique symbol; export interface QueryRefresh { readonly id: string; readonly [QUERY_REFRESH]: () => { readonly ast: QueryAST; readonly page: Readonly<{ readonly size: number; }>; }; } type RefreshableQuery = { readonly id: string; readonly page: Readonly<{ readonly size: number; }>; prepare?(input: Input): Input; build(input: Input): Query; }; /** Pair one exact named Query definition with its admitted input for targeted invalidation. */ export declare function queryRefresh(definition: RefreshableQuery, input: Input): QueryRefresh; export type ActionRefresh = 'all' | 'none' | { readonly queries: readonly QueryRefresh[]; }; export interface ActionOptions extends SessionRequestOptions { readonly refresh?: ActionRefresh; readonly onError?: (error: unknown) => void; } type ActionArgs = C extends InstanceMethod ? [receiver: MethodReceiver, input: CallableInputOf] : [input: CallableInputOf]; export interface DomainAction { run(...args: Args): Promise; readonly pending: boolean; readonly error: unknown; readonly result: Result | undefined; reset(): void; } /** Invoke one schema-declared Function or Method and invalidate Store by explicit policy. */ export declare function useAction(callable: C, options?: ActionOptions): DomainAction, CallableResultOf>; export {}; //# sourceMappingURL=action.hook.d.ts.map