Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

AtLeast

AtLeast<L, K>: AtLeast<ObjectOf<L>, `${K & number}` | K> extends infer U ? U extends unknown ? _ListOf<U & object> : never : never

Make that at least one of the keys K are required in L at a time.

Type parameters

  • L: List

    to make required

  • K: Key

    (?=keyof L) to choose fields

returns

List [[Union]]

example

import {L} from 'ts-toolbelt'

type test0 = L.AtLeast<[1, 2, 3], 0> // [1, 2 | undefined, 3 | undefined]
type test1 = L.AtLeast<[1, 2, 3], 0 | 1> // [1, 2 | undefined, 3 | undefined] | [1 | undefined, 2, 3 | undefined]
type test2 = L.AtLeast<[1, 2, 3]>
// | [1, 2, 3]
// | [1, 2 | undefined, 3 | undefined]
// | [1 | undefined, 2, 3 | undefined]
// | [1 | undefined, 2 | undefined, 3]

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