Type alias ApiTypeOf<Closure, Meta, T>

ApiTypeOf<Closure, Meta, T>: { [ Prop in keyof T]: T[Prop] extends ((...args: any) => any) ? EndpointWithClosure<T[Prop], Closure, Meta> : ApiTypeOf<Closure, Meta, T[Prop] extends Api<unknown, Meta> ? T[Prop] : never> }

Estuary-RPC at some points needs a type definition for your API, and at some points needs the metadata definition This type will extract the type definition with a generic closure (as client and server side type definitions use separate closures).

Example

const myApiMetadata = { foo: get<number, number, SimpleMeta>("foo")};
type MyApiTypeOf<Closure> = ApiTypeOf<typeof myApiMetadata>;
const client = createApiClient(myApiMetadata) as MyApiTypeOf<ClientClosure>;

Type Parameters

Generated using TypeDoc