import { AnySchema, ErrorMap, AnyORPCError, AnyORPCErrorJSON, InferSchemaInput, InferSchemaOutput, ORPCError, ORPCErrorJSON, ORPCErrorCode, ORPCErrorFromErrorMap, ThrowableError, Context, Lazyable, Procedure, ProcedureClientOptions } from '@orpc/server'; import { MaybeOptionalOptions } from '@orpc/shared'; type ServerFunctionORPCErrorJSON = T extends ORPCError ? ORPCErrorJSON & { inferable: true; } : ORPCErrorJSON & { inferable: false; }; type ServerFunctionError = T extends ORPCErrorJSON & { inferable: true; } ? ORPCError : ThrowableError; type ServerFunctionRest = [input: TInput] | (undefined extends TInput ? [input?: TInput] : [input: TInput]); type ServerFunctionResult = [error: null, data: TOutput] | [error: TError, data: undefined]; interface ServerFunction { (...rest: ServerFunctionRest): Promise>; } type ProcedureServerFunction = ServerFunction, InferSchemaOutput, ServerFunctionORPCErrorJSON | TReturnedORPCError | ThrowableError>>; declare function createServerFunction(procedure: Lazyable>, ...rest: MaybeOptionalOptions>): ProcedureServerFunction; export { createServerFunction as e }; export type { ProcedureServerFunction as P, ServerFunction as S, ServerFunctionError as a, ServerFunctionORPCErrorJSON as b, ServerFunctionRest as c, ServerFunctionResult as d };