Skip to content

Instantly share code, notes, and snippets.

@BackEndTea
Last active March 12, 2021 09:54
Show Gist options
  • Save BackEndTea/d4da1c082b3d9eddcde1d2e6c19c4fcd to your computer and use it in GitHub Desktop.
Save BackEndTea/d4da1c082b3d9eddcde1d2e6c19c4fcd to your computer and use it in GitHub Desktop.
interface Foo {
foo(): void;
}
// One
type FooBag = {
one: Foo,
two: Foo,
three: Foo
};
// Two
type FooKey = 'one'|'two'|'three';
type FooBag = Record<FooKey, Foo>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment