import type { BindingOperationRef, DataSourceDiagnostic } from '@ankhorage/contracts'; export type RuntimeEventOperationStatus = 'idle' | 'loading' | 'success' | 'error'; export interface RuntimeEventOperationState { readonly status: RuntimeEventOperationStatus; readonly loading: boolean; readonly errorMessage: string; readonly nodeId?: string; readonly operation?: BindingOperationRef; } export interface RuntimeEventOperationInvocation { readonly id: number; } export interface RuntimeEventOperationLifecycle { start(args: { readonly nodeId: string; readonly operation: BindingOperationRef; }): RuntimeEventOperationInvocation | undefined; succeed(invocation: RuntimeEventOperationInvocation): void; fail(invocation: RuntimeEventOperationInvocation, message: string): void; } export declare const IDLE_RUNTIME_EVENT_OPERATION_STATE: RuntimeEventOperationState; /** * Creates a single-flight lifecycle controller for component-triggered API operations. * * @param onStateChange - Receives bindable lifecycle snapshots. * @returns A controller that rejects concurrent starts and ignores stale completions. */ export declare function createRuntimeEventOperationLifecycle(onStateChange: (state: RuntimeEventOperationState) => void): RuntimeEventOperationLifecycle; /** * Adds the public Runtime event-operation namespace without replacing caller context. * * @param context - Existing manifest binding context. * @param state - Current event-operation lifecycle snapshot. * @returns Context exposing `runtime.eventOperation` for ordinary context bindings. */ export declare function createRuntimeEventOperationBindingContext(context: Record | undefined, state: RuntimeEventOperationState): Record; /** * Selects a stable, human-readable error for inline presentation. * * @param diagnostics - Diagnostics produced while resolving or executing the operation. * @returns The first error message, or a safe generic fallback. */ export declare function resolveRuntimeEventOperationErrorMessage(diagnostics: readonly DataSourceDiagnostic[]): string; //# sourceMappingURL=runtimeEventOperationLifecycle.d.ts.map