UNPKG

@xtr-dev/zod-rpc

Version:

Simple, type-safe RPC library with Zod validation and automatic TypeScript inference

62 lines 1.76 kB
import { z } from 'zod'; export declare const userService: import("@xtr-dev/zod-rpc").ServiceDefinition<{ get: { input: z.ZodObject<{ userId: z.ZodString; }, z.core.$strip>; output: z.ZodObject<{ id: z.ZodString; name: z.ZodString; email: z.ZodString; age: z.ZodNumber; }, z.core.$strip>; }; create: { input: z.ZodObject<{ name: z.ZodString; email: z.ZodString; age: z.ZodNumber; }, z.core.$strip>; output: z.ZodObject<{ id: z.ZodString; success: z.ZodBoolean; }, z.core.$strip>; }; list: { input: z.ZodObject<{ page: z.ZodNumber; limit: z.ZodNumber; }, z.core.$strip>; output: z.ZodObject<{ users: z.ZodArray<z.ZodObject<{ id: z.ZodString; name: z.ZodString; email: z.ZodString; }, z.core.$strip>>; total: z.ZodNumber; hasMore: z.ZodBoolean; }, z.core.$strip>; }; }>; export declare const mathService: import("@xtr-dev/zod-rpc").ServiceDefinition<{ add: { input: z.ZodObject<{ a: z.ZodNumber; b: z.ZodNumber; }, z.core.$strip>; output: z.ZodObject<{ result: z.ZodNumber; }, z.core.$strip>; }; calculate: { input: z.ZodObject<{ expression: z.ZodString; precision: z.ZodDefault<z.ZodNumber>; }, z.core.$strip>; output: z.ZodObject<{ result: z.ZodNumber; expression: z.ZodString; }, z.core.$strip>; }; }>; //# sourceMappingURL=shared.d.ts.map