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
Schema
into 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.0
is supported, butarr.0.property
is not. Use a more flexible type (such asany
orSomeDoc
) to support that.