Comment Comment by fwouts Yes! They're called discriminated unions: https://www.typescriptlang.org/docs/handbook/typescript-in-5...Here's an example: https://tseditor.fwouts.com/?t=ZXhwb3J0IHR5cGUgVmFsdWUgPSBVc... parent fwouts 4 years ago
Here's an example: https://tseditor.fwouts.com/?t=ZXhwb3J0IHR5cGUgVmFsdWUgPSBVc...