import type { GadgetConnection } from "./GadgetConnection.js"; import type { ActionFunction, ActionFunctionMetadata, GlobalActionFunction } from "./GadgetFunctions.js"; import type { GadgetRecord } from "./GadgetRecord.js"; import type { ActionFunctionOptions, DefaultSelection, Select } from "./types.js"; export type BackgroundActionResultData | GlobalActionFunction, Selection> = F extends ActionFunction ? F["hasReturnType"] extends true ? any : GadgetRecord, DefaultSelection>> : any; export type BackgroundActionResult = { id: string; outcome: string | null; result: Data | null; }; /** Represents a handle to a background action which has been enqueued */ export declare class BackgroundActionHandle | GlobalActionFunction> { readonly connection: GadgetConnection; readonly action: Action; readonly id: string; constructor(connection: GadgetConnection, action: Action, id: string); /** Wait for this background action to complete and return the result. */ result, ResultData = BackgroundActionResultData>(options?: Options): Promise; /** Cancel this background action by id. */ cancel(): Promise; }