I'm working on JSON-Schema-faker project where we use following TypeScript interface:
interface IGeneratorSchema {
faker?: any;
chance?: any;
}
for objects such as:
{
"faker": "name.findName"
}
or:
{
"chance": {
"bool": {
"likelihood": 100
}
}
}
Now we need to introduce support for x-faker and x-chance fields that would semantically mean the same as faker and chance, e.g:
{
"x-faker": "name.findName"
}
or:
{
"x-chance": {
"bool": {
"likelihood": 100
}
}
}
I know I can create neither x-faker nor x-chance field in TypeScript interface. The question is - how can I overcome that? I want TypeScript to strictly allow only those four fields: faker, chance, x-faker, x-chance.