sgenoud / replicad

The library to build browser based 3D models with code.
https://replicad.xyz
MIT License
323 stars 38 forks source link

Some typing issues #122

Open maelp opened 6 months ago

maelp commented 6 months ago

When trying to compile the equivalent of cad.js in typescript I get this error:

error TS2339: Property 'shell' does not exist on type 'Shell | Solid | CompSolid | Compound | Vertex | Edge | Wire | Face'.
  Property 'shell' does not exist on type 'Vertex'.
maelp commented 6 months ago

Similarly, when trying to compile

  const OC = await opencascade({
    locateFile: () => opencascadeWasm,
  });

there's an error

error TS2554: Expected 0 arguments, but got 1.

(and indeed the .d.ts shows declare function init(): Promise<OpenCascadeInstance>;)

sgenoud commented 6 months ago

What is the context of the first one?

For the second one I looked into it at some point - if I remember well, it comes from the upstream project

maelp commented 6 months ago

I just tried to compile this in Typescript:

https://github.com/sgenoud/replicad/blob/main/packages/replicad-app-example/src/cad.js#L4

and that was the error shown