split-pane-react icon indicating copy to clipboard operation
split-pane-react copied to clipboard

Typescript error

Open sscarduzio opened this issue 3 years ago • 2 comments

I'm trying to get this to work in my vite project, I keep on getting this error:

node_modules/split-pane-react/src/SplitPane.tsx:122:46 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'IAxis'.
  No index signature with a parameter of type 'string' was found on type 'IAxis'.

122         let distanceX = curAxis[splitAxis] - axis.current[splitAxis];
                                                 ~~~~~~~~~~~~~~~~~~~~~~~


sscarduzio avatar Nov 30 '22 10:11 sscarduzio

After loosening up tsconfig.json the above is ignored, but then I have these:

#26 4.052 node_modules/split-pane-react/src/SplitPane.tsx(60,30): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
#26 4.052   No index signature with a parameter of type 'string' was found on type '{}'.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(104,45): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(112,43): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(120,46): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(120,49): error TS7006: Parameter 'i' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(122,25): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ x: any; y: any; }'.
#26 4.053   No index signature with a parameter of type 'string' was found on type '{ x: any; y: any; }'.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(122,46): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'IAxis'.
#26 4.053   No index signature with a parameter of type 'string' was found on type 'IAxis'.
#26 4.053 node_modules/split-pane-react/src/base.ts(45,28): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
#26 4.053 node_modules/split-pane-react/src/sash.tsx(17,39): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/sash.tsx(21,37): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/sash.tsx(55,13): error TS2322: Type 'void' is not assignable to type 'ReactNode'.
#26 4.112 error Command failed with exit code 2.
#26 4.112 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

sscarduzio avatar Nov 30 '22 10:11 sscarduzio

After loosening up tsconfig.json the above is ignored, but then I have these:

#26 4.052 node_modules/split-pane-react/src/SplitPane.tsx(60,30): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
#26 4.052   No index signature with a parameter of type 'string' was found on type '{}'.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(104,45): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(112,43): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(120,46): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(120,49): error TS7006: Parameter 'i' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(122,25): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ x: any; y: any; }'.
#26 4.053   No index signature with a parameter of type 'string' was found on type '{ x: any; y: any; }'.
#26 4.053 node_modules/split-pane-react/src/SplitPane.tsx(122,46): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'IAxis'.
#26 4.053   No index signature with a parameter of type 'string' was found on type 'IAxis'.
#26 4.053 node_modules/split-pane-react/src/base.ts(45,28): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
#26 4.053 node_modules/split-pane-react/src/sash.tsx(17,39): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/sash.tsx(21,37): error TS7006: Parameter 'e' implicitly has an 'any' type.
#26 4.053 node_modules/split-pane-react/src/sash.tsx(55,13): error TS2322: Type 'void' is not assignable to type 'ReactNode'.
#26 4.112 error Command failed with exit code 2.
#26 4.112 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Thanks for using, I will repair it soon

yyllff avatar Nov 30 '22 12:11 yyllff