import { Component } from "https://deno.land/x/tui@2.0.0-RC3/mod.ts";
Constructors
new
Component(options: ComponentOptions)Properties
children: SortedArray<Component>
drawnObjects: Record<string, DrawObject | DrawObject[]>
lastInteraction: Interaction
rectangle: BaseSignal<Rectangle>
state: BaseSignal<ComponentState>
style: BaseSignal<Style>
optional
subComponentOf: ComponentsubComponents: Record<string, Component>
theme: Theme
tui: Tui
view: BaseSignal<View | undefined>
visible: BaseSignal<boolean>
zIndex: BaseSignal<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