Deep partial typescript

Code examples

0
0

deep partial typescript

//You can simply create a new type, say, DeepPartial, which basically references itself:
type DeepPartial<T> = {
    [P in keyof T]?: DeepPartial<T[P]>;
};

//Then, you can use it as such:
const foobar: DeepPartial<Foobar> = {
  foo: 1,
  bar: { baz: true }
};

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................