Open tfs-tada opened 5 months ago
type Human<T> = { body: T; isHuman: true }; type Robot<T> = { body: T; isHuman: false; uuid: string }; type User<T> = Human<T> | Robot<T>; const jiro = { body: { name: "jiro" }, isHuman: true, uuid: "123" } as const; const user: User<{ name: string }> = jiro;