Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

Type

Type<A, Id>: object & A

Create your own opaque sub-type from a type A

Type parameters

  • A: any

    to be personalized

  • Id: Key

    to name the sub-type

returns

A new type Type<A, Id>

example

import {A} from 'ts-toolbelt'

type EUR = A.Type<number, 'eur'>
type USD = A.Type<number, 'usd'>

let eurWallet = 10 as EUR
let usdWallet = 15 as USD

eurWallet = usdWallet // error

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.