You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per #208, their new tsconfig set compilerOptions.skipLibCheck to true - this does not fix the issue, but hides it by not type checking the type declaration. Adding the flag allows it to compile; however, the types are still incorrect.
The full error I get:
node_modules/blessed-contrib/index.d.ts:134:13 - error TS2416: Property 'setData' in type 'BarElement' is not assignable to the same property in base type 'CanvasElement<BarData>'.
Type '(data: BarData) => void' is not assignable to type '{ (data: BarData): void; (titles: string[], data: BarData): void; }'.
Types of parameters 'data' and 'titles' are incompatible.
Type 'string[]' has no properties in common with type 'BarData'.
134 setData(data: BarData): void;
~~~~~~~
node_modules/blessed-contrib/index.d.ts:277:13 - error TS2416: Property 'setData' in type 'GaugeElement' is not assignable to the same property in base type 'CanvasElement<any>'.
Type '{ (percent: number[]): void; (percent: number): void; }' is not assignable to type '{ (data: any): void; (titles: string[], data: any): void; }'.
Types of parameters 'percent' and 'titles' are incompatible.
Type 'string[]' is not assignable to type 'number[]'.
Type 'string' is not assignable to type 'number'.
277 setData(percent: number[]): void;
~~~~~~~
node_modules/blessed-contrib/index.d.ts:278:13 - error TS2416: Property 'setData' in type 'GaugeElement' is not assignable to the same property in base type 'CanvasElement<any>'.
Type '{ (percent: number[]): void; (percent: number): void; }' is not assignable to type '{ (data: any): void; (titles: string[], data: any): void; }'.
278 setData(percent: number): void;
~~~~~~~
Seems to have been introduced in 4.8.21 via #206, which adds the parameter overload for CanvasElement.setData to accept non-generic string titles which introduces the type compatibility.
Removing the overloaded function signature seems to resolve the errors without skipping type checks in the tsconfig. Perhaps instead fo changing the generic type, the SparklineElement class could implement a custom setData signature as a special case?
The text was updated successfully, but these errors were encountered:
Fresh install of
blessed
andblessed-contrib
.Typescript v4.6.3
Duplicate of #208, which was closed by original poster without clear justification.
The error presents itself with my original
tsconfig.json
:Per #208, their new
tsconfig
setcompilerOptions.skipLibCheck
totrue
- this does not fix the issue, but hides it by not type checking the type declaration. Adding the flag allows it to compile; however, the types are still incorrect.The full error I get:
Seems to have been introduced in 4.8.21 via #206, which adds the parameter overload for
CanvasElement.setData
to accept non-generic string titles which introduces the type compatibility.Removing the overloaded function signature seems to resolve the errors without skipping type checks in the
tsconfig
. Perhaps instead fo changing the generic type, theSparklineElement
class could implement a customsetData
signature as a special case?The text was updated successfully, but these errors were encountered: