import { Array, Lazy, Literal, Object, Optional, type Parsed, type Runtype, Undefined, Union } from 'runtypes'; import { type Student as _Student, type Teacher as _Teacher } from '@runtyping/test-type-writers/fixtures/source/circular-references'; // This file is generated by runtyping (https://github.com/johngeorgewright/runtyping). // Manual changes might be lost - proceed with caution! export const Teacher: Runtype.Core<_Teacher> = Lazy(() => Object({ type: Literal("teacher"), students: Optional(Union(Array(Student), Undefined,)), reportsTo: Optional(Union(Teacher, Undefined,)), })); export type Teacher = Parsed; export const Student: Runtype.Core<_Student> = Lazy(() => Object({ type: Literal("student"), teacher: Teacher, })); export type Student = Parsed; export const User = Union(Student, Teacher,); export type User = Parsed;