Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module.d.ts bad typings create error when using on typescript projects #500

Open
raffaeldp opened this issue Oct 7, 2024 · 0 comments
Open
Labels

Comments

@raffaeldp
Copy link

In the color.js file, some functions are typed like this :

/**
     * @param {integer} r Red component.
     * @param {integer} g Green component.
     * @param {integer} b Blue component.
     * @param {integer} a Alpha component.
     */

When the o3dv.module.d.ts is generated, the integer is used to type the function parameters :

Set(r: integer, g: integer, b: integer, a: integer): void;

The issue is that typescript can't find what 'integer' is.
Here is an example of the error while using angular :
image

The only solution for the moment is to skip the typescript libcheck by changing the skipLibCheck option to true in the project who use o3dv :

// tsconfig.json
{
    "compilerOptions": {
        ...
        "skipLibCheck": true,
    }
}

But it was not turned on since then and it would be nice that it stays on false.

Is there a specific reason for theses to be typed with "integer" instead of "number" ?
Maybe we can replace it by "number" and the problem will be gone ?
I will try to provide a Pull Request very soon to do this.
Any other idea to fix this issue ?

Ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant