uwdata / arquero

Query processing and transformation of array-backed data tables.
https://idl.uw.edu/arquero
BSD 3-Clause "New" or "Revised" License
1.22k stars 64 forks source link

Problems getting Arquero to find it's types in Typescript #332

Closed mishatsvelik closed 2 weeks ago

mishatsvelik commented 1 year ago

I keep on getting messages like this, suggesting that arquero cannot find it's type declarations:

node_modules/arquero/dist/types/op/window-functions.d.ts:25:35 - error TS2304: Cannot find name 'WindowState'.

25 export type WindowValue = (state: WindowState) => any;


node_modules/arquero/dist/types/op/window-functions.d.ts:33:11 - error TS2304: Cannot find name 'AggregateInit'.

33     init: AggregateInit;
mishatsvelik commented 1 year ago

To reproduce this:

  1. Installed arquero to my Typescript project through the CLI: npm install arquero --save
  2. Added import * as aq from 'arquero' to index.ts
  3. Then if you go to node_modules/arquero/dist/types/op/window-functions.d.ts can see WindowState is highlighted red: type WindowState = /*unresolved*/ any
coreboarder commented 7 months ago

This is happening in Angular 17 as well

X [ERROR] TS2304: Cannot find name 'WindowState'. [plugin angular-compiler]

node_modules/arquero/dist/types/op/window-functions.d.ts:25:34:
  25 │ export type WindowValue = (state: WindowState) => any;
     ╵                                   ~~~~~~~~~~~

tsconfig.json is

/ To learn more about this file see: https://angular.io/config/tsconfig. / { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "esModuleInterop": true, "sourceMap": true, "declaration": false, "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, "target": "ES2022", "module": "ES2022", "useDefineForClassFields": false, "lib": [ "ES2022", "dom" ] }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true } }

coreboarder commented 7 months ago

The bolded change appears to have fixed the issue for me.

{ "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "esModuleInterop": true, "sourceMap": true, "declaration": false, "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, "target": "ES2022", "module": "ES2022", "useDefineForClassFields": false, "lib": [ "ES2022", "dom" ], "skipLibCheck": true }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true } }

atmgrifter00 commented 3 months ago

I'd like to point out that the above bolded change isn't really a fix. It's basically just a way to ignore type errors that Typescript would otherwise report. This is a library that we are trying to uptake, but we are not interested in turning on skipLibCheck, so I'd be interested in an actual solution.

rajsite commented 3 months ago

Looks like #346 may address this issue