Skip to content

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

@raffaeldp

Description

@raffaeldp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions