diff --git a/src/core/Infer.ts b/src/core/Infer.ts index 07b8325f..571934aa 100644 --- a/src/core/Infer.ts +++ b/src/core/Infer.ts @@ -3,6 +3,7 @@ import {EntryFields} from './EntryFields.js' import {Expr} from './Expr.js' import {Field} from './Field.js' import {Type} from './Type.js' +import {ListRow} from './shape/ListShape.js' type QueryList = Expand< UnionOfValues<{ @@ -13,7 +14,7 @@ type QueryList = Expand< export type InferQueryValue = T extends Array> ? InferQueryValue : T extends Type - ? Type.Infer & EntryFields + ? Type.Infer : T extends Expr ? QueryValue : T extends Record @@ -41,3 +42,14 @@ export type InferStoredValue = T extends Type : {} export type Infer = InferQueryValue + +export namespace Infer { + export type Entry< + T extends Type, + TypeName extends string = string + > = InferQueryValue & Omit & {_type: TypeName} + export type ListItem< + T extends Type, + TypeName extends string = string + > = InferQueryValue & Omit & {_type: TypeName} +}