import { Component } from "https://deno.land/x/tui@2.1.11/mod.ts";
Constructors
new
Component(options: ComponentOptions)Properties
children: SortedArray<Component>
drawnObjects: Record<string, DrawObject | DrawObject[]>
lastInteraction: Interaction
rectangle: SignalOfObject<Rectangle>
state: Signal<ComponentState>
optional
subComponentOf: ComponentsubComponents: Record<string, Component>
theme: Theme
tui: Tui
visible: Signal<boolean>
zIndex: Signal<number>
Methods
changeDrawnObjectVisibility(visible: boolean, remove?): void
Changes visibility of drawnObjects
(erases/draws them depending on {visible})
If {visible} is set to false and {remove} is set to true it deletes objects from drawnObjects
destroy(): void
Destroys component:
- Disables all listeners
- Removes all
drawnObjects
- calls
destroy()
on its children - Removes itself from
subComponentOf.subComponents
- Removes itself from
parent.children