three-ts-types
three-ts-types copied to clipboard
Incorrect typing for Earcut.triangulate return value
-
three
version: 0.143 -
node
version: 16.14.2 -
npm
(oryarn
) version: 8.5.0
Problem description:
According to its documentation and source, the Earcut.triangulate
method returns "an array of triangles. A triangle is defined by three consecutive integers representing vertex indices"; but the typings use Triangle[]
which is something else.
Suggested solution:
Should be fixed here, probably as:
function triangulate(data: number[], holeIndices: number[], dim: number): number[];