ExtractSchema
ExtractSchema<
T> =Textendsobject?S:EmptySchema
Defined in: packages/codecs/src/schema-types.ts:116
Extract the schema type from a Module or Client instance.
Type Parameters
Section titled “Type Parameters”T
Example
Section titled “Example”const worker = new Module("worker") .method("search", { requestCodec: msgpack<SearchQuery>(), responseCodec: msgpack<SearchResult>(), });
export type WorkerSchema = ExtractSchema<typeof worker>;
// child.tsimport type { WorkerSchema } from "./parent.js";const client = new Client<WorkerSchema>();