xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
732 stars 290 forks source link

Type Declarations and Duplicate Identifier Issues in xeokit-sdk #1715

Closed JonathanMuribeca closed 1 week ago

JonathanMuribeca commented 3 weeks ago

Description:
In an Angular 17 project using xeokit-sdk, several TypeScript errors occur during the build process with ng build. The errors include missing module declarations, duplicate identifiers, and interface mismatches. This impacts the compilation and strict type checking within Angular's build pipeline.

Steps to Reproduce:

  1. Set up a new Angular 17 project (ng new).
  2. Install xeokit-sdk with npm install @xeokit/xeokit-sdk.
  3. Configure TypeScript for strict type checking.
  4. Run ng build.
  5. The following TypeScript errors are displayed during the build process:

Error Details:

  1. Module Not Found:

    • node_modules/@xeokit/xeokit-sdk/types/viewer/scene/models/PerformanceModel/index.d.ts:2:15 - error TS2307: Cannot find module './PerformanceNode' or its corresponding type declarations.
    • Line of code: export * from "./PerformanceNode";
  2. Duplicate Identifier numEntities:

    • node_modules/@xeokit/xeokit-sdk/types/viewer/scene/models/SceneModel.d.ts:172:9 - error TS2300: Duplicate identifier 'numEntities'.
    • node_modules/@xeokit/xeokit-sdk/types/viewer/scene/models/SceneModel.d.ts:179:9 - error TS2300: Duplicate identifier 'numEntities'.
  3. Interface Mismatch in Node Class:

    • node_modules/@xeokit/xeokit-sdk/types/viewer/scene/nodes/Node.d.ts:61:22 - error TS2420: Class 'Node' incorrectly implements interface 'Omit<Entity, "parent">'. Property 'getEachVertex' is missing in type 'Node' but required in type 'Omit<Entity, "parent">'.
    • node_modules/@xeokit/xeokit-sdk/types/viewer/scene/Entity.d.ts:395:3 - 'getEachVertex' is declared here.
    • In the JavaScript code of xeokit-sdk, the Node class extends from the abstract Entity class but does not implement the getEachVertex method. This results in a TypeScript error because TypeScript expects any subclass of Entity to either implement all abstract members or be itself marked abstract.

error

Environment:

Additional Information:
The issues seem related to TypeScript's strict checking and Angular's build process, causing the build to fail due to incompatibilities or missing declarations in the xeokit-sdk. Fixing these issues will help improve compatibility and ease of integration with Angular projects.

Thank you for your attention to this issue. Please let me know if I can provide further information or assist with testing.