-
-
Notifications
You must be signed in to change notification settings - Fork 460
Open
Labels
Description
Love the library, appreciate all the work on it!
We have tried to update to v0.8.17, and hit a bunch of type-checker errors. We use TypeScript. The errors are generally places in our codebase which take a Shape
as an argument. It doesn't seem TypeScript believes the v0.8.17 versions of, well, just about anything qualify as a Shape
. Not Group
, not Rectangle
, not Line
, not Path
. Most, I think all, complain about the type of an _update
field. E.g.
function f(_: Two.Shape) {}
f(new Two.Group())
With v0.8.17 produces errors like so:
Overload 1 of 2, '(objects: Shape | Shape[]): Group', gave the following error.
Argument of type 'Group' is not assignable to parameter of type 'Shape | Shape[]'.
Type 'Group' is not assignable to type 'Shape'.
Types have separate declarations of a private property '_update'.
Overload 2 of 2, '(...args: Shape[]): Group', gave the following error.
Argument of type 'Group' is not assignable to parameter of type 'Shape'.
Types have separate declarations of a private property '_update'.
Overload 1 of 2, '(objects: Shape | Shape[]): Group', gave the following error.
Argument of type 'Line' is not assignable to parameter of type 'Shape | Shape[]'.
Type 'Line' is not assignable to type 'Shape'.
The types returned by 'copy(...)' are incompatible between these types.
Type 'Path' is not assignable to type 'Shape'.
Types have separate declarations of a private property '_update'.
Overload 2 of 2, '(...args: Shape[]): Group', gave the following error.
Argument of type 'Line' is not assignable to parameter of type 'Shape'.
The types returned by 'copy(...)' are incompatible between these types.
Type 'Path' is not assignable to type 'Shape'.
Types have separate declarations of a private property '_update'.
Is that the intent?
If so, what would you recommend for those use-cases?