Recursively map an API type to its validator shape.
Given an API like:
type API = { add(a: number, b: number): Promise<number> math: { multiply(a: number, b: number): Promise<number> }} Copy
type API = { add(a: number, b: number): Promise<number> math: { multiply(a: number, b: number): Promise<number> }}
This produces:
{ add?: { input?: StandardSchemaV1<[number, number]>, output?: StandardSchemaV1<number> } math?: { multiply?: { input?: ..., output?: ... } }} Copy
{ add?: { input?: StandardSchemaV1<[number, number]>, output?: StandardSchemaV1<number> } math?: { multiply?: { input?: ..., output?: ... } }}
MethodValidators<Parameters, ReturnType>
RPCValidators<NestedAPI>
never
Every key is optional at every level, so you only validate what you want.
Recursively map an API type to its validator shape.
Given an API like:
This produces:
MethodValidators<Parameters, ReturnType>RPCValidators<NestedAPI>never)Every key is optional at every level, so you only validate what you want.