Skip to content

Instantly share code, notes, and snippets.

@eamonnboyle
Created August 27, 2021 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eamonnboyle/f123e47346f2778f2dd78a541d22772c to your computer and use it in GitHub Desktop.
Save eamonnboyle/f123e47346f2778f2dd78a541d22772c to your computer and use it in GitHub Desktop.
Large Discriminated Union
interface A {
kind: 'A';
child: Node;
}
interface B {
kind: 'B';
child: Node;
}
interface C {
kind: 'C';
child: Node;
}
interface D {
kind: 'D';
child: Node;
}
interface E {
kind: 'E';
child: Node;
}
interface F {
kind: 'F';
child: Node;
}
interface Terminal {
kind: 'Terminal';
}
type Node = A | B | C | D | E | F | Terminal;
declare const root: Node;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment