interface BasicSchema {
num: number,
arr: string[],
obj: {
nested: string,
someDoc: SomeDoc,
}
}
interface BasicSchemaInDotNotation {
'num': number,
'arr': string[],
[`arr.${number}`]: string,
'obj': { nested: string, someDoc: SomeDoc }
'obj.nested': string,
'obj.someDoc': SomeDoc,
[`obj.someDoc.${string}`]: any,
}
Converts some
Schemainto a type representing its dot notation (object paths).If a value is any or SomeDoc, it'll be allowed to be any old object.
Note that this does NOT support indexing into arrays beyond the initial array index itself. Meaning,
arr.0is supported, butarr.0.propertyis not. Use a more flexible type (such asanyorSomeDoc) to support that.