Created
September 16, 2017 10:05
-
-
Save gunzip/936897e963327d18223f64072497db1b to your computer and use it in GitHub Desktop.
typescript tagged type
This file contains 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
declare class As<S extends string> { | |
private as: S; | |
} | |
type Email = string & As<'email'>; | |
type CustomerId = number & As<'customer-id'>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment