-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts-interface-generator: interface is not generated in multiple scenarios #337
Comments
Hi Ilja, Note that type "number" is not allowed for UI5 properties, only "int" or "float" - see https://ui5.sap.com/#/api/sap.ui.base.ManagedObject%23methods/sap.ui.base.ManagedObject.extend Thanks and regards |
Hi @akudev, Thanks a lot!
Yeah, silly mistake by me. I was aware of that, but I guess my data typing was "typescripted" away for this issue :) |
The next release has been created now (0.4.1). |
Hi @akudev, I'm receiving an error for this case using v0.4.1:
|
Hi @iljapostnovs, NOTE:
Class MyControl in file [c:/.../git/ui5-typescript/packages/ts-interface-generator/src/test/testdata/testControl/MyControl.ts]() needs to contain the following constructors, in order to make TypeScript aware of the possible constructor settings. Please copy&paste the block manually, as the ts-interface-generator will not touch your source files:
===== BEGIN =====
// The following three lines were generated and should remain as-is to make TypeScript aware of the constructor signatures
constructor(idOrSettings?: string | $MyControlSettings);
constructor(id?: string, settings?: $MyControlSettings);
constructor(id?: string, settings?: $MyControlSettings) { super(id, settings); }
===== END ===== Once the suggested constructors are added to MyControl, the next run of the generator does succeed. This is what I would suggest as temporary workaround. I'm not sure whether the scenario is likely to happen - at least when MyControl is developed first, the constructors should already be added in the beginning and then creating OneMoreControl will succeed just fine. But apparently you encountered the scenario. Maybe the hint to add the constructors should be made clearer. Or maybe not doing so should result in an error? But of course I can also try to handle this case. After all, all the way up the chain there is a UI5 base class with well-defined settings type. Might be a bit tricky, though, to get there in this stage of the generation, orthogonal to the regular flow... I'll have to check. Thanks for reporting! I opened #346 to track it separately. |
ts-interface-generator version: 0.4.0
Interface for ManagedObject children is not generated:
Interface for second+ level children of Control is not generated:
The text was updated successfully, but these errors were encountered: