Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

At

At<A, K>: A extends List ? number extends A["length"] ? K extends number | `${number}` ? A[never] | undefined : undefined : K extends keyof A ? A[K] : undefined : unknown extends A ? unknown : K extends keyof A ? A[K] : undefined

Get in O the type of a field of key K

Type parameters

  • A: any
  • K: Key

    to extract at

param

to extract from

returns

[[Any]]

example

import {O} from 'ts-toolbelt'

type User = {
 info: {
     name: string
     age: number
     payment: {}
 }
 id: number
}

type test0 = O.At<User, 'id'> // number

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