refactor(core): CORE-13 type component registries and own control lifetimes

This commit is contained in:
Harvey Zhao committed 2026-09-11 04:54:32 +08:00
1 parent 9eb7c945ca
commit 697817eceb
68 files changed
+10100 -1925

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import type { ComponentHost, EntryInput } from './component/types'
import Component from './utils/component'
export interface LayerHost extends ComponentHost {
option: { layers: EntryInput<LayerHost>[] }
template: { $player: HTMLElement, $layer: HTMLElement }
}
export default class Layer extends Component<LayerHost> {
constructor(art: LayerHost) {
super(art)
const { option, template: { $layer } } = art
this.name = 'layer'
this.$parent = $layer
for (let index = 0; index < option.layers.length; index++)
this.add(option.layers[index]!)
}
}