mcneel / rhino3dm

Libraries based on OpenNURBS with a RhinoCommon style
MIT License
599 stars 135 forks source link

Missing and wrong Typescript definitions #470

Closed jesterKing closed 6 months ago

jesterKing commented 2 years ago

https://discourse.mcneel.com/t/rhino3dm-js-issues-in-the-typescript-declaration-file/141504

Relates to #433

opdich commented 2 years ago

I am having the same issue. Additionally, rhino3dm.d.ts is not included in the most recent version, 7.15.0

ghaaflan commented 1 year ago

you need to add a declaration file to convert js modules to typescript. A declaration file (with the .d.ts extension) is a TypeScript file that contains type declarations for a module, library, or API. These declarations provide type information for JavaScript code, allowing the TypeScript compiler to type-check and provide type-safe access to the code.

declare module 'rhino3dm' 
 // Declare the types and interfaces for therhino3dmmodule here. 

// For example: 
export interface Point { x: number; y: number; z: number; } 
fraguada commented 1 year ago

Dusting off this issue.

fraguada commented 1 year ago

The issues above have been fixed in docgen. Here is an example of what this produces (zipped to for GitHub): rhino3dm.d.ts.zip

fraguada commented 1 year ago

Closing. Tracking additional issues in #431

fraguada commented 7 months ago

There still seems to be an issue with the d.ts files. 8.4.0 went out with a poor d.ts file. Reopening to see if I can get a better system in place.

fraguada commented 6 months ago

Updated definitions are in the dev branch: https://github.com/mcneel/rhino3dm/blob/dev/src/js/rhino3dm.d.ts