import { AnyProcedure, ProcedureArgs } from './procedure'; import { AnyRouter, AnyRouterDef, Router } from './router'; import { inferTransformedProcedureOutput } from './shared'; export type inferRouterDef = TRouter extends Router ? TParams extends AnyRouterDef ? TParams : never : never; export type inferRouterConfig = inferRouterDef['_config']; export type inferRouterContext = inferRouterConfig['$types']['ctx']; export type inferRouterError = inferRouterConfig['$types']['errorShape']; export type inferRouterMeta = inferRouterConfig['$types']['meta']; export declare const procedureTypes: readonly ["query", "mutation", "subscription"]; /** * @public */ export type ProcedureType = (typeof procedureTypes)[number]; export type inferHandlerInput = ProcedureArgs>; export type inferProcedureInput = inferProcedureParams['_input_in']; export type inferProcedureParams = TProcedure extends AnyProcedure ? TProcedure['_def'] : never; export type inferProcedureOutput = inferProcedureParams['_output_out']; type GetInferenceHelpers = { [TKey in keyof TRouter['_def']['record']]: TRouter['_def']['record'][TKey] extends infer TRouterOrProcedure ? TRouterOrProcedure extends AnyRouter ? GetInferenceHelpers : TRouterOrProcedure extends AnyProcedure ? TType extends 'input' ? inferProcedureInput : inferTransformedProcedureOutput : never : never; }; export type inferRouterInputs = GetInferenceHelpers<'input', TRouter>; export type inferRouterOutputs = GetInferenceHelpers<'output', TRouter>; /** * @internal */ export type IntersectionError = `The property '${TKey}' in your router collides with a built-in method, rename this router or procedure on your backend.`; /** * @internal */ export type ProtectedIntersection = keyof TType & keyof TWith extends never ? TType & TWith : IntersectionError; /** * @public */ export type Maybe = TType | null | undefined; /** * @internal * @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325 */ export type Simplify = TType extends any[] | Date ? TType : { [K in keyof TType]: TType[K]; }; /** * @public */ export type Dict = Record; /** * @public */ export type MaybePromise = Promise | TType; /** * @internal * * Creates a "lower-priority" type inference. * https://github.com/microsoft/TypeScript/issues/14829#issuecomment-322267089 */ export type InferLast = TType & { [KeyType in keyof TType]: TType[KeyType]; }; /** * @public */ export type inferAsyncReturnType any> = Awaited>; export type FilterKeys = { [TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never; }[keyof TObj]; /** * @internal */ export type Filter = Pick>; /** * Unwrap return type if the type is a function (sync or async), else use the type as is * @internal */ export type Unwrap = TType extends (...args: any[]) => infer R ? Awaited : TType; /** * Makes the object recursively optional * @internal */ export type DeepPartial = TObject extends object ? { [P in keyof TObject]?: DeepPartial; } : TObject; /** * Omits the key without removing a potential union * @internal */ export type DistributiveOmit = TObj extends any ? Omit : never; export type WithoutIndexSignature = { [K in keyof TObj as string extends K ? never : number extends K ? never : K]: TObj[K]; }; export {}; //# sourceMappingURL=types.d.ts.map