export { EdenClient, EdenClientInternalRequestOptions, EdenClientPromisifyRequestOptions, EdenClientRequestOptions, EdenCreateClient, EdenSubscriptionObserver } from './client.cjs'; import { N as NonEmptyArray, T as TypeError } from './errors-DQ0_HKez.cjs'; export { d as ERROR_SYMBOL, c as EdenClientErrorLike, a as EdenFatalError, E as EdenFetchError, b as ErrorRange, M as MapError } from './errors-DQ0_HKez.cjs'; import { H as HTTPHeaders } from './http-BobyyETH.cjs'; export { A as AbortControllerEsque, b as AbortControllerInstanceEsque, c as HTTPLinkBaseOptions, a as HeadersInitEsque, l as HttMethod, j as HttpMutationMethod, i as HttpQueryMethod, k as HttpSubscriptionMethod, g as getAbortController, f as httpMethods, d as httpMutationMethods, h as httpQueryMethods, e as httpSubscriptionMethods } from './http-BobyyETH.cjs'; export { InferRouteBody, InferRouteError, InferRouteOptions, InferRouteOutput, InferRouteOutputAll, InferRouteResponse, TreatyResponse } from './infer.cjs'; import { AnyElysia, MaybeArray } from 'elysia'; import { E as EdenQueryStoreKey, B as BatchPluginOptions } from './constraints-iwkJs7sG.cjs'; import { D as DataTransformerOptions } from './transformer-BrEsAU6i.cjs'; export { C as CombinedDataTransformer, a as DataTransformer, g as getDataTransformer } from './transformer-BrEsAU6i.cjs'; import { E as EdenRequestOptions, O as Operation, a as EdenLink, b as OperationResultEnvelope } from './operation-JC_TyDnC.cjs'; export { u as EdenClientError, t as EdenClientOptions, s as EdenClientRuntime, x as EdenOnRequest, y as EdenOnResponse, A as EdenRawResponse, w as EdenRequestHeaders, D as EdenRequestParams, z as EdenResponse, q as EdenResultMessage, r as EdenSuccessResponse, I as InferObservableValue, M as MonoTypeOperatorFunction, h as Observable, g as ObservableAbortError, d as Observer, k as OperationContext, v as OperationError, l as OperationLink, m as OperationLinkOptions, n as OperationResultObservable, o as OperationResultObserver, j as OperationType, c as OperatorFunction, S as Subscribable, T as TeardownLogic, U as UnaryFunction, e as Unsubscribable, i as isObservable, C as parseResponse, p as pipeReducer, f as promisifyObservable, F as resolveEdenRequest, B as streamResponse } from './operation-JC_TyDnC.cjs'; export { e as EdenTreatyClient, f as EdenTreatyHooksProxy, k as EdenTreatyMutationLeaf, j as EdenTreatyQueryLeaf, i as EdenTreatyQueryRouteLeaf, l as EdenTreatySubscriptionLeaf, m as EdenTreatyUnknownLeaf, p as EmptyToVoid, E as ExtractEdenTreatyRouteParams, d as ExtractEdenTreatyRouteParamsInput, b as HTTPLinkFactory, H as HTTPLinkFactoryOptions, a as HTTPLinkOptions, o as createEdenTreaty, n as createEdenTreatyProxy, g as getPathParam, c as httpLink, h as httpLinkFactory, s as safeHttpLink } from './treaty-psvr7Oqr.cjs'; import './ws.cjs'; import './config.cjs'; /** * @remarks Do not derive this from HTTPLinkOptions, because it breaks the types for some reason... * * @template TTransformer * @todo Maybe check if T['store'][EdenQueryStoreKey] matches a certain interface? */ type HttpBatchLinkOptions = Omit & { /** * Path for the batch endpoint. * * @example /batch */ endpoint?: string; /** * Configure the maximum URL length if making batch requests with GET. */ maxURLLength?: number; /** * @todo: Merge this headers type into {@link EdenRequestOptions} */ headers?: HTTPHeaders | ((operations: NonEmptyArray) => HTTPHeaders | Promise); method?: BatchMethod; } & (TTransformer extends false ? { transformer?: DataTransformerOptions; } : TTransformer extends DataTransformerOptions ? { transformer: TTransformer; } : { transformer?: DataTransformerOptions; }); type BatchMethod = 'GET' | 'POST'; /** * If using GET request to batch, the request data will be encoded in query parameters. * This is only possible if all requests are GET requests. * * The query will look like this * * // GET request to /api/b?name=elysia, i.e. query of name=elysia * * batch=1&0.path=/api/b&0.method=GET&0.query.name=elysia */ declare function generateGetBatchRequestInformation(operations: Operation[]): { body: null; query: Record; headers: Headers; }; /** * If using POST request to batch, most of the request data will be encoded in the FormData body. * * It will look like this: * * { * // POST request to /api/a with a JSON body of { value: 0 } * * '0.path': '/api/a', * '0.method': 'POST', * '0.body_type': 'JSON', * '0.body': '{ value: 0 }' * * // GET request to /api/b?name=elysia, i.e. query of name=elysia * * '1.path': '/api/b', * '1.method': 'GET', * '1.query.name': 'elysia' * } */ declare function generatePostBatchRequestInformation(operations: Operation[], options?: HttpBatchLinkOptions): { body: FormData; query: {}; headers: Headers; }; /** * @see https://trpc.io/docs/v11/client/links/httpLink */ declare const safeHttpBatchLink: (options?: HttpBatchLinkOptions) => T["store"][typeof EdenQueryStoreKey]["batch"] extends true | BatchPluginOptions ? EdenLink : TypeError<"Batch plugin not detected on Elysia.js app instance">; /** * @see https://trpc.io/docs/v11/client/links/httpLink */ declare function httpBatchLink(options?: HttpBatchLinkOptions): EdenLink; type ConsoleEsque = { log: (...args: any[]) => void; error: (...args: any[]) => void; }; type EnableFnOptions = { direction: 'down'; result: OperationResultEnvelope | unknown; } | (Operation & { direction: 'up'; }); type EnabledFn = (opts: EnableFnOptions) => boolean; type LoggerLinkFnOptions = Operation & ({ /** * Request result */ direction: 'down'; result: OperationResultEnvelope | unknown; elapsedMs: number; } | { /** * Request was just initialized */ direction: 'up'; }); type LoggerLinkFn = (opts: LoggerLinkFnOptions) => void; type ColorMode = 'ansi' | 'css' | 'none'; interface LoggerLinkOptions { logger?: LoggerLinkFn; enabled?: EnabledFn; /** * Used in the built-in defaultLogger */ console?: ConsoleEsque; /** * Color mode * @default typeof window === 'undefined' ? 'ansi' : 'css' */ colorMode?: ColorMode; /** * Include context in the log - defaults to false unless `colorMode` is 'css' */ withContext?: boolean; } type ExtendedLoggerFnOptions = LoggerLinkFnOptions & { colorMode: ColorMode; withContext?: boolean; }; type LoggerOptions = { c?: ConsoleEsque; colorMode?: ColorMode; withContext?: boolean; }; /** * @see https://trpc.io/docs/v11/client/links/loggerLink */ declare function loggerLink(options?: LoggerLinkOptions): EdenLink; type SplitLinkOptions = { /** */ condition: (operation: Operation) => boolean; /** * The link(s) to execute next if {@link SplitLinkOptions.condition} function returns `true`. */ true: MaybeArray>; /** * The link(s) to execute next if {@link SplitLinkOptions.condition} function returns `false`. */ false: MaybeArray>; }; declare function splitLink(options: SplitLinkOptions): EdenLink; /** * The result of parsing a paths array. */ type ParsedPathAndMethod = { /** * Array of path segments that make up the path. * * @example ['api', 'hello', 'index', 'get'] -> ['api', 'hello', 'index'] */ paths: string[]; /** * The (absolute) path represented as a single string. * * @example ['api', 'hello', 'index', 'get'] ->'/api/hello/index' */ path: string; /** * The method from the original paths array, if found. * * @example ['api', 'hello', 'index', 'get'] -> 'get' */ method?: string; }; /** * Given an array of path segments, where the last segment is possibly a method, * parse it into proper labels. * * @example * * const originalPaths = ['api', 'hello', 'index', 'get'] * * const path = '/api/hello/index' * * const method = 'get' */ declare function parsePathsAndMethod(paths: string[] | readonly string[]): ParsedPathAndMethod; declare function isHttpMethod(value: unknown): boolean; declare function isGetOrHeadMethod(value: unknown): boolean; export { type BatchMethod, DataTransformerOptions, EdenLink, EdenRequestOptions, type ExtendedLoggerFnOptions, HTTPHeaders, type HttpBatchLinkOptions, type LoggerLinkOptions, type LoggerOptions, Operation, OperationResultEnvelope, type ParsedPathAndMethod, type SplitLinkOptions, TypeError, generateGetBatchRequestInformation, generatePostBatchRequestInformation, httpBatchLink, isGetOrHeadMethod, isHttpMethod, loggerLink, parsePathsAndMethod, safeHttpBatchLink, splitLink };