json-schema-to-typescript
                                
                                 json-schema-to-typescript copied to clipboard
                                
                                    json-schema-to-typescript copied to clipboard
                            
                            
                            
                        Support propertyNames with enum
propertyNames is included in the "not expressible in TS" list, but at least for the case with enum instead of pattern, this is not true. Consider the following example:
{
  "type": "object",
  "title": "workingHours",
  "definitions": {
    "weekdays": {"type": "string", "enum": ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]}
  },
  "additionalProperties": {"type": "number"},
  "propertyNames": {"$ref": "#/definitions/weekdays"}
}
could well be expressed in TS as
enum weekdays {
  monday = "monday",
  tuesday = "tuesday",
  wednesday = "wednesday",
  thursday = "thursday",
  friday = "friday",
  saturday = "saturday",
  sunday = "sunday"
}
type workingHours = {[k in weekdays]: number};
The example also shows what would be the purpose of this instead of specifying the properties literally: weekdays does not have to be repeated all the time when there are more types making use of its keys.
Note that properties expressed with additionalProperties are optional so the correct expression in TS is:
type workingHours = {[k in weekdays]?: number};