-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
Description
It appears that the addArray function only accepts types extended from IRectangle. This appears to be an issue because IRectangle includes values that should not be set during addition of rectangles (such as x and y).
e.g.
// packer: MaxRectsPacker<IRectangle>
packer.addArray([{width: 1, height: 1}]) // Type '{ width: number; height: number; }' is missing the following properties from type 'IRectangle': x, y ts(2739)I think the generic needs to be more narrowed to something like
interface IRectangleInput {
width: number
height: number
[propName: string]: any
}perhaps porting the tests to typescript would catch this?
Thanks for making this lib either way π
Reactions are currently unavailable