Group.children if I am not mistaken is the collection of items added by the Group.Add method. So they are TwoElements.
With this assumption I made Collection generic. (with default of any in order to prevent affecting other usages)
And also defined Children type as a collection of TwoElements. And also Group.children as Children.
this made usages possible like,
this.root.children.forEach(child => this.root.position.blablabla
I am still thinking of
export class Children extends Collection<Shape> ...
but children is filled by Add and it accepts TwoElement; so I think i will stick with that.
Group.children
if I am not mistaken is the collection of items added by theGroup.Add
method. So they areTwoElements
. With this assumption I madeCollection
generic. (with default of any in order to prevent affecting other usages) And also definedChildren
type as a collection ofTwoElements
. And alsoGroup.children
asChildren
.this made usages possible like,
this.root.children.forEach(child => this.root.position.blablabla
I am still thinking of
export class Children extends Collection<Shape> ...
but children is filled by Add and it accepts TwoElement; so I think i will stick with that.