Index
Type aliases
Type aliases
Update
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;
// }
Update in
O
the fields of keyK
withA
. Use thex
placeholder to get the current field type.