Created
June 30, 2021 18:26
-
-
Save ankitbtanna/4d685da3c263739a9f0190904166e08d to your computer and use it in GitHub Desktop.
TypeScript: Template Literal Types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type SearchScopes = 'All Data' | 'Current Project' | 'My Projects'; | |
type Page = 'PL' | 'Search'; | |
type Search = `${SearchScopes}-${Page}`; | |
var a: Search = 'All Data-PL'; // Possible combinations = 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment