svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

error TS2416: Property 'at' in type 'PointArray' is not assignable to the same property in base type 'Array<ArrayXY>'. #1212

Closed lukatendai closed 2 years ago

lukatendai commented 3 years ago

Error: node_modules/@svgdotjs/svg.js/svg.js.d.ts:380:9 - error TS2416: Property 'at' in type 'PointArray' is not assignable to the same property in base type 'Array'. Type '(pos: number) => PointArray' is not assignable to type '(index: number) => ArrayXY'. Type 'PointArray' is not assignable to type 'ArrayXY'.

380 at(pos: number): PointArray; ~~

Error: node_modules/@svgdotjs/svg.js/svg.js.d.ts:439:9 - error TS2416: Property 'at' in type 'PathArray' is not assignable to the same property in base type 'Array'. Type '(pos: number) => PathArray' is not assignable to type '(index: number) => PathCommand'. Type 'PathArray' is not assignable to type 'PathCommand'. Type 'PathArray' is not assignable to type '["a" | "A", number, number, number, number, number, number, number]'.

It looks like at should return element of the array not the whole array?

Fuzzyma commented 3 years ago

No it does return the whole array but as far as I know this Funktion is not used anymore? Have to double check

crystalfp commented 3 years ago

As a test I commented the two lines in svg.js.d.ts (380 and 439) and now the application compiles and runs without errors.

larshp commented 3 years ago

hmm, same issue here, commented the lines, but its just a temporary fix

TV-T commented 2 years ago

@Fuzzyma looks like you removed the function from PointArray and PathArray in this commit: https://github.com/svgdotjs/svg.js/commit/747f8e810eea3bb4836b50f411a7de6f5d67cbfa#

Fuzzyma commented 2 years ago

@Basementbrb in that case it should be removed form the typescript file alltogether

larshp commented 2 years ago

when the latest code is published to npm this issue should be fixed

meriturva commented 2 years ago

Just to know, any ETA when the new version will be released?

MuhKuh7 commented 2 years ago

any update?

larshp commented 2 years ago

new version released, see https://github.com/svgdotjs/svg.js/issues/1245#issuecomment-1022660309

I can confirm that the new release solves my issue ❤️