Hello.
When using your reports framework in typescript, the stimulsoft.reports.d.ts is not written correctly. Doing this should help you with your development as well as I instantly found a bug in your declaration that was easy to fix.
Maybe you should re-write it in typescript - you would pick up a lot of bugs much earlier in your development life cycle.
File 'node_modules/stimulsoft-reports-js/Scripts/stimulsoft.reports.d.ts' is not a module
I am not a typescript expert - so it would be good if you found the best practice for generating this - but here are some issues I found.
1) I can fix the error above if I do a global replace of
declare namespace
to
export namespace
2) once I have done #1 - VSCode shows me a bug in your declarations:
Property 'draw' in type 'StiMarkerCoreXF' is not assignable to the same property in base type 'IStiMarkerCoreXF'.
Type '(context: StiContext, marker: IStiMarker, position: Point, zoom: number, showShadow: boolean, isMouseOver: boolean, isTooltipMode: boolean, isAnimation: boolean, toolTip: string, tag: any, interaction: StiInteractionDataGeom) => void' is not assignable to type '(context: StiContext, marker: IStiMarker, position: Point, zoom: number, showShadow: boolean, isMouseOver: boolean, isTooltipMode: boolean, isAnimation: boolean, toolTip: String, tag: any, interaction: StiInteractionDataGeom) => any'.
Types of parameters 'toolTip' and 'toolTip' are incompatible.
Type 'String' is not assignable to type 'string'.
Simple to fix - in interface IStiMarkerCoreXF and the draw method ( line 18173 ) , I change toolTip: String to toolTip: string
3) The stimulsoft.reports.d.ts file is massive 2.7MB . It would be a good idea to break down the typesceript definition file into smaller files otherwise you are having to load the whole thing every time youload a report.
Thanks
Martin
Reports not properly written for Typescript
-
- Posts: 7
- Joined: Thu Nov 23, 2017 11:32 pm
Re: Reports not properly written for Typescript
Hello.
Thank you for your questions.
We need some time for analysis and will keep in touch with any news.
Thank you.
Ticket reference: #2317
Thank you for your questions.
We need some time for analysis and will keep in touch with any news.
Thank you.
Ticket reference: #2317
Re: Reports not properly written for Typescript
Hello.
Here are answers from our developers:
1. The file is created by the compiler. Why do you think that this is wrong?
2. The issue with the types is fixed.
3. This task needs more time. It is in our TODO list.
Thank you.
Here are answers from our developers:
1. The file is created by the compiler. Why do you think that this is wrong?
2. The issue with the types is fixed.
3. This task needs more time. It is in our TODO list.
Thank you.
-
- Posts: 7
- Joined: Thu Nov 23, 2017 11:32 pm
Re: Reports not properly written for Typescript
Hello.
So the problem is that non of your examples are in typescript.
I am forced to use:
var Stimulsoft = require('stimulsoft-reports-js');
When I should be able to use:
import Stimulsoft from 'stimulsoft-reports-js';
If I use the import - it should give me all the typings , and access to all the objects through intellisense AND it should help you find and bugs in your code ( which there appear to be 241 currently )
But it says:
/node_modules/stimulsoft-reports-js/Scripts/stimulsoft.reports.d.ts' is not a module.ts(2306)
Errors like the following show up and it is unusable with a proper import statement.
Errors like:
'text' is defined as a property in class 'BaseTree', but is overridden here in 'CommonTree' as an accessor.
So the problem is that non of your examples are in typescript.
I am forced to use:
var Stimulsoft = require('stimulsoft-reports-js');
When I should be able to use:
import Stimulsoft from 'stimulsoft-reports-js';
If I use the import - it should give me all the typings , and access to all the objects through intellisense AND it should help you find and bugs in your code ( which there appear to be 241 currently )
But it says:
/node_modules/stimulsoft-reports-js/Scripts/stimulsoft.reports.d.ts' is not a module.ts(2306)
Errors like the following show up and it is unusable with a proper import statement.
Errors like:
'text' is defined as a property in class 'BaseTree', but is overridden here in 'CommonTree' as an accessor.
Re: Reports not properly written for Typescript
Hello.
Unfortunately, it's impossible to import our scripts this way.
They are too large. Please, use the script tag to load the scripts.
Thank you.
Unfortunately, it's impossible to import our scripts this way.
They are too large. Please, use the script tag to load the scripts.
Thank you.