TypeScript
Typescript
Union Type
- (type1 | type2 | type3 | .. | typeN)
let code: (string | number)
Literal type
-
let resultConversion: 'as-number' | 'as-text'
Aliases type
type User {
name: string,
age: number
}
- (type1 | type2 | type3 | .. | typeN)
let code: (string | number)
let resultConversion: 'as-number' | 'as-text'
type User {
name: string,
age: number
}