import type { Definitions, DefArguments, DefResult } from '@forge/resolver/shared'; import { InvokeMetadata, InvokePayload, InvokeResponse } from '../types'; /** * Calls a resolver function with explicit payload and return types. * * The first generic is the payload shape and the second generic is the return type. * When this overload is used, payload is required. * * @example * type Payload = { name: string }; * type Response = { message: string }; * const response = await invoke('greet', { name: 'Taylor' }); */ export declare function invoke(functionKey: string, payload: Payload, metadata?: InvokeMetadata): Promise>; /** * Calls a resolver function using the legacy generic form where the type argument is the return type. * * @example * const response = await invoke<{ message: string }>('greet', { name: 'Taylor' }); */ export declare function invoke(functionKey: string, payload?: InvokePayload, metadata?: InvokeMetadata): Promise>; type Invoke = (call: Def, ...arg: DefArguments) => Promise>; /** * Specialises the invoke function to a given Definitions type. * * @returns An invoke function that can be used to call backend functions. */ export declare function makeInvoke(): Invoke; export {}; //# sourceMappingURL=invoke.d.ts.map