Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepbox8646 committed Jun 22, 2024
1 parent fc6dda9 commit 9bfaff2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/core/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,9 @@ export abstract class Widget {
* Add children widgets for the widget.
* @param children The added children.
*/
add(...children: (Widget | ((parent: Widget) => Widget))[]): this {
add(...children: any[]): this {
// let index = 0
for (let child of children) {
if (typeof child === 'function')
child = child(this)
for (const child of children) {
child.parent = this
// child.status = 'live'
this.children.push(child)
Expand Down Expand Up @@ -257,7 +255,7 @@ export abstract class Widget {
return this
}

setup(setupFunc: SetupFunction<this>): this {
setup(setupFunc: SetupFunction<typeof this>): this {
const generator = setupFunc(this)
this.setups.push({ generator: generator as any, nextFrame: 0 })
return this
Expand Down

0 comments on commit 9bfaff2

Please sign in to comment.