/** * Snout Functions: your own TypeScript, at `/v1/fn/` (`/functions/v1/` in the old * vocabulary). * * `call` sends the signed-in person's token, so a function can act as them, and decodes the * answer by its content type. A function that answers with a status of 400 or above is an * `error` whose `context` is the Response, so its own body can still be read. */ import { type Transport } from './http.js'; export declare class FunctionsError extends Error { /** The function's own response, when it answered at all. */ readonly context: Response | undefined; constructor(message: string, name: 'FunctionsHttpError' | 'FunctionsFetchError' | 'FunctionsRelayError', context?: Response); } export type FunctionsResult = { data: T; error: null; } | { data: null; error: FunctionsError; }; export interface CallOptions { body?: unknown; headers?: Record; method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; signal?: AbortSignal; } /** @deprecated Since 0.4.0: `CallOptions`. */ export type InvokeOptions = CallOptions; export declare class FunctionsClient { /** @internal */ readonly url: string; private readonly transport; constructor( /** @internal */ url: string, transport: Transport); /** @deprecated Since 0.4.0: use `call()`, the same function. Removed in 0.5.0. */ invoke: FunctionsClient['call']; /** Calls the function `name` (a subpath or a query string after it is the function's own). */ call(name: string, options?: CallOptions): Promise>; }