Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "Object/Update"

Index

Type aliases

Type aliases

Update

Update<O, K, A>: object

Update in O the fields of key K with A. Use the x placeholder to get the current field type.

Type parameters

  • O: object

    to update

  • K: Index

    to chose fields

  • A: any

    to update with

returns

object

example

import {A, O} from 'ts-toolbelt'

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

type test0 = Update<User, 'id' | 'info', A.x | null>
// {
//     info: {
//         name: string;
//         age: number;
//         payment: {};
//     } | null;
//     id: number | null;
// }

Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.