Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

Invert

Invert<O>: O extends unknown ? _Invert<O> : never

Swaps the keys and values of an Object (if applicable)

Type parameters

returns

Object

example

import {O} from 'ts-toolbelt'

enum E {
 A = 'Av',
 B = 'Bv',
 C = 'Cv',
 D = 'Dv',
 X = 1
}

type O = {
 A: 'Av'
 B: 'Bv'
 C: 'Cv'
 D: 'Dv'
 X: 1
}

type test0 = O.Invert<typeof E>
type test1 = O.Invert<O>

  • 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.