We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion to add types to lib.d.ts:
type RecursiveReadonly<T> = { readonly [P in keyof T]: RecursiveReadonly<T[P]>; }; type RecursivePartial<T> = { [P in keyof T]?: RecursivePartial<T[P]>; };
Difference from Readonly and Partial
type ComplexType = { a: { b: { c: { d: number; } } } }; const x:Readonly<ComplexType> = { a: { b: { c: { d: 1 } } } }; const xx: RecursiveReadonly<ComplexType> = { a: { b: { c: { d: 1 } } } }; x.a.b.c.d = 3; //xx.a.b.c.d = 3; // Error const y:Partial<ComplexType> = {}; const yy: RecursivePartial<ComplexType> = {}; //y.a = {};// Error yy.a = {}; // OK
Playground
The text was updated successfully, but these errors were encountered:
Duplicate of #13923
Sorry, something went wrong.
No branches or pull requests
Suggestion to add types to lib.d.ts:
Difference from Readonly and Partial
Playground
The text was updated successfully, but these errors were encountered: