@ui5/ts-interface-generator fails if there is no settings type
See original GitHub issue@ui5/ts-interface-generator: 0.5.1 There are issues with classes which doesn’t have settings type.
Error: CustomWebSocket inherits from EventProvider and has metadata but the parent class "sap/ui/core/ws/WebSocket".WebSocket seems to have no settings type. It might have no constructors, this is where the settings type is used.
In case this parent class is also in your project, make sure to add its constructors, then try again. A comment with instructions might be in the console output above.
Otherwise, you can temporarily remove this file (.../WebSocket.ts) from the project and try again to get the console output with the suggested constructors.
In any case, you need to make the parent parent class "sap/ui/core/ws/WebSocket".WebSocket have constructors with typed settings object to overcome this issue.
Generator fails on this and doesn’t continue to generate the rest of the interfaces.
Example: extending of WebSocket (https://ui5.sap.com/#/api/sap.ui.core.ws.WebSocket)
Would it be possible to generate interfaces without settings type of the parent? I see that the second interface in .gen.d.ts file could be generated without parent. (which adds fire<Event>
, detach<Event>
, attach<Event>
etc)
If no, at least some configuration with file exclusions would be nice as well.
Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
@ui5/ts-interface-generator - npm
Generator for TypeScript type definitions for custom UI5 controls implemented in TypeScript. Latest version: 0.5.3, last published: 18 days ...
Read more >UI5 & TypeScript - SAP
UI5 -TypeScript. This page provides an overview of all official TypeScript-related resources in the UI5 world. Topics. What is TypeScript about?
Read more >ts-interface-generator `Cannot read properties of undefined ...
Suddenly the generator started crashing with the same error: ... It's only the @ui5/dts-generator (generating type definitions for the UI5 ...
Read more >UI5 Tooling: a modern development experience for UI5!
Introduction On April 1st I talked about the “UI5 Tooling – a modern CLI-based development experience” in a SAP Community call.
Read more >TS cannot find modules - typescript - Stack Overflow
TypeScript relies on definition files that define the types, interfaces, ... If you're not familiar with TypeScript, I recommend going through their basic ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@iljapostnovs valid point reg.
EventProvider
and the generation of event related methods. However, I didn’t find enough benefit in changing this, see https://github.com/SAP/openui5/issues/3084#issuecomment-992187635 .Seems to make sense, thanks!