Closed A-nd-y closed 1 year ago
Can you please show me the code that leads to these errors? I have an idea what’s the problem …
The generated type declarations are not fully TypeScript-conform at the moment. I've run into this a few weeks ago, trying to use the openhab module in a TypeScript project. I started to fix this issues and got it to work. I've created a branch of my changes, but it is now some commits behind the current main, because I didn't had the time to complete a pr.
I've also added a npm script to test the generated type declarations (compile it with tsc), which could be run during the test stage.
@florian-h05 I could rebase my branch to the current main and incorporate the changes to type declarations, which happened in main during the last time.
@sfriedle Would be great to get some type definitions additions, so yes, please rebase and open a PR. I’m not sure if your branch also included type definitions for Rule Builder, that would be really great.
Hi!
After some research I found the cause of the errors:
When I started developing the rules in Typescript, version 1.2.3 of the package was current. But in the package.json of this version there was no types property. So I manually added the typeRoots to tsconfig.json. And that was the whole problem.
Now that the types property is present in packes.json, I was able to revert the changes to the typeRoots and everything is fine.
So nothing needs to be fixed Sorry!
Hi!
With openhab 3.3 I started to rewrite all my rules with typescript. for this I use the npm package "openhab". Unfortunately without manual rework in node-module i get the following build error:
But if i create simple index.d.ts files in the folders
node_modules/openhab/types/items node_modules/openhab/types/metadata node_modules/openhab/types/things
all errors are gone and the output is generated. Apparently the behavior is still the same with the current package version (3.1.2). If you could add the missing index.d.ts files, I would be grateful.