You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's a really great idea @ikokostya! We might get requests to split it into two settings at some point (readOnlyProperties via readonly keyword, readOnlyValues via Readonly<> or ReadonlyArray<> types) - what do you think of splitting it that way?
The problem
I want to generate interface for object which must not be changed. I can manually wrap result using
DeepReadonly
type:but it doesn't work with arrays:
readonly
type operator to allow correct definition ofObject.freeze
microsoft/TypeScript#10725Suggestion
Add some option to
json-schema-to-typescript
for generating readonly properties. For example fromREADME.md
:For arrays
ReadonlyArray
type can be used:Questions
Unfortunately there is no way to create read only tuple (as I known) if
json-schema-to-typescript
produces it.The text was updated successfully, but these errors were encountered: