Skip to content

Instantly share code, notes, and snippets.

@codeBelt
Created June 5, 2019 18:21
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 codeBelt/0625400f2fc7b7adf05c7c48653c5ebc to your computer and use it in GitHub Desktop.
Save codeBelt/0625400f2fc7b7adf05c7c48653c5ebc to your computer and use it in GitHub Desktop.
TypeScript Types
type SizeUnion =
| 'title1'
| 'title2'
| 'title3'
| 'headline'
| 'subhead'
| 'caption1'
| 'caption2'
| 'body1'
| 'callout'
| 'footnote1'
| 'footnote2'
| 'instruction1';
type SizeMap = Record<SizeUnion, string>;
private _sizeMap: SizeMap = {
title1: 'h1',
title2: 'h2',
title3: 'h3',
headline: 'h4',
subhead: 'h5',
caption1: 'p',
caption2: 'p',
body1: 'p',
callout: 'p',
footnote1: 'p',
footnote2: 'p',
instruction1: 'p',
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment