TypeScript

Typescript

Union Type

- (type1 | type2 | type3 | .. | typeN)

let code: (string | number)

Literal type

  • link

    let resultConversion: 'as-number' | 'as-text'

Aliases type

type User {
    name: string,
    age: number
}