ts-interface-builder
ts-interface-builder copied to clipboard
Lookup or indexed access operator doesn't support
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html
Sorry, maybe I just not found... Does this builder support lookups?
interface i1 {
field: string
}
interface i2 {
field: i1["field"]
}
Props inside the iface is array, so only way to implement this lookup like
private _compileIndexedAccessType(node: ts.IndexedAccessTypeNode): string {
return `this.${node.objectType.getText()}.props.find(prop => prop.name === ${node.indexType.getText()})`;
}
Guys I need your help.