type WithKind> = { [K in keyof T]: T[K] & { kind: K }; }[keyof T]; type TopLevelParams = { enum: { values: string[] }, interface: { base: string[]; props: Record; } }; type TopLevel = WithKind; type TypeParams = { literal: { value: string | boolean | null }, reference: { name: string }, array: { base: Type }, union: { types: Type[] }, object: { items: Record }, }; type Type = WithKind; type SpecExtension = Record; type Spec = SpecExtension & { __is_resolved__: true }; export const parser: { parse(src: string): SpecExtension };