UNPKG

@xtr-dev/zod-rpc

Version:

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

117 lines 2.62 kB
/** * Auto-generated TypeScript types for Zod RPC services * Generated from: shared.ts * * This file contains TypeScript interfaces generated from JSON schemas. */ export interface MathAddInput { a: number; b: number; } export interface MathAddOutput { result: number; } export interface MathCalculateInput { expression: string; precision?: number; } export interface MathCalculateOutput { result: number; expression: string; } export interface UserGetInput { userId: string; } export interface UserGetOutput { id: string; name: string; email: string; age: number; } export interface UserCreateInput { name: string; email: string; age: number; } export interface UserCreateOutput { id: string; success: boolean; } export interface UserListInput { page: number; limit: number; } export interface UserListOutput { users: object[]; total: number; hasMore: boolean; } /** * Math Service * * 2 methods available: add, calculate */ export declare namespace MathService { type AddInput = MathAddInput; type AddOutput = MathAddOutput; type CalculateInput = MathCalculateInput; type CalculateOutput = MathCalculateOutput; /** * Service interface with all available methods */ interface Service { /** * add method */ add(input: AddInput): Promise<AddOutput>; /** * calculate method */ calculate(input: CalculateInput): Promise<CalculateOutput>; } } /** * User Service * * 3 methods available: get, create, list */ export declare namespace UserService { type GetInput = UserGetInput; type GetOutput = UserGetOutput; type CreateInput = UserCreateInput; type CreateOutput = UserCreateOutput; type ListInput = UserListInput; type ListOutput = UserListOutput; /** * Service interface with all available methods */ interface Service { /** * get method */ get(input: GetInput): Promise<GetOutput>; /** * create method */ create(input: CreateInput): Promise<CreateOutput>; /** * list method */ list(input: ListInput): Promise<ListOutput>; } } /** * Main API interface that combines all services * This represents the complete API surface that clients can interact with */ export interface API { /** * Math service methods */ math: MathService.Service; /** * User service methods */ user: UserService.Service; } //# sourceMappingURL=types.d.ts.map