/** * Client-side actions — executed by the prefab renderer without server roundtrip. */ import type { Action, ActionJSON } from './types.js'; export interface SetStateOpts { onSuccess?: Action | Action[]; onError?: Action | Action[]; } export declare class SetState implements Action { readonly key: string; readonly value: unknown; private readonly opts?; constructor(key: string, value: unknown, opts?: SetStateOpts | undefined); toJSON(): ActionJSON; } export declare class ToggleState implements Action { readonly key: string; constructor(key: string); toJSON(): ActionJSON; } export declare class AppendState implements Action { readonly key: string; readonly value: unknown; readonly index?: number | undefined; constructor(key: string, value: unknown, index?: number | undefined); toJSON(): ActionJSON; } export declare class PopState implements Action { readonly key: string; readonly index: number | string; constructor(key: string, index: number | string); toJSON(): ActionJSON; } export type ToastVariant = 'default' | 'success' | 'error' | 'warning' | 'info'; export interface ShowToastOpts { description?: string; variant?: ToastVariant; duration?: number; } export declare class ShowToast implements Action { readonly message: string; private readonly opts?; constructor(message: string, opts?: ShowToastOpts | undefined); toJSON(): ActionJSON; } export declare class CloseOverlay implements Action { toJSON(): ActionJSON; } export declare class OpenLink implements Action { readonly url: string; readonly target: string; constructor(url: string, target?: string); toJSON(): ActionJSON; } export declare class SetInterval implements Action { readonly intervalMs: number; readonly onTick: Action | Action[]; constructor(intervalMs: number, onTick: Action | Action[]); toJSON(): ActionJSON; } export interface FetchOpts { method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; headers?: Record; body?: unknown; resultKey?: string; onSuccess?: Action | Action[]; onError?: Action | Action[]; } export declare class Fetch implements Action { readonly url: string; private readonly opts?; constructor(url: string, opts?: FetchOpts | undefined); toJSON(): ActionJSON; } export interface OpenFilePickerOpts { accept?: string; multiple?: boolean; resultKey?: string; onSuccess?: Action | Action[]; } export declare class OpenFilePicker implements Action { private readonly opts?; constructor(opts?: OpenFilePickerOpts | undefined); toJSON(): ActionJSON; } export interface CallHandlerOpts { arguments?: Record; resultKey?: string; onSuccess?: Action | Action[]; onError?: Action | Action[]; } export declare class CallHandler implements Action { readonly handler: string; private readonly opts?; constructor(handler: string, opts?: CallHandlerOpts | undefined); toJSON(): ActionJSON; } //# sourceMappingURL=client.d.ts.map