Typescript declaration file displays errors in valid react components

Stimulsoft Reports.JS discussion
Post Reply
grbspltt
Posts: 25
Joined: Fri Apr 28, 2017 2:50 pm

Typescript declaration file displays errors in valid react components

Post by grbspltt »

Using Stimulsoft.Reports.JS
Version: 2018.2.3
Build date: 2018.07.05

When I include the stimulsoft.report.d.ts type declaration file in my project it creates the error below for all valid react html elements returning from render functions.

I have to remove the file whenever I need to test the app.

Code: Select all

Type '{}' is not assignable to type 'DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>'.
  Type '{}' is not assignable to type 'HTMLAttributes<HTMLSpanElement>'.
    Types of property 'is' are incompatible.
      Type '(type: any) => boolean' is not assignable to type 'string'.
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Typescript declaration file displays errors in valid react components

Post by Lech Kulikowski »

Hello,

Please send us a sample project which reproduces the issue for analysis on support@stimulsoft.com

Thank you.
grbspltt
Posts: 25
Joined: Fri Apr 28, 2017 2:50 pm

Re: Typescript declaration file displays errors in valid react components

Post by grbspltt »

See attached.
Attachments
Reports-scaffold-app.zip
(3.27 MiB) Downloaded 160 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Typescript declaration file displays errors in valid react components

Post by HighAley »

Hello.

We need some time for analysis of your issue.
We will keep in touch with any news.

Thank you.

Ticket reference: #7216
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Typescript declaration file displays errors in valid react components

Post by HighAley »

Hello,

We have made an improvement.
Please, check our next build.

Also, you should load the stimulsoft.reports script first.

Thank you.
grbspltt
Posts: 25
Joined: Fri Apr 28, 2017 2:50 pm

Re: Typescript declaration file displays errors in valid react components

Post by grbspltt »

Thanks for the response, I downloaded the latest and loaded into the project, same exact error. See attached project. There is also a type error in the d.ts file on line 3142: Class 'Type' incorrectly implements interface 'Function'.   Property 'name' is missing in type 'Type'. Property '[Symbol.hasInstance]' is missing in type 'Type'.

Adding the bottom two lines appeared to fix the error.
class Type implements Function {
apply(thisArg: any, argArray?: any): any;
call(thisArg: any, ...argArray: any[]): any;
bind(thisArg: any, ...argArray: any[]): any;
prototype: any;
length: number;
arguments: any;
caller: Function;
readonly name: string;
[Symbol.hasInstance](value: any): boolean;
}
Attachments
stimulsoft-18-3-3-react-ts-scaffold.zip
(4.12 MiB) Downloaded 150 times
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Typescript declaration file displays errors in valid react components

Post by Lech Kulikowski »

Hello,

We need some time to investigate the issue.

Thank you.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Typescript declaration file displays errors in valid react components

Post by HighAley »

Hello.

We have made an improvement.
Please, check our next build when it will be available.

Thank you.
Post Reply