import { type TRPCMutationProcedure, type TRPCQueryProcedure, type TRPCSubscriptionProcedure } from '@trpc/server'; import type { Context } from '../types/Context.js'; import { z } from 'zod/v4-mini'; import type { ApiParams } from '../types/ApiParams.js'; import type { Session } from '@ms-cloudpack/common-types'; export type CreateContext = () => Promise; /** * tRPC backend (the initialization functions should only be called once). * Exported for testing. */ export declare const trpc: import("@trpc/server").TRPCRootObject; /** Reusable TRPC router helper. */ export declare const createRouter: import("@trpc/server").TRPCRouterBuilder<{ ctx: Context; meta: object; errorShape: { message: string; code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER; data: import("@trpc/server").TRPCDefaultErrorData; }; transformer: false; }>; /** * Generic procedure supertype for the procedure helpers. This should only be used in defining * procedure helpers (not as a type on functions) because it expects all Context/Session keys * rather than narrowing to only the ones used. */ type Procedure = (opts: ApiParams) => TOutput | Promise; /** * tRPC procedure definition type. `metadata` is marked as `never` because we're not currently * using the `.metadata()` feature of procedures (could be added later). */ type ProcedureDef = { input: TInput; output: TOutput; meta: never; }; /** * Mutation procedure helper for tRPC. * * It's recommended to explicitly specify the type parameters to ensure the original types * and any docs are preserved in the procedures exposed on the client. */ export declare function mutationProcedure(procedure: Procedure, input: z.ZodMiniType, output: z.ZodMiniType): TRPCMutationProcedure>; /** * Query procedure helper for tRPC. * * It's recommended to explicitly specify the type parameters to ensure the original types * and any docs are preserved in the procedures exposed on the client. */ export declare function queryProcedure(procedure: Procedure, input: z.ZodMiniType, output: z.ZodMiniType): TRPCQueryProcedure>; /** * Subscription procedure helper for tRPC. * * It's recommended to explicitly specify the type parameters to ensure the original types * and any docs are preserved in the procedures exposed on the client. */ export declare function subscriptionProcedure(procedure: Procedure, input: z.ZodMiniType, output: z.ZodMiniType): TRPCSubscriptionProcedure>; export {}; //# sourceMappingURL=common.d.ts.map