import type { AnyElysia } from 'elysia'; import type { EdenFetchError } from '../../errors'; import type { EdenRequestParams } from '../../resolve'; import type { Observable, Observer } from './observable'; export type OperationType = 'query' | 'mutation' | 'subscription'; export interface OperationContext extends Record { } export type Operation = { id: number; type: OperationType; params: EdenRequestParams; context: OperationContext; }; export type OperationLink = (options: OperationLinkOptions) => OperationResultObservable; export type OperationLinkOptions = { operation: Operation; next: (operation: Operation) => OperationResultObservable; }; export type OperationResultObservable = Observable, EdenClientError>; export type OperationResultObserver = Observer, EdenClientError>; export type OperationResultEnvelope = (EdenResultMessage | EdenSuccessResponse) & { context?: OperationContext; }; export type EdenResultMessage = { type: 'started'; data?: never; } | { type: 'stopped'; data?: never; } | { data: T; type: 'data'; }; export type EdenSuccessResponse = { data: T; type?: 'data'; }; export type EdenLink = ((opts: EdenClientRuntime) => OperationLink) & TMeta; export type EdenClientRuntime = {}; export type EdenClientOptions = { links: EdenLink[]; }; /** * Type representing errors that can occur during Eden client operations. * This is the union of all possible error types from the Elysia route schema. * * @template _T - The Elysia app type (reserved for future use with route-specific error types) */ export type EdenClientError<_T extends AnyElysia = AnyElysia> = EdenFetchError | Error; export declare class OperationError extends Error { constructor(message?: string); } //# sourceMappingURL=operation.d.ts.map