···130 * Infers the TypeScript type for a lexicon namespace, returning only the 'main' definition
131 * with all local refs (#user, #post, etc.) resolved to their actual types.
132 */
133-export type Infer<T extends { id: string; defs: Record<string, unknown> }> =
134- Prettify<
135- "main" extends keyof T["defs"]
136- ? { $type: T["id"] } & ReplaceRefsInType<
137- InferType<T["defs"]["main"]>,
138- { [K in keyof T["defs"]]: InferType<T["defs"][K]> }
139- >
140- : never
141- >;
0
···130 * Infers the TypeScript type for a lexicon namespace, returning only the 'main' definition
131 * with all local refs (#user, #post, etc.) resolved to their actual types.
132 */
133+export type Infer<
134+ T extends { json: { id: string; defs: Record<string, unknown> } },
135+> = Prettify<
136+ "main" extends keyof T["json"]["defs"]
137+ ? { $type: T["json"]["id"] } & ReplaceRefsInType<
138+ InferType<T["json"]["defs"]["main"]>,
139+ { [K in keyof T["json"]["defs"]]: InferType<T["json"]["defs"][K]> }
140+ >
141+ : never
142+>;
+1-1
packages/prototypey/src/lib.ts
···329330class Namespace<T extends LexiconNamespace> {
331 public json: T;
332- public infer: Infer<T> = null as unknown as Infer<T>;
333334 constructor(json: T) {
335 this.json = json;
···329330class Namespace<T extends LexiconNamespace> {
331 public json: T;
332+ public infer: Infer<{ json: T }> = null as unknown as Infer<{ json: T }>;
333334 constructor(json: T) {
335 this.json = json;