blecsd 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -2
- package/README.md +209 -66
- package/dist/3d/index.d.ts +2 -2
- package/dist/3d/index.js +1 -1
- package/dist/audio/index.d.ts +2 -2
- package/dist/{border-D_Jb4ZJV.d.ts → border-Jb7TrMob.d.ts} +20 -10
- package/dist/chunk-2IEMMRUO.js +1 -0
- package/dist/chunk-3AV52GY5.js +1 -0
- package/dist/chunk-3LHLSY3Y.js +1 -0
- package/dist/chunk-3O4TQHGK.js +4 -0
- package/dist/chunk-3UJWZ5ZN.js +1 -0
- package/dist/chunk-5N3O25O7.js +1 -0
- package/dist/chunk-6M2J5QUA.js +1 -0
- package/dist/chunk-7IQEUVGF.js +1 -0
- package/dist/chunk-A6M6TFBL.js +1 -0
- package/dist/chunk-CUEUJAHK.js +3 -0
- package/dist/chunk-D42Q2KKR.js +1 -0
- package/dist/chunk-DYEXOFUU.js +2 -0
- package/dist/chunk-DYU72XLL.js +1 -0
- package/dist/chunk-E4CJRSND.js +1 -0
- package/dist/chunk-EAY7B5GL.js +1 -0
- package/dist/chunk-FCMTWFSE.js +1 -0
- package/dist/chunk-FL56THSI.js +25 -0
- package/dist/{chunk-2UBBZFE4.js → chunk-G437VE43.js} +1 -1
- package/dist/chunk-GGXNWT36.js +8 -0
- package/dist/chunk-HLFORKXS.js +1 -0
- package/dist/chunk-J7MBKEBY.js +1 -0
- package/dist/{chunk-TYMY2TBR.js → chunk-JHCKPCUH.js} +3 -3
- package/dist/chunk-K3SX2LY5.js +1 -0
- package/dist/chunk-LDAFEXN5.js +1 -0
- package/dist/chunk-MKMFUXLB.js +33 -0
- package/dist/chunk-MQWPHPUM.js +1 -0
- package/dist/chunk-MTI376CU.js +5 -0
- package/dist/chunk-MTV2RJZD.js +1 -0
- package/dist/chunk-NPDPBAW6.js +4 -0
- package/dist/chunk-OB66FB4F.js +1 -0
- package/dist/chunk-OR3BZY7C.js +1 -0
- package/dist/{chunk-VNZ6CWJA.js → chunk-R7AICVRN.js} +2 -2
- package/dist/{chunk-3B7MIVW6.js → chunk-RZ7FGVI6.js} +1 -1
- package/dist/chunk-UMGTXSQB.js +11 -0
- package/dist/chunk-X3Q3T2SS.js +4 -0
- package/dist/{chunk-JKVHO4LH.js → chunk-XZJRWFOS.js} +1 -1
- package/dist/chunk-ZAHG7Y3X.js +1 -0
- package/dist/cli/init.d.ts +1 -1
- package/dist/componentStorage-CJTh-TPO.d.ts +246 -0
- package/dist/components/index.d.ts +1942 -514
- package/dist/components/index.js +1 -1
- package/dist/core/index.d.ts +857 -259
- package/dist/core/index.js +1 -1
- package/dist/debug/index.d.ts +491 -98
- package/dist/debug/index.js +1 -1
- package/dist/dirtyTracking-C4v8MmM9.d.ts +235 -0
- package/dist/errors/index.d.ts +12 -12
- package/dist/errors/index.js +1 -1
- package/dist/{events-BbbxkgvX.d.ts → events-9ForpTfM.d.ts} +75 -2
- package/dist/game/index.d.ts +7 -7
- package/dist/game/index.js +1 -1
- package/dist/{gameLoop-BIPW7-OY.d.ts → gameLoop-C-Ez_i54.d.ts} +2 -2
- package/dist/{index-zSGJ2eUk.d.ts → index-DBS5Uefn.d.ts} +2 -2
- package/dist/index.d.ts +283 -20
- package/dist/index.js +3 -1
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +1 -1
- package/dist/{inputActions-CefRUBuT.d.ts → inputActions-CRsUtTHM.d.ts} +10 -721
- package/dist/packedStore-BgvnEdE7.d.ts +191 -0
- package/dist/{renderable-jTMOA-GK.d.ts → renderable-CwqGwrEV.d.ts} +9 -9
- package/dist/{scheduler-DcfoFuum.d.ts → scheduler-CMcYew9Z.d.ts} +65 -3
- package/dist/systems/index.d.ts +356 -55
- package/dist/systems/index.js +1 -1
- package/dist/terminal/index.d.ts +2233 -2299
- package/dist/terminal/index.js +1 -1
- package/dist/{tilemap-D1HJvKy3.d.ts → tilemap-BirMJdbu.d.ts} +92 -3
- package/dist/{types-BcsvoKzf.d.ts → types-CPB4CpbH.d.ts} +2 -2
- package/dist/utils/index.d.ts +27 -180
- package/dist/utils/index.js +1 -1
- package/dist/{virtualScrollback-DvZTRU8a.d.ts → virtualScrollback-D9uLFe8l.d.ts} +4 -4
- package/dist/{virtualViewport-Dx2iJliO.d.ts → virtualViewport-Bpv6jlKt.d.ts} +283 -761
- package/dist/widgets/bigText.d.ts +1 -1
- package/dist/widgets/bigText.js +1 -1
- package/dist/widgets/index.d.ts +10519 -5463
- package/dist/widgets/index.js +1 -1
- package/package.json +102 -6
- package/dist/chunk-35I22JJO.js +0 -1
- package/dist/chunk-3EGGGI5J.js +0 -3
- package/dist/chunk-4X4N4HNQ.js +0 -2
- package/dist/chunk-AQ7LW75B.js +0 -1
- package/dist/chunk-AXZQAH4X.js +0 -1
- package/dist/chunk-BCADUCOZ.js +0 -1
- package/dist/chunk-EJ5WVDDZ.js +0 -6
- package/dist/chunk-FT7BMYSN.js +0 -1
- package/dist/chunk-FYEBZAWN.js +0 -1
- package/dist/chunk-GYHI26UE.js +0 -1
- package/dist/chunk-H2YAOJDW.js +0 -1
- package/dist/chunk-K2B2OXQ5.js +0 -5
- package/dist/chunk-K37L3G4Z.js +0 -4
- package/dist/chunk-KD55INV7.js +0 -1
- package/dist/chunk-KFAK4A3G.js +0 -1
- package/dist/chunk-LCN2ZITE.js +0 -1
- package/dist/chunk-OUXUPF3V.js +0 -33
- package/dist/chunk-P6CJO3BC.js +0 -1
- package/dist/chunk-PI5UOHOH.js +0 -1
- package/dist/chunk-PSXXMBVJ.js +0 -1
- package/dist/chunk-TRK4422V.js +0 -12
- package/dist/chunk-W5OU7Z6J.js +0 -1
- package/dist/chunk-WNG4A3K7.js +0 -4
- package/dist/chunk-XRJNAHNG.js +0 -19
- package/dist/chunk-XZA63ZPO.js +0 -1
- package/dist/chunk-YAMOSPWB.js +0 -4
- package/dist/chunk-YD6ULIUR.js +0 -1
- package/dist/{keyParser-Bwm8-l7v.d.ts → keyParser-BnHbg2iD.d.ts} +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { W as World, E as Entity } from '../types-
|
|
2
|
-
export { B as BORDER_ASCII, a as BORDER_BOLD, b as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { A as
|
|
6
|
-
export { D as DEFAULT_BG, a as DEFAULT_FG, R as Renderable, b as RenderableData, S as StyleData, c as StyleOptions, g as getRenderable, d as getStyle, h as hasRenderable, e as hide, i as isDetached, f as isDirty, j as isEffectivelyVisible, k as isVisible, m as markClean, l as markDirty, s as setStyle, n as setVisible, o as show, t as toggle } from '../renderable-
|
|
1
|
+
import { W as World, E as Entity, U as Unsubscribe } from '../types-CPB4CpbH.js';
|
|
2
|
+
export { B as BORDER_ASCII, a as BORDER_BOLD, b as BORDER_DASHED, c as BORDER_DASHED_HEAVY, d as BORDER_DOUBLE, e as BORDER_ROUNDED, f as BORDER_SINGLE, g as Border, h as BorderCharset, i as BorderData, j as BorderOptions, k as BorderType, D as DEFAULT_BORDER_BG, l as DEFAULT_BORDER_FG, m as disableAllBorders, n as enableAllBorders, o as getBorder, p as getBorderChar, q as hasBorder, r as hasBorderVisible, s as setBorder, t as setBorderChars } from '../border-Jb7TrMob.js';
|
|
3
|
+
export { A as AABB, C as Collider, a as ColliderData, b as ColliderOptions, c as ColliderType, d as CollisionPair, D as DEFAULT_LAYER, e as DEFAULT_MASK, E as EMPTY_TILE, f as EmitterAppearance, g as EmitterData, h as EmitterOptions, P as Particle, i as ParticleData, j as ParticleEmitter, k as ParticleOptions, R as RenderedTileCell, T as TileDefinition, l as TileMap, m as TileMapComponentData, n as TileMapData, o as TileMapLayer, p as TileMapOptions, q as TilesetData, r as TilesetOptions, s as TrackedParticle, t as activateEmitter, u as addLayer, v as canLayersCollide, w as collisionPairKey, x as createCollisionPair, y as createTileData, z as fillTileRect, B as fillTiles, F as getCollider, G as getColliderAABB, H as getEmitter, I as getEmitterAppearance, J as getEmitterParticles, K as getLayerCount, L as getParticle, M as getParticleColor, N as getParticleProgress, O as getParticleTrackingStore, Q as getTile, S as getTileData, U as getTileMap, V as getTileMapDataId, W as getTileset, X as getTilesetByName, Y as hasCollider, Z as hasEmitter, _ as hasParticle, $ as hasTileMap, a0 as interpolateColor, a1 as isEmitterActive, a2 as isLayerVisible, a3 as isParticleDead, a4 as isTrigger, a5 as pauseEmitter, a6 as registerTileset, a7 as removeCollider, a8 as removeEmitter, a9 as removeParticle, aa as removeTileData, ab as removeTileMap, ac as renderTileMapArea, ad as resetParticleStore, ae as resetTileMapStore, af as resetTilesetStore, ag as setCollider, ah as setCollisionLayer, ai as setCollisionMask, aj as setEmitter, ak as setEmitterAppearance, al as setEmitterGravity, am as setEmitterRate, an as setEmitterSpeed, ao as setLayerVisible, ap as setParticle, aq as setTile, ar as setTileMap, as as setTrigger, at as testAABBOverlap, au as testCircleAABBOverlap, av as testCircleOverlap, aw as testCollision, ax as tileMapStore, ay as tilesetStore, az as trackParticle, aA as unregisterTileset, aB as untrackParticle } from '../tilemap-BirMJdbu.js';
|
|
4
|
+
import { t as ListSelectCallback, p as ListItem, u as ListState, o as ListEvent, m as ListDisplay, n as ListDisplayOptions, L as ListAction, v as ListStore, s as ListScrollInfo } from '../virtualViewport-Bpv6jlKt.js';
|
|
5
|
+
export { A as AUTO_DIMENSION, C as CellAlign, D as DEFAULT_CELL_BG, a as DEFAULT_CELL_FG, b as DEFAULT_HEADER_BG, c as DEFAULT_HEADER_FG, d as DEFAULT_SCROLLBACK_LINES, e as DEFAULT_TABLE_BORDER_BG, f as DEFAULT_TABLE_BORDER_FG, g as DEFAULT_TERMINAL_HEIGHT, h as DEFAULT_TERMINAL_WIDTH, i as DimensionConstraints, j as DimensionValue, k as Dimensions, l as DimensionsData, q as ListLazyLoadCallback, r as ListScrollCallback, S as ScrollInfoSchema, w as ScrollPercentage, x as ScrollPosition, y as Scrollable, z as ScrollableData, B as ScrollableOptions, E as ScrollbarVisibility, T as Table, F as TableCell, G as TableColumn, H as TableData, I as TableDisplay, J as TableDisplayOptions, K as TableRow, M as TableStore, N as TerminalBuffer, O as TerminalBufferConfig, P as TerminalBufferConfigSchema, Q as TerminalCursorShape, R as TerminalState, V as VirtualViewport, U as VirtualViewportData, W as VirtualViewportOptions, X as VirtualViewportOptionsSchema, Y as VirtualViewportScrollInfo, Z as VisibleRange, _ as VisibleRangeSchema, $ as appendRow, a0 as attachTableBehavior, a1 as calculateColumnWidths, a2 as canScroll, a3 as clearData, a4 as clearTableDisplay, a5 as clearTerminal, a6 as clearViewportDirty, a7 as decodePercentage, a8 as detachTableBehavior, a9 as encodePercentage, aa as ensureCursorVisible, bA as getCell, ab as getCellPadding, ac as getCellValue, ad as getColCount, ae as getColumn, af as getColumns, ag as getCursorLine, ah as getData, ai as getDataAsStrings, aj as getDataRows, ak as getDimensions, al as getHeaderRowCount, am as getHeaderRows, an as getResolvedHeight, ao as getResolvedWidth, ap as getRow, aq as getRowCount, ar as getScroll, as as getScrollPercentage, at as getScrollable, au as getSelectedLine, av as getTableDisplay, aw as getTerminalBuffer, ax as getTerminalCells, ay as getTerminalState, az as getVirtualScrollInfo, aA as getVirtualViewport, aB as getVisibleRange, aC as hasCellBorders, aD as hasDimensions, aE as hasScrollable, aF as hasTerminalBuffer, aG as hasVirtualViewport, aH as insertRow, aI as invalidateViewport, aJ as isAtBottom, aK as isAtTop, aL as isLineInRenderRange, aM as isLineVisible, aN as isPercentage, aO as isTable, aP as isViewportDirty, aQ as moveViewportCursor, aR as removeRow, aS as removeTerminalBuffer, aT as renderTableLines, aU as renderTerminalToAnsi, aV as resetTableStore, aW as resetTerminal, aX as resetTerminalBufferStore, aY as resizeTerminalBuffer, aZ as scrollBy, a_ as scrollByLines, a$ as scrollByPages, b0 as scrollTerminalDown, b1 as scrollTerminalToBottom, b2 as scrollTerminalToTop, b3 as scrollTerminalUp, b4 as scrollTo, b5 as scrollToBottom, b6 as scrollToLine, b7 as scrollToTop, b8 as scrollViewportToBottom, b9 as scrollViewportToTop, bB as setCell, ba as setCellBorders, bb as setCellPadding, bc as setConstraints, bd as setCursorLine, be as setCursorPosition, bC as setCursorVisible, bf as setData, bg as setDimensions, bh as setHeaderRowCount, bi as setHeaders, bj as setOverscan, bk as setScroll, bl as setScrollSize, bm as setScrollable, bn as setScrollbarVisibility, bo as setSelectedLine, bp as setShrink, bq as setTableDisplay, br as setTerminalBuffer, bs as setTotalLineCount, bt as setViewportStart, bu as setVirtualViewport, bv as setVisibleLineCount, bw as shouldShrink, bx as tableStore, by as writeChar, bz as writeToTerminal } from '../virtualViewport-Bpv6jlKt.js';
|
|
6
|
+
export { D as DEFAULT_BG, a as DEFAULT_FG, R as Renderable, b as RenderableData, S as StyleData, c as StyleOptions, g as getRenderable, d as getStyle, h as hasRenderable, e as hide, i as isDetached, f as isDirty, j as isEffectivelyVisible, k as isVisible, m as markClean, l as markDirty, s as setStyle, n as setVisible, o as show, t as toggle } from '../renderable-CwqGwrEV.js';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import { V as VirtualizedLineStore } from '../virtualizedLineStore-DwPEvPkk.js';
|
|
9
9
|
export { c as colorToHex, h as hexToColor, p as packColor, u as unpackColor } from '../color-B78w3zH-.js';
|
|
10
10
|
import 'bitecs';
|
|
11
|
+
import '../packedStore-BgvnEdE7.js';
|
|
11
12
|
import '../parser-iMHmQuUh.js';
|
|
12
13
|
import '../cell-DwIu2ryP.js';
|
|
13
|
-
import '../virtualScrollback-
|
|
14
|
+
import '../virtualScrollback-D9uLFe8l.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Animation component for sprite animation control.
|
|
@@ -803,6 +804,73 @@ declare function updateBehaviorTimer(world: World, eid: Entity, delta: number):
|
|
|
803
804
|
*/
|
|
804
805
|
declare function resetBehaviorStore(): void;
|
|
805
806
|
|
|
807
|
+
/**
|
|
808
|
+
* Configurable state machine framework
|
|
809
|
+
* @module core/stateMachine
|
|
810
|
+
* @internal This module is for internal use by widgets
|
|
811
|
+
*/
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Action function executed on state transitions.
|
|
815
|
+
* Receives the state machine context for side effects.
|
|
816
|
+
*/
|
|
817
|
+
type Action<Context = unknown> = (context: Context) => void;
|
|
818
|
+
/**
|
|
819
|
+
* Transition target with optional actions.
|
|
820
|
+
*/
|
|
821
|
+
interface TransitionConfig<S extends string, Context = unknown> {
|
|
822
|
+
target: S;
|
|
823
|
+
actions?: Action<Context>[];
|
|
824
|
+
guard?: (context: Context) => boolean;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* State configuration with entry/exit actions and transitions.
|
|
828
|
+
*/
|
|
829
|
+
interface StateConfig<S extends string, E extends string, Context = unknown> {
|
|
830
|
+
/** Actions to run when entering this state */
|
|
831
|
+
entry?: Action<Context>[];
|
|
832
|
+
/** Actions to run when exiting this state */
|
|
833
|
+
exit?: Action<Context>[];
|
|
834
|
+
/** Event handlers mapping events to target states */
|
|
835
|
+
on?: Partial<Record<E, S | TransitionConfig<S, Context>>>;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Full state machine configuration.
|
|
839
|
+
*
|
|
840
|
+
* @typeParam S - Union type of all state names
|
|
841
|
+
* @typeParam E - Union type of all event names
|
|
842
|
+
* @typeParam Context - Optional context object passed to actions
|
|
843
|
+
*/
|
|
844
|
+
interface StateMachineConfig<S extends string, E extends string, Context = unknown> {
|
|
845
|
+
/** Initial state when machine starts */
|
|
846
|
+
initial: S;
|
|
847
|
+
/** State definitions */
|
|
848
|
+
states: Record<S, StateConfig<S, E, Context>>;
|
|
849
|
+
/** Optional initial context */
|
|
850
|
+
context?: Context;
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* State change listener function.
|
|
854
|
+
*/
|
|
855
|
+
type StateListener<S extends string> = (current: S, previous: S) => void;
|
|
856
|
+
/**
|
|
857
|
+
* StateMachine interface for type-safe access.
|
|
858
|
+
*
|
|
859
|
+
* @typeParam S - Union type of all state names
|
|
860
|
+
* @typeParam E - Union type of all event names
|
|
861
|
+
* @typeParam Context - Optional context object passed to actions
|
|
862
|
+
*/
|
|
863
|
+
interface StateMachine<S extends string, E extends string, Context = unknown> {
|
|
864
|
+
readonly current: S;
|
|
865
|
+
readonly context: Context;
|
|
866
|
+
send(event: E): boolean;
|
|
867
|
+
can(event: E): boolean;
|
|
868
|
+
matches(state: S): boolean;
|
|
869
|
+
subscribe(listener: StateListener<S>): Unsubscribe;
|
|
870
|
+
validEvents(): E[];
|
|
871
|
+
reset(): void;
|
|
872
|
+
}
|
|
873
|
+
|
|
806
874
|
/**
|
|
807
875
|
* Button component and helper functions.
|
|
808
876
|
* Provides state machine support and button-specific operations.
|
|
@@ -1925,6 +1993,7 @@ declare const contentStore: {
|
|
|
1925
1993
|
* - `align`: Horizontal text alignment
|
|
1926
1994
|
* - `valign`: Vertical text alignment
|
|
1927
1995
|
* - `parseTags`: Whether to parse markup tags (0=no, 1=yes)
|
|
1996
|
+
* - `tabSize`: Tab character width in spaces (default: 8)
|
|
1928
1997
|
*
|
|
1929
1998
|
* @example
|
|
1930
1999
|
* ```typescript
|
|
@@ -1950,6 +2019,8 @@ declare const Content: {
|
|
|
1950
2019
|
valign: Uint8Array<ArrayBuffer>;
|
|
1951
2020
|
/** Parse markup tags (0=no, 1=yes) */
|
|
1952
2021
|
parseTags: Uint8Array<ArrayBuffer>;
|
|
2022
|
+
/** Tab character width in spaces (default: 8) */
|
|
2023
|
+
tabSize: Uint8Array<ArrayBuffer>;
|
|
1953
2024
|
};
|
|
1954
2025
|
/**
|
|
1955
2026
|
* Content configuration options.
|
|
@@ -1963,6 +2034,8 @@ interface ContentOptions {
|
|
|
1963
2034
|
valign?: TextVAlign;
|
|
1964
2035
|
/** Whether to parse markup tags */
|
|
1965
2036
|
parseTags?: boolean;
|
|
2037
|
+
/** Tab character width in spaces (1-16, default: 8) */
|
|
2038
|
+
tabSize?: number;
|
|
1966
2039
|
}
|
|
1967
2040
|
/**
|
|
1968
2041
|
* Content data returned by getContentData.
|
|
@@ -1975,6 +2048,7 @@ interface ContentData {
|
|
|
1975
2048
|
readonly align: TextAlign;
|
|
1976
2049
|
readonly valign: TextVAlign;
|
|
1977
2050
|
readonly parseTags: boolean;
|
|
2051
|
+
readonly tabSize: number;
|
|
1978
2052
|
}
|
|
1979
2053
|
/**
|
|
1980
2054
|
* Sets the text content of an entity.
|
|
@@ -2197,247 +2271,6 @@ declare function isParsingTags(world: World, eid: Entity): boolean;
|
|
|
2197
2271
|
*/
|
|
2198
2272
|
declare function resetContentStore(): void;
|
|
2199
2273
|
|
|
2200
|
-
/**
|
|
2201
|
-
* Dimensions component for entity sizing in the terminal grid.
|
|
2202
|
-
* @module components/dimensions
|
|
2203
|
-
*/
|
|
2204
|
-
|
|
2205
|
-
/**
|
|
2206
|
-
* Special value indicating "auto" (content-based) dimension.
|
|
2207
|
-
* When used, the dimension is calculated based on content.
|
|
2208
|
-
*/
|
|
2209
|
-
declare const AUTO_DIMENSION = -1;
|
|
2210
|
-
/**
|
|
2211
|
-
* Encodes a percentage value for storage in typed arrays.
|
|
2212
|
-
* Percentages are stored as negative values: -2 = 0%, -102 = 100%
|
|
2213
|
-
*
|
|
2214
|
-
* @param percent - Percentage value (0-100)
|
|
2215
|
-
* @returns Encoded value for storage
|
|
2216
|
-
*
|
|
2217
|
-
* @example
|
|
2218
|
-
* ```typescript
|
|
2219
|
-
* const encoded = encodePercentage(50); // Returns -52
|
|
2220
|
-
* ```
|
|
2221
|
-
*/
|
|
2222
|
-
declare function encodePercentage(percent: number): number;
|
|
2223
|
-
/**
|
|
2224
|
-
* Decodes a percentage value from typed array storage.
|
|
2225
|
-
*
|
|
2226
|
-
* @param value - Encoded value from storage
|
|
2227
|
-
* @returns Percentage value (0-100) or null if not a percentage
|
|
2228
|
-
*
|
|
2229
|
-
* @example
|
|
2230
|
-
* ```typescript
|
|
2231
|
-
* const percent = decodePercentage(-52); // Returns 50
|
|
2232
|
-
* const notPercent = decodePercentage(100); // Returns null
|
|
2233
|
-
* ```
|
|
2234
|
-
*/
|
|
2235
|
-
declare function decodePercentage(value: number): number | null;
|
|
2236
|
-
/**
|
|
2237
|
-
* Checks if a value represents a percentage.
|
|
2238
|
-
*
|
|
2239
|
-
* @param value - Value to check
|
|
2240
|
-
* @returns true if the value is an encoded percentage
|
|
2241
|
-
*/
|
|
2242
|
-
declare function isPercentage(value: number): boolean;
|
|
2243
|
-
/**
|
|
2244
|
-
* Dimensions component store using SoA (Structure of Arrays) for performance.
|
|
2245
|
-
*
|
|
2246
|
-
* - `width`, `height`: Size in terminal cells (floats), or encoded percentages
|
|
2247
|
-
* - `minWidth`, `minHeight`: Minimum size constraints
|
|
2248
|
-
* - `maxWidth`, `maxHeight`: Maximum size constraints
|
|
2249
|
-
* - `shrink`: Whether to shrink to content (0=no, 1=yes)
|
|
2250
|
-
*
|
|
2251
|
-
* Percentage values are encoded as negative numbers: -2 = 0%, -102 = 100%
|
|
2252
|
-
* Use `encodePercentage()` and `decodePercentage()` for conversion.
|
|
2253
|
-
*
|
|
2254
|
-
* @example
|
|
2255
|
-
* ```typescript
|
|
2256
|
-
* import { Dimensions, setDimensions, getDimensions } from 'blecsd';
|
|
2257
|
-
*
|
|
2258
|
-
* setDimensions(world, entity, 80, 24);
|
|
2259
|
-
*
|
|
2260
|
-
* const dims = getDimensions(world, entity);
|
|
2261
|
-
* console.log(dims.width, dims.height); // 80, 24
|
|
2262
|
-
* ```
|
|
2263
|
-
*/
|
|
2264
|
-
declare const Dimensions: {
|
|
2265
|
-
/** Width in terminal cells (or encoded percentage) */
|
|
2266
|
-
width: Float32Array<ArrayBuffer>;
|
|
2267
|
-
/** Height in terminal cells (or encoded percentage) */
|
|
2268
|
-
height: Float32Array<ArrayBuffer>;
|
|
2269
|
-
/** Minimum width constraint */
|
|
2270
|
-
minWidth: Float32Array<ArrayBuffer>;
|
|
2271
|
-
/** Minimum height constraint */
|
|
2272
|
-
minHeight: Float32Array<ArrayBuffer>;
|
|
2273
|
-
/** Maximum width constraint */
|
|
2274
|
-
maxWidth: Float32Array<ArrayBuffer>;
|
|
2275
|
-
/** Maximum height constraint */
|
|
2276
|
-
maxHeight: Float32Array<ArrayBuffer>;
|
|
2277
|
-
/** 0 = fixed size, 1 = shrink to content */
|
|
2278
|
-
shrink: Uint8Array<ArrayBuffer>;
|
|
2279
|
-
};
|
|
2280
|
-
/**
|
|
2281
|
-
* Dimension value that can be a number, percentage string, or 'auto'.
|
|
2282
|
-
*/
|
|
2283
|
-
type DimensionValue = number | `${number}%` | 'auto';
|
|
2284
|
-
/**
|
|
2285
|
-
* Dimensions data returned by getDimensions.
|
|
2286
|
-
*/
|
|
2287
|
-
interface DimensionsData {
|
|
2288
|
-
readonly width: number;
|
|
2289
|
-
readonly height: number;
|
|
2290
|
-
readonly minWidth: number;
|
|
2291
|
-
readonly minHeight: number;
|
|
2292
|
-
readonly maxWidth: number;
|
|
2293
|
-
readonly maxHeight: number;
|
|
2294
|
-
readonly shrink: boolean;
|
|
2295
|
-
}
|
|
2296
|
-
/**
|
|
2297
|
-
* Constraints data for min/max dimensions.
|
|
2298
|
-
*/
|
|
2299
|
-
interface DimensionConstraints {
|
|
2300
|
-
readonly minWidth?: number;
|
|
2301
|
-
readonly minHeight?: number;
|
|
2302
|
-
readonly maxWidth?: number;
|
|
2303
|
-
readonly maxHeight?: number;
|
|
2304
|
-
}
|
|
2305
|
-
/**
|
|
2306
|
-
* Sets the dimensions of an entity.
|
|
2307
|
-
* Adds the Dimensions component if not already present.
|
|
2308
|
-
*
|
|
2309
|
-
* @param world - The ECS world
|
|
2310
|
-
* @param eid - The entity ID
|
|
2311
|
-
* @param width - Width value (number, percentage string like "50%", or "auto")
|
|
2312
|
-
* @param height - Height value (number, percentage string like "50%", or "auto")
|
|
2313
|
-
* @returns The entity ID for chaining
|
|
2314
|
-
*
|
|
2315
|
-
* @example
|
|
2316
|
-
* ```typescript
|
|
2317
|
-
* import { createWorld, addEntity } from '../core/ecs';
|
|
2318
|
-
* import { setDimensions } from 'blecsd';
|
|
2319
|
-
*
|
|
2320
|
-
* const world = createWorld();
|
|
2321
|
-
* const entity = addEntity(world);
|
|
2322
|
-
*
|
|
2323
|
-
* // Fixed size
|
|
2324
|
-
* setDimensions(world, entity, 80, 24);
|
|
2325
|
-
*
|
|
2326
|
-
* // Percentage width
|
|
2327
|
-
* setDimensions(world, entity, '50%', 24);
|
|
2328
|
-
*
|
|
2329
|
-
* // Auto height
|
|
2330
|
-
* setDimensions(world, entity, 80, 'auto');
|
|
2331
|
-
* ```
|
|
2332
|
-
*/
|
|
2333
|
-
declare function setDimensions(world: World, eid: Entity, width: DimensionValue, height: DimensionValue): Entity;
|
|
2334
|
-
/**
|
|
2335
|
-
* Gets the dimensions data of an entity.
|
|
2336
|
-
* Returns undefined if the entity doesn't have a Dimensions component.
|
|
2337
|
-
*
|
|
2338
|
-
* @param world - The ECS world
|
|
2339
|
-
* @param eid - The entity ID
|
|
2340
|
-
* @returns Dimensions data or undefined
|
|
2341
|
-
*
|
|
2342
|
-
* @example
|
|
2343
|
-
* ```typescript
|
|
2344
|
-
* import { getDimensions } from 'blecsd';
|
|
2345
|
-
*
|
|
2346
|
-
* const dims = getDimensions(world, entity);
|
|
2347
|
-
* if (dims) {
|
|
2348
|
-
* console.log(`Size: ${dims.width}x${dims.height}`);
|
|
2349
|
-
* }
|
|
2350
|
-
* ```
|
|
2351
|
-
*/
|
|
2352
|
-
declare function getDimensions(world: World, eid: Entity): DimensionsData | undefined;
|
|
2353
|
-
/**
|
|
2354
|
-
* Sets dimension constraints (min/max) for an entity.
|
|
2355
|
-
*
|
|
2356
|
-
* @param world - The ECS world
|
|
2357
|
-
* @param eid - The entity ID
|
|
2358
|
-
* @param constraints - Constraint values to set
|
|
2359
|
-
* @returns The entity ID for chaining
|
|
2360
|
-
*
|
|
2361
|
-
* @example
|
|
2362
|
-
* ```typescript
|
|
2363
|
-
* import { setConstraints } from 'blecsd';
|
|
2364
|
-
*
|
|
2365
|
-
* setConstraints(world, entity, {
|
|
2366
|
-
* minWidth: 10,
|
|
2367
|
-
* maxWidth: 100,
|
|
2368
|
-
* minHeight: 5,
|
|
2369
|
-
* });
|
|
2370
|
-
* ```
|
|
2371
|
-
*/
|
|
2372
|
-
declare function setConstraints(world: World, eid: Entity, constraints: DimensionConstraints): Entity;
|
|
2373
|
-
/**
|
|
2374
|
-
* Sets the shrink-to-content flag for an entity.
|
|
2375
|
-
*
|
|
2376
|
-
* @param world - The ECS world
|
|
2377
|
-
* @param eid - The entity ID
|
|
2378
|
-
* @param shrink - true to shrink to content, false for fixed size
|
|
2379
|
-
* @returns The entity ID for chaining
|
|
2380
|
-
*
|
|
2381
|
-
* @example
|
|
2382
|
-
* ```typescript
|
|
2383
|
-
* import { setShrink } from 'blecsd';
|
|
2384
|
-
*
|
|
2385
|
-
* // Enable shrink-to-content
|
|
2386
|
-
* setShrink(world, entity, true);
|
|
2387
|
-
* ```
|
|
2388
|
-
*/
|
|
2389
|
-
declare function setShrink(world: World, eid: Entity, shrink: boolean): Entity;
|
|
2390
|
-
/**
|
|
2391
|
-
* Checks if an entity should shrink to content.
|
|
2392
|
-
*
|
|
2393
|
-
* @param world - The ECS world
|
|
2394
|
-
* @param eid - The entity ID
|
|
2395
|
-
* @returns true if shrink is enabled, false otherwise
|
|
2396
|
-
*/
|
|
2397
|
-
declare function shouldShrink(world: World, eid: Entity): boolean;
|
|
2398
|
-
/**
|
|
2399
|
-
* Checks if an entity has a Dimensions component.
|
|
2400
|
-
*
|
|
2401
|
-
* @param world - The ECS world
|
|
2402
|
-
* @param eid - The entity ID
|
|
2403
|
-
* @returns true if entity has Dimensions component
|
|
2404
|
-
*/
|
|
2405
|
-
declare function hasDimensions(world: World, eid: Entity): boolean;
|
|
2406
|
-
/**
|
|
2407
|
-
* Gets the width of an entity, resolving percentages against a container width.
|
|
2408
|
-
*
|
|
2409
|
-
* @param world - The ECS world
|
|
2410
|
-
* @param eid - The entity ID
|
|
2411
|
-
* @param containerWidth - Container width to resolve percentages against
|
|
2412
|
-
* @returns Resolved width value, or undefined if no Dimensions component
|
|
2413
|
-
*
|
|
2414
|
-
* @example
|
|
2415
|
-
* ```typescript
|
|
2416
|
-
* import { getResolvedWidth, setDimensions } from 'blecsd';
|
|
2417
|
-
*
|
|
2418
|
-
* setDimensions(world, entity, '50%', 24);
|
|
2419
|
-
* const width = getResolvedWidth(world, entity, 100); // Returns 50
|
|
2420
|
-
* ```
|
|
2421
|
-
*/
|
|
2422
|
-
declare function getResolvedWidth(world: World, eid: Entity, containerWidth: number): number | undefined;
|
|
2423
|
-
/**
|
|
2424
|
-
* Gets the height of an entity, resolving percentages against a container height.
|
|
2425
|
-
*
|
|
2426
|
-
* @param world - The ECS world
|
|
2427
|
-
* @param eid - The entity ID
|
|
2428
|
-
* @param containerHeight - Container height to resolve percentages against
|
|
2429
|
-
* @returns Resolved height value, or undefined if no Dimensions component
|
|
2430
|
-
*
|
|
2431
|
-
* @example
|
|
2432
|
-
* ```typescript
|
|
2433
|
-
* import { getResolvedHeight, setDimensions } from 'blecsd';
|
|
2434
|
-
*
|
|
2435
|
-
* setDimensions(world, entity, 80, '25%');
|
|
2436
|
-
* const height = getResolvedHeight(world, entity, 80); // Returns 20
|
|
2437
|
-
* ```
|
|
2438
|
-
*/
|
|
2439
|
-
declare function getResolvedHeight(world: World, eid: Entity, containerHeight: number): number | undefined;
|
|
2440
|
-
|
|
2441
2274
|
/**
|
|
2442
2275
|
* Focusable component for focus management.
|
|
2443
2276
|
* @module components/focusable
|
|
@@ -4314,6 +4147,8 @@ declare const Interactive: {
|
|
|
4314
4147
|
focused: Uint8Array<ArrayBuffer>;
|
|
4315
4148
|
/** Tab index for focus order (-1=skip, 0+=order) */
|
|
4316
4149
|
tabIndex: Int16Array<ArrayBuffer>;
|
|
4150
|
+
/** Whether entity is enabled (0=disabled, 1=enabled) */
|
|
4151
|
+
enabled: Uint8Array<ArrayBuffer>;
|
|
4317
4152
|
/** Hover effect foreground color */
|
|
4318
4153
|
hoverEffectFg: Uint32Array<ArrayBuffer>;
|
|
4319
4154
|
/** Hover effect background color */
|
|
@@ -4339,6 +4174,8 @@ interface InteractiveOptions {
|
|
|
4339
4174
|
focusable?: boolean;
|
|
4340
4175
|
/** Tab index for focus order (-1=skip, 0+=order) */
|
|
4341
4176
|
tabIndex?: number;
|
|
4177
|
+
/** Whether entity is enabled (can receive input/focus) */
|
|
4178
|
+
enabled?: boolean;
|
|
4342
4179
|
/** Hover effect foreground color */
|
|
4343
4180
|
hoverEffectFg?: number;
|
|
4344
4181
|
/** Hover effect background color */
|
|
@@ -4357,6 +4194,7 @@ interface InteractiveData {
|
|
|
4357
4194
|
readonly hoverable: boolean;
|
|
4358
4195
|
readonly hovered: boolean;
|
|
4359
4196
|
readonly pressed: boolean;
|
|
4197
|
+
readonly enabled: boolean;
|
|
4360
4198
|
readonly keyable: boolean;
|
|
4361
4199
|
readonly focusable: boolean;
|
|
4362
4200
|
readonly focused: boolean;
|
|
@@ -4683,6 +4521,66 @@ declare function hasKeysEnabled(world: World, eid: Entity): boolean;
|
|
|
4683
4521
|
* @returns true if any input is enabled
|
|
4684
4522
|
*/
|
|
4685
4523
|
declare function hasInputEnabled(world: World, eid: Entity): boolean;
|
|
4524
|
+
/**
|
|
4525
|
+
* Enables an entity, allowing it to receive input and focus.
|
|
4526
|
+
* Disabled entities are skipped in focus traversal and ignore input.
|
|
4527
|
+
*
|
|
4528
|
+
* @param world - The ECS world
|
|
4529
|
+
* @param eid - The entity ID
|
|
4530
|
+
* @returns The entity ID for chaining
|
|
4531
|
+
*
|
|
4532
|
+
* @example
|
|
4533
|
+
* ```typescript
|
|
4534
|
+
* import { enable, disable, isEnabled } from 'blecsd';
|
|
4535
|
+
*
|
|
4536
|
+
* // Disable a button temporarily
|
|
4537
|
+
* disable(world, button);
|
|
4538
|
+
*
|
|
4539
|
+
* // Re-enable it later
|
|
4540
|
+
* enable(world, button);
|
|
4541
|
+
* ```
|
|
4542
|
+
*/
|
|
4543
|
+
declare function enable(world: World, eid: Entity): Entity;
|
|
4544
|
+
/**
|
|
4545
|
+
* Disables an entity, preventing it from receiving input and focus.
|
|
4546
|
+
* Disabled entities are skipped in focus traversal and ignore input.
|
|
4547
|
+
*
|
|
4548
|
+
* @param world - The ECS world
|
|
4549
|
+
* @param eid - The entity ID
|
|
4550
|
+
* @returns The entity ID for chaining
|
|
4551
|
+
*
|
|
4552
|
+
* @example
|
|
4553
|
+
* ```typescript
|
|
4554
|
+
* import { enable, disable, isEnabled } from 'blecsd';
|
|
4555
|
+
*
|
|
4556
|
+
* // Disable a form field while loading
|
|
4557
|
+
* disable(world, formField);
|
|
4558
|
+
*
|
|
4559
|
+
* // Re-enable when ready
|
|
4560
|
+
* enable(world, formField);
|
|
4561
|
+
* ```
|
|
4562
|
+
*/
|
|
4563
|
+
declare function disable(world: World, eid: Entity): Entity;
|
|
4564
|
+
/**
|
|
4565
|
+
* Checks if an entity is enabled.
|
|
4566
|
+
* Disabled entities cannot receive input or focus.
|
|
4567
|
+
*
|
|
4568
|
+
* @param world - The ECS world
|
|
4569
|
+
* @param eid - The entity ID
|
|
4570
|
+
* @returns true if entity is enabled (default: true)
|
|
4571
|
+
*
|
|
4572
|
+
* @example
|
|
4573
|
+
* ```typescript
|
|
4574
|
+
* import { isEnabled, disable } from 'blecsd';
|
|
4575
|
+
*
|
|
4576
|
+
* if (isEnabled(world, button)) {
|
|
4577
|
+
* // Process click
|
|
4578
|
+
* } else {
|
|
4579
|
+
* // Show disabled styling
|
|
4580
|
+
* }
|
|
4581
|
+
* ```
|
|
4582
|
+
*/
|
|
4583
|
+
declare function isEnabled(world: World, eid: Entity): boolean;
|
|
4686
4584
|
|
|
4687
4585
|
/**
|
|
4688
4586
|
* Label component for element labels.
|
|
@@ -4992,91 +4890,989 @@ declare function removeLabel(world: World, eid: Entity): Entity;
|
|
|
4992
4890
|
declare function hasLabelText(world: World, eid: Entity): boolean;
|
|
4993
4891
|
|
|
4994
4892
|
/**
|
|
4995
|
-
*
|
|
4996
|
-
*
|
|
4893
|
+
* List Component Callbacks
|
|
4894
|
+
*
|
|
4895
|
+
* @module components/list/callbacks
|
|
4997
4896
|
*/
|
|
4998
4897
|
|
|
4999
4898
|
/**
|
|
5000
|
-
*
|
|
4899
|
+
* Registers a callback for when selection changes.
|
|
5001
4900
|
*
|
|
5002
|
-
*
|
|
4901
|
+
* @param eid - The entity ID
|
|
4902
|
+
* @param callback - The callback function
|
|
4903
|
+
* @returns Unsubscribe function
|
|
5003
4904
|
*
|
|
5004
4905
|
* @example
|
|
5005
4906
|
* ```typescript
|
|
5006
|
-
*
|
|
5007
|
-
*
|
|
5008
|
-
*
|
|
5009
|
-
* setPadding(world, entity, { left: 1, top: 2, right: 1, bottom: 2 });
|
|
5010
|
-
*
|
|
5011
|
-
* // Set all sides at once
|
|
5012
|
-
* setPaddingAll(world, entity, 2);
|
|
5013
|
-
*
|
|
5014
|
-
* const padding = getPadding(world, entity);
|
|
5015
|
-
* console.log(padding.left); // 1
|
|
4907
|
+
* const unsubscribe = onListSelect(eid, (index, item) => {
|
|
4908
|
+
* console.log(`Selected: ${item.text}`);
|
|
4909
|
+
* });
|
|
5016
4910
|
* ```
|
|
5017
4911
|
*/
|
|
5018
|
-
declare
|
|
5019
|
-
/** Left padding in cells */
|
|
5020
|
-
left: Uint8Array<ArrayBuffer>;
|
|
5021
|
-
/** Top padding in cells */
|
|
5022
|
-
top: Uint8Array<ArrayBuffer>;
|
|
5023
|
-
/** Right padding in cells */
|
|
5024
|
-
right: Uint8Array<ArrayBuffer>;
|
|
5025
|
-
/** Bottom padding in cells */
|
|
5026
|
-
bottom: Uint8Array<ArrayBuffer>;
|
|
5027
|
-
};
|
|
5028
|
-
/**
|
|
5029
|
-
* Padding configuration options.
|
|
5030
|
-
*/
|
|
5031
|
-
interface PaddingOptions {
|
|
5032
|
-
/** Left padding */
|
|
5033
|
-
left?: number;
|
|
5034
|
-
/** Top padding */
|
|
5035
|
-
top?: number;
|
|
5036
|
-
/** Right padding */
|
|
5037
|
-
right?: number;
|
|
5038
|
-
/** Bottom padding */
|
|
5039
|
-
bottom?: number;
|
|
5040
|
-
}
|
|
5041
|
-
/**
|
|
5042
|
-
* Padding data returned by getPadding.
|
|
5043
|
-
*/
|
|
5044
|
-
interface PaddingData {
|
|
5045
|
-
readonly left: number;
|
|
5046
|
-
readonly top: number;
|
|
5047
|
-
readonly right: number;
|
|
5048
|
-
readonly bottom: number;
|
|
5049
|
-
}
|
|
4912
|
+
declare function onListSelect(eid: Entity, callback: ListSelectCallback): () => void;
|
|
5050
4913
|
/**
|
|
5051
|
-
*
|
|
5052
|
-
* Adds the Padding component if not already present.
|
|
4914
|
+
* Registers a callback for when an item is activated (confirmed).
|
|
5053
4915
|
*
|
|
5054
|
-
* @param world - The ECS world
|
|
5055
4916
|
* @param eid - The entity ID
|
|
5056
|
-
* @param
|
|
5057
|
-
* @returns
|
|
4917
|
+
* @param callback - The callback function
|
|
4918
|
+
* @returns Unsubscribe function
|
|
5058
4919
|
*
|
|
5059
4920
|
* @example
|
|
5060
4921
|
* ```typescript
|
|
5061
|
-
*
|
|
5062
|
-
*
|
|
5063
|
-
*
|
|
5064
|
-
* const world = createWorld();
|
|
5065
|
-
* const entity = addEntity(world);
|
|
5066
|
-
*
|
|
5067
|
-
* // Set individual sides
|
|
5068
|
-
* setPadding(world, entity, { left: 1, top: 2, right: 1, bottom: 2 });
|
|
5069
|
-
*
|
|
5070
|
-
* // Set only some sides (others remain unchanged)
|
|
5071
|
-
* setPadding(world, entity, { left: 3 });
|
|
4922
|
+
* const unsubscribe = onListActivate(eid, (index, item) => {
|
|
4923
|
+
* console.log(`Activated: ${item.text}`);
|
|
4924
|
+
* });
|
|
5072
4925
|
* ```
|
|
5073
4926
|
*/
|
|
5074
|
-
declare function
|
|
4927
|
+
declare function onListActivate(eid: Entity, callback: ListSelectCallback): () => void;
|
|
5075
4928
|
/**
|
|
5076
|
-
*
|
|
5077
|
-
* Adds the Padding component if not already present.
|
|
4929
|
+
* Registers a callback for cancel events (when Escape is pressed).
|
|
5078
4930
|
*
|
|
5079
|
-
* @param
|
|
4931
|
+
* @param eid - The entity ID
|
|
4932
|
+
* @param callback - Callback function to invoke on cancel
|
|
4933
|
+
* @returns Function to unsubscribe the callback
|
|
4934
|
+
*
|
|
4935
|
+
* @example
|
|
4936
|
+
* ```typescript
|
|
4937
|
+
* const unsubscribe = onListCancel(eid, () => {
|
|
4938
|
+
* console.log('List cancelled');
|
|
4939
|
+
* });
|
|
4940
|
+
* ```
|
|
4941
|
+
*/
|
|
4942
|
+
declare function onListCancel(eid: Entity, callback: () => void): () => void;
|
|
4943
|
+
/**
|
|
4944
|
+
* Triggers cancel callbacks for a list.
|
|
4945
|
+
*
|
|
4946
|
+
* @param eid - The entity ID
|
|
4947
|
+
*/
|
|
4948
|
+
declare function triggerListCancel(eid: Entity): void;
|
|
4949
|
+
/**
|
|
4950
|
+
* Clears all callbacks for a list.
|
|
4951
|
+
*
|
|
4952
|
+
* @param eid - The entity ID
|
|
4953
|
+
*/
|
|
4954
|
+
declare function clearListCallbacks(eid: Entity): void;
|
|
4955
|
+
|
|
4956
|
+
/**
|
|
4957
|
+
* List Component Constants
|
|
4958
|
+
*
|
|
4959
|
+
* @module components/list/constants
|
|
4960
|
+
*/
|
|
4961
|
+
/** Default selected prefix character */
|
|
4962
|
+
declare const DEFAULT_SELECTED_PREFIX = "> ";
|
|
4963
|
+
/** Default unselected prefix character */
|
|
4964
|
+
declare const DEFAULT_UNSELECTED_PREFIX = " ";
|
|
4965
|
+
/** Default selected foreground color */
|
|
4966
|
+
declare const DEFAULT_SELECTED_FG = 4294967295;
|
|
4967
|
+
/** Default selected background color */
|
|
4968
|
+
declare const DEFAULT_SELECTED_BG = 6750207;
|
|
4969
|
+
/** Default item foreground color */
|
|
4970
|
+
declare const DEFAULT_ITEM_FG = 3435973887;
|
|
4971
|
+
/** Default item background color */
|
|
4972
|
+
declare const DEFAULT_ITEM_BG = 255;
|
|
4973
|
+
/** Default disabled foreground color */
|
|
4974
|
+
declare const DEFAULT_DISABLED_FG = 1717987071;
|
|
4975
|
+
|
|
4976
|
+
/**
|
|
4977
|
+
* List Component Core Functions
|
|
4978
|
+
*
|
|
4979
|
+
* @module components/list/core
|
|
4980
|
+
*/
|
|
4981
|
+
|
|
4982
|
+
/**
|
|
4983
|
+
* Attaches list behavior to an entity.
|
|
4984
|
+
*
|
|
4985
|
+
* @param world - The ECS world
|
|
4986
|
+
* @param eid - The entity ID
|
|
4987
|
+
* @param items - Initial items
|
|
4988
|
+
* @param options - List options
|
|
4989
|
+
*
|
|
4990
|
+
* @example
|
|
4991
|
+
* ```typescript
|
|
4992
|
+
* import { attachListBehavior } from 'blecsd';
|
|
4993
|
+
*
|
|
4994
|
+
* attachListBehavior(world, eid, [
|
|
4995
|
+
* { text: 'Option 1', value: 'opt1' },
|
|
4996
|
+
* { text: 'Option 2', value: 'opt2' },
|
|
4997
|
+
* ], { interactive: true, keys: true });
|
|
4998
|
+
* ```
|
|
4999
|
+
*/
|
|
5000
|
+
declare function attachListBehavior(world: World, eid: Entity, items?: ListItem[], options?: {
|
|
5001
|
+
interactive?: boolean;
|
|
5002
|
+
mouse?: boolean;
|
|
5003
|
+
keys?: boolean;
|
|
5004
|
+
search?: boolean;
|
|
5005
|
+
selectedIndex?: number;
|
|
5006
|
+
visibleCount?: number;
|
|
5007
|
+
}): void;
|
|
5008
|
+
/**
|
|
5009
|
+
* Checks if an entity is a list.
|
|
5010
|
+
*
|
|
5011
|
+
* @param world - The ECS world
|
|
5012
|
+
* @param eid - The entity ID
|
|
5013
|
+
* @returns true if entity is a list
|
|
5014
|
+
*/
|
|
5015
|
+
declare function isList(world: World, eid: Entity): boolean;
|
|
5016
|
+
/**
|
|
5017
|
+
* Gets the current state of a list.
|
|
5018
|
+
*
|
|
5019
|
+
* @param world - The ECS world
|
|
5020
|
+
* @param eid - The entity ID
|
|
5021
|
+
* @returns The current state
|
|
5022
|
+
*/
|
|
5023
|
+
declare function getListState(world: World, eid: Entity): ListState;
|
|
5024
|
+
/**
|
|
5025
|
+
* Checks if list is in a specific state.
|
|
5026
|
+
*
|
|
5027
|
+
* @param world - The ECS world
|
|
5028
|
+
* @param eid - The entity ID
|
|
5029
|
+
* @param state - The state to check
|
|
5030
|
+
* @returns true if list is in the specified state
|
|
5031
|
+
*/
|
|
5032
|
+
declare function isListInState(world: World, eid: Entity, state: ListState): boolean;
|
|
5033
|
+
/**
|
|
5034
|
+
* Checks if list is focused.
|
|
5035
|
+
*
|
|
5036
|
+
* @param world - The ECS world
|
|
5037
|
+
* @param eid - The entity ID
|
|
5038
|
+
* @returns true if list is focused
|
|
5039
|
+
*/
|
|
5040
|
+
declare function isListFocused(world: World, eid: Entity): boolean;
|
|
5041
|
+
/**
|
|
5042
|
+
* Checks if list is disabled.
|
|
5043
|
+
*
|
|
5044
|
+
* @param world - The ECS world
|
|
5045
|
+
* @param eid - The entity ID
|
|
5046
|
+
* @returns true if list is disabled
|
|
5047
|
+
*/
|
|
5048
|
+
declare function isListDisabled(world: World, eid: Entity): boolean;
|
|
5049
|
+
/**
|
|
5050
|
+
* Sends an event to the list state machine.
|
|
5051
|
+
*
|
|
5052
|
+
* @param world - The ECS world
|
|
5053
|
+
* @param eid - The entity ID
|
|
5054
|
+
* @param event - The event to send
|
|
5055
|
+
* @returns true if transition occurred
|
|
5056
|
+
*/
|
|
5057
|
+
declare function sendListEvent(world: World, eid: Entity, event: ListEvent): boolean;
|
|
5058
|
+
/**
|
|
5059
|
+
* Focuses the list.
|
|
5060
|
+
*
|
|
5061
|
+
* @param world - The ECS world
|
|
5062
|
+
* @param eid - The entity ID
|
|
5063
|
+
* @returns true if focused successfully
|
|
5064
|
+
*/
|
|
5065
|
+
declare function focusList(world: World, eid: Entity): boolean;
|
|
5066
|
+
/**
|
|
5067
|
+
* Blurs the list.
|
|
5068
|
+
*
|
|
5069
|
+
* @param world - The ECS world
|
|
5070
|
+
* @param eid - The entity ID
|
|
5071
|
+
* @returns true if blurred successfully
|
|
5072
|
+
*/
|
|
5073
|
+
declare function blurList(world: World, eid: Entity): boolean;
|
|
5074
|
+
/**
|
|
5075
|
+
* Disables the list.
|
|
5076
|
+
*
|
|
5077
|
+
* @param world - The ECS world
|
|
5078
|
+
* @param eid - The entity ID
|
|
5079
|
+
* @returns true if disabled successfully
|
|
5080
|
+
*/
|
|
5081
|
+
declare function disableList(world: World, eid: Entity): boolean;
|
|
5082
|
+
/**
|
|
5083
|
+
* Enables the list.
|
|
5084
|
+
*
|
|
5085
|
+
* @param world - The ECS world
|
|
5086
|
+
* @param eid - The entity ID
|
|
5087
|
+
* @returns true if enabled successfully
|
|
5088
|
+
*/
|
|
5089
|
+
declare function enableList(world: World, eid: Entity): boolean;
|
|
5090
|
+
|
|
5091
|
+
/**
|
|
5092
|
+
* List Component Display Configuration
|
|
5093
|
+
*
|
|
5094
|
+
* @module components/list/display
|
|
5095
|
+
*/
|
|
5096
|
+
|
|
5097
|
+
/**
|
|
5098
|
+
* Sets the list display configuration.
|
|
5099
|
+
*
|
|
5100
|
+
* @param eid - The entity ID
|
|
5101
|
+
* @param options - Display options
|
|
5102
|
+
*/
|
|
5103
|
+
declare function setListDisplay(eid: Entity, options: ListDisplayOptions): void;
|
|
5104
|
+
/**
|
|
5105
|
+
* Gets the list display configuration.
|
|
5106
|
+
*
|
|
5107
|
+
* @param eid - The entity ID
|
|
5108
|
+
* @returns Display configuration
|
|
5109
|
+
*/
|
|
5110
|
+
declare function getListDisplay(eid: Entity): ListDisplay;
|
|
5111
|
+
/**
|
|
5112
|
+
* Clears the list display configuration.
|
|
5113
|
+
*
|
|
5114
|
+
* @param eid - The entity ID
|
|
5115
|
+
*/
|
|
5116
|
+
declare function clearListDisplay(eid: Entity): void;
|
|
5117
|
+
|
|
5118
|
+
/**
|
|
5119
|
+
* List Component Filter
|
|
5120
|
+
*
|
|
5121
|
+
* @module components/list/filter
|
|
5122
|
+
*/
|
|
5123
|
+
|
|
5124
|
+
/**
|
|
5125
|
+
* Sets a filter text to show only matching items.
|
|
5126
|
+
*
|
|
5127
|
+
* @param world - The ECS world
|
|
5128
|
+
* @param eid - The entity ID
|
|
5129
|
+
* @param filterText - The filter text (case-insensitive substring match)
|
|
5130
|
+
*
|
|
5131
|
+
* @example
|
|
5132
|
+
* ```typescript
|
|
5133
|
+
* setListFilter(world, eid, 'app'); // Shows only items containing 'app'
|
|
5134
|
+
* ```
|
|
5135
|
+
*/
|
|
5136
|
+
declare function setListFilter(world: World, eid: Entity, filterText: string): void;
|
|
5137
|
+
/**
|
|
5138
|
+
* Clears the filter, showing all items.
|
|
5139
|
+
*
|
|
5140
|
+
* @param world - The ECS world
|
|
5141
|
+
* @param eid - The entity ID
|
|
5142
|
+
*/
|
|
5143
|
+
declare function clearListFilter(world: World, eid: Entity): void;
|
|
5144
|
+
/**
|
|
5145
|
+
* Gets the filtered (visible) items based on current filter.
|
|
5146
|
+
*
|
|
5147
|
+
* @param eid - The entity ID
|
|
5148
|
+
* @returns Array of filtered items
|
|
5149
|
+
*/
|
|
5150
|
+
declare function getFilteredItems(eid: Entity): readonly ListItem[];
|
|
5151
|
+
|
|
5152
|
+
/**
|
|
5153
|
+
* List Component Item Management
|
|
5154
|
+
*
|
|
5155
|
+
* @module components/list/items
|
|
5156
|
+
*/
|
|
5157
|
+
|
|
5158
|
+
/**
|
|
5159
|
+
* Gets all items from a list.
|
|
5160
|
+
*
|
|
5161
|
+
* @param eid - The entity ID
|
|
5162
|
+
* @returns Array of list items
|
|
5163
|
+
*/
|
|
5164
|
+
declare function getItems(eid: Entity): readonly ListItem[];
|
|
5165
|
+
/**
|
|
5166
|
+
* Sets all items in a list.
|
|
5167
|
+
*
|
|
5168
|
+
* @param world - The ECS world
|
|
5169
|
+
* @param eid - The entity ID
|
|
5170
|
+
* @param items - The items to set
|
|
5171
|
+
*/
|
|
5172
|
+
declare function setItems(world: World, eid: Entity, items: ListItem[]): void;
|
|
5173
|
+
/**
|
|
5174
|
+
* Adds an item to the list.
|
|
5175
|
+
*
|
|
5176
|
+
* @param world - The ECS world
|
|
5177
|
+
* @param eid - The entity ID
|
|
5178
|
+
* @param item - The item to add
|
|
5179
|
+
* @param index - Optional index to insert at (defaults to end)
|
|
5180
|
+
*/
|
|
5181
|
+
declare function addItem(world: World, eid: Entity, item: ListItem, index?: number): void;
|
|
5182
|
+
/**
|
|
5183
|
+
* Removes an item from the list.
|
|
5184
|
+
*
|
|
5185
|
+
* @param world - The ECS world
|
|
5186
|
+
* @param eid - The entity ID
|
|
5187
|
+
* @param index - The index to remove
|
|
5188
|
+
* @returns The removed item or undefined
|
|
5189
|
+
*/
|
|
5190
|
+
declare function removeItem(world: World, eid: Entity, index: number): ListItem | undefined;
|
|
5191
|
+
/**
|
|
5192
|
+
* Gets an item by index.
|
|
5193
|
+
*
|
|
5194
|
+
* @param eid - The entity ID
|
|
5195
|
+
* @param index - The item index
|
|
5196
|
+
* @returns The item or undefined
|
|
5197
|
+
*/
|
|
5198
|
+
declare function getItem(eid: Entity, index: number): ListItem | undefined;
|
|
5199
|
+
/**
|
|
5200
|
+
* Updates an item at a specific index.
|
|
5201
|
+
*
|
|
5202
|
+
* @param world - The ECS world
|
|
5203
|
+
* @param eid - The entity ID
|
|
5204
|
+
* @param index - The item index
|
|
5205
|
+
* @param item - The new item data
|
|
5206
|
+
* @returns true if updated successfully
|
|
5207
|
+
*/
|
|
5208
|
+
declare function updateItem(world: World, eid: Entity, index: number, item: ListItem): boolean;
|
|
5209
|
+
/**
|
|
5210
|
+
* Gets the number of items in the list.
|
|
5211
|
+
*
|
|
5212
|
+
* @param eid - The entity ID
|
|
5213
|
+
* @returns Number of items
|
|
5214
|
+
*/
|
|
5215
|
+
declare function getItemCount(eid: Entity): number;
|
|
5216
|
+
/**
|
|
5217
|
+
* Clears all items from the list.
|
|
5218
|
+
*
|
|
5219
|
+
* @param world - The ECS world
|
|
5220
|
+
* @param eid - The entity ID
|
|
5221
|
+
*/
|
|
5222
|
+
declare function clearItems(world: World, eid: Entity): void;
|
|
5223
|
+
|
|
5224
|
+
/**
|
|
5225
|
+
* List Component Key Handling
|
|
5226
|
+
*
|
|
5227
|
+
* @module components/list/keyHandling
|
|
5228
|
+
*/
|
|
5229
|
+
|
|
5230
|
+
/**
|
|
5231
|
+
* Handles key press for list widget.
|
|
5232
|
+
*
|
|
5233
|
+
* @param world - The ECS world
|
|
5234
|
+
* @param eid - The entity ID
|
|
5235
|
+
* @param key - The key name
|
|
5236
|
+
* @returns Action to perform or null
|
|
5237
|
+
*
|
|
5238
|
+
* @example
|
|
5239
|
+
* ```typescript
|
|
5240
|
+
* const action = handleListKeyPress(world, eid, 'down');
|
|
5241
|
+
* if (action?.type === 'selectNext') {
|
|
5242
|
+
* selectNext(world, eid);
|
|
5243
|
+
* }
|
|
5244
|
+
* ```
|
|
5245
|
+
*/
|
|
5246
|
+
declare function handleListKeyPress(world: World, eid: Entity, key: string): ListAction | null;
|
|
5247
|
+
|
|
5248
|
+
/**
|
|
5249
|
+
* List Component Multi-Select
|
|
5250
|
+
*
|
|
5251
|
+
* @module components/list/multiSelect
|
|
5252
|
+
*/
|
|
5253
|
+
|
|
5254
|
+
/**
|
|
5255
|
+
* Enables or disables multi-select mode for a list.
|
|
5256
|
+
*
|
|
5257
|
+
* @param eid - The entity ID
|
|
5258
|
+
* @param enabled - Whether multi-select is enabled
|
|
5259
|
+
*
|
|
5260
|
+
* @example
|
|
5261
|
+
* ```typescript
|
|
5262
|
+
* setListMultiSelect(eid, true);
|
|
5263
|
+
* ```
|
|
5264
|
+
*/
|
|
5265
|
+
declare function setListMultiSelect(eid: Entity, enabled: boolean): void;
|
|
5266
|
+
/**
|
|
5267
|
+
* Checks if a list has multi-select enabled.
|
|
5268
|
+
*
|
|
5269
|
+
* @param eid - The entity ID
|
|
5270
|
+
* @returns true if multi-select is enabled
|
|
5271
|
+
*/
|
|
5272
|
+
declare function isListMultiSelect(eid: Entity): boolean;
|
|
5273
|
+
/**
|
|
5274
|
+
* Toggles selection of an item in multi-select mode.
|
|
5275
|
+
*
|
|
5276
|
+
* @param eid - The entity ID
|
|
5277
|
+
* @param index - The item index to toggle
|
|
5278
|
+
* @returns true if the item is now selected, false if deselected
|
|
5279
|
+
*/
|
|
5280
|
+
declare function toggleMultiSelect(eid: Entity, index: number): boolean;
|
|
5281
|
+
/**
|
|
5282
|
+
* Gets all selected indices in multi-select mode.
|
|
5283
|
+
*
|
|
5284
|
+
* @param eid - The entity ID
|
|
5285
|
+
* @returns Array of selected indices
|
|
5286
|
+
*/
|
|
5287
|
+
declare function getMultiSelected(eid: Entity): number[];
|
|
5288
|
+
/**
|
|
5289
|
+
* Selects all items in multi-select mode.
|
|
5290
|
+
*
|
|
5291
|
+
* @param eid - The entity ID
|
|
5292
|
+
*/
|
|
5293
|
+
declare function selectAllItems(eid: Entity): void;
|
|
5294
|
+
/**
|
|
5295
|
+
* Deselects all items in multi-select mode.
|
|
5296
|
+
*
|
|
5297
|
+
* @param eid - The entity ID
|
|
5298
|
+
*/
|
|
5299
|
+
declare function deselectAllItems(eid: Entity): void;
|
|
5300
|
+
/**
|
|
5301
|
+
* Checks if an item is selected in multi-select mode.
|
|
5302
|
+
*
|
|
5303
|
+
* @param eid - The entity ID
|
|
5304
|
+
* @param index - The item index
|
|
5305
|
+
* @returns true if the item is selected
|
|
5306
|
+
*/
|
|
5307
|
+
declare function isItemMultiSelected(eid: Entity, index: number): boolean;
|
|
5308
|
+
|
|
5309
|
+
/**
|
|
5310
|
+
* List Component Options Management
|
|
5311
|
+
*
|
|
5312
|
+
* @module components/list/options
|
|
5313
|
+
*/
|
|
5314
|
+
|
|
5315
|
+
/**
|
|
5316
|
+
* Checks if list is interactive.
|
|
5317
|
+
*
|
|
5318
|
+
* @param eid - The entity ID
|
|
5319
|
+
* @returns true if interactive
|
|
5320
|
+
*/
|
|
5321
|
+
declare function isListInteractive(eid: Entity): boolean;
|
|
5322
|
+
/**
|
|
5323
|
+
* Sets list interactive mode.
|
|
5324
|
+
*
|
|
5325
|
+
* @param world - The ECS world
|
|
5326
|
+
* @param eid - The entity ID
|
|
5327
|
+
* @param interactive - Whether list is interactive
|
|
5328
|
+
*/
|
|
5329
|
+
declare function setListInteractive(world: World, eid: Entity, interactive: boolean): void;
|
|
5330
|
+
/**
|
|
5331
|
+
* Checks if list responds to mouse.
|
|
5332
|
+
*
|
|
5333
|
+
* @param eid - The entity ID
|
|
5334
|
+
* @returns true if mouse enabled
|
|
5335
|
+
*/
|
|
5336
|
+
declare function isListMouseEnabled(eid: Entity): boolean;
|
|
5337
|
+
/**
|
|
5338
|
+
* Sets list mouse mode.
|
|
5339
|
+
*
|
|
5340
|
+
* @param world - The ECS world
|
|
5341
|
+
* @param eid - The entity ID
|
|
5342
|
+
* @param mouse - Whether mouse is enabled
|
|
5343
|
+
*/
|
|
5344
|
+
declare function setListMouse(world: World, eid: Entity, mouse: boolean): void;
|
|
5345
|
+
/**
|
|
5346
|
+
* Checks if list responds to keyboard.
|
|
5347
|
+
*
|
|
5348
|
+
* @param eid - The entity ID
|
|
5349
|
+
* @returns true if keys enabled
|
|
5350
|
+
*/
|
|
5351
|
+
declare function isListKeysEnabled(eid: Entity): boolean;
|
|
5352
|
+
/**
|
|
5353
|
+
* Sets list keys mode.
|
|
5354
|
+
*
|
|
5355
|
+
* @param world - The ECS world
|
|
5356
|
+
* @param eid - The entity ID
|
|
5357
|
+
* @param keys - Whether keys are enabled
|
|
5358
|
+
*/
|
|
5359
|
+
declare function setListKeys(world: World, eid: Entity, keys: boolean): void;
|
|
5360
|
+
|
|
5361
|
+
/**
|
|
5362
|
+
* List Component Rendering Helpers
|
|
5363
|
+
*
|
|
5364
|
+
* @module components/list/rendering
|
|
5365
|
+
*/
|
|
5366
|
+
|
|
5367
|
+
/**
|
|
5368
|
+
* Renders list items as strings for display.
|
|
5369
|
+
*
|
|
5370
|
+
* @param eid - The entity ID
|
|
5371
|
+
* @param width - Available width
|
|
5372
|
+
* @returns Array of rendered line strings
|
|
5373
|
+
*/
|
|
5374
|
+
declare function renderListItems(eid: Entity, width: number): string[];
|
|
5375
|
+
|
|
5376
|
+
/**
|
|
5377
|
+
* List Component Store Reset (for testing)
|
|
5378
|
+
*
|
|
5379
|
+
* @module components/list/reset
|
|
5380
|
+
*/
|
|
5381
|
+
/**
|
|
5382
|
+
* Resets the list store. Used for testing.
|
|
5383
|
+
*/
|
|
5384
|
+
declare function resetListStore(): void;
|
|
5385
|
+
|
|
5386
|
+
/**
|
|
5387
|
+
* List Component Search Mode
|
|
5388
|
+
*
|
|
5389
|
+
* @module components/list/search
|
|
5390
|
+
*/
|
|
5391
|
+
|
|
5392
|
+
/**
|
|
5393
|
+
* Checks if search mode is enabled for the list.
|
|
5394
|
+
*
|
|
5395
|
+
* @param eid - The entity ID
|
|
5396
|
+
* @returns true if search is enabled
|
|
5397
|
+
*/
|
|
5398
|
+
declare function isListSearchEnabled(eid: Entity): boolean;
|
|
5399
|
+
/**
|
|
5400
|
+
* Sets whether search mode is enabled for the list.
|
|
5401
|
+
*
|
|
5402
|
+
* @param world - The ECS world
|
|
5403
|
+
* @param eid - The entity ID
|
|
5404
|
+
* @param enabled - Whether search is enabled
|
|
5405
|
+
*/
|
|
5406
|
+
declare function setListSearchEnabled(world: World, eid: Entity, enabled: boolean): void;
|
|
5407
|
+
/**
|
|
5408
|
+
* Checks if list is currently in search mode.
|
|
5409
|
+
*
|
|
5410
|
+
* @param world - The ECS world
|
|
5411
|
+
* @param eid - The entity ID
|
|
5412
|
+
* @returns true if list is in searching state
|
|
5413
|
+
*/
|
|
5414
|
+
declare function isListSearching(world: World, eid: Entity): boolean;
|
|
5415
|
+
/**
|
|
5416
|
+
* Starts search mode for the list.
|
|
5417
|
+
*
|
|
5418
|
+
* @param world - The ECS world
|
|
5419
|
+
* @param eid - The entity ID
|
|
5420
|
+
* @returns true if search mode was started
|
|
5421
|
+
*/
|
|
5422
|
+
declare function startListSearch(world: World, eid: Entity): boolean;
|
|
5423
|
+
/**
|
|
5424
|
+
* Ends search mode for the list.
|
|
5425
|
+
*
|
|
5426
|
+
* @param world - The ECS world
|
|
5427
|
+
* @param eid - The entity ID
|
|
5428
|
+
* @returns true if search mode was ended
|
|
5429
|
+
*/
|
|
5430
|
+
declare function endListSearch(world: World, eid: Entity): boolean;
|
|
5431
|
+
/**
|
|
5432
|
+
* Gets the current search query.
|
|
5433
|
+
*
|
|
5434
|
+
* @param eid - The entity ID
|
|
5435
|
+
* @returns The current search query or empty string
|
|
5436
|
+
*/
|
|
5437
|
+
declare function getListSearchQuery(eid: Entity): string;
|
|
5438
|
+
/**
|
|
5439
|
+
* Sets the search query and finds matching items.
|
|
5440
|
+
*
|
|
5441
|
+
* @param world - The ECS world
|
|
5442
|
+
* @param eid - The entity ID
|
|
5443
|
+
* @param query - The search query
|
|
5444
|
+
* @returns true if a match was found and selected
|
|
5445
|
+
*/
|
|
5446
|
+
declare function setListSearchQuery(world: World, eid: Entity, query: string): boolean;
|
|
5447
|
+
/**
|
|
5448
|
+
* Appends a character to the search query.
|
|
5449
|
+
*
|
|
5450
|
+
* @param world - The ECS world
|
|
5451
|
+
* @param eid - The entity ID
|
|
5452
|
+
* @param char - The character to append
|
|
5453
|
+
* @returns true if a match was found and selected
|
|
5454
|
+
*/
|
|
5455
|
+
declare function appendToSearchQuery(world: World, eid: Entity, char: string): boolean;
|
|
5456
|
+
/**
|
|
5457
|
+
* Removes the last character from the search query.
|
|
5458
|
+
*
|
|
5459
|
+
* @param world - The ECS world
|
|
5460
|
+
* @param eid - The entity ID
|
|
5461
|
+
* @returns true if a match was found and selected
|
|
5462
|
+
*/
|
|
5463
|
+
declare function backspaceSearchQuery(world: World, eid: Entity): boolean;
|
|
5464
|
+
/**
|
|
5465
|
+
* Clears the search query.
|
|
5466
|
+
*
|
|
5467
|
+
* @param world - The ECS world
|
|
5468
|
+
* @param eid - The entity ID
|
|
5469
|
+
*/
|
|
5470
|
+
declare function clearSearchQuery(world: World, eid: Entity): void;
|
|
5471
|
+
/**
|
|
5472
|
+
* Finds and selects the first item matching the text (case-insensitive).
|
|
5473
|
+
*
|
|
5474
|
+
* @param world - The ECS world
|
|
5475
|
+
* @param eid - The entity ID
|
|
5476
|
+
* @param text - The text to search for
|
|
5477
|
+
* @returns true if a match was found and selected
|
|
5478
|
+
*/
|
|
5479
|
+
declare function findAndSelectByText(world: World, eid: Entity, text: string): boolean;
|
|
5480
|
+
/**
|
|
5481
|
+
* Finds the next item matching the current search query.
|
|
5482
|
+
*
|
|
5483
|
+
* @param world - The ECS world
|
|
5484
|
+
* @param eid - The entity ID
|
|
5485
|
+
* @returns true if a match was found and selected
|
|
5486
|
+
*/
|
|
5487
|
+
declare function findNextMatch(world: World, eid: Entity): boolean;
|
|
5488
|
+
/**
|
|
5489
|
+
* Registers a callback for when search query changes.
|
|
5490
|
+
*
|
|
5491
|
+
* @param eid - The entity ID
|
|
5492
|
+
* @param callback - The callback function
|
|
5493
|
+
* @returns Unsubscribe function
|
|
5494
|
+
*
|
|
5495
|
+
* @example
|
|
5496
|
+
* ```typescript
|
|
5497
|
+
* const unsubscribe = onListSearchChange(eid, (query) => {
|
|
5498
|
+
* console.log(`Search: ${query}`);
|
|
5499
|
+
* });
|
|
5500
|
+
* ```
|
|
5501
|
+
*/
|
|
5502
|
+
declare function onListSearchChange(eid: Entity, callback: (query: string) => void): () => void;
|
|
5503
|
+
|
|
5504
|
+
/**
|
|
5505
|
+
* List Component Selection Management
|
|
5506
|
+
*
|
|
5507
|
+
* @module components/list/selection
|
|
5508
|
+
*/
|
|
5509
|
+
|
|
5510
|
+
/**
|
|
5511
|
+
* Gets the selected index.
|
|
5512
|
+
*
|
|
5513
|
+
* @param eid - The entity ID
|
|
5514
|
+
* @returns Selected index or -1 if none
|
|
5515
|
+
*/
|
|
5516
|
+
declare function getSelectedIndex$1(eid: Entity): number;
|
|
5517
|
+
/**
|
|
5518
|
+
* Gets the selected item.
|
|
5519
|
+
*
|
|
5520
|
+
* @param eid - The entity ID
|
|
5521
|
+
* @returns Selected item or undefined
|
|
5522
|
+
*/
|
|
5523
|
+
declare function getSelectedItem(eid: Entity): ListItem | undefined;
|
|
5524
|
+
/**
|
|
5525
|
+
* Sets the selected index.
|
|
5526
|
+
*
|
|
5527
|
+
* @param world - The ECS world
|
|
5528
|
+
* @param eid - The entity ID
|
|
5529
|
+
* @param index - The index to select (-1 to clear)
|
|
5530
|
+
* @returns true if selection changed
|
|
5531
|
+
*/
|
|
5532
|
+
declare function setSelectedIndex(world: World, eid: Entity, index: number): boolean;
|
|
5533
|
+
/**
|
|
5534
|
+
* Selects the previous item.
|
|
5535
|
+
*
|
|
5536
|
+
* @param world - The ECS world
|
|
5537
|
+
* @param eid - The entity ID
|
|
5538
|
+
* @param wrap - Whether to wrap around (default: true)
|
|
5539
|
+
* @returns true if selection changed
|
|
5540
|
+
*/
|
|
5541
|
+
declare function selectPrev(world: World, eid: Entity, wrap?: boolean): boolean;
|
|
5542
|
+
/**
|
|
5543
|
+
* Selects the next item.
|
|
5544
|
+
*
|
|
5545
|
+
* @param world - The ECS world
|
|
5546
|
+
* @param eid - The entity ID
|
|
5547
|
+
* @param wrap - Whether to wrap around (default: true)
|
|
5548
|
+
* @returns true if selection changed
|
|
5549
|
+
*/
|
|
5550
|
+
declare function selectNext(world: World, eid: Entity, wrap?: boolean): boolean;
|
|
5551
|
+
/**
|
|
5552
|
+
* Selects the first item.
|
|
5553
|
+
*
|
|
5554
|
+
* @param world - The ECS world
|
|
5555
|
+
* @param eid - The entity ID
|
|
5556
|
+
* @returns true if selection changed
|
|
5557
|
+
*/
|
|
5558
|
+
declare function selectFirst(world: World, eid: Entity): boolean;
|
|
5559
|
+
/**
|
|
5560
|
+
* Selects the last item.
|
|
5561
|
+
*
|
|
5562
|
+
* @param world - The ECS world
|
|
5563
|
+
* @param eid - The entity ID
|
|
5564
|
+
* @returns true if selection changed
|
|
5565
|
+
*/
|
|
5566
|
+
declare function selectLast(world: World, eid: Entity): boolean;
|
|
5567
|
+
/**
|
|
5568
|
+
* Selects an item by value.
|
|
5569
|
+
*
|
|
5570
|
+
* @param world - The ECS world
|
|
5571
|
+
* @param eid - The entity ID
|
|
5572
|
+
* @param value - The value to select
|
|
5573
|
+
* @returns true if selection changed
|
|
5574
|
+
*/
|
|
5575
|
+
declare function selectByValue(world: World, eid: Entity, value: string): boolean;
|
|
5576
|
+
/**
|
|
5577
|
+
* Clears the selection.
|
|
5578
|
+
*
|
|
5579
|
+
* @param world - The ECS world
|
|
5580
|
+
* @param eid - The entity ID
|
|
5581
|
+
*/
|
|
5582
|
+
declare function clearSelection$2(world: World, eid: Entity): void;
|
|
5583
|
+
/**
|
|
5584
|
+
* Activates (confirms) the currently selected item.
|
|
5585
|
+
*
|
|
5586
|
+
* @param world - The ECS world
|
|
5587
|
+
* @param eid - The entity ID
|
|
5588
|
+
* @returns true if an item was activated
|
|
5589
|
+
*/
|
|
5590
|
+
declare function activateSelected(_world: World, eid: Entity): boolean;
|
|
5591
|
+
|
|
5592
|
+
/**
|
|
5593
|
+
* List Component State Machine Configuration
|
|
5594
|
+
*
|
|
5595
|
+
* @module components/list/stateMachine
|
|
5596
|
+
*/
|
|
5597
|
+
|
|
5598
|
+
/**
|
|
5599
|
+
* State machine configuration for list widgets.
|
|
5600
|
+
*
|
|
5601
|
+
* States:
|
|
5602
|
+
* - idle: List is not focused
|
|
5603
|
+
* - focused: List has focus, ready for navigation
|
|
5604
|
+
* - selecting: User is actively selecting (e.g., during mouse drag)
|
|
5605
|
+
* - searching: User is typing to search/filter items
|
|
5606
|
+
* - disabled: List is disabled and cannot be interacted with
|
|
5607
|
+
*/
|
|
5608
|
+
declare const LIST_STATE_MACHINE_CONFIG: StateMachineConfig<ListState, ListEvent>;
|
|
5609
|
+
|
|
5610
|
+
/**
|
|
5611
|
+
* Store for list component data.
|
|
5612
|
+
*/
|
|
5613
|
+
declare const listStore: ListStore;
|
|
5614
|
+
|
|
5615
|
+
/**
|
|
5616
|
+
* List Component Virtualization
|
|
5617
|
+
*
|
|
5618
|
+
* @module components/list/virtualization
|
|
5619
|
+
*/
|
|
5620
|
+
|
|
5621
|
+
/**
|
|
5622
|
+
* Gets the first visible item index.
|
|
5623
|
+
*
|
|
5624
|
+
* @param eid - The entity ID
|
|
5625
|
+
* @returns First visible index
|
|
5626
|
+
*/
|
|
5627
|
+
declare function getFirstVisible(eid: Entity): number;
|
|
5628
|
+
/**
|
|
5629
|
+
* Sets the first visible item index.
|
|
5630
|
+
*
|
|
5631
|
+
* @param world - The ECS world
|
|
5632
|
+
* @param eid - The entity ID
|
|
5633
|
+
* @param index - The first visible index
|
|
5634
|
+
*/
|
|
5635
|
+
declare function setFirstVisible(world: World, eid: Entity, index: number): void;
|
|
5636
|
+
/**
|
|
5637
|
+
* Gets the number of visible items.
|
|
5638
|
+
*
|
|
5639
|
+
* @param eid - The entity ID
|
|
5640
|
+
* @returns Number of visible items
|
|
5641
|
+
*/
|
|
5642
|
+
declare function getVisibleCount(eid: Entity): number;
|
|
5643
|
+
/**
|
|
5644
|
+
* Sets the number of visible items.
|
|
5645
|
+
*
|
|
5646
|
+
* @param world - The ECS world
|
|
5647
|
+
* @param eid - The entity ID
|
|
5648
|
+
* @param count - The number of visible items
|
|
5649
|
+
*/
|
|
5650
|
+
declare function setVisibleCount(world: World, eid: Entity, count: number): void;
|
|
5651
|
+
/**
|
|
5652
|
+
* Ensures an index is visible by scrolling if necessary.
|
|
5653
|
+
*
|
|
5654
|
+
* @param world - The ECS world
|
|
5655
|
+
* @param eid - The entity ID
|
|
5656
|
+
* @param index - The index to make visible
|
|
5657
|
+
*/
|
|
5658
|
+
declare function ensureVisible(world: World, eid: Entity, index: number): void;
|
|
5659
|
+
/**
|
|
5660
|
+
* Scrolls the list by a page (visibleCount items).
|
|
5661
|
+
*
|
|
5662
|
+
* @param world - The ECS world
|
|
5663
|
+
* @param eid - The entity ID
|
|
5664
|
+
* @param direction - 1 for down, -1 for up
|
|
5665
|
+
* @returns true if scrolled
|
|
5666
|
+
*/
|
|
5667
|
+
declare function scrollPage(world: World, eid: Entity, direction: 1 | -1): boolean;
|
|
5668
|
+
/**
|
|
5669
|
+
* Gets the visible items for rendering.
|
|
5670
|
+
*
|
|
5671
|
+
* @param eid - The entity ID
|
|
5672
|
+
* @returns Array of visible items with their indices
|
|
5673
|
+
*/
|
|
5674
|
+
declare function getVisibleItems(eid: Entity): Array<{
|
|
5675
|
+
index: number;
|
|
5676
|
+
item: ListItem;
|
|
5677
|
+
}>;
|
|
5678
|
+
/**
|
|
5679
|
+
* Sets the total item count for virtualized lists.
|
|
5680
|
+
* This can be larger than the actual loaded items count for infinite scroll.
|
|
5681
|
+
*
|
|
5682
|
+
* @param world - The ECS world
|
|
5683
|
+
* @param eid - The entity ID
|
|
5684
|
+
* @param count - Total item count
|
|
5685
|
+
*/
|
|
5686
|
+
declare function setTotalCount(world: World, eid: Entity, count: number): void;
|
|
5687
|
+
/**
|
|
5688
|
+
* Gets the total item count (may be larger than loaded items).
|
|
5689
|
+
*
|
|
5690
|
+
* @param eid - The entity ID
|
|
5691
|
+
* @returns Total item count
|
|
5692
|
+
*/
|
|
5693
|
+
declare function getTotalCount(eid: Entity): number;
|
|
5694
|
+
/**
|
|
5695
|
+
* Sets the lazy load callback for loading items on demand.
|
|
5696
|
+
*
|
|
5697
|
+
* @param eid - The entity ID
|
|
5698
|
+
* @param callback - Callback function to load items
|
|
5699
|
+
*/
|
|
5700
|
+
declare function setLazyLoadCallback(eid: Entity, callback: (startIndex: number, count: number) => Promise<ListItem[]>): void;
|
|
5701
|
+
/**
|
|
5702
|
+
* Gets the lazy load callback.
|
|
5703
|
+
*
|
|
5704
|
+
* @param eid - The entity ID
|
|
5705
|
+
* @returns Lazy load callback or undefined
|
|
5706
|
+
*/
|
|
5707
|
+
declare function getLazyLoadCallback(eid: Entity): ((startIndex: number, count: number) => Promise<ListItem[]>) | undefined;
|
|
5708
|
+
/**
|
|
5709
|
+
* Clears the lazy load callback.
|
|
5710
|
+
*
|
|
5711
|
+
* @param eid - The entity ID
|
|
5712
|
+
*/
|
|
5713
|
+
declare function clearLazyLoadCallback(eid: Entity): void;
|
|
5714
|
+
/**
|
|
5715
|
+
* Registers a scroll callback for detecting scroll events.
|
|
5716
|
+
*
|
|
5717
|
+
* @param eid - The entity ID
|
|
5718
|
+
* @param callback - Callback function
|
|
5719
|
+
* @returns Unsubscribe function
|
|
5720
|
+
*/
|
|
5721
|
+
declare function onListScroll(eid: Entity, callback: (scrollInfo: ListScrollInfo) => void): () => void;
|
|
5722
|
+
/**
|
|
5723
|
+
* Sets the loading state for a list.
|
|
5724
|
+
*
|
|
5725
|
+
* @param world - The ECS world
|
|
5726
|
+
* @param eid - The entity ID
|
|
5727
|
+
* @param loading - Whether items are loading
|
|
5728
|
+
*/
|
|
5729
|
+
declare function setListLoading(world: World, eid: Entity, loading: boolean): void;
|
|
5730
|
+
/**
|
|
5731
|
+
* Checks if a list is currently loading items.
|
|
5732
|
+
*
|
|
5733
|
+
* @param eid - The entity ID
|
|
5734
|
+
* @returns true if loading
|
|
5735
|
+
*/
|
|
5736
|
+
declare function isListLoading(eid: Entity): boolean;
|
|
5737
|
+
/**
|
|
5738
|
+
* Sets the loading placeholder text.
|
|
5739
|
+
*
|
|
5740
|
+
* @param eid - The entity ID
|
|
5741
|
+
* @param text - Placeholder text to show while loading
|
|
5742
|
+
*/
|
|
5743
|
+
declare function setLoadingPlaceholder(eid: Entity, text: string): void;
|
|
5744
|
+
/**
|
|
5745
|
+
* Gets the loading placeholder text.
|
|
5746
|
+
*
|
|
5747
|
+
* @param eid - The entity ID
|
|
5748
|
+
* @returns Loading placeholder text
|
|
5749
|
+
*/
|
|
5750
|
+
declare function getLoadingPlaceholder(eid: Entity): string;
|
|
5751
|
+
/**
|
|
5752
|
+
* Loads items for a range using the lazy load callback.
|
|
5753
|
+
* Returns immediately if no callback is set or already loading.
|
|
5754
|
+
*
|
|
5755
|
+
* @param world - The ECS world
|
|
5756
|
+
* @param eid - The entity ID
|
|
5757
|
+
* @param startIndex - First item to load
|
|
5758
|
+
* @param count - Number of items to load
|
|
5759
|
+
* @returns Promise that resolves when loading completes
|
|
5760
|
+
*/
|
|
5761
|
+
declare function loadItems(world: World, eid: Entity, startIndex: number, count: number): Promise<void>;
|
|
5762
|
+
/**
|
|
5763
|
+
* Checks if items need to be loaded for the current visible range.
|
|
5764
|
+
*
|
|
5765
|
+
* @param eid - The entity ID
|
|
5766
|
+
* @returns Object with needsLoad flag and range to load
|
|
5767
|
+
*/
|
|
5768
|
+
declare function checkNeedsLoad(eid: Entity): {
|
|
5769
|
+
needsLoad: boolean;
|
|
5770
|
+
startIndex: number;
|
|
5771
|
+
count: number;
|
|
5772
|
+
};
|
|
5773
|
+
/**
|
|
5774
|
+
* Gets scroll info for the list.
|
|
5775
|
+
*
|
|
5776
|
+
* @param eid - The entity ID
|
|
5777
|
+
* @param threshold - Items from end to trigger nearEnd (default: visibleCount)
|
|
5778
|
+
* @returns Scroll information
|
|
5779
|
+
*/
|
|
5780
|
+
declare function getScrollInfo(eid: Entity, threshold?: number): ListScrollInfo;
|
|
5781
|
+
/**
|
|
5782
|
+
* Appends items to the list (useful for infinite scroll).
|
|
5783
|
+
*
|
|
5784
|
+
* @param world - The ECS world
|
|
5785
|
+
* @param eid - The entity ID
|
|
5786
|
+
* @param newItems - Items to append
|
|
5787
|
+
*/
|
|
5788
|
+
declare function appendItems(world: World, eid: Entity, newItems: readonly ListItem[]): void;
|
|
5789
|
+
|
|
5790
|
+
/**
|
|
5791
|
+
* Padding component for element spacing.
|
|
5792
|
+
* @module components/padding
|
|
5793
|
+
*/
|
|
5794
|
+
|
|
5795
|
+
/**
|
|
5796
|
+
* Padding component store using SoA (Structure of Arrays) for performance.
|
|
5797
|
+
*
|
|
5798
|
+
* - `left`, `top`, `right`, `bottom`: Padding values in characters/cells
|
|
5799
|
+
*
|
|
5800
|
+
* @example
|
|
5801
|
+
* ```typescript
|
|
5802
|
+
* import { Padding, setPadding, getPadding } from 'blecsd';
|
|
5803
|
+
*
|
|
5804
|
+
* // Set individual padding values
|
|
5805
|
+
* setPadding(world, entity, { left: 1, top: 2, right: 1, bottom: 2 });
|
|
5806
|
+
*
|
|
5807
|
+
* // Set all sides at once
|
|
5808
|
+
* setPaddingAll(world, entity, 2);
|
|
5809
|
+
*
|
|
5810
|
+
* const padding = getPadding(world, entity);
|
|
5811
|
+
* console.log(padding.left); // 1
|
|
5812
|
+
* ```
|
|
5813
|
+
*/
|
|
5814
|
+
declare const Padding: {
|
|
5815
|
+
/** Left padding in cells */
|
|
5816
|
+
left: Uint8Array<ArrayBuffer>;
|
|
5817
|
+
/** Top padding in cells */
|
|
5818
|
+
top: Uint8Array<ArrayBuffer>;
|
|
5819
|
+
/** Right padding in cells */
|
|
5820
|
+
right: Uint8Array<ArrayBuffer>;
|
|
5821
|
+
/** Bottom padding in cells */
|
|
5822
|
+
bottom: Uint8Array<ArrayBuffer>;
|
|
5823
|
+
};
|
|
5824
|
+
/**
|
|
5825
|
+
* Padding configuration options.
|
|
5826
|
+
*/
|
|
5827
|
+
interface PaddingOptions {
|
|
5828
|
+
/** Left padding */
|
|
5829
|
+
left?: number | undefined;
|
|
5830
|
+
/** Top padding */
|
|
5831
|
+
top?: number | undefined;
|
|
5832
|
+
/** Right padding */
|
|
5833
|
+
right?: number | undefined;
|
|
5834
|
+
/** Bottom padding */
|
|
5835
|
+
bottom?: number | undefined;
|
|
5836
|
+
}
|
|
5837
|
+
/**
|
|
5838
|
+
* Padding data returned by getPadding.
|
|
5839
|
+
*/
|
|
5840
|
+
interface PaddingData {
|
|
5841
|
+
readonly left: number;
|
|
5842
|
+
readonly top: number;
|
|
5843
|
+
readonly right: number;
|
|
5844
|
+
readonly bottom: number;
|
|
5845
|
+
}
|
|
5846
|
+
/**
|
|
5847
|
+
* Sets the padding of an entity.
|
|
5848
|
+
* Adds the Padding component if not already present.
|
|
5849
|
+
*
|
|
5850
|
+
* @param world - The ECS world
|
|
5851
|
+
* @param eid - The entity ID
|
|
5852
|
+
* @param options - Padding options (individual sides)
|
|
5853
|
+
* @returns The entity ID for chaining
|
|
5854
|
+
*
|
|
5855
|
+
* @example
|
|
5856
|
+
* ```typescript
|
|
5857
|
+
* import { createWorld, addEntity } from '../core/ecs';
|
|
5858
|
+
* import { setPadding } from 'blecsd';
|
|
5859
|
+
*
|
|
5860
|
+
* const world = createWorld();
|
|
5861
|
+
* const entity = addEntity(world);
|
|
5862
|
+
*
|
|
5863
|
+
* // Set individual sides
|
|
5864
|
+
* setPadding(world, entity, { left: 1, top: 2, right: 1, bottom: 2 });
|
|
5865
|
+
*
|
|
5866
|
+
* // Set only some sides (others remain unchanged)
|
|
5867
|
+
* setPadding(world, entity, { left: 3 });
|
|
5868
|
+
* ```
|
|
5869
|
+
*/
|
|
5870
|
+
declare function setPadding(world: World, eid: Entity, options: PaddingOptions): Entity;
|
|
5871
|
+
/**
|
|
5872
|
+
* Sets all padding sides to the same value.
|
|
5873
|
+
* Adds the Padding component if not already present.
|
|
5874
|
+
*
|
|
5875
|
+
* @param world - The ECS world
|
|
5080
5876
|
* @param eid - The entity ID
|
|
5081
5877
|
* @param value - Padding value for all sides
|
|
5082
5878
|
* @returns The entity ID for chaining
|
|
@@ -5460,6 +6256,56 @@ declare function normalizeZIndices(world: World, entities: readonly Entity[]): v
|
|
|
5460
6256
|
* ```
|
|
5461
6257
|
*/
|
|
5462
6258
|
declare function swapZIndex(world: World, a: Entity, b: Entity): void;
|
|
6259
|
+
/**
|
|
6260
|
+
* Position keyword type for alignment shortcuts.
|
|
6261
|
+
*/
|
|
6262
|
+
type PositionKeyword = 'center' | 'top-left' | 'tl' | 'top-right' | 'tr' | 'bottom-left' | 'bl' | 'bottom-right' | 'br';
|
|
6263
|
+
/**
|
|
6264
|
+
* Sets entity position using a keyword for quick alignment.
|
|
6265
|
+
* Requires parent with Dimensions component.
|
|
6266
|
+
*
|
|
6267
|
+
* @param world - The ECS world
|
|
6268
|
+
* @param eid - The entity ID
|
|
6269
|
+
* @param keyword - Position keyword
|
|
6270
|
+
* @returns The entity ID for chaining
|
|
6271
|
+
*
|
|
6272
|
+
* @example
|
|
6273
|
+
* ```typescript
|
|
6274
|
+
* import { setPositionKeyword } from 'blecsd';
|
|
6275
|
+
*
|
|
6276
|
+
* // Center within parent
|
|
6277
|
+
* setPositionKeyword(world, dialog, 'center');
|
|
6278
|
+
*
|
|
6279
|
+
* // Top-left corner
|
|
6280
|
+
* setPositionKeyword(world, logo, 'top-left');
|
|
6281
|
+
*
|
|
6282
|
+
* // Bottom-right corner
|
|
6283
|
+
* setPositionKeyword(world, statusBar, 'bottom-right');
|
|
6284
|
+
* ```
|
|
6285
|
+
*/
|
|
6286
|
+
declare function setPositionKeyword(world: World, eid: Entity, keyword: PositionKeyword): Entity;
|
|
6287
|
+
/**
|
|
6288
|
+
* Sets entity position using percentage of parent size.
|
|
6289
|
+
* Requires parent with Dimensions component.
|
|
6290
|
+
*
|
|
6291
|
+
* @param world - The ECS world
|
|
6292
|
+
* @param eid - The entity ID
|
|
6293
|
+
* @param xPercent - X position as percentage (0-100)
|
|
6294
|
+
* @param yPercent - Y position as percentage (0-100)
|
|
6295
|
+
* @returns The entity ID for chaining
|
|
6296
|
+
*
|
|
6297
|
+
* @example
|
|
6298
|
+
* ```typescript
|
|
6299
|
+
* import { setPositionPercent } from 'blecsd';
|
|
6300
|
+
*
|
|
6301
|
+
* // Center horizontally, 25% from top
|
|
6302
|
+
* setPositionPercent(world, header, 50, 25);
|
|
6303
|
+
*
|
|
6304
|
+
* // Bottom-right quadrant
|
|
6305
|
+
* setPositionPercent(world, footer, 75, 75);
|
|
6306
|
+
* ```
|
|
6307
|
+
*/
|
|
6308
|
+
declare function setPositionPercent(world: World, eid: Entity, xPercent: number, yPercent: number): Entity;
|
|
5463
6309
|
|
|
5464
6310
|
/**
|
|
5465
6311
|
* ProgressBar component and helper functions.
|
|
@@ -5518,12 +6364,12 @@ interface ProgressBarDisplay {
|
|
|
5518
6364
|
* Options for progress bar display configuration.
|
|
5519
6365
|
*/
|
|
5520
6366
|
interface ProgressBarDisplayOptions {
|
|
5521
|
-
fillChar?: string;
|
|
5522
|
-
emptyChar?: string;
|
|
5523
|
-
fillFg?: number;
|
|
5524
|
-
fillBg?: number;
|
|
5525
|
-
emptyFg?: number;
|
|
5526
|
-
emptyBg?: number;
|
|
6367
|
+
fillChar?: string | undefined;
|
|
6368
|
+
emptyChar?: string | undefined;
|
|
6369
|
+
fillFg?: number | undefined;
|
|
6370
|
+
fillBg?: number | undefined;
|
|
6371
|
+
emptyFg?: number | undefined;
|
|
6372
|
+
emptyBg?: number | undefined;
|
|
5527
6373
|
}
|
|
5528
6374
|
/** Default fill character for horizontal progress bars */
|
|
5529
6375
|
declare const DEFAULT_FILL_CHAR$1 = "\u2588";
|
|
@@ -5591,6 +6437,7 @@ declare function isProgressBar(_world: World, eid: Entity): boolean;
|
|
|
5591
6437
|
/**
|
|
5592
6438
|
* Gets the current progress value.
|
|
5593
6439
|
*
|
|
6440
|
+
* @param world - The ECS world
|
|
5594
6441
|
* @param eid - Progress bar entity ID
|
|
5595
6442
|
* @returns Current value
|
|
5596
6443
|
*
|
|
@@ -5598,27 +6445,30 @@ declare function isProgressBar(_world: World, eid: Entity): boolean;
|
|
|
5598
6445
|
* ```typescript
|
|
5599
6446
|
* import { getProgress } from 'blecsd';
|
|
5600
6447
|
*
|
|
5601
|
-
* const value = getProgress(progressBar);
|
|
6448
|
+
* const value = getProgress(world, progressBar);
|
|
5602
6449
|
* ```
|
|
5603
6450
|
*/
|
|
5604
|
-
declare function getProgress(eid: Entity): number;
|
|
6451
|
+
declare function getProgress(_world: World, eid: Entity): number;
|
|
5605
6452
|
/**
|
|
5606
6453
|
* Gets the minimum value of the progress bar.
|
|
5607
6454
|
*
|
|
6455
|
+
* @param world - The ECS world
|
|
5608
6456
|
* @param eid - Progress bar entity ID
|
|
5609
6457
|
* @returns Minimum value
|
|
5610
6458
|
*/
|
|
5611
|
-
declare function getProgressMin(eid: Entity): number;
|
|
6459
|
+
declare function getProgressMin(_world: World, eid: Entity): number;
|
|
5612
6460
|
/**
|
|
5613
6461
|
* Gets the maximum value of the progress bar.
|
|
5614
6462
|
*
|
|
6463
|
+
* @param world - The ECS world
|
|
5615
6464
|
* @param eid - Progress bar entity ID
|
|
5616
6465
|
* @returns Maximum value
|
|
5617
6466
|
*/
|
|
5618
|
-
declare function getProgressMax(eid: Entity): number;
|
|
6467
|
+
declare function getProgressMax(_world: World, eid: Entity): number;
|
|
5619
6468
|
/**
|
|
5620
6469
|
* Gets the progress as a percentage (0-100).
|
|
5621
6470
|
*
|
|
6471
|
+
* @param world - The ECS world
|
|
5622
6472
|
* @param eid - Progress bar entity ID
|
|
5623
6473
|
* @returns Progress percentage (0-100)
|
|
5624
6474
|
*
|
|
@@ -5626,25 +6476,27 @@ declare function getProgressMax(eid: Entity): number;
|
|
|
5626
6476
|
* ```typescript
|
|
5627
6477
|
* import { getProgressPercentage } from 'blecsd';
|
|
5628
6478
|
*
|
|
5629
|
-
* const percent = getProgressPercentage(progressBar);
|
|
6479
|
+
* const percent = getProgressPercentage(world, progressBar);
|
|
5630
6480
|
* console.log(`${percent}% complete`);
|
|
5631
6481
|
* ```
|
|
5632
6482
|
*/
|
|
5633
|
-
declare function getProgressPercentage(eid: Entity): number;
|
|
6483
|
+
declare function getProgressPercentage(_world: World, eid: Entity): number;
|
|
5634
6484
|
/**
|
|
5635
6485
|
* Gets the progress bar orientation.
|
|
5636
6486
|
*
|
|
6487
|
+
* @param world - The ECS world
|
|
5637
6488
|
* @param eid - Progress bar entity ID
|
|
5638
6489
|
* @returns Orientation value
|
|
5639
6490
|
*/
|
|
5640
|
-
declare function getProgressOrientation(eid: Entity): ProgressOrientation;
|
|
6491
|
+
declare function getProgressOrientation(_world: World, eid: Entity): ProgressOrientation;
|
|
5641
6492
|
/**
|
|
5642
6493
|
* Checks if percentage display is enabled.
|
|
5643
6494
|
*
|
|
6495
|
+
* @param world - The ECS world
|
|
5644
6496
|
* @param eid - Progress bar entity ID
|
|
5645
6497
|
* @returns True if percentage is shown
|
|
5646
6498
|
*/
|
|
5647
|
-
declare function isShowingPercentage(eid: Entity): boolean;
|
|
6499
|
+
declare function isShowingPercentage(_world: World, eid: Entity): boolean;
|
|
5648
6500
|
/**
|
|
5649
6501
|
* Sets the progress bar value.
|
|
5650
6502
|
* Value is clamped to min/max range.
|
|
@@ -5701,6 +6553,7 @@ declare function completeProgress(world: World, eid: Entity): void;
|
|
|
5701
6553
|
/**
|
|
5702
6554
|
* Checks if the progress bar is complete (at max value).
|
|
5703
6555
|
*
|
|
6556
|
+
* @param world - The ECS world
|
|
5704
6557
|
* @param eid - Progress bar entity ID
|
|
5705
6558
|
* @returns True if at max value
|
|
5706
6559
|
*
|
|
@@ -5708,15 +6561,16 @@ declare function completeProgress(world: World, eid: Entity): void;
|
|
|
5708
6561
|
* ```typescript
|
|
5709
6562
|
* import { isProgressComplete } from 'blecsd';
|
|
5710
6563
|
*
|
|
5711
|
-
* if (isProgressComplete(progressBar)) {
|
|
6564
|
+
* if (isProgressComplete(world, progressBar)) {
|
|
5712
6565
|
* console.log('Done!');
|
|
5713
6566
|
* }
|
|
5714
6567
|
* ```
|
|
5715
6568
|
*/
|
|
5716
|
-
declare function isProgressComplete(eid: Entity): boolean;
|
|
6569
|
+
declare function isProgressComplete(_world: World, eid: Entity): boolean;
|
|
5717
6570
|
/**
|
|
5718
6571
|
* Sets the progress bar display configuration.
|
|
5719
6572
|
*
|
|
6573
|
+
* @param world - The ECS world
|
|
5720
6574
|
* @param eid - Progress bar entity ID
|
|
5721
6575
|
* @param options - Display options
|
|
5722
6576
|
*
|
|
@@ -5724,45 +6578,50 @@ declare function isProgressComplete(eid: Entity): boolean;
|
|
|
5724
6578
|
* ```typescript
|
|
5725
6579
|
* import { setProgressBarDisplay } from 'blecsd';
|
|
5726
6580
|
*
|
|
5727
|
-
* setProgressBarDisplay(progressBar, {
|
|
6581
|
+
* setProgressBarDisplay(world, progressBar, {
|
|
5728
6582
|
* fillChar: '=',
|
|
5729
6583
|
* emptyChar: '-',
|
|
5730
6584
|
* fillFg: 0x00ff00ff,
|
|
5731
6585
|
* });
|
|
5732
6586
|
* ```
|
|
5733
6587
|
*/
|
|
5734
|
-
declare function setProgressBarDisplay(eid: Entity, options: ProgressBarDisplayOptions): void;
|
|
6588
|
+
declare function setProgressBarDisplay(_world: World, eid: Entity, options: ProgressBarDisplayOptions): void;
|
|
5735
6589
|
/**
|
|
5736
6590
|
* Gets the progress bar display configuration.
|
|
5737
6591
|
*
|
|
6592
|
+
* @param world - The ECS world
|
|
5738
6593
|
* @param eid - Progress bar entity ID
|
|
5739
6594
|
* @returns Display configuration
|
|
5740
6595
|
*/
|
|
5741
|
-
declare function getProgressBarDisplay(eid: Entity): ProgressBarDisplay;
|
|
6596
|
+
declare function getProgressBarDisplay(_world: World, eid: Entity): ProgressBarDisplay;
|
|
5742
6597
|
/**
|
|
5743
6598
|
* Clears the progress bar display configuration.
|
|
5744
6599
|
*
|
|
6600
|
+
* @param world - The ECS world
|
|
5745
6601
|
* @param eid - Progress bar entity ID
|
|
5746
6602
|
*/
|
|
5747
|
-
declare function clearProgressBarDisplay(eid: Entity): void;
|
|
6603
|
+
declare function clearProgressBarDisplay(_world: World, eid: Entity): void;
|
|
5748
6604
|
/**
|
|
5749
6605
|
* Gets the fill character for the current progress value.
|
|
5750
6606
|
*
|
|
6607
|
+
* @param world - The ECS world
|
|
5751
6608
|
* @param eid - Progress bar entity ID
|
|
5752
6609
|
* @returns Fill character
|
|
5753
6610
|
*/
|
|
5754
|
-
declare function getProgressFillChar(eid: Entity): string;
|
|
6611
|
+
declare function getProgressFillChar(world: World, eid: Entity): string;
|
|
5755
6612
|
/**
|
|
5756
6613
|
* Gets the empty character for the remaining progress.
|
|
5757
6614
|
*
|
|
6615
|
+
* @param world - The ECS world
|
|
5758
6616
|
* @param eid - Progress bar entity ID
|
|
5759
6617
|
* @returns Empty character
|
|
5760
6618
|
*/
|
|
5761
|
-
declare function getProgressEmptyChar(eid: Entity): string;
|
|
6619
|
+
declare function getProgressEmptyChar(world: World, eid: Entity): string;
|
|
5762
6620
|
/**
|
|
5763
6621
|
* Renders the progress bar as a string.
|
|
5764
6622
|
* Useful for custom rendering.
|
|
5765
6623
|
*
|
|
6624
|
+
* @param world - The ECS world
|
|
5766
6625
|
* @param eid - Progress bar entity ID
|
|
5767
6626
|
* @param width - Width in characters
|
|
5768
6627
|
* @returns Rendered progress bar string
|
|
@@ -5771,14 +6630,15 @@ declare function getProgressEmptyChar(eid: Entity): string;
|
|
|
5771
6630
|
* ```typescript
|
|
5772
6631
|
* import { renderProgressString } from 'blecsd';
|
|
5773
6632
|
*
|
|
5774
|
-
* const bar = renderProgressString(progressBar, 20);
|
|
6633
|
+
* const bar = renderProgressString(world, progressBar, 20);
|
|
5775
6634
|
* // Returns something like "████████████░░░░░░░░"
|
|
5776
6635
|
* ```
|
|
5777
6636
|
*/
|
|
5778
|
-
declare function renderProgressString(eid: Entity, width: number): string;
|
|
6637
|
+
declare function renderProgressString(world: World, eid: Entity, width: number): string;
|
|
5779
6638
|
/**
|
|
5780
6639
|
* Registers a callback for progress completion.
|
|
5781
6640
|
*
|
|
6641
|
+
* @param world - The ECS world
|
|
5782
6642
|
* @param eid - Progress bar entity ID
|
|
5783
6643
|
* @param callback - Function to call when complete
|
|
5784
6644
|
* @returns Unsubscribe function
|
|
@@ -5787,26 +6647,28 @@ declare function renderProgressString(eid: Entity, width: number): string;
|
|
|
5787
6647
|
* ```typescript
|
|
5788
6648
|
* import { onProgressComplete } from 'blecsd';
|
|
5789
6649
|
*
|
|
5790
|
-
* const unsubscribe = onProgressComplete(progressBar, () => {
|
|
6650
|
+
* const unsubscribe = onProgressComplete(world, progressBar, () => {
|
|
5791
6651
|
* console.log('Progress complete!');
|
|
5792
6652
|
* });
|
|
5793
6653
|
* ```
|
|
5794
6654
|
*/
|
|
5795
|
-
declare function onProgressComplete(eid: Entity, callback: ProgressCompleteCallback): () => void;
|
|
6655
|
+
declare function onProgressComplete(_world: World, eid: Entity, callback: ProgressCompleteCallback): () => void;
|
|
5796
6656
|
/**
|
|
5797
6657
|
* Registers a callback for progress changes.
|
|
5798
6658
|
*
|
|
6659
|
+
* @param world - The ECS world
|
|
5799
6660
|
* @param eid - Progress bar entity ID
|
|
5800
6661
|
* @param callback - Function to call on change
|
|
5801
6662
|
* @returns Unsubscribe function
|
|
5802
6663
|
*/
|
|
5803
|
-
declare function onProgressChange(eid: Entity, callback: ProgressChangeCallback): () => void;
|
|
6664
|
+
declare function onProgressChange(_world: World, eid: Entity, callback: ProgressChangeCallback): () => void;
|
|
5804
6665
|
/**
|
|
5805
6666
|
* Clears all callbacks for a progress bar.
|
|
5806
6667
|
*
|
|
6668
|
+
* @param world - The ECS world
|
|
5807
6669
|
* @param eid - Progress bar entity ID
|
|
5808
6670
|
*/
|
|
5809
|
-
declare function clearProgressBarCallbacks(eid: Entity): void;
|
|
6671
|
+
declare function clearProgressBarCallbacks(_world: World, eid: Entity): void;
|
|
5810
6672
|
/**
|
|
5811
6673
|
* Sets the progress bar orientation.
|
|
5812
6674
|
*
|
|
@@ -5899,8 +6761,8 @@ interface RadioButtonDisplay {
|
|
|
5899
6761
|
* Options for radio button display configuration.
|
|
5900
6762
|
*/
|
|
5901
6763
|
interface RadioButtonDisplayOptions {
|
|
5902
|
-
selectedChar?: string;
|
|
5903
|
-
unselectedChar?: string;
|
|
6764
|
+
selectedChar?: string | undefined;
|
|
6765
|
+
unselectedChar?: string | undefined;
|
|
5904
6766
|
}
|
|
5905
6767
|
/** Default selected character */
|
|
5906
6768
|
declare const DEFAULT_RADIO_SELECTED_CHAR = "\u25C9";
|
|
@@ -6220,6 +7082,28 @@ declare function getRadioButtonsInSet(radioSetId: Entity): Entity[];
|
|
|
6220
7082
|
*/
|
|
6221
7083
|
declare function selectRadioByValue(world: World, radioSetId: Entity, value: string): boolean;
|
|
6222
7084
|
|
|
7085
|
+
/**
|
|
7086
|
+
* Component name registration for better validation error messages
|
|
7087
|
+
*
|
|
7088
|
+
* This file registers all built-in components with their human-readable names
|
|
7089
|
+
* to provide clear error messages when component validation fails.
|
|
7090
|
+
*
|
|
7091
|
+
* @module components/registerNames
|
|
7092
|
+
*/
|
|
7093
|
+
/**
|
|
7094
|
+
* Registers all built-in component names for better error messages.
|
|
7095
|
+
* Call this early in your application (e.g., in initialization code).
|
|
7096
|
+
*
|
|
7097
|
+
* @example
|
|
7098
|
+
* ```typescript
|
|
7099
|
+
* import { registerBuiltinComponentNames } from 'blecsd/components';
|
|
7100
|
+
*
|
|
7101
|
+
* // Call once during app initialization
|
|
7102
|
+
* registerBuiltinComponentNames();
|
|
7103
|
+
* ```
|
|
7104
|
+
*/
|
|
7105
|
+
declare function registerBuiltinComponentNames(): void;
|
|
7106
|
+
|
|
6223
7107
|
/**
|
|
6224
7108
|
* Screen Component
|
|
6225
7109
|
*
|
|
@@ -6336,10 +7220,10 @@ interface ScreenData {
|
|
|
6336
7220
|
* Options for initializing the Screen component.
|
|
6337
7221
|
*/
|
|
6338
7222
|
interface ScreenOptions {
|
|
6339
|
-
cursorVisible?: boolean;
|
|
6340
|
-
cursorShape?: CursorShapeValue;
|
|
6341
|
-
fullUnicode?: boolean;
|
|
6342
|
-
autoPadding?: boolean;
|
|
7223
|
+
cursorVisible?: boolean | undefined;
|
|
7224
|
+
cursorShape?: CursorShapeValue | undefined;
|
|
7225
|
+
fullUnicode?: boolean | undefined;
|
|
7226
|
+
autoPadding?: boolean | undefined;
|
|
6343
7227
|
}
|
|
6344
7228
|
/**
|
|
6345
7229
|
* Initializes the Screen component with default values.
|
|
@@ -6463,146 +7347,442 @@ declare function setScreenCursorShape(world: World, eid: Entity, shape: CursorSh
|
|
|
6463
7347
|
*
|
|
6464
7348
|
* @example
|
|
6465
7349
|
* ```typescript
|
|
6466
|
-
* const focused = getScreenFocus(world, screen);
|
|
6467
|
-
* if (focused !== null) {
|
|
6468
|
-
* console.log(`Entity ${focused} is focused`);
|
|
6469
|
-
* }
|
|
7350
|
+
* const focused = getScreenFocus(world, screen);
|
|
7351
|
+
* if (focused !== null) {
|
|
7352
|
+
* console.log(`Entity ${focused} is focused`);
|
|
7353
|
+
* }
|
|
7354
|
+
* ```
|
|
7355
|
+
*/
|
|
7356
|
+
declare function getScreenFocus(world: World, eid: Entity): Entity | null;
|
|
7357
|
+
/**
|
|
7358
|
+
* Sets the currently focused entity.
|
|
7359
|
+
*
|
|
7360
|
+
* @param world - The ECS world
|
|
7361
|
+
* @param eid - The screen entity ID
|
|
7362
|
+
* @param focusedEntity - The entity to focus, or null to clear focus
|
|
7363
|
+
* @returns true if set successfully
|
|
7364
|
+
*
|
|
7365
|
+
* @example
|
|
7366
|
+
* ```typescript
|
|
7367
|
+
* setScreenFocus(world, screen, buttonEntity);
|
|
7368
|
+
*
|
|
7369
|
+
* // Clear focus
|
|
7370
|
+
* setScreenFocus(world, screen, null);
|
|
7371
|
+
* ```
|
|
7372
|
+
*/
|
|
7373
|
+
declare function setScreenFocus(world: World, eid: Entity, focusedEntity: Entity | null): boolean;
|
|
7374
|
+
/**
|
|
7375
|
+
* Gets the currently hovered entity.
|
|
7376
|
+
*
|
|
7377
|
+
* @param world - The ECS world
|
|
7378
|
+
* @param eid - The screen entity ID
|
|
7379
|
+
* @returns The hovered entity ID, or null if none hovered
|
|
7380
|
+
*/
|
|
7381
|
+
declare function getScreenHover(world: World, eid: Entity): Entity | null;
|
|
7382
|
+
/**
|
|
7383
|
+
* Sets the currently hovered entity.
|
|
7384
|
+
*
|
|
7385
|
+
* @param world - The ECS world
|
|
7386
|
+
* @param eid - The screen entity ID
|
|
7387
|
+
* @param hoveredEntity - The entity being hovered, or null to clear
|
|
7388
|
+
* @returns true if set successfully
|
|
7389
|
+
*/
|
|
7390
|
+
declare function setScreenHover(world: World, eid: Entity, hoveredEntity: Entity | null): boolean;
|
|
7391
|
+
/**
|
|
7392
|
+
* Gets the full screen data.
|
|
7393
|
+
*
|
|
7394
|
+
* @param world - The ECS world
|
|
7395
|
+
* @param eid - The screen entity ID
|
|
7396
|
+
* @returns Full screen data or undefined if not a screen
|
|
7397
|
+
*
|
|
7398
|
+
* @example
|
|
7399
|
+
* ```typescript
|
|
7400
|
+
* const data = getScreenData(world, screen);
|
|
7401
|
+
* if (data) {
|
|
7402
|
+
* console.log(`Screen: ${data.width}x${data.height}`);
|
|
7403
|
+
* console.log(`Focused: ${data.focused}`);
|
|
7404
|
+
* }
|
|
7405
|
+
* ```
|
|
7406
|
+
*/
|
|
7407
|
+
declare function getScreenData(world: World, eid: Entity): ScreenData | undefined;
|
|
7408
|
+
/**
|
|
7409
|
+
* Gets the screen dimensions.
|
|
7410
|
+
*
|
|
7411
|
+
* @param world - The ECS world
|
|
7412
|
+
* @param eid - The screen entity ID
|
|
7413
|
+
* @returns Object with width and height, or undefined if not a screen
|
|
7414
|
+
*
|
|
7415
|
+
* @example
|
|
7416
|
+
* ```typescript
|
|
7417
|
+
* const size = getScreenSize(world, screen);
|
|
7418
|
+
* console.log(`Terminal: ${size?.width}x${size?.height}`);
|
|
7419
|
+
* ```
|
|
7420
|
+
*/
|
|
7421
|
+
declare function getScreenSize(world: World, eid: Entity): {
|
|
7422
|
+
width: number;
|
|
7423
|
+
height: number;
|
|
7424
|
+
} | undefined;
|
|
7425
|
+
/**
|
|
7426
|
+
* Resizes the screen.
|
|
7427
|
+
*
|
|
7428
|
+
* @param world - The ECS world
|
|
7429
|
+
* @param eid - The screen entity ID
|
|
7430
|
+
* @param width - New width
|
|
7431
|
+
* @param height - New height
|
|
7432
|
+
* @returns true if resized successfully
|
|
7433
|
+
*
|
|
7434
|
+
* @example
|
|
7435
|
+
* ```typescript
|
|
7436
|
+
* // Handle terminal resize
|
|
7437
|
+
* process.stdout.on('resize', () => {
|
|
7438
|
+
* resizeScreen(world, screen, process.stdout.columns, process.stdout.rows);
|
|
7439
|
+
* });
|
|
7440
|
+
* ```
|
|
7441
|
+
*/
|
|
7442
|
+
declare function resizeScreen(world: World, eid: Entity, width: number, height: number): boolean;
|
|
7443
|
+
/**
|
|
7444
|
+
* Checks if full Unicode support is enabled.
|
|
7445
|
+
*
|
|
7446
|
+
* @param world - The ECS world
|
|
7447
|
+
* @param eid - The screen entity ID
|
|
7448
|
+
* @returns true if full Unicode is enabled
|
|
7449
|
+
*/
|
|
7450
|
+
declare function isFullUnicode(world: World, eid: Entity): boolean;
|
|
7451
|
+
/**
|
|
7452
|
+
* Sets full Unicode support.
|
|
7453
|
+
*
|
|
7454
|
+
* @param world - The ECS world
|
|
7455
|
+
* @param eid - The screen entity ID
|
|
7456
|
+
* @param enabled - Whether to enable full Unicode
|
|
7457
|
+
* @returns true if set successfully
|
|
7458
|
+
*/
|
|
7459
|
+
declare function setFullUnicode(world: World, eid: Entity, enabled: boolean): boolean;
|
|
7460
|
+
/**
|
|
7461
|
+
* Checks if auto padding is enabled.
|
|
7462
|
+
*
|
|
7463
|
+
* @param world - The ECS world
|
|
7464
|
+
* @param eid - The screen entity ID
|
|
7465
|
+
* @returns true if auto padding is enabled
|
|
7466
|
+
*/
|
|
7467
|
+
declare function isAutoPadding(world: World, eid: Entity): boolean;
|
|
7468
|
+
/**
|
|
7469
|
+
* Sets auto padding.
|
|
7470
|
+
*
|
|
7471
|
+
* @param world - The ECS world
|
|
7472
|
+
* @param eid - The screen entity ID
|
|
7473
|
+
* @param enabled - Whether to enable auto padding
|
|
7474
|
+
* @returns true if set successfully
|
|
7475
|
+
*/
|
|
7476
|
+
declare function setAutoPadding(world: World, eid: Entity, enabled: boolean): boolean;
|
|
7477
|
+
/**
|
|
7478
|
+
* Removes the screen entity from the world.
|
|
7479
|
+
* Clears the singleton reference.
|
|
7480
|
+
*
|
|
7481
|
+
* @param world - The ECS world
|
|
7482
|
+
* @returns true if screen was removed
|
|
7483
|
+
*/
|
|
7484
|
+
declare function destroyScreen(world: World): boolean;
|
|
7485
|
+
/**
|
|
7486
|
+
* Resets the screen singleton state. Used for testing.
|
|
7487
|
+
* @internal
|
|
7488
|
+
*/
|
|
7489
|
+
declare function resetScreenSingleton(world: World): void;
|
|
7490
|
+
|
|
7491
|
+
/**
|
|
7492
|
+
* Scrollbar component for rendering scrollbars on scrollable widgets.
|
|
7493
|
+
*
|
|
7494
|
+
* Provides visual feedback for scroll position with configurable characters,
|
|
7495
|
+
* colors, and auto-hide behavior.
|
|
7496
|
+
*
|
|
7497
|
+
* @module components/scrollbar
|
|
7498
|
+
*/
|
|
7499
|
+
|
|
7500
|
+
/**
|
|
7501
|
+
* Default scrollbar track character (light vertical bar).
|
|
7502
|
+
*/
|
|
7503
|
+
declare const DEFAULT_TRACK_CHAR$1 = 9474;
|
|
7504
|
+
/**
|
|
7505
|
+
* Default scrollbar thumb character (full block).
|
|
7506
|
+
*/
|
|
7507
|
+
declare const DEFAULT_THUMB_CHAR$1 = 9608;
|
|
7508
|
+
/**
|
|
7509
|
+
* Default horizontal track character (light horizontal bar).
|
|
7510
|
+
*/
|
|
7511
|
+
declare const DEFAULT_TRACK_CHAR_H = 9472;
|
|
7512
|
+
/**
|
|
7513
|
+
* Default track color (dark gray).
|
|
7514
|
+
*/
|
|
7515
|
+
declare const DEFAULT_TRACK_COLOR = 4281545523;
|
|
7516
|
+
/**
|
|
7517
|
+
* Default thumb color (light gray).
|
|
7518
|
+
*/
|
|
7519
|
+
declare const DEFAULT_THUMB_COLOR = 4287137928;
|
|
7520
|
+
/**
|
|
7521
|
+
* Scrollbar component store using SoA (Structure of Arrays) for performance.
|
|
7522
|
+
*
|
|
7523
|
+
* - `enabled`: Whether scrollbar is enabled (0=disabled, 1=enabled)
|
|
7524
|
+
* - `vertical`: Whether vertical scrollbar is visible (0=no, 1=yes)
|
|
7525
|
+
* - `horizontal`: Whether horizontal scrollbar is visible (0=no, 1=yes)
|
|
7526
|
+
* - `trackChar`: Unicode codepoint for track character (vertical)
|
|
7527
|
+
* - `thumbChar`: Unicode codepoint for thumb character (vertical)
|
|
7528
|
+
* - `trackCharH`: Unicode codepoint for horizontal track character
|
|
7529
|
+
* - `thumbCharH`: Unicode codepoint for horizontal thumb character
|
|
7530
|
+
* - `trackColor`: Track color (packed RGBA)
|
|
7531
|
+
* - `thumbColor`: Thumb color (packed RGBA)
|
|
7532
|
+
* - `alwaysShow`: Always show scrollbar (0=auto, 1=always)
|
|
7533
|
+
*
|
|
7534
|
+
* @example
|
|
7535
|
+
* ```typescript
|
|
7536
|
+
* import { Scrollbar, setScrollbar, getScrollbar } from 'blecsd';
|
|
7537
|
+
*
|
|
7538
|
+
* setScrollbar(world, entity, { enabled: true });
|
|
7539
|
+
* setScrollbar(world, entity, { thumbColor: '#ff0000', alwaysShow: true });
|
|
7540
|
+
*
|
|
7541
|
+
* const scrollbar = getScrollbar(world, entity);
|
|
7542
|
+
* if (scrollbar?.enabled) {
|
|
7543
|
+
* console.log(`Track char: ${String.fromCodePoint(scrollbar.trackChar)}`);
|
|
7544
|
+
* }
|
|
7545
|
+
* ```
|
|
7546
|
+
*/
|
|
7547
|
+
declare const Scrollbar: {
|
|
7548
|
+
/** 0 = disabled, 1 = enabled */
|
|
7549
|
+
enabled: Uint8Array<ArrayBuffer>;
|
|
7550
|
+
/** Vertical scrollbar visible (0=no, 1=yes) */
|
|
7551
|
+
vertical: Uint8Array<ArrayBuffer>;
|
|
7552
|
+
/** Horizontal scrollbar visible (0=no, 1=yes) */
|
|
7553
|
+
horizontal: Uint8Array<ArrayBuffer>;
|
|
7554
|
+
/** Track character for vertical scrollbar */
|
|
7555
|
+
trackChar: Uint32Array<ArrayBuffer>;
|
|
7556
|
+
/** Thumb character for vertical scrollbar */
|
|
7557
|
+
thumbChar: Uint32Array<ArrayBuffer>;
|
|
7558
|
+
/** Track character for horizontal scrollbar */
|
|
7559
|
+
trackCharH: Uint32Array<ArrayBuffer>;
|
|
7560
|
+
/** Thumb character for horizontal scrollbar */
|
|
7561
|
+
thumbCharH: Uint32Array<ArrayBuffer>;
|
|
7562
|
+
/** Track color (packed RGBA) */
|
|
7563
|
+
trackColor: Uint32Array<ArrayBuffer>;
|
|
7564
|
+
/** Thumb color (packed RGBA) */
|
|
7565
|
+
thumbColor: Uint32Array<ArrayBuffer>;
|
|
7566
|
+
/** Always show scrollbar (0=auto, 1=always) */
|
|
7567
|
+
alwaysShow: Uint8Array<ArrayBuffer>;
|
|
7568
|
+
};
|
|
7569
|
+
/**
|
|
7570
|
+
* Scrollbar configuration options.
|
|
7571
|
+
*/
|
|
7572
|
+
interface ScrollbarOptions {
|
|
7573
|
+
/** Enable or disable scrollbar */
|
|
7574
|
+
enabled?: boolean;
|
|
7575
|
+
/** Show vertical scrollbar */
|
|
7576
|
+
vertical?: boolean;
|
|
7577
|
+
/** Show horizontal scrollbar */
|
|
7578
|
+
horizontal?: boolean;
|
|
7579
|
+
/** Track character for vertical scrollbar */
|
|
7580
|
+
trackChar?: number;
|
|
7581
|
+
/** Thumb character for vertical scrollbar */
|
|
7582
|
+
thumbChar?: number;
|
|
7583
|
+
/** Track character for horizontal scrollbar */
|
|
7584
|
+
trackCharH?: number;
|
|
7585
|
+
/** Thumb character for horizontal scrollbar */
|
|
7586
|
+
thumbCharH?: number;
|
|
7587
|
+
/** Track color (hex string or packed number) */
|
|
7588
|
+
trackColor?: string | number;
|
|
7589
|
+
/** Thumb color (hex string or packed number) */
|
|
7590
|
+
thumbColor?: string | number;
|
|
7591
|
+
/** Always show scrollbar (even when content fits) */
|
|
7592
|
+
alwaysShow?: boolean;
|
|
7593
|
+
}
|
|
7594
|
+
/**
|
|
7595
|
+
* Scrollbar data returned by getScrollbar.
|
|
7596
|
+
*/
|
|
7597
|
+
interface ScrollbarData {
|
|
7598
|
+
readonly enabled: boolean;
|
|
7599
|
+
readonly vertical: boolean;
|
|
7600
|
+
readonly horizontal: boolean;
|
|
7601
|
+
readonly trackChar: number;
|
|
7602
|
+
readonly thumbChar: number;
|
|
7603
|
+
readonly trackCharH: number;
|
|
7604
|
+
readonly thumbCharH: number;
|
|
7605
|
+
readonly trackColor: number;
|
|
7606
|
+
readonly thumbColor: number;
|
|
7607
|
+
readonly alwaysShow: boolean;
|
|
7608
|
+
}
|
|
7609
|
+
/**
|
|
7610
|
+
* Scrollbar render position for a single cell.
|
|
7611
|
+
*/
|
|
7612
|
+
interface ScrollbarRenderCell {
|
|
7613
|
+
readonly x: number;
|
|
7614
|
+
readonly y: number;
|
|
7615
|
+
readonly char: number;
|
|
7616
|
+
readonly color: number;
|
|
7617
|
+
readonly isThumb: boolean;
|
|
7618
|
+
}
|
|
7619
|
+
/**
|
|
7620
|
+
* Sets the scrollbar configuration of an entity.
|
|
7621
|
+
* Adds the Scrollbar component if not already present.
|
|
7622
|
+
*
|
|
7623
|
+
* @param world - The ECS world
|
|
7624
|
+
* @param eid - The entity ID
|
|
7625
|
+
* @param options - Scrollbar configuration options
|
|
7626
|
+
* @returns The entity ID for chaining
|
|
7627
|
+
*
|
|
7628
|
+
* @example
|
|
7629
|
+
* ```typescript
|
|
7630
|
+
* import { createWorld, addEntity } from '../core/ecs';
|
|
7631
|
+
* import { setScrollbar } from 'blecsd';
|
|
7632
|
+
*
|
|
7633
|
+
* const world = createWorld();
|
|
7634
|
+
* const entity = addEntity(world);
|
|
7635
|
+
*
|
|
7636
|
+
* // Enable scrollbar with default settings
|
|
7637
|
+
* setScrollbar(world, entity, { enabled: true });
|
|
7638
|
+
*
|
|
7639
|
+
* // Custom scrollbar configuration
|
|
7640
|
+
* setScrollbar(world, entity, {
|
|
7641
|
+
* enabled: true,
|
|
7642
|
+
* thumbColor: '#ff0000',
|
|
7643
|
+
* trackColor: '#333333',
|
|
7644
|
+
* alwaysShow: true,
|
|
7645
|
+
* });
|
|
6470
7646
|
* ```
|
|
6471
7647
|
*/
|
|
6472
|
-
declare function
|
|
7648
|
+
declare function setScrollbar(world: World, eid: Entity, options: ScrollbarOptions): Entity;
|
|
6473
7649
|
/**
|
|
6474
|
-
*
|
|
7650
|
+
* Gets the scrollbar data of an entity.
|
|
7651
|
+
* Returns undefined if the entity doesn't have a Scrollbar component.
|
|
6475
7652
|
*
|
|
6476
7653
|
* @param world - The ECS world
|
|
6477
|
-
* @param eid - The
|
|
6478
|
-
* @
|
|
6479
|
-
* @returns true if set successfully
|
|
7654
|
+
* @param eid - The entity ID
|
|
7655
|
+
* @returns Scrollbar data or undefined
|
|
6480
7656
|
*
|
|
6481
7657
|
* @example
|
|
6482
7658
|
* ```typescript
|
|
6483
|
-
*
|
|
7659
|
+
* import { getScrollbar } from 'blecsd';
|
|
6484
7660
|
*
|
|
6485
|
-
*
|
|
6486
|
-
*
|
|
7661
|
+
* const scrollbar = getScrollbar(world, entity);
|
|
7662
|
+
* if (scrollbar?.enabled) {
|
|
7663
|
+
* console.log(`Track: ${scrollbar.trackColor.toString(16)}`);
|
|
7664
|
+
* }
|
|
6487
7665
|
* ```
|
|
6488
7666
|
*/
|
|
6489
|
-
declare function
|
|
7667
|
+
declare function getScrollbar(world: World, eid: Entity): ScrollbarData | undefined;
|
|
6490
7668
|
/**
|
|
6491
|
-
*
|
|
7669
|
+
* Checks if an entity has a Scrollbar component.
|
|
6492
7670
|
*
|
|
6493
7671
|
* @param world - The ECS world
|
|
6494
|
-
* @param eid - The
|
|
6495
|
-
* @returns
|
|
7672
|
+
* @param eid - The entity ID
|
|
7673
|
+
* @returns true if entity has Scrollbar component
|
|
6496
7674
|
*/
|
|
6497
|
-
declare function
|
|
7675
|
+
declare function hasScrollbar(world: World, eid: Entity): boolean;
|
|
6498
7676
|
/**
|
|
6499
|
-
*
|
|
7677
|
+
* Checks if scrollbar is enabled for an entity.
|
|
6500
7678
|
*
|
|
6501
7679
|
* @param world - The ECS world
|
|
6502
|
-
* @param eid - The
|
|
6503
|
-
* @
|
|
6504
|
-
* @returns true if set successfully
|
|
7680
|
+
* @param eid - The entity ID
|
|
7681
|
+
* @returns true if scrollbar is enabled
|
|
6505
7682
|
*/
|
|
6506
|
-
declare function
|
|
7683
|
+
declare function isScrollbarEnabled(world: World, eid: Entity): boolean;
|
|
6507
7684
|
/**
|
|
6508
|
-
*
|
|
7685
|
+
* Enables the scrollbar for an entity.
|
|
6509
7686
|
*
|
|
6510
7687
|
* @param world - The ECS world
|
|
6511
|
-
* @param eid - The
|
|
6512
|
-
* @returns
|
|
6513
|
-
*
|
|
6514
|
-
* @example
|
|
6515
|
-
* ```typescript
|
|
6516
|
-
* const data = getScreenData(world, screen);
|
|
6517
|
-
* if (data) {
|
|
6518
|
-
* console.log(`Screen: ${data.width}x${data.height}`);
|
|
6519
|
-
* console.log(`Focused: ${data.focused}`);
|
|
6520
|
-
* }
|
|
6521
|
-
* ```
|
|
7688
|
+
* @param eid - The entity ID
|
|
7689
|
+
* @returns The entity ID for chaining
|
|
6522
7690
|
*/
|
|
6523
|
-
declare function
|
|
7691
|
+
declare function enableScrollbar(world: World, eid: Entity): Entity;
|
|
6524
7692
|
/**
|
|
6525
|
-
*
|
|
7693
|
+
* Disables the scrollbar for an entity.
|
|
6526
7694
|
*
|
|
6527
7695
|
* @param world - The ECS world
|
|
6528
|
-
* @param eid - The
|
|
6529
|
-
* @returns
|
|
6530
|
-
*
|
|
6531
|
-
* @example
|
|
6532
|
-
* ```typescript
|
|
6533
|
-
* const size = getScreenSize(world, screen);
|
|
6534
|
-
* console.log(`Terminal: ${size?.width}x${size?.height}`);
|
|
6535
|
-
* ```
|
|
7696
|
+
* @param eid - The entity ID
|
|
7697
|
+
* @returns The entity ID for chaining
|
|
6536
7698
|
*/
|
|
6537
|
-
declare function
|
|
6538
|
-
width: number;
|
|
6539
|
-
height: number;
|
|
6540
|
-
} | undefined;
|
|
7699
|
+
declare function disableScrollbar(world: World, eid: Entity): Entity;
|
|
6541
7700
|
/**
|
|
6542
|
-
*
|
|
7701
|
+
* Sets scrollbar characters for vertical scrollbar.
|
|
6543
7702
|
*
|
|
6544
7703
|
* @param world - The ECS world
|
|
6545
|
-
* @param eid - The
|
|
6546
|
-
* @param
|
|
6547
|
-
* @param
|
|
6548
|
-
* @returns
|
|
6549
|
-
*
|
|
6550
|
-
* @example
|
|
6551
|
-
* ```typescript
|
|
6552
|
-
* // Handle terminal resize
|
|
6553
|
-
* process.stdout.on('resize', () => {
|
|
6554
|
-
* resizeScreen(world, screen, process.stdout.columns, process.stdout.rows);
|
|
6555
|
-
* });
|
|
6556
|
-
* ```
|
|
7704
|
+
* @param eid - The entity ID
|
|
7705
|
+
* @param trackChar - Track character codepoint
|
|
7706
|
+
* @param thumbChar - Thumb character codepoint
|
|
7707
|
+
* @returns The entity ID for chaining
|
|
6557
7708
|
*/
|
|
6558
|
-
declare function
|
|
7709
|
+
declare function setScrollbarChars(world: World, eid: Entity, trackChar: number, thumbChar: number): Entity;
|
|
6559
7710
|
/**
|
|
6560
|
-
*
|
|
7711
|
+
* Sets scrollbar colors.
|
|
6561
7712
|
*
|
|
6562
7713
|
* @param world - The ECS world
|
|
6563
|
-
* @param eid - The
|
|
6564
|
-
* @
|
|
7714
|
+
* @param eid - The entity ID
|
|
7715
|
+
* @param trackColor - Track color (hex string or packed number)
|
|
7716
|
+
* @param thumbColor - Thumb color (hex string or packed number)
|
|
7717
|
+
* @returns The entity ID for chaining
|
|
6565
7718
|
*/
|
|
6566
|
-
declare function
|
|
7719
|
+
declare function setScrollbarColors(world: World, eid: Entity, trackColor: string | number, thumbColor: string | number): Entity;
|
|
6567
7720
|
/**
|
|
6568
|
-
*
|
|
7721
|
+
* Calculates vertical scrollbar render positions.
|
|
6569
7722
|
*
|
|
6570
|
-
* @param
|
|
6571
|
-
* @param
|
|
6572
|
-
* @param
|
|
6573
|
-
* @
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
*
|
|
7723
|
+
* @param x - Scrollbar X position (typically right edge of widget)
|
|
7724
|
+
* @param y - Scrollbar Y position (typically widget top)
|
|
7725
|
+
* @param height - Scrollbar height (typically widget height)
|
|
7726
|
+
* @param scrollOffset - Current scroll offset
|
|
7727
|
+
* @param scrollSize - Total scrollable content size
|
|
7728
|
+
* @param viewportSize - Visible area size
|
|
7729
|
+
* @param trackChar - Track character codepoint
|
|
7730
|
+
* @param thumbChar - Thumb character codepoint
|
|
7731
|
+
* @param trackColor - Track color
|
|
7732
|
+
* @param thumbColor - Thumb color
|
|
7733
|
+
* @returns Array of scrollbar cells to render
|
|
6578
7734
|
*
|
|
6579
|
-
* @
|
|
6580
|
-
*
|
|
6581
|
-
*
|
|
7735
|
+
* @example
|
|
7736
|
+
* ```typescript
|
|
7737
|
+
* import { calculateVerticalScrollbar } from 'blecsd';
|
|
7738
|
+
*
|
|
7739
|
+
* const cells = calculateVerticalScrollbar(
|
|
7740
|
+
* 79, 0, 24, // x, y, height
|
|
7741
|
+
* 100, 1000, 200, // scrollOffset, scrollSize, viewportSize
|
|
7742
|
+
* 0x2502, 0x2588, // track, thumb chars
|
|
7743
|
+
* 0xff333333, 0xff888888 // track, thumb colors
|
|
7744
|
+
* );
|
|
7745
|
+
*
|
|
7746
|
+
* for (const cell of cells) {
|
|
7747
|
+
* renderCell(cell.x, cell.y, cell.char, cell.color);
|
|
7748
|
+
* }
|
|
7749
|
+
* ```
|
|
6582
7750
|
*/
|
|
6583
|
-
declare function
|
|
7751
|
+
declare function calculateVerticalScrollbar(x: number, y: number, height: number, scrollOffset: number, scrollSize: number, viewportSize: number, trackChar: number, thumbChar: number, trackColor: number, thumbColor: number): ScrollbarRenderCell[];
|
|
6584
7752
|
/**
|
|
6585
|
-
*
|
|
7753
|
+
* Calculates horizontal scrollbar render positions.
|
|
6586
7754
|
*
|
|
6587
|
-
* @param
|
|
6588
|
-
* @param
|
|
6589
|
-
* @param
|
|
6590
|
-
* @
|
|
7755
|
+
* @param x - Scrollbar X position (typically widget left)
|
|
7756
|
+
* @param y - Scrollbar Y position (typically bottom edge of widget)
|
|
7757
|
+
* @param width - Scrollbar width (typically widget width)
|
|
7758
|
+
* @param scrollOffset - Current scroll offset
|
|
7759
|
+
* @param scrollSize - Total scrollable content size
|
|
7760
|
+
* @param viewportSize - Visible area size
|
|
7761
|
+
* @param trackChar - Track character codepoint
|
|
7762
|
+
* @param thumbChar - Thumb character codepoint
|
|
7763
|
+
* @param trackColor - Track color
|
|
7764
|
+
* @param thumbColor - Thumb color
|
|
7765
|
+
* @returns Array of scrollbar cells to render
|
|
6591
7766
|
*/
|
|
6592
|
-
declare function
|
|
7767
|
+
declare function calculateHorizontalScrollbar(x: number, y: number, width: number, scrollOffset: number, scrollSize: number, viewportSize: number, trackChar: number, thumbChar: number, trackColor: number, thumbColor: number): ScrollbarRenderCell[];
|
|
6593
7768
|
/**
|
|
6594
|
-
*
|
|
6595
|
-
* Clears the singleton reference.
|
|
7769
|
+
* Determines if vertical scrollbar should be visible.
|
|
6596
7770
|
*
|
|
6597
|
-
* @param
|
|
6598
|
-
* @
|
|
7771
|
+
* @param scrollSize - Total scrollable height
|
|
7772
|
+
* @param viewportSize - Visible area height
|
|
7773
|
+
* @param alwaysShow - Always show even if content fits
|
|
7774
|
+
* @returns true if vertical scrollbar should be shown
|
|
6599
7775
|
*/
|
|
6600
|
-
declare function
|
|
7776
|
+
declare function shouldShowVerticalScrollbar(scrollSize: number, viewportSize: number, alwaysShow: boolean): boolean;
|
|
6601
7777
|
/**
|
|
6602
|
-
*
|
|
6603
|
-
*
|
|
7778
|
+
* Determines if horizontal scrollbar should be visible.
|
|
7779
|
+
*
|
|
7780
|
+
* @param scrollSize - Total scrollable width
|
|
7781
|
+
* @param viewportSize - Visible area width
|
|
7782
|
+
* @param alwaysShow - Always show even if content fits
|
|
7783
|
+
* @returns true if horizontal scrollbar should be shown
|
|
6604
7784
|
*/
|
|
6605
|
-
declare function
|
|
7785
|
+
declare function shouldShowHorizontalScrollbar(scrollSize: number, viewportSize: number, alwaysShow: boolean): boolean;
|
|
6606
7786
|
|
|
6607
7787
|
/**
|
|
6608
7788
|
* Select/Dropdown Component
|
|
@@ -6808,10 +7988,11 @@ declare function enableSelect(world: World, eid: Entity): boolean;
|
|
|
6808
7988
|
/**
|
|
6809
7989
|
* Gets the options for a select.
|
|
6810
7990
|
*
|
|
7991
|
+
* @param _world - The ECS world
|
|
6811
7992
|
* @param eid - The entity ID
|
|
6812
7993
|
* @returns Array of options
|
|
6813
7994
|
*/
|
|
6814
|
-
declare function getSelectOptions(eid: Entity): readonly SelectOption[];
|
|
7995
|
+
declare function getSelectOptions(_world: World, eid: Entity): readonly SelectOption[];
|
|
6815
7996
|
/**
|
|
6816
7997
|
* Sets the options for a select.
|
|
6817
7998
|
*
|
|
@@ -6823,46 +8004,52 @@ declare function setSelectOptions(world: World, eid: Entity, options: SelectOpti
|
|
|
6823
8004
|
/**
|
|
6824
8005
|
* Gets the number of options.
|
|
6825
8006
|
*
|
|
8007
|
+
* @param _world - The ECS world
|
|
6826
8008
|
* @param eid - The entity ID
|
|
6827
8009
|
* @returns Number of options
|
|
6828
8010
|
*/
|
|
6829
|
-
declare function getOptionCount(eid: Entity): number;
|
|
8011
|
+
declare function getOptionCount(_world: World, eid: Entity): number;
|
|
6830
8012
|
/**
|
|
6831
8013
|
* Gets an option by index.
|
|
6832
8014
|
*
|
|
8015
|
+
* @param _world - The ECS world
|
|
6833
8016
|
* @param eid - The entity ID
|
|
6834
8017
|
* @param index - The option index
|
|
6835
8018
|
* @returns The option or undefined
|
|
6836
8019
|
*/
|
|
6837
|
-
declare function getOptionAt(eid: Entity, index: number): SelectOption | undefined;
|
|
8020
|
+
declare function getOptionAt(_world: World, eid: Entity, index: number): SelectOption | undefined;
|
|
6838
8021
|
/**
|
|
6839
8022
|
* Gets the selected index.
|
|
6840
8023
|
*
|
|
8024
|
+
* @param _world - The ECS world
|
|
6841
8025
|
* @param eid - The entity ID
|
|
6842
8026
|
* @returns Selected index or -1 if none
|
|
6843
8027
|
*/
|
|
6844
|
-
declare function getSelectedIndex(eid: Entity): number;
|
|
8028
|
+
declare function getSelectedIndex(_world: World, eid: Entity): number;
|
|
6845
8029
|
/**
|
|
6846
8030
|
* Gets the selected option.
|
|
6847
8031
|
*
|
|
8032
|
+
* @param world - The ECS world
|
|
6848
8033
|
* @param eid - The entity ID
|
|
6849
8034
|
* @returns Selected option or undefined
|
|
6850
8035
|
*/
|
|
6851
|
-
declare function getSelectedOption(eid: Entity): SelectOption | undefined;
|
|
8036
|
+
declare function getSelectedOption(world: World, eid: Entity): SelectOption | undefined;
|
|
6852
8037
|
/**
|
|
6853
8038
|
* Gets the selected value.
|
|
6854
8039
|
*
|
|
8040
|
+
* @param world - The ECS world
|
|
6855
8041
|
* @param eid - The entity ID
|
|
6856
8042
|
* @returns Selected value or undefined
|
|
6857
8043
|
*/
|
|
6858
|
-
declare function getSelectedValue(eid: Entity): string | undefined;
|
|
8044
|
+
declare function getSelectedValue(world: World, eid: Entity): string | undefined;
|
|
6859
8045
|
/**
|
|
6860
8046
|
* Gets the selected label.
|
|
6861
8047
|
*
|
|
8048
|
+
* @param world - The ECS world
|
|
6862
8049
|
* @param eid - The entity ID
|
|
6863
8050
|
* @returns Selected label or undefined
|
|
6864
8051
|
*/
|
|
6865
|
-
declare function getSelectedLabel(eid: Entity): string | undefined;
|
|
8052
|
+
declare function getSelectedLabel(world: World, eid: Entity): string | undefined;
|
|
6866
8053
|
/**
|
|
6867
8054
|
* Selects an option by index.
|
|
6868
8055
|
*
|
|
@@ -6891,10 +8078,11 @@ declare function clearSelection$1(world: World, eid: Entity): void;
|
|
|
6891
8078
|
/**
|
|
6892
8079
|
* Gets the highlighted index.
|
|
6893
8080
|
*
|
|
8081
|
+
* @param _world - The ECS world
|
|
6894
8082
|
* @param eid - The entity ID
|
|
6895
8083
|
* @returns Highlighted index
|
|
6896
8084
|
*/
|
|
6897
|
-
declare function getHighlightedIndex(eid: Entity): number;
|
|
8085
|
+
declare function getHighlightedIndex(_world: World, eid: Entity): number;
|
|
6898
8086
|
/**
|
|
6899
8087
|
* Sets the highlighted index.
|
|
6900
8088
|
*
|
|
@@ -6930,23 +8118,26 @@ declare function selectHighlighted(world: World, eid: Entity): boolean;
|
|
|
6930
8118
|
/**
|
|
6931
8119
|
* Sets the select display configuration.
|
|
6932
8120
|
*
|
|
8121
|
+
* @param _world - The ECS world
|
|
6933
8122
|
* @param eid - The entity ID
|
|
6934
8123
|
* @param options - Display options
|
|
6935
8124
|
*/
|
|
6936
|
-
declare function setSelectDisplay(eid: Entity, options: SelectDisplayOptions): void;
|
|
8125
|
+
declare function setSelectDisplay(_world: World, eid: Entity, options: SelectDisplayOptions): void;
|
|
6937
8126
|
/**
|
|
6938
8127
|
* Gets the select display configuration.
|
|
6939
8128
|
*
|
|
8129
|
+
* @param _world - The ECS world
|
|
6940
8130
|
* @param eid - The entity ID
|
|
6941
8131
|
* @returns Display configuration
|
|
6942
8132
|
*/
|
|
6943
|
-
declare function getSelectDisplay(eid: Entity): SelectDisplay;
|
|
8133
|
+
declare function getSelectDisplay(_world: World, eid: Entity): SelectDisplay;
|
|
6944
8134
|
/**
|
|
6945
8135
|
* Clears the select display configuration.
|
|
6946
8136
|
*
|
|
8137
|
+
* @param _world - The ECS world
|
|
6947
8138
|
* @param eid - The entity ID
|
|
6948
8139
|
*/
|
|
6949
|
-
declare function clearSelectDisplay(eid: Entity): void;
|
|
8140
|
+
declare function clearSelectDisplay(_world: World, eid: Entity): void;
|
|
6950
8141
|
/**
|
|
6951
8142
|
* Gets the indicator character based on state.
|
|
6952
8143
|
*
|
|
@@ -6958,40 +8149,44 @@ declare function getSelectIndicator(world: World, eid: Entity): string;
|
|
|
6958
8149
|
/**
|
|
6959
8150
|
* Registers a callback for when the selection changes.
|
|
6960
8151
|
*
|
|
8152
|
+
* @param _world - The ECS world
|
|
6961
8153
|
* @param eid - The entity ID
|
|
6962
8154
|
* @param callback - The callback function
|
|
6963
8155
|
* @returns Unsubscribe function
|
|
6964
8156
|
*
|
|
6965
8157
|
* @example
|
|
6966
8158
|
* ```typescript
|
|
6967
|
-
* const unsubscribe = onSelectChange(eid, (value, label, index) => {
|
|
8159
|
+
* const unsubscribe = onSelectChange(world, eid, (value, label, index) => {
|
|
6968
8160
|
* console.log(`Selected: ${label} (${value})`);
|
|
6969
8161
|
* });
|
|
6970
8162
|
* ```
|
|
6971
8163
|
*/
|
|
6972
|
-
declare function onSelectChange(eid: Entity, callback: SelectCallback): () => void;
|
|
8164
|
+
declare function onSelectChange(_world: World, eid: Entity, callback: SelectCallback): () => void;
|
|
6973
8165
|
/**
|
|
6974
8166
|
* Registers a callback for when the dropdown opens.
|
|
6975
8167
|
*
|
|
8168
|
+
* @param _world - The ECS world
|
|
6976
8169
|
* @param eid - The entity ID
|
|
6977
8170
|
* @param callback - The callback function
|
|
6978
8171
|
* @returns Unsubscribe function
|
|
6979
8172
|
*/
|
|
6980
|
-
declare function onSelectOpen(eid: Entity, callback: () => void): () => void;
|
|
8173
|
+
declare function onSelectOpen(_world: World, eid: Entity, callback: () => void): () => void;
|
|
6981
8174
|
/**
|
|
6982
8175
|
* Registers a callback for when the dropdown closes.
|
|
6983
8176
|
*
|
|
8177
|
+
* @param _world - The ECS world
|
|
6984
8178
|
* @param eid - The entity ID
|
|
6985
8179
|
* @param callback - The callback function
|
|
6986
8180
|
* @returns Unsubscribe function
|
|
6987
8181
|
*/
|
|
6988
|
-
declare function onSelectClose(eid: Entity, callback: () => void): () => void;
|
|
8182
|
+
declare function onSelectClose(_world: World, eid: Entity, callback: () => void): () => void;
|
|
6989
8183
|
/**
|
|
6990
8184
|
* Clears all callbacks for a select.
|
|
6991
8185
|
*
|
|
8186
|
+
* @param _world - The ECS world
|
|
6992
8187
|
* @param eid - The entity ID
|
|
6993
8188
|
*/
|
|
6994
|
-
declare function clearSelectCallbacks(eid: Entity): void;
|
|
8189
|
+
declare function clearSelectCallbacks(_world: World, eid: Entity): void;
|
|
6995
8190
|
/**
|
|
6996
8191
|
* Action returned from key press handling.
|
|
6997
8192
|
*/
|
|
@@ -7483,15 +8678,15 @@ interface SliderDisplay {
|
|
|
7483
8678
|
* Slider display options for configuration.
|
|
7484
8679
|
*/
|
|
7485
8680
|
interface SliderDisplayOptions {
|
|
7486
|
-
trackChar?: string;
|
|
7487
|
-
thumbChar?: string;
|
|
7488
|
-
fillChar?: string;
|
|
7489
|
-
trackFg?: number;
|
|
7490
|
-
trackBg?: number;
|
|
7491
|
-
thumbFg?: number;
|
|
7492
|
-
thumbBg?: number;
|
|
7493
|
-
fillFg?: number;
|
|
7494
|
-
fillBg?: number;
|
|
8681
|
+
trackChar?: string | undefined;
|
|
8682
|
+
thumbChar?: string | undefined;
|
|
8683
|
+
fillChar?: string | undefined;
|
|
8684
|
+
trackFg?: number | undefined;
|
|
8685
|
+
trackBg?: number | undefined;
|
|
8686
|
+
thumbFg?: number | undefined;
|
|
8687
|
+
thumbBg?: number | undefined;
|
|
8688
|
+
fillFg?: number | undefined;
|
|
8689
|
+
fillBg?: number | undefined;
|
|
7495
8690
|
}
|
|
7496
8691
|
/**
|
|
7497
8692
|
* Slider callback function type.
|
|
@@ -7665,10 +8860,11 @@ declare function enableSlider(world: World, eid: Entity): boolean;
|
|
|
7665
8860
|
/**
|
|
7666
8861
|
* Gets the slider value.
|
|
7667
8862
|
*
|
|
8863
|
+
* @param _world - The ECS world
|
|
7668
8864
|
* @param eid - The entity ID
|
|
7669
8865
|
* @returns The current value
|
|
7670
8866
|
*/
|
|
7671
|
-
declare function getSliderValue(eid: Entity): number;
|
|
8867
|
+
declare function getSliderValue(_world: World, eid: Entity): number;
|
|
7672
8868
|
/**
|
|
7673
8869
|
* Sets the slider value.
|
|
7674
8870
|
*
|
|
@@ -7680,24 +8876,27 @@ declare function setSliderValue(world: World, eid: Entity, value: number): void;
|
|
|
7680
8876
|
/**
|
|
7681
8877
|
* Gets the slider minimum value.
|
|
7682
8878
|
*
|
|
8879
|
+
* @param _world - The ECS world
|
|
7683
8880
|
* @param eid - The entity ID
|
|
7684
8881
|
* @returns The minimum value
|
|
7685
8882
|
*/
|
|
7686
|
-
declare function getSliderMin(eid: Entity): number;
|
|
8883
|
+
declare function getSliderMin(_world: World, eid: Entity): number;
|
|
7687
8884
|
/**
|
|
7688
8885
|
* Gets the slider maximum value.
|
|
7689
8886
|
*
|
|
8887
|
+
* @param _world - The ECS world
|
|
7690
8888
|
* @param eid - The entity ID
|
|
7691
8889
|
* @returns The maximum value
|
|
7692
8890
|
*/
|
|
7693
|
-
declare function getSliderMax(eid: Entity): number;
|
|
8891
|
+
declare function getSliderMax(_world: World, eid: Entity): number;
|
|
7694
8892
|
/**
|
|
7695
8893
|
* Gets the slider step value.
|
|
7696
8894
|
*
|
|
8895
|
+
* @param _world - The ECS world
|
|
7697
8896
|
* @param eid - The entity ID
|
|
7698
8897
|
* @returns The step value
|
|
7699
8898
|
*/
|
|
7700
|
-
declare function getSliderStep(eid: Entity): number;
|
|
8899
|
+
declare function getSliderStep(_world: World, eid: Entity): number;
|
|
7701
8900
|
/**
|
|
7702
8901
|
* Sets the slider range.
|
|
7703
8902
|
*
|
|
@@ -7718,10 +8917,11 @@ declare function setSliderStep(world: World, eid: Entity, step: number): void;
|
|
|
7718
8917
|
/**
|
|
7719
8918
|
* Gets the slider percentage (0-1).
|
|
7720
8919
|
*
|
|
8920
|
+
* @param _world - The ECS world
|
|
7721
8921
|
* @param eid - The entity ID
|
|
7722
8922
|
* @returns Value as percentage
|
|
7723
8923
|
*/
|
|
7724
|
-
declare function getSliderPercentage(eid: Entity): number;
|
|
8924
|
+
declare function getSliderPercentage(_world: World, eid: Entity): number;
|
|
7725
8925
|
/**
|
|
7726
8926
|
* Sets the slider value from a percentage.
|
|
7727
8927
|
*
|
|
@@ -7763,10 +8963,11 @@ declare function setSliderToMax(world: World, eid: Entity): void;
|
|
|
7763
8963
|
/**
|
|
7764
8964
|
* Gets the slider orientation.
|
|
7765
8965
|
*
|
|
8966
|
+
* @param _world - The ECS world
|
|
7766
8967
|
* @param eid - The entity ID
|
|
7767
8968
|
* @returns The orientation
|
|
7768
8969
|
*/
|
|
7769
|
-
declare function getSliderOrientation(eid: Entity): SliderOrientationType;
|
|
8970
|
+
declare function getSliderOrientation(_world: World, eid: Entity): SliderOrientationType;
|
|
7770
8971
|
/**
|
|
7771
8972
|
* Sets the slider orientation.
|
|
7772
8973
|
*
|
|
@@ -7778,24 +8979,27 @@ declare function setSliderOrientation(world: World, eid: Entity, orientation: Sl
|
|
|
7778
8979
|
/**
|
|
7779
8980
|
* Checks if slider is horizontal.
|
|
7780
8981
|
*
|
|
8982
|
+
* @param world - The ECS world
|
|
7781
8983
|
* @param eid - The entity ID
|
|
7782
8984
|
* @returns true if horizontal
|
|
7783
8985
|
*/
|
|
7784
|
-
declare function isSliderHorizontal(eid: Entity): boolean;
|
|
8986
|
+
declare function isSliderHorizontal(world: World, eid: Entity): boolean;
|
|
7785
8987
|
/**
|
|
7786
8988
|
* Checks if slider is vertical.
|
|
7787
8989
|
*
|
|
8990
|
+
* @param world - The ECS world
|
|
7788
8991
|
* @param eid - The entity ID
|
|
7789
8992
|
* @returns true if vertical
|
|
7790
8993
|
*/
|
|
7791
|
-
declare function isSliderVertical(eid: Entity): boolean;
|
|
8994
|
+
declare function isSliderVertical(world: World, eid: Entity): boolean;
|
|
7792
8995
|
/**
|
|
7793
8996
|
* Gets whether the slider shows its value.
|
|
7794
8997
|
*
|
|
8998
|
+
* @param _world - The ECS world
|
|
7795
8999
|
* @param eid - The entity ID
|
|
7796
9000
|
* @returns true if showing value
|
|
7797
9001
|
*/
|
|
7798
|
-
declare function isShowingSliderValue(eid: Entity): boolean;
|
|
9002
|
+
declare function isShowingSliderValue(_world: World, eid: Entity): boolean;
|
|
7799
9003
|
/**
|
|
7800
9004
|
* Sets whether to show the slider value.
|
|
7801
9005
|
*
|
|
@@ -7807,60 +9011,67 @@ declare function setShowSliderValue(world: World, eid: Entity, show: boolean): v
|
|
|
7807
9011
|
/**
|
|
7808
9012
|
* Sets the slider display configuration.
|
|
7809
9013
|
*
|
|
9014
|
+
* @param world - The ECS world
|
|
7810
9015
|
* @param eid - The entity ID
|
|
7811
9016
|
* @param options - Display options
|
|
7812
9017
|
*/
|
|
7813
|
-
declare function setSliderDisplay(eid: Entity, options: SliderDisplayOptions): void;
|
|
9018
|
+
declare function setSliderDisplay(world: World, eid: Entity, options: SliderDisplayOptions): void;
|
|
7814
9019
|
/**
|
|
7815
9020
|
* Gets the slider display configuration.
|
|
7816
9021
|
*
|
|
9022
|
+
* @param world - The ECS world
|
|
7817
9023
|
* @param eid - The entity ID
|
|
7818
9024
|
* @returns Display configuration
|
|
7819
9025
|
*/
|
|
7820
|
-
declare function getSliderDisplay(eid: Entity): SliderDisplay;
|
|
9026
|
+
declare function getSliderDisplay(world: World, eid: Entity): SliderDisplay;
|
|
7821
9027
|
/**
|
|
7822
9028
|
* Clears the slider display configuration.
|
|
7823
9029
|
*
|
|
9030
|
+
* @param _world - The ECS world
|
|
7824
9031
|
* @param eid - The entity ID
|
|
7825
9032
|
*/
|
|
7826
|
-
declare function clearSliderDisplay(eid: Entity): void;
|
|
9033
|
+
declare function clearSliderDisplay(_world: World, eid: Entity): void;
|
|
7827
9034
|
/**
|
|
7828
9035
|
* Registers a callback for when the slider value changes.
|
|
7829
9036
|
*
|
|
9037
|
+
* @param _world - The ECS world
|
|
7830
9038
|
* @param eid - The entity ID
|
|
7831
9039
|
* @param callback - The callback function
|
|
7832
9040
|
* @returns Unsubscribe function
|
|
7833
9041
|
*
|
|
7834
9042
|
* @example
|
|
7835
9043
|
* ```typescript
|
|
7836
|
-
* const unsubscribe = onSliderChange(eid, (value) => {
|
|
9044
|
+
* const unsubscribe = onSliderChange(world, eid, (value) => {
|
|
7837
9045
|
* console.log(`Value: ${value}`);
|
|
7838
9046
|
* });
|
|
7839
9047
|
* ```
|
|
7840
9048
|
*/
|
|
7841
|
-
declare function onSliderChange(eid: Entity, callback: SliderChangeCallback): () => void;
|
|
9049
|
+
declare function onSliderChange(_world: World, eid: Entity, callback: SliderChangeCallback): () => void;
|
|
7842
9050
|
/**
|
|
7843
9051
|
* Registers a callback for when dragging starts.
|
|
7844
9052
|
*
|
|
9053
|
+
* @param _world - The ECS world
|
|
7845
9054
|
* @param eid - The entity ID
|
|
7846
9055
|
* @param callback - The callback function
|
|
7847
9056
|
* @returns Unsubscribe function
|
|
7848
9057
|
*/
|
|
7849
|
-
declare function onSliderDragStart(eid: Entity, callback: () => void): () => void;
|
|
9058
|
+
declare function onSliderDragStart(_world: World, eid: Entity, callback: () => void): () => void;
|
|
7850
9059
|
/**
|
|
7851
9060
|
* Registers a callback for when dragging ends.
|
|
7852
9061
|
*
|
|
9062
|
+
* @param _world - The ECS world
|
|
7853
9063
|
* @param eid - The entity ID
|
|
7854
9064
|
* @param callback - The callback function
|
|
7855
9065
|
* @returns Unsubscribe function
|
|
7856
9066
|
*/
|
|
7857
|
-
declare function onSliderDragEnd(eid: Entity, callback: () => void): () => void;
|
|
9067
|
+
declare function onSliderDragEnd(_world: World, eid: Entity, callback: () => void): () => void;
|
|
7858
9068
|
/**
|
|
7859
9069
|
* Clears all callbacks for a slider.
|
|
7860
9070
|
*
|
|
9071
|
+
* @param _world - The ECS world
|
|
7861
9072
|
* @param eid - The entity ID
|
|
7862
9073
|
*/
|
|
7863
|
-
declare function clearSliderCallbacks(eid: Entity): void;
|
|
9074
|
+
declare function clearSliderCallbacks(_world: World, eid: Entity): void;
|
|
7864
9075
|
/**
|
|
7865
9076
|
* Action returned from key press handling.
|
|
7866
9077
|
*/
|
|
@@ -7895,11 +9106,12 @@ declare function handleSliderKeyPress(world: World, eid: Entity, key: string): S
|
|
|
7895
9106
|
/**
|
|
7896
9107
|
* Renders the slider as a string.
|
|
7897
9108
|
*
|
|
9109
|
+
* @param _world - The ECS world
|
|
7898
9110
|
* @param eid - The entity ID
|
|
7899
9111
|
* @param width - The available width
|
|
7900
9112
|
* @returns Rendered slider string
|
|
7901
9113
|
*/
|
|
7902
|
-
declare function renderSliderString(eid: Entity, width: number): string;
|
|
9114
|
+
declare function renderSliderString(_world: World, eid: Entity, width: number): string;
|
|
7903
9115
|
/**
|
|
7904
9116
|
* Resets the slider store. Used for testing.
|
|
7905
9117
|
*/
|
|
@@ -8667,6 +9879,16 @@ interface TextInputStore {
|
|
|
8667
9879
|
* Global text input store.
|
|
8668
9880
|
*/
|
|
8669
9881
|
declare const textInputStore: TextInputStore;
|
|
9882
|
+
/**
|
|
9883
|
+
* Validation function type.
|
|
9884
|
+
* Returns true if the value is valid, false otherwise.
|
|
9885
|
+
* Can optionally return an error message string.
|
|
9886
|
+
*/
|
|
9887
|
+
type ValidationFunction = (value: string) => boolean | string;
|
|
9888
|
+
/**
|
|
9889
|
+
* When to run validation.
|
|
9890
|
+
*/
|
|
9891
|
+
type ValidationTiming = 'onChange' | 'onSubmit' | 'both';
|
|
8670
9892
|
/**
|
|
8671
9893
|
* Configuration for text input display and behavior.
|
|
8672
9894
|
*/
|
|
@@ -8681,6 +9903,10 @@ interface TextInputConfig {
|
|
|
8681
9903
|
maxLength: number;
|
|
8682
9904
|
/** Whether input supports multiple lines (for Textarea) */
|
|
8683
9905
|
multiline: boolean;
|
|
9906
|
+
/** Optional validation function */
|
|
9907
|
+
validator?: ValidationFunction | undefined;
|
|
9908
|
+
/** When to run validation (default: 'both') */
|
|
9909
|
+
validationTiming?: ValidationTiming | undefined;
|
|
8684
9910
|
}
|
|
8685
9911
|
/**
|
|
8686
9912
|
* Default censor character for password fields.
|
|
@@ -8872,10 +10098,11 @@ declare function clearTextInputError(world: World, eid: Entity): boolean;
|
|
|
8872
10098
|
/**
|
|
8873
10099
|
* Gets the cursor position.
|
|
8874
10100
|
*
|
|
10101
|
+
* @param world - The ECS world
|
|
8875
10102
|
* @param eid - Entity ID
|
|
8876
10103
|
* @returns Cursor position
|
|
8877
10104
|
*/
|
|
8878
|
-
declare function getCursorPos(eid: Entity): number;
|
|
10105
|
+
declare function getCursorPos(_world: World, eid: Entity): number;
|
|
8879
10106
|
/**
|
|
8880
10107
|
* Sets the cursor position.
|
|
8881
10108
|
*
|
|
@@ -8895,10 +10122,11 @@ declare function moveCursor(world: World, eid: Entity, delta: number): void;
|
|
|
8895
10122
|
/**
|
|
8896
10123
|
* Gets the selection range.
|
|
8897
10124
|
*
|
|
10125
|
+
* @param world - The ECS world
|
|
8898
10126
|
* @param eid - Entity ID
|
|
8899
10127
|
* @returns Selection range [start, end] or null if no selection
|
|
8900
10128
|
*/
|
|
8901
|
-
declare function getSelection(eid: Entity): [number, number] | null;
|
|
10129
|
+
declare function getSelection(_world: World, eid: Entity): [number, number] | null;
|
|
8902
10130
|
/**
|
|
8903
10131
|
* Sets the selection range.
|
|
8904
10132
|
*
|
|
@@ -8918,10 +10146,11 @@ declare function clearSelection(world: World, eid: Entity): void;
|
|
|
8918
10146
|
/**
|
|
8919
10147
|
* Checks if there is an active selection.
|
|
8920
10148
|
*
|
|
10149
|
+
* @param world - The ECS world
|
|
8921
10150
|
* @param eid - Entity ID
|
|
8922
10151
|
* @returns true if there is a selection
|
|
8923
10152
|
*/
|
|
8924
|
-
declare function hasSelection(eid: Entity): boolean;
|
|
10153
|
+
declare function hasSelection(world: World, eid: Entity): boolean;
|
|
8925
10154
|
/**
|
|
8926
10155
|
* Cursor display configuration.
|
|
8927
10156
|
*/
|
|
@@ -8946,10 +10175,11 @@ declare const DEFAULT_CURSOR_BLOCK_CHAR = "\u2588";
|
|
|
8946
10175
|
/**
|
|
8947
10176
|
* Gets the cursor configuration for a text input.
|
|
8948
10177
|
*
|
|
10178
|
+
* @param world - The ECS world
|
|
8949
10179
|
* @param eid - Entity ID
|
|
8950
10180
|
* @returns Cursor configuration
|
|
8951
10181
|
*/
|
|
8952
|
-
declare function getCursorConfig(eid: Entity): CursorConfig;
|
|
10182
|
+
declare function getCursorConfig(_world: World, eid: Entity): CursorConfig;
|
|
8953
10183
|
/**
|
|
8954
10184
|
* Options for setting cursor configuration.
|
|
8955
10185
|
*/
|
|
@@ -8966,26 +10196,28 @@ interface CursorConfigOptions {
|
|
|
8966
10196
|
/**
|
|
8967
10197
|
* Sets the cursor configuration for a text input.
|
|
8968
10198
|
*
|
|
10199
|
+
* @param world - The ECS world
|
|
8969
10200
|
* @param eid - Entity ID
|
|
8970
10201
|
* @param options - Cursor configuration options
|
|
8971
10202
|
*
|
|
8972
10203
|
* @example
|
|
8973
10204
|
* ```typescript
|
|
8974
|
-
* setCursorConfig(textbox, {
|
|
10205
|
+
* setCursorConfig(world, textbox, {
|
|
8975
10206
|
* blink: true,
|
|
8976
10207
|
* blinkIntervalMs: 500,
|
|
8977
10208
|
* lineChar: '|',
|
|
8978
10209
|
* });
|
|
8979
10210
|
* ```
|
|
8980
10211
|
*/
|
|
8981
|
-
declare function setCursorConfig(eid: Entity, options: CursorConfigOptions): void;
|
|
10212
|
+
declare function setCursorConfig(world: World, eid: Entity, options: CursorConfigOptions): void;
|
|
8982
10213
|
/**
|
|
8983
10214
|
* Gets the cursor visual mode (line or block).
|
|
8984
10215
|
*
|
|
10216
|
+
* @param world - The ECS world
|
|
8985
10217
|
* @param eid - Entity ID
|
|
8986
10218
|
* @returns Cursor mode (0=line, 1=block)
|
|
8987
10219
|
*/
|
|
8988
|
-
declare function getCursorMode(eid: Entity): CursorModeType;
|
|
10220
|
+
declare function getCursorMode(_world: World, eid: Entity): CursorModeType;
|
|
8989
10221
|
/**
|
|
8990
10222
|
* Sets the cursor visual mode.
|
|
8991
10223
|
*
|
|
@@ -9011,10 +10243,11 @@ declare function toggleCursorMode(world: World, eid: Entity): CursorModeType;
|
|
|
9011
10243
|
/**
|
|
9012
10244
|
* Checks if cursor blink is enabled for a text input.
|
|
9013
10245
|
*
|
|
10246
|
+
* @param world - The ECS world
|
|
9014
10247
|
* @param eid - Entity ID
|
|
9015
10248
|
* @returns true if blink is enabled
|
|
9016
10249
|
*/
|
|
9017
|
-
declare function isCursorBlinkEnabled(eid: Entity): boolean;
|
|
10250
|
+
declare function isCursorBlinkEnabled(_world: World, eid: Entity): boolean;
|
|
9018
10251
|
/**
|
|
9019
10252
|
* Enables or disables cursor blink.
|
|
9020
10253
|
*
|
|
@@ -9027,9 +10260,10 @@ declare function setCursorBlinkEnabled(world: World, eid: Entity, enabled: boole
|
|
|
9027
10260
|
* Resets the cursor blink timer.
|
|
9028
10261
|
* Call this when the user types or moves the cursor to show cursor immediately.
|
|
9029
10262
|
*
|
|
10263
|
+
* @param world - The ECS world
|
|
9030
10264
|
* @param eid - Entity ID
|
|
9031
10265
|
*/
|
|
9032
|
-
declare function resetCursorBlink(eid: Entity): void;
|
|
10266
|
+
declare function resetCursorBlink(_world: World, eid: Entity): void;
|
|
9033
10267
|
/**
|
|
9034
10268
|
* Gets whether the cursor should be visible at the current time.
|
|
9035
10269
|
* Takes into account the blink state and timing.
|
|
@@ -9050,10 +10284,11 @@ declare function isCursorVisible(world: World, eid: Entity): boolean;
|
|
|
9050
10284
|
/**
|
|
9051
10285
|
* Gets the character to display for the cursor based on mode.
|
|
9052
10286
|
*
|
|
10287
|
+
* @param world - The ECS world
|
|
9053
10288
|
* @param eid - Entity ID
|
|
9054
10289
|
* @returns Cursor character
|
|
9055
10290
|
*/
|
|
9056
|
-
declare function getCursorChar(eid: Entity): string;
|
|
10291
|
+
declare function getCursorChar(world: World, eid: Entity): string;
|
|
9057
10292
|
/**
|
|
9058
10293
|
* Gets the display text for rendering, with cursor character inserted.
|
|
9059
10294
|
* Handles password masking and placeholder display.
|
|
@@ -9078,10 +10313,11 @@ declare function getCursorDisplayText(world: World, eid: Entity, value: string):
|
|
|
9078
10313
|
* Gets selection range for rendering with highlight.
|
|
9079
10314
|
* Returns the start and end positions normalized (start < end).
|
|
9080
10315
|
*
|
|
10316
|
+
* @param world - The ECS world
|
|
9081
10317
|
* @param eid - Entity ID
|
|
9082
10318
|
* @returns Normalized selection range or null
|
|
9083
10319
|
*/
|
|
9084
|
-
declare function getNormalizedSelection(eid: Entity): {
|
|
10320
|
+
declare function getNormalizedSelection(world: World, eid: Entity): {
|
|
9085
10321
|
start: number;
|
|
9086
10322
|
end: number;
|
|
9087
10323
|
} | null;
|
|
@@ -9099,130 +10335,155 @@ interface TextInputConfigOptions {
|
|
|
9099
10335
|
maxLength?: number;
|
|
9100
10336
|
/** Whether input supports multiple lines (for Textarea) */
|
|
9101
10337
|
multiline?: boolean;
|
|
10338
|
+
/** Optional validation function */
|
|
10339
|
+
validator?: ValidationFunction;
|
|
10340
|
+
/** When to run validation (default: 'both') */
|
|
10341
|
+
validationTiming?: ValidationTiming;
|
|
9102
10342
|
}
|
|
9103
10343
|
/**
|
|
9104
10344
|
* Sets the text input configuration.
|
|
9105
10345
|
*
|
|
10346
|
+
* @param world - The ECS world
|
|
9106
10347
|
* @param eid - Entity ID
|
|
9107
10348
|
* @param options - Configuration options
|
|
9108
10349
|
*
|
|
9109
10350
|
* @example
|
|
9110
10351
|
* ```typescript
|
|
9111
|
-
* setTextInputConfig(textbox, {
|
|
10352
|
+
* setTextInputConfig(world, textbox, {
|
|
9112
10353
|
* secret: true,
|
|
9113
10354
|
* censor: '*',
|
|
9114
10355
|
* maxLength: 20,
|
|
10356
|
+
* validator: (value) => value.length >= 8 || 'Password must be at least 8 characters',
|
|
10357
|
+
* validationTiming: 'onSubmit',
|
|
9115
10358
|
* });
|
|
9116
10359
|
* ```
|
|
9117
10360
|
*/
|
|
9118
|
-
declare function setTextInputConfig(eid: Entity, options: TextInputConfigOptions): void;
|
|
10361
|
+
declare function setTextInputConfig(_world: World, eid: Entity, options: TextInputConfigOptions): void;
|
|
9119
10362
|
/**
|
|
9120
10363
|
* Gets the text input configuration.
|
|
9121
10364
|
*
|
|
10365
|
+
* @param world - The ECS world
|
|
9122
10366
|
* @param eid - Entity ID
|
|
9123
10367
|
* @returns Configuration or defaults
|
|
9124
10368
|
*/
|
|
9125
|
-
declare function getTextInputConfig(eid: Entity): TextInputConfig;
|
|
10369
|
+
declare function getTextInputConfig(_world: World, eid: Entity): TextInputConfig;
|
|
9126
10370
|
/**
|
|
9127
10371
|
* Checks if the text input is in secret/password mode.
|
|
9128
10372
|
*
|
|
10373
|
+
* @param world - The ECS world
|
|
9129
10374
|
* @param eid - Entity ID
|
|
9130
10375
|
* @returns true if in secret mode
|
|
9131
10376
|
*/
|
|
9132
|
-
declare function isSecretMode(eid: Entity): boolean;
|
|
10377
|
+
declare function isSecretMode(world: World, eid: Entity): boolean;
|
|
9133
10378
|
/**
|
|
9134
10379
|
* Gets the censor character for password display.
|
|
9135
10380
|
*
|
|
10381
|
+
* @param world - The ECS world
|
|
9136
10382
|
* @param eid - Entity ID
|
|
9137
10383
|
* @returns Censor character
|
|
9138
10384
|
*/
|
|
9139
|
-
declare function getCensorChar(eid: Entity): string;
|
|
10385
|
+
declare function getCensorChar(world: World, eid: Entity): string;
|
|
9140
10386
|
/**
|
|
9141
10387
|
* Gets the placeholder text.
|
|
9142
10388
|
*
|
|
10389
|
+
* @param world - The ECS world
|
|
9143
10390
|
* @param eid - Entity ID
|
|
9144
10391
|
* @returns Placeholder text
|
|
9145
10392
|
*/
|
|
9146
|
-
declare function getPlaceholder(eid: Entity): string;
|
|
10393
|
+
declare function getPlaceholder(world: World, eid: Entity): string;
|
|
9147
10394
|
/**
|
|
9148
10395
|
* Gets the maximum input length.
|
|
9149
10396
|
*
|
|
10397
|
+
* @param world - The ECS world
|
|
9150
10398
|
* @param eid - Entity ID
|
|
9151
10399
|
* @returns Maximum length (0 = unlimited)
|
|
9152
10400
|
*/
|
|
9153
|
-
declare function getMaxLength(eid: Entity): number;
|
|
10401
|
+
declare function getMaxLength(world: World, eid: Entity): number;
|
|
9154
10402
|
/**
|
|
9155
10403
|
* Checks if the text input is multiline (textarea mode).
|
|
9156
10404
|
*
|
|
10405
|
+
* @param world - The ECS world
|
|
9157
10406
|
* @param eid - Entity ID
|
|
9158
10407
|
* @returns true if multiline
|
|
9159
10408
|
*/
|
|
9160
|
-
declare function isMultiline(eid: Entity): boolean;
|
|
10409
|
+
declare function isMultiline(world: World, eid: Entity): boolean;
|
|
9161
10410
|
/**
|
|
9162
10411
|
* Masks a string for password display.
|
|
9163
10412
|
*
|
|
10413
|
+
* @param world - The ECS world
|
|
9164
10414
|
* @param eid - Entity ID
|
|
9165
10415
|
* @param value - The value to mask
|
|
9166
10416
|
* @returns Masked string
|
|
9167
10417
|
*
|
|
9168
10418
|
* @example
|
|
9169
10419
|
* ```typescript
|
|
9170
|
-
* const masked = maskValue(textbox, 'secret');
|
|
10420
|
+
* const masked = maskValue(world, textbox, 'secret');
|
|
9171
10421
|
* // Returns '******'
|
|
9172
10422
|
* ```
|
|
9173
10423
|
*/
|
|
9174
|
-
declare function maskValue(eid: Entity, value: string): string;
|
|
10424
|
+
declare function maskValue(world: World, eid: Entity, value: string): string;
|
|
9175
10425
|
/**
|
|
9176
10426
|
* Registers a callback for value changes.
|
|
9177
10427
|
*
|
|
10428
|
+
* @param world - The ECS world
|
|
9178
10429
|
* @param eid - Entity ID
|
|
9179
10430
|
* @param callback - Function to call on value change
|
|
9180
10431
|
* @returns Unsubscribe function
|
|
9181
10432
|
*/
|
|
9182
|
-
declare function onTextInputChange(eid: Entity, callback: (value: string) => void): () => void;
|
|
10433
|
+
declare function onTextInputChange(_world: World, eid: Entity, callback: (value: string) => void): () => void;
|
|
9183
10434
|
/**
|
|
9184
10435
|
* Registers a callback for submit events.
|
|
9185
10436
|
*
|
|
10437
|
+
* @param world - The ECS world
|
|
9186
10438
|
* @param eid - Entity ID
|
|
9187
10439
|
* @param callback - Function to call on submit
|
|
9188
10440
|
* @returns Unsubscribe function
|
|
9189
10441
|
*/
|
|
9190
|
-
declare function onTextInputSubmit(eid: Entity, callback: (value: string) => void): () => void;
|
|
10442
|
+
declare function onTextInputSubmit(_world: World, eid: Entity, callback: (value: string) => void): () => void;
|
|
9191
10443
|
/**
|
|
9192
10444
|
* Registers a callback for cancel events.
|
|
9193
10445
|
*
|
|
10446
|
+
* @param world - The ECS world
|
|
9194
10447
|
* @param eid - Entity ID
|
|
9195
10448
|
* @param callback - Function to call on cancel
|
|
9196
10449
|
* @returns Unsubscribe function
|
|
9197
10450
|
*/
|
|
9198
|
-
declare function onTextInputCancel(eid: Entity, callback: () => void): () => void;
|
|
10451
|
+
declare function onTextInputCancel(_world: World, eid: Entity, callback: () => void): () => void;
|
|
9199
10452
|
/**
|
|
9200
10453
|
* Emits a value change event.
|
|
10454
|
+
* Runs validation if validationTiming is 'onChange' or 'both'.
|
|
9201
10455
|
*
|
|
10456
|
+
* @param world - The ECS world
|
|
9202
10457
|
* @param eid - Entity ID
|
|
9203
10458
|
* @param value - New value
|
|
9204
10459
|
*/
|
|
9205
|
-
declare function emitValueChange(eid: Entity, value: string): void;
|
|
10460
|
+
declare function emitValueChange(world: World, eid: Entity, value: string): void;
|
|
9206
10461
|
/**
|
|
9207
10462
|
* Emits a submit event.
|
|
10463
|
+
* Runs validation if validationTiming is 'onSubmit' or 'both'.
|
|
10464
|
+
* If validation fails, the submit event is not emitted.
|
|
9208
10465
|
*
|
|
10466
|
+
* @param world - The ECS world
|
|
9209
10467
|
* @param eid - Entity ID
|
|
9210
10468
|
* @param value - Submitted value
|
|
10469
|
+
* @returns true if submitted, false if validation failed
|
|
9211
10470
|
*/
|
|
9212
|
-
declare function emitSubmit(eid: Entity, value: string):
|
|
10471
|
+
declare function emitSubmit(world: World, eid: Entity, value: string): boolean;
|
|
9213
10472
|
/**
|
|
9214
10473
|
* Emits a cancel event.
|
|
9215
10474
|
*
|
|
10475
|
+
* @param world - The ECS world
|
|
9216
10476
|
* @param eid - Entity ID
|
|
9217
10477
|
*/
|
|
9218
|
-
declare function emitCancel(eid: Entity): void;
|
|
10478
|
+
declare function emitCancel(_world: World, eid: Entity): void;
|
|
9219
10479
|
/**
|
|
9220
10480
|
* Clears all callbacks for a text input.
|
|
9221
10481
|
* Call this when destroying a text input entity.
|
|
9222
10482
|
*
|
|
10483
|
+
* @param world - The ECS world
|
|
9223
10484
|
* @param eid - Entity ID
|
|
9224
10485
|
*/
|
|
9225
|
-
declare function clearTextInputCallbacks(eid: Entity): void;
|
|
10486
|
+
declare function clearTextInputCallbacks(_world: World, eid: Entity): void;
|
|
9226
10487
|
/**
|
|
9227
10488
|
* Handles a key press on a text input.
|
|
9228
10489
|
* Returns information about what action to take.
|
|
@@ -9231,6 +10492,7 @@ declare function clearTextInputCallbacks(eid: Entity): void;
|
|
|
9231
10492
|
* @param eid - Entity ID
|
|
9232
10493
|
* @param keyName - Name of the key pressed
|
|
9233
10494
|
* @param currentValue - Current text value
|
|
10495
|
+
* @param ctrl - Whether Ctrl key is pressed (default: false)
|
|
9234
10496
|
* @returns Action to take or null if not handled
|
|
9235
10497
|
*
|
|
9236
10498
|
* @example
|
|
@@ -9243,7 +10505,7 @@ declare function clearTextInputCallbacks(eid: Entity): void;
|
|
|
9243
10505
|
* }
|
|
9244
10506
|
* ```
|
|
9245
10507
|
*/
|
|
9246
|
-
declare function handleTextInputKeyPress(world: World, eid: Entity, keyName: string, currentValue: string): TextInputAction | null;
|
|
10508
|
+
declare function handleTextInputKeyPress(world: World, eid: Entity, keyName: string, currentValue: string, ctrl?: boolean): TextInputAction | null;
|
|
9247
10509
|
/**
|
|
9248
10510
|
* Text input action types.
|
|
9249
10511
|
*/
|
|
@@ -9266,6 +10528,22 @@ type TextInputAction = {
|
|
|
9266
10528
|
} | {
|
|
9267
10529
|
type: 'newline';
|
|
9268
10530
|
position: number;
|
|
10531
|
+
} | {
|
|
10532
|
+
type: 'moveWordLeft';
|
|
10533
|
+
text: string;
|
|
10534
|
+
position: number;
|
|
10535
|
+
} | {
|
|
10536
|
+
type: 'moveWordRight';
|
|
10537
|
+
text: string;
|
|
10538
|
+
position: number;
|
|
10539
|
+
} | {
|
|
10540
|
+
type: 'deleteWordBackward';
|
|
10541
|
+
text: string;
|
|
10542
|
+
position: number;
|
|
10543
|
+
} | {
|
|
10544
|
+
type: 'deleteWordForward';
|
|
10545
|
+
text: string;
|
|
10546
|
+
position: number;
|
|
9269
10547
|
};
|
|
9270
10548
|
|
|
9271
10549
|
/**
|
|
@@ -9980,6 +11258,156 @@ declare function resetTimerStore(): void;
|
|
|
9980
11258
|
*/
|
|
9981
11259
|
declare function updateTimers(world: World, dt: number): readonly Entity[];
|
|
9982
11260
|
|
|
11261
|
+
/**
|
|
11262
|
+
* UserData component for storing arbitrary application-specific data on entities.
|
|
11263
|
+
* Provides blessed-compatible _data, __, and $ aliases.
|
|
11264
|
+
* @module components/userData
|
|
11265
|
+
*/
|
|
11266
|
+
|
|
11267
|
+
/**
|
|
11268
|
+
* UserData component marker using SoA.
|
|
11269
|
+
* The actual data is stored in a separate Map for flexibility.
|
|
11270
|
+
*
|
|
11271
|
+
* This marker simply tracks which entities have user data.
|
|
11272
|
+
* The data itself is stored in userDataStore.
|
|
11273
|
+
*
|
|
11274
|
+
* @example
|
|
11275
|
+
* ```typescript
|
|
11276
|
+
* import { UserData, setUserData, getUserData } from 'blecsd';
|
|
11277
|
+
*
|
|
11278
|
+
* // Set user data
|
|
11279
|
+
* setUserData(world, entity, { score: 100, level: 5 });
|
|
11280
|
+
*
|
|
11281
|
+
* // Get user data
|
|
11282
|
+
* const data = getUserData(world, entity);
|
|
11283
|
+
* console.log(data?.score); // 100
|
|
11284
|
+
* ```
|
|
11285
|
+
*/
|
|
11286
|
+
declare const UserData: {
|
|
11287
|
+
/** Marker to indicate entity has user data (1 = has data) */
|
|
11288
|
+
hasData: Uint8Array<ArrayBuffer>;
|
|
11289
|
+
};
|
|
11290
|
+
/**
|
|
11291
|
+
* User data object type.
|
|
11292
|
+
* Can store any key-value pairs.
|
|
11293
|
+
*/
|
|
11294
|
+
type UserDataObject = Record<string, unknown>;
|
|
11295
|
+
/**
|
|
11296
|
+
* Sets user data for an entity.
|
|
11297
|
+
* Adds the UserData component if not already present.
|
|
11298
|
+
*
|
|
11299
|
+
* @param world - The ECS world
|
|
11300
|
+
* @param eid - The entity ID
|
|
11301
|
+
* @param data - User data object to store
|
|
11302
|
+
* @returns The entity ID for chaining
|
|
11303
|
+
*
|
|
11304
|
+
* @example
|
|
11305
|
+
* ```typescript
|
|
11306
|
+
* import { setUserData } from 'blecsd';
|
|
11307
|
+
*
|
|
11308
|
+
* setUserData(world, entity, {
|
|
11309
|
+
* customId: 'player1',
|
|
11310
|
+
* inventory: ['sword', 'shield'],
|
|
11311
|
+
* stats: { hp: 100, mp: 50 }
|
|
11312
|
+
* });
|
|
11313
|
+
* ```
|
|
11314
|
+
*/
|
|
11315
|
+
declare function setUserData(world: World, eid: Entity, data: UserDataObject): Entity;
|
|
11316
|
+
/**
|
|
11317
|
+
* Gets user data for an entity.
|
|
11318
|
+
* Returns undefined if the entity has no user data.
|
|
11319
|
+
*
|
|
11320
|
+
* @param world - The ECS world
|
|
11321
|
+
* @param eid - The entity ID
|
|
11322
|
+
* @returns User data object or undefined
|
|
11323
|
+
*
|
|
11324
|
+
* @example
|
|
11325
|
+
* ```typescript
|
|
11326
|
+
* import { getUserData } from 'blecsd';
|
|
11327
|
+
*
|
|
11328
|
+
* const data = getUserData(world, entity);
|
|
11329
|
+
* if (data) {
|
|
11330
|
+
* console.log('Custom data:', data);
|
|
11331
|
+
* }
|
|
11332
|
+
* ```
|
|
11333
|
+
*/
|
|
11334
|
+
declare function getUserData(world: World, eid: Entity): UserDataObject | undefined;
|
|
11335
|
+
/**
|
|
11336
|
+
* Gets or creates user data for an entity.
|
|
11337
|
+
* If the entity has no user data, creates an empty object.
|
|
11338
|
+
*
|
|
11339
|
+
* @param world - The ECS world
|
|
11340
|
+
* @param eid - The entity ID
|
|
11341
|
+
* @returns User data object (existing or new)
|
|
11342
|
+
*
|
|
11343
|
+
* @example
|
|
11344
|
+
* ```typescript
|
|
11345
|
+
* import { getOrCreateUserData } from 'blecsd';
|
|
11346
|
+
*
|
|
11347
|
+
* const data = getOrCreateUserData(world, entity);
|
|
11348
|
+
* data.customProperty = 'value'; // Safe to assign
|
|
11349
|
+
* ```
|
|
11350
|
+
*/
|
|
11351
|
+
declare function getOrCreateUserData(world: World, eid: Entity): UserDataObject;
|
|
11352
|
+
/**
|
|
11353
|
+
* Checks if an entity has user data.
|
|
11354
|
+
*
|
|
11355
|
+
* @param world - The ECS world
|
|
11356
|
+
* @param eid - The entity ID
|
|
11357
|
+
* @returns true if the entity has user data
|
|
11358
|
+
*
|
|
11359
|
+
* @example
|
|
11360
|
+
* ```typescript
|
|
11361
|
+
* import { hasUserData } from 'blecsd';
|
|
11362
|
+
*
|
|
11363
|
+
* if (hasUserData(world, entity)) {
|
|
11364
|
+
* console.log('Entity has custom data');
|
|
11365
|
+
* }
|
|
11366
|
+
* ```
|
|
11367
|
+
*/
|
|
11368
|
+
declare function hasUserData(world: World, eid: Entity): boolean;
|
|
11369
|
+
/**
|
|
11370
|
+
* Removes user data from an entity.
|
|
11371
|
+
*
|
|
11372
|
+
* @param world - The ECS world
|
|
11373
|
+
* @param eid - The entity ID
|
|
11374
|
+
* @returns true if data was removed, false if entity had no data
|
|
11375
|
+
*
|
|
11376
|
+
* @example
|
|
11377
|
+
* ```typescript
|
|
11378
|
+
* import { removeUserData } from 'blecsd';
|
|
11379
|
+
*
|
|
11380
|
+
* removeUserData(world, entity);
|
|
11381
|
+
* ```
|
|
11382
|
+
*/
|
|
11383
|
+
declare function removeUserData(world: World, eid: Entity): boolean;
|
|
11384
|
+
/**
|
|
11385
|
+
* Clears all user data from all entities.
|
|
11386
|
+
* Useful for testing or when destroying the world.
|
|
11387
|
+
*
|
|
11388
|
+
* @example
|
|
11389
|
+
* ```typescript
|
|
11390
|
+
* import { clearAllUserData } from 'blecsd';
|
|
11391
|
+
*
|
|
11392
|
+
* clearAllUserData();
|
|
11393
|
+
* ```
|
|
11394
|
+
*/
|
|
11395
|
+
declare function clearAllUserData(): void;
|
|
11396
|
+
/**
|
|
11397
|
+
* Gets the total number of entities with user data.
|
|
11398
|
+
* Useful for debugging and metrics.
|
|
11399
|
+
*
|
|
11400
|
+
* @returns Number of entities with user data
|
|
11401
|
+
*
|
|
11402
|
+
* @example
|
|
11403
|
+
* ```typescript
|
|
11404
|
+
* import { getUserDataCount } from 'blecsd';
|
|
11405
|
+
*
|
|
11406
|
+
* console.log(`${getUserDataCount()} entities have user data`);
|
|
11407
|
+
* ```
|
|
11408
|
+
*/
|
|
11409
|
+
declare function getUserDataCount(): number;
|
|
11410
|
+
|
|
9983
11411
|
/**
|
|
9984
11412
|
* Velocity and Acceleration components for entity movement.
|
|
9985
11413
|
* @module components/velocity
|
|
@@ -10295,4 +11723,4 @@ declare function applyVelocityToEntity(eid: Entity, deltaTime: number): void;
|
|
|
10295
11723
|
*/
|
|
10296
11724
|
declare function updateEntityMovement(world: World, eid: Entity, deltaTime: number): void;
|
|
10297
11725
|
|
|
10298
|
-
export { AUTO_DIMENSION, Acceleration, type AccelerationData, Animation, type AnimationData, type AnimationDefinition, AnimationDirection, type AnimationFrame, type AnimationOptions, BACKGROUND_COPY_CHUNK_SIZE, BLOCK_SPINNER_CHARS, BRAILLE_SPINNER_CHARS, BUTTON_STATE_MACHINE_CONFIG, Behavior, type BehaviorData, type BehaviorDirection, type BehaviorOptions, BehaviorState, type BehaviorStateValue, BehaviorType, type BehaviorTypeValue, type ButtonEvent, type ButtonState, type ButtonStore, CHECKBOX_STATE_MACHINE_CONFIG, Camera, type CameraBounds, type CameraData, type CameraOptions, type CheckboxDisplay, type CheckboxDisplayOptions, type CheckboxEvent, type CheckboxState, type CheckboxStore, Content, type ContentData, type ContentOptions, type CopyProgress, type CursorConfig, type CursorConfigOptions, CursorMode, type CursorModeType, CursorShape, type CursorShapeValue, type CustomBehaviorCallback, DEFAULT_CENSOR_CHAR, DEFAULT_CHECKED_CHAR, DEFAULT_CLOSED_INDICATOR, DEFAULT_CURSOR_BLINK_MS, DEFAULT_CURSOR_BLOCK_CHAR, DEFAULT_CURSOR_LINE_CHAR, DEFAULT_EMPTY_CHAR, DEFAULT_EMPTY_CHAR_VERTICAL, DEFAULT_FILL_CHAR$1 as DEFAULT_FILL_CHAR, DEFAULT_FILL_CHAR_VERTICAL$1 as DEFAULT_FILL_CHAR_VERTICAL, DEFAULT_FOCUS_BG, DEFAULT_FOCUS_FG, DEFAULT_HOVER_BG, DEFAULT_HOVER_FG, DEFAULT_OPEN_INDICATOR, DEFAULT_PLACEHOLDER, DEFAULT_RADIO_SELECTED_CHAR, DEFAULT_RADIO_UNSELECTED_CHAR, DEFAULT_SELECTED_MARK, DEFAULT_SEPARATOR, DEFAULT_SHADOW_CHAR, DEFAULT_SHADOW_COLOR, DEFAULT_SHADOW_OFFSET_X, DEFAULT_SHADOW_OFFSET_Y, DEFAULT_SHADOW_OPACITY, DEFAULT_FILL_BG as DEFAULT_SLIDER_FILL_BG, DEFAULT_FILL_CHAR as DEFAULT_SLIDER_FILL_CHAR, DEFAULT_FILL_CHAR_VERTICAL as DEFAULT_SLIDER_FILL_CHAR_VERTICAL, DEFAULT_FILL_FG as DEFAULT_SLIDER_FILL_FG, DEFAULT_SPINNER_CHARS, DEFAULT_SPINNER_INTERVAL, DEFAULT_THUMB_BG, DEFAULT_THUMB_CHAR, DEFAULT_THUMB_FG, DEFAULT_TRACK_BG, DEFAULT_TRACK_CHAR, DEFAULT_TRACK_CHAR_VERTICAL, DEFAULT_TRACK_FG, DEFAULT_UNCHECKED_CHAR, DEFAULT_VIEWPORT_HEIGHT, DEFAULT_VIEWPORT_WIDTH, DOTS_SPINNER_CHARS, type DimensionConstraints, type DimensionValue, Dimensions, type DimensionsData, Focusable, type FocusableData, type FocusableOptions, type FormFieldValue, type FormResetCallback, type FormStore, type FormSubmitCallback, type FormValues, Health, type HealthData, type HealthOptions, Hierarchy, type HierarchyData, InputBuffer, type InputBufferData, Interactive, type InteractiveData, type InteractiveOptions, KeyboardInput, type KeyboardInputData, type KeyboardInputOptions, Label, type LabelData, type LabelOptions, LabelPosition, type LineSelectionInfo, ModifierFlags, MouseButtons, MouseInput, type MouseInputData, type MouseInputOptions, NULL_ENTITY, Padding, type PaddingData, type PaddingOptions, type PatrolRoute, type PlayAnimationOptions, type Point2D, Position, type PositionData, type ProgressBarDisplay, type ProgressBarDisplayOptions, type ProgressBarStore, type ProgressChangeCallback, type ProgressCompleteCallback, ProgressOrientation, RADIO_BUTTON_STATE_MACHINE_CONFIG, type RadioButtonDisplay, type RadioButtonDisplayOptions, type RadioButtonEvent, type RadioButtonState, type RadioButtonStore, type RadioSelectCallback, type RadioSetStore, SELECT_STATE_MACHINE_CONFIG, SHADOW_CHAR_DARK, SHADOW_CHAR_LIGHT, SHADOW_CHAR_MEDIUM, SLIDER_STATE_MACHINE_CONFIG, SYNC_COPY_LINE_LIMIT, Screen, type ScreenCursor, type ScreenData, type ScreenOptions, type SelectAction, type SelectCallback, type SelectDisplay, type SelectDisplayOptions, type SelectEvent, type SelectOption, type SelectState, type SelectStore, type SelectionMode, SelectionModeSchema, type SelectionPosition, SelectionPositionSchema, type SelectionRange, Shadow, type ShadowData, type ShadowOptions, type ShadowPosition, type SliderAction, type SliderChangeCallback, type SliderDisplay, type SliderDisplayOptions, type SliderEvent, SliderOrientation, type SliderOrientationType, type SliderState, type SliderStore, Spinner, type SpinnerData, type SpinnerOptions, Sprite, type SpriteCell, type SpriteData, type SpriteFrame, type SpriteSheetData, type SpriteSheetOptions, StateMachineStore, TEXT_INPUT_STATE_MACHINE_CONFIG, TIMER_INFINITE, TextAlign, type TextInputAction, type TextInputConfig, type TextInputConfigOptions, type TextInputEvent, type TextInputState, type TextInputStore, type TextSelectionState, TextVAlign, Timer, type TimerCallback, type TimerCompleteCallback, type TimerData, type TimerOptions, type TraversalCallback, Velocity, type VelocityData, type VelocityOptions, addSpinner, addVelocity, advanceSpinnerFrame, animationStore, appendChild, appendContent, applyAccelerationToEntity, applyFrictionToEntity, applyVelocityToEntity, attachButtonBehavior, attachCheckboxBehavior, attachFormBehavior, attachProgressBarBehavior, attachRadioButtonBehavior, attachRadioSetBehavior, attachSelectBehavior, attachSliderBehavior, attachStateMachine, attachTextInputBehavior, autoRegisterFields, blendShadowColor, blur, blurSlider, blurTextInput, bringToFront, buttonStore, calculateShadowPositions, canSendEvent, centerCameraOn, checkCheckbox, checkboxStore, clampSpeedForEntity, clearAcceleration, clearButtonCallbacks, clearCameraBounds, clearCheckboxCallbacks, clearCheckboxDisplay, clearContent, clearFormCallbacks, clearInputBufferSelection, clearInteractionState, clearInvulnerable, clearKeyboardInput, clearMouseInput, clearProgressBarCallbacks, clearProgressBarDisplay, clearRadioButtonDisplay, clearRadioSetCallbacks, clearSelectCallbacks, clearSelectDisplay, clearSelection$1 as clearSelectSelection, clearSelection, clearSliderCallbacks, clearSliderDisplay, clearTextInputCallbacks, clearTextInputError, clearTextSelection, clearTimerCallbacks, closeSelect, completeProgress, computeChaseDirection, computeFleeDirection, computePatrolDirection, contentStore, createBackgroundCopy, createSelectionState, damage, decodePercentage, decrementProgress, decrementSlider, deselectRadioButton, destroyScreen, detach, detachStateMachine, disableButton, disableCheckbox, disableInput, disableKeys, disableMouse, disableRadioButton, disableSelect, disableShadow, disableSlider, disableTextInput, emitCancel, emitSubmit, emitValueChange, enableButton, enableCheckbox, enableInput, enableKeys, enableMouse, enableRadioButton, enableSelect, enableShadow, enableSlider, enableTextInput, encodePercentage, endEditingTextInput, executeCustomBehavior, focus, focusNext, focusNextField, focusPrev, focusPrevField, focusSlider, focusTextInput, forAncestors, forDescendants, formStore, getAcceleration, getAncestors, getAnimation, getAnimationByName, getAnimationData, getAnimationIdByName, getBehavior, getBehaviorState, getBehaviorTarget, getBehaviorType, getButtonState, getCamera, getCameraPosition, getCameraTarget, getCensorChar, getCheckboxChar, getCheckboxDisplay, getCheckboxState, getChildAt, getChildIndex, getChildren, getCommonAncestor, getContent, getContentData, getContentHash, getContentLength, getCurrentFrame, getCurrentPatrolPoint, getCursorChar, getCursorConfig, getCursorDisplayText, getCursorMode, getCursorPos, getDepth, getDescendants, getDimensions, getEntityAnimation, getEntitySpriteSheet, getFieldName, getFieldValue, getFirstChild, getFocusEffect, getFocusable, getFocusedEntity, getFormFields, getFormTabOrder, getFormValues, getHealth, getHealthPercent, getHierarchy, getHighlightedIndex, getHorizontalPadding, getInputBuffer, getInputBufferText, getInteractive, getKeyboardInput, getLabel, getLabelPosition, getLabelText, getLastChild, getLineSelectionInfo, getMaxLength, getMouseInput, getNextSibling, getNormalizedRange, getNormalizedSelection, getOptionAt, getOptionCount, getPadding, getParent, getPatrolRoute, getPlaceholder, getPosition, getPrevSibling, getPreviousState, getProgress, getProgressBarDisplay, getProgressEmptyChar, getProgressFillChar, getProgressMax, getProgressMin, getProgressOrientation, getProgressPercentage, getRadioButtonChar, getRadioButtonDisplay, getRadioButtonState, getRadioButtonsInSet, getRadioSet, getRadioValue, getResolvedHeight, getResolvedWidth, getRoot, getScreen, getScreenCursor, getScreenData, getScreenFocus, getScreenHover, getScreenSize, getSelectDisplay, getSelectIndicator, getSelectOptions, getSelectState, getSelectedValue as getSelectValue, getSelectedButton, getSelectedIndex, getSelectedLabel, getSelectedLinesInViewport, getSelectedOption, getSelectedText, getSelectedValue$1 as getSelectedValue, getSelection, getSelectionDirtyRanges, getSelectionLineCount, getSelectionState, getShadow, getShadowChar, getShadowColor, getShadowOffset, getShadowOpacity, getSiblings, getSliderDisplay, getSliderMax, getSliderMin, getSliderOrientation, getSliderPercentage, getSliderState, getSliderStep, getSliderValue, getSpeed, getSpinnerChar, getSpinnerData, getSprite, getSpriteIdByName, getSpriteSheet, getSpriteSheetByName, getState, getStateAge, getTabIndex, getTabOrder, getText, getTextInputConfig, getTextInputState, getTimer, getTimerProgress, getVelocity, getVerticalPadding, getZIndex, handleButtonKeyPress, handleCheckboxKeyPress, handleFormKeyPress, handleRadioButtonKeyPress, handleSelectKeyPress, handleSliderKeyPress, handleTextInputKeyPress, hasAcceleration, hasActiveSelection, hasAncestor, hasAnimation, hasBehavior, hasCamera, hasContent, hasDescendant, hasDimensions, hasFocusable, hasHealth, hasHierarchy, hasInputBuffer, hasInputEnabled, hasInteractive, hasKeyboardInput, hasKeysEnabled, hasLabel, hasLabelText, hasMouseEnabled, hasMouseInput, hasPadding, hasPaddingValue, hasPosition, hasScreen, hasScreenSingleton, hasSelection, hasSelectionState, hasShadow, hasSpinner, hasSprite, hasStateMachine, hasTimer, hasVelocity, heal, highlightNext, highlightPrev, incrementProgress, incrementSlider, initScreenComponent, inputBufferStore, insertAfter, insertAt, insertBefore, isAbsolute, isAnimationPlaying, isAreaInView, isAutoPadding, isBehaviorActive, isBehaviorCompleted, isBehaviorWaiting, isButton, isButtonDisabled, isButtonFocused, isButtonHovered, isButtonInState, isButtonPressed, isCameraBounded, isCheckbox, isCheckboxDisabled, isCheckboxInState, isChecked, isClickable, isCursorBlinkEnabled, isCursorVisible, isDead, isDraggable, isFocusable, isFocused, isFollowingTarget, isForm, isFormKeysEnabled, isFormSubmitOnEnter, isFullUnicode, isHoverable, isHovered, isInState, isInTabOrder, isInView, isInvulnerable, isKeyable, isLeaf, isLineSelected, isMultiline, isParsingTags, isPercentage, isPressed, isProgressBar, isProgressComplete, isRadioButton, isRadioButtonDisabled, isRadioButtonInState, isRadioSelected, isRadioSet, isRoot, isScreen, isSecretMode, isSelect, isSelectDisabled, isSelectInState, isSelectOpen, isShadowBlending, isShadowEnabled, isShowingPercentage, isShowingSliderValue, isSlider, isSliderDisabled, isSliderDragging, isSliderFocused, isSliderHorizontal, isSliderInState, isSliderVertical, isTextInput, isTextInputDisabled, isTextInputEditing, isTextInputError, isTextInputFocused, isTextInputInState, isTextWrapped, isTimerComplete, isTimerRunning, isUnchecked, labelStore, makeFocusable, maskValue, moveBackward, moveBy, moveCameraBy, moveCursor, moveForward, nextFrame, normalizeZIndices, onButtonPress, onCheckboxChange, onFormReset, onFormSubmit, onProgressChange, onProgressComplete, onRadioSelect, onSelectChange, onSelectClose, onSelectOpen, onSliderChange, onSliderDragEnd, onSliderDragStart, onTextInputCancel, onTextInputChange, onTextInputSubmit, onTimerComplete, onTimerFire, openSelect, packModifiers, pauseAnimation, pauseTimer, playAnimation, playAnimationByName, prepend, pressButton, prevFrame, progressBarStore, radioButtonStore, radioSetStore, recordClick, registerAnimation, registerFormField, registerScreenSingleton, registerSelectionState, registerSprite, removeAcceleration, removeAnimation, removeBehavior, removeCamera, removeChild, removeHealth, removeInputBuffer, removeKeyboardInput, removeLabel, removeMouseInput, removeSelectionState, removeShadow, removeSpinner, removeSprite, removeTimer, removeVelocity, renderProgressString, renderSliderString, resetAnimationStore, resetBehaviorStore, resetButtonStore, resetCheckboxStore, resetContentStore, resetCursorBlink, resetFocusState, resetForm, resetFormStore, resetLabelStore, resetProgress, resetProgressBarStore, resetRadioButtonStore, resetScreenSingleton, resetSelectStore, resetSelectionStore, resetSliderStore, resetSpinner, resetSpinnerStore, resetSpriteStore, resetTextInputStore, resetTimer, resetTimerStore, resizeScreen, resumeAnimation, resumeTimer, screenToWorld, selectAll, selectHighlighted, selectLine, selectLineRange, selectOptionByIndex, selectOptionByValue, selectRadioButton, selectRadioByValue, selectStore, sendButtonEvent, sendCheckboxEvent, sendEvent, sendRadioButtonEvent, sendSelectEvent, sendSliderEvent, sendTextInputEvent, sendToBack, setAbsolute, setAcceleration, setAnimationDirection, setAnimationLoop, setAnimationSpeed, setAutoPadding, setBehavior, setBehaviorSpeed, setBehaviorTarget, setCamera, setCameraBounds, setCameraDeadZone, setCameraPosition, setCameraTarget, setChase, setCheckboxDisplay, setChecked, setClickable, setConstraints, setContent, setCurrentHealth, setCursorBlinkEnabled, setCursorConfig, setCursorMode, setCursorPos, setCustomBehavior, setDetectionRange, setDimensions, setDraggable, setFieldValue, setFlee, setFocusEffect, setFocusable, setFocusedState, setFrame, setFriction, setFullUnicode, setHealth, setHighlightedIndex, setHoverable, setHovered, setIdle, setInputBuffer, setInputBufferSelection, setInputBufferText, setInteractive, setInvulnerable, setKeyable, setKeyboardInput, setLabel, setLabelOffset, setLabelPosition, setMaxHealth, setMaxSpeed, setMouseInput, setPadding, setPaddingAll, setPaddingHV, setParent, setParseTags, setPatrol, setPosition, setPressed, setProgress, setProgressBarDisplay, setProgressOrientation, setProgressRange, setRadioButtonDisplay, setRadioSet, setRadioValue, setRegen, setScreenCursor, setScreenCursorShape, setScreenCursorVisible, setScreenFocus, setScreenHover, setSelectDisplay, setSelectOptions, setSelection, setSelectionMode, setShadow, setShadowBlend, setShadowChar, setShadowColor, setShadowOffset, setShadowOpacity, setShowPercentage, setShowSliderValue, setShrink, setSliderDisplay, setSliderFromPercentage, setSliderOrientation, setSliderRange, setSliderStep, setSliderToMax, setSliderToMin, setSliderValue, setSpinnerFrames, setSpinnerInterval, setSprite, setSpriteByName, setTabIndex, setText, setTextAlign, setTextInputConfig, setTextInputError, setTextVAlign, setTextWrap, setTimer, setVelocity, setVelocityOptions, setZIndex, shouldShrink, sliderStore, snapshotSelection, spriteStore, startDragging, startEditingTextInput, startSelection, startTimer, stopAnimation, stopDragging, stopEntity, stopTimer, submitForm, swapZIndex, textInputStore, toggleCheckbox, toggleCursorMode, toggleSelect, toggleShadow, uncheckCheckbox, unpackModifiers, unregisterAnimation, unregisterFormField, unregisterSprite, updateAnimationEntity, updateBehaviorTimer, updateCameraFollow, updateEntityMovement, updateHealth, updateSelection, updateSpinner, updateStateAge, updateTimers, worldToScreen };
|
|
11726
|
+
export { Acceleration, type AccelerationData, Animation, type AnimationData, type AnimationDefinition, AnimationDirection, type AnimationFrame, type AnimationOptions, BACKGROUND_COPY_CHUNK_SIZE, BLOCK_SPINNER_CHARS, BRAILLE_SPINNER_CHARS, BUTTON_STATE_MACHINE_CONFIG, Behavior, type BehaviorData, type BehaviorDirection, type BehaviorOptions, BehaviorState, type BehaviorStateValue, BehaviorType, type BehaviorTypeValue, type ButtonEvent, type ButtonState, type ButtonStore, CHECKBOX_STATE_MACHINE_CONFIG, Camera, type CameraBounds, type CameraData, type CameraOptions, type CheckboxDisplay, type CheckboxDisplayOptions, type CheckboxEvent, type CheckboxState, type CheckboxStore, Content, type ContentData, type ContentOptions, type CopyProgress, type CursorConfig, type CursorConfigOptions, CursorMode, type CursorModeType, CursorShape, type CursorShapeValue, type CustomBehaviorCallback, DEFAULT_CENSOR_CHAR, DEFAULT_CHECKED_CHAR, DEFAULT_CLOSED_INDICATOR, DEFAULT_CURSOR_BLINK_MS, DEFAULT_CURSOR_BLOCK_CHAR, DEFAULT_CURSOR_LINE_CHAR, DEFAULT_DISABLED_FG, DEFAULT_EMPTY_CHAR, DEFAULT_EMPTY_CHAR_VERTICAL, DEFAULT_FILL_CHAR$1 as DEFAULT_FILL_CHAR, DEFAULT_FILL_CHAR_VERTICAL$1 as DEFAULT_FILL_CHAR_VERTICAL, DEFAULT_FOCUS_BG, DEFAULT_FOCUS_FG, DEFAULT_HOVER_BG, DEFAULT_HOVER_FG, DEFAULT_ITEM_BG, DEFAULT_ITEM_FG, DEFAULT_OPEN_INDICATOR, DEFAULT_PLACEHOLDER, DEFAULT_RADIO_SELECTED_CHAR, DEFAULT_RADIO_UNSELECTED_CHAR, DEFAULT_THUMB_CHAR$1 as DEFAULT_SCROLLBAR_THUMB_CHAR, DEFAULT_TRACK_CHAR$1 as DEFAULT_SCROLLBAR_TRACK_CHAR, DEFAULT_SELECTED_BG, DEFAULT_SELECTED_FG, DEFAULT_SELECTED_MARK, DEFAULT_SELECTED_PREFIX, DEFAULT_SEPARATOR, DEFAULT_SHADOW_CHAR, DEFAULT_SHADOW_COLOR, DEFAULT_SHADOW_OFFSET_X, DEFAULT_SHADOW_OFFSET_Y, DEFAULT_SHADOW_OPACITY, DEFAULT_FILL_BG as DEFAULT_SLIDER_FILL_BG, DEFAULT_FILL_CHAR as DEFAULT_SLIDER_FILL_CHAR, DEFAULT_FILL_CHAR_VERTICAL as DEFAULT_SLIDER_FILL_CHAR_VERTICAL, DEFAULT_FILL_FG as DEFAULT_SLIDER_FILL_FG, DEFAULT_SPINNER_CHARS, DEFAULT_SPINNER_INTERVAL, DEFAULT_THUMB_BG, DEFAULT_THUMB_CHAR, DEFAULT_THUMB_COLOR, DEFAULT_THUMB_FG, DEFAULT_TRACK_BG, DEFAULT_TRACK_CHAR, DEFAULT_TRACK_CHAR_H, DEFAULT_TRACK_CHAR_VERTICAL, DEFAULT_TRACK_COLOR, DEFAULT_TRACK_FG, DEFAULT_UNCHECKED_CHAR, DEFAULT_UNSELECTED_PREFIX, DEFAULT_VIEWPORT_HEIGHT, DEFAULT_VIEWPORT_WIDTH, DOTS_SPINNER_CHARS, Focusable, type FocusableData, type FocusableOptions, type FormFieldValue, type FormResetCallback, type FormStore, type FormSubmitCallback, type FormValues, Health, type HealthData, type HealthOptions, Hierarchy, type HierarchyData, InputBuffer, type InputBufferData, Interactive, type InteractiveData, type InteractiveOptions, KeyboardInput, type KeyboardInputData, type KeyboardInputOptions, LIST_STATE_MACHINE_CONFIG, Label, type LabelData, type LabelOptions, LabelPosition, type LineSelectionInfo, ListAction, ListDisplay, ListDisplayOptions, ListEvent, ListItem, ListScrollInfo, ListSelectCallback, ListState, ListStore, ModifierFlags, MouseButtons, MouseInput, type MouseInputData, type MouseInputOptions, NULL_ENTITY, Padding, type PaddingData, type PaddingOptions, type PatrolRoute, type PlayAnimationOptions, type Point2D, Position, type PositionData, type PositionKeyword, type ProgressBarDisplay, type ProgressBarDisplayOptions, type ProgressBarStore, type ProgressChangeCallback, type ProgressCompleteCallback, ProgressOrientation, RADIO_BUTTON_STATE_MACHINE_CONFIG, type RadioButtonDisplay, type RadioButtonDisplayOptions, type RadioButtonEvent, type RadioButtonState, type RadioButtonStore, type RadioSelectCallback, type RadioSetStore, SELECT_STATE_MACHINE_CONFIG, SHADOW_CHAR_DARK, SHADOW_CHAR_LIGHT, SHADOW_CHAR_MEDIUM, SLIDER_STATE_MACHINE_CONFIG, SYNC_COPY_LINE_LIMIT, Screen, type ScreenCursor, type ScreenData, type ScreenOptions, Scrollbar, type ScrollbarData, type ScrollbarOptions, type ScrollbarRenderCell, type SelectAction, type SelectCallback, type SelectDisplay, type SelectDisplayOptions, type SelectEvent, type SelectOption, type SelectState, type SelectStore, type SelectionMode, SelectionModeSchema, type SelectionPosition, SelectionPositionSchema, type SelectionRange, Shadow, type ShadowData, type ShadowOptions, type ShadowPosition, type SliderAction, type SliderChangeCallback, type SliderDisplay, type SliderDisplayOptions, type SliderEvent, SliderOrientation, type SliderOrientationType, type SliderState, type SliderStore, Spinner, type SpinnerData, type SpinnerOptions, Sprite, type SpriteCell, type SpriteData, type SpriteFrame, type SpriteSheetData, type SpriteSheetOptions, StateMachineStore, TEXT_INPUT_STATE_MACHINE_CONFIG, TIMER_INFINITE, TextAlign, type TextInputAction, type TextInputConfig, type TextInputConfigOptions, type TextInputEvent, type TextInputState, type TextInputStore, type TextSelectionState, TextVAlign, Timer, type TimerCallback, type TimerCompleteCallback, type TimerData, type TimerOptions, type TraversalCallback, UserData, type UserDataObject, Velocity, type VelocityData, type VelocityOptions, activateSelected, addItem, addSpinner, addVelocity, advanceSpinnerFrame, animationStore, appendChild, appendContent, appendItems, appendToSearchQuery, applyAccelerationToEntity, applyFrictionToEntity, applyVelocityToEntity, attachButtonBehavior, attachCheckboxBehavior, attachFormBehavior, attachListBehavior, attachProgressBarBehavior, attachRadioButtonBehavior, attachRadioSetBehavior, attachSelectBehavior, attachSliderBehavior, attachStateMachine, attachTextInputBehavior, autoRegisterFields, backspaceSearchQuery, blendShadowColor, blur, blurList, blurSlider, blurTextInput, bringToFront, buttonStore, calculateHorizontalScrollbar, calculateShadowPositions, calculateVerticalScrollbar, canSendEvent, centerCameraOn, checkCheckbox, checkNeedsLoad, checkboxStore, clampSpeedForEntity, clearAcceleration, clearAllUserData, clearButtonCallbacks, clearCameraBounds, clearCheckboxCallbacks, clearCheckboxDisplay, clearContent, clearFormCallbacks, clearInputBufferSelection, clearInteractionState, clearInvulnerable, clearItems, clearKeyboardInput, clearLazyLoadCallback, clearListCallbacks, clearListDisplay, clearListFilter, clearSelection$2 as clearListSelection, clearMouseInput, clearProgressBarCallbacks, clearProgressBarDisplay, clearRadioButtonDisplay, clearRadioSetCallbacks, clearSearchQuery, clearSelectCallbacks, clearSelectDisplay, clearSelection$1 as clearSelectSelection, clearSelection, clearSliderCallbacks, clearSliderDisplay, clearTextInputCallbacks, clearTextInputError, clearTextSelection, clearTimerCallbacks, closeSelect, completeProgress, computeChaseDirection, computeFleeDirection, computePatrolDirection, contentStore, createBackgroundCopy, createSelectionState, damage, decrementProgress, decrementSlider, deselectAllItems, deselectRadioButton, destroyScreen, detach, detachStateMachine, disable, disableButton, disableCheckbox, disableInput, disableKeys, disableList, disableMouse, disableRadioButton, disableScrollbar, disableSelect, disableShadow, disableSlider, disableTextInput, emitCancel, emitSubmit, emitValueChange, enable, enableButton, enableCheckbox, enableInput, enableKeys, enableList, enableMouse, enableRadioButton, enableScrollbar, enableSelect, enableShadow, enableSlider, enableTextInput, endEditingTextInput, endListSearch, ensureVisible, executeCustomBehavior, findAndSelectByText, findNextMatch, focus, focusList, focusNext, focusNextField, focusPrev, focusPrevField, focusSlider, focusTextInput, forAncestors, forDescendants, formStore, getAcceleration, getAncestors, getAnimation, getAnimationByName, getAnimationData, getAnimationIdByName, getBehavior, getBehaviorState, getBehaviorTarget, getBehaviorType, getButtonState, getCamera, getCameraPosition, getCameraTarget, getCensorChar, getCheckboxChar, getCheckboxDisplay, getCheckboxState, getChildAt, getChildIndex, getChildren, getCommonAncestor, getContent, getContentData, getContentHash, getContentLength, getCurrentFrame, getCurrentPatrolPoint, getCursorChar, getCursorConfig, getCursorDisplayText, getCursorMode, getCursorPos, getDepth, getDescendants, getEntityAnimation, getEntitySpriteSheet, getFieldName, getFieldValue, getFilteredItems, getFirstChild, getFirstVisible, getFocusEffect, getFocusable, getFocusedEntity, getFormFields, getFormTabOrder, getFormValues, getHealth, getHealthPercent, getHierarchy, getHighlightedIndex, getHorizontalPadding, getInputBuffer, getInputBufferText, getInteractive, getItem, getItemCount, getItems, getKeyboardInput, getLabel, getLabelPosition, getLabelText, getLastChild, getLazyLoadCallback, getLineSelectionInfo, getListDisplay, getListSearchQuery, getSelectedIndex$1 as getListSelectedIndex, getListState, getLoadingPlaceholder, getMaxLength, getMouseInput, getMultiSelected, getNextSibling, getNormalizedRange, getNormalizedSelection, getOptionAt, getOptionCount, getOrCreateUserData, getPadding, getParent, getPatrolRoute, getPlaceholder, getPosition, getPrevSibling, getPreviousState, getProgress, getProgressBarDisplay, getProgressEmptyChar, getProgressFillChar, getProgressMax, getProgressMin, getProgressOrientation, getProgressPercentage, getRadioButtonChar, getRadioButtonDisplay, getRadioButtonState, getRadioButtonsInSet, getRadioSet, getRadioValue, getRoot, getScreen, getScreenCursor, getScreenData, getScreenFocus, getScreenHover, getScreenSize, getScrollInfo, getScrollbar, getSelectDisplay, getSelectIndicator, getSelectOptions, getSelectState, getSelectedValue as getSelectValue, getSelectedButton, getSelectedIndex, getSelectedItem, getSelectedLabel, getSelectedLinesInViewport, getSelectedOption, getSelectedText, getSelectedValue$1 as getSelectedValue, getSelection, getSelectionDirtyRanges, getSelectionLineCount, getSelectionState, getShadow, getShadowChar, getShadowColor, getShadowOffset, getShadowOpacity, getSiblings, getSliderDisplay, getSliderMax, getSliderMin, getSliderOrientation, getSliderPercentage, getSliderState, getSliderStep, getSliderValue, getSpeed, getSpinnerChar, getSpinnerData, getSprite, getSpriteIdByName, getSpriteSheet, getSpriteSheetByName, getState, getStateAge, getTabIndex, getTabOrder, getText, getTextInputConfig, getTextInputState, getTimer, getTimerProgress, getTotalCount, getUserData, getUserDataCount, getVelocity, getVerticalPadding, getVisibleCount, getVisibleItems, getZIndex, handleButtonKeyPress, handleCheckboxKeyPress, handleFormKeyPress, handleListKeyPress, handleRadioButtonKeyPress, handleSelectKeyPress, handleSliderKeyPress, handleTextInputKeyPress, hasAcceleration, hasActiveSelection, hasAncestor, hasAnimation, hasBehavior, hasCamera, hasContent, hasDescendant, hasFocusable, hasHealth, hasHierarchy, hasInputBuffer, hasInputEnabled, hasInteractive, hasKeyboardInput, hasKeysEnabled, hasLabel, hasLabelText, hasMouseEnabled, hasMouseInput, hasPadding, hasPaddingValue, hasPosition, hasScreen, hasScreenSingleton, hasScrollbar, hasSelection, hasSelectionState, hasShadow, hasSpinner, hasSprite, hasStateMachine, hasTimer, hasUserData, hasVelocity, heal, highlightNext, highlightPrev, incrementProgress, incrementSlider, initScreenComponent, inputBufferStore, insertAfter, insertAt, insertBefore, isAbsolute, isAnimationPlaying, isAreaInView, isAutoPadding, isBehaviorActive, isBehaviorCompleted, isBehaviorWaiting, isButton, isButtonDisabled, isButtonFocused, isButtonHovered, isButtonInState, isButtonPressed, isCameraBounded, isCheckbox, isCheckboxDisabled, isCheckboxInState, isChecked, isClickable, isCursorBlinkEnabled, isCursorVisible, isDead, isDraggable, isEnabled, isFocusable, isFocused, isFollowingTarget, isForm, isFormKeysEnabled, isFormSubmitOnEnter, isFullUnicode, isHoverable, isHovered, isInState, isInTabOrder, isInView, isInvulnerable, isItemMultiSelected, isKeyable, isLeaf, isLineSelected, isList, isListDisabled, isListFocused, isListInState, isListInteractive, isListKeysEnabled, isListLoading, isListMouseEnabled, isListMultiSelect, isListSearchEnabled, isListSearching, isMultiline, isParsingTags, isPressed, isProgressBar, isProgressComplete, isRadioButton, isRadioButtonDisabled, isRadioButtonInState, isRadioSelected, isRadioSet, isRoot, isScreen, isScrollbarEnabled, isSecretMode, isSelect, isSelectDisabled, isSelectInState, isSelectOpen, isShadowBlending, isShadowEnabled, isShowingPercentage, isShowingSliderValue, isSlider, isSliderDisabled, isSliderDragging, isSliderFocused, isSliderHorizontal, isSliderInState, isSliderVertical, isTextInput, isTextInputDisabled, isTextInputEditing, isTextInputError, isTextInputFocused, isTextInputInState, isTextWrapped, isTimerComplete, isTimerRunning, isUnchecked, labelStore, listStore, loadItems, makeFocusable, maskValue, moveBackward, moveBy, moveCameraBy, moveCursor, moveForward, nextFrame, normalizeZIndices, onButtonPress, onCheckboxChange, onFormReset, onFormSubmit, onListActivate, onListCancel, onListScroll, onListSearchChange, onListSelect, onProgressChange, onProgressComplete, onRadioSelect, onSelectChange, onSelectClose, onSelectOpen, onSliderChange, onSliderDragEnd, onSliderDragStart, onTextInputCancel, onTextInputChange, onTextInputSubmit, onTimerComplete, onTimerFire, openSelect, packModifiers, pauseAnimation, pauseTimer, playAnimation, playAnimationByName, prepend, pressButton, prevFrame, progressBarStore, radioButtonStore, radioSetStore, recordClick, registerAnimation, registerBuiltinComponentNames, registerFormField, registerScreenSingleton, registerSelectionState, registerSprite, removeAcceleration, removeAnimation, removeBehavior, removeCamera, removeChild, removeHealth, removeInputBuffer, removeItem, removeKeyboardInput, removeLabel, removeMouseInput, removeSelectionState, removeShadow, removeSpinner, removeSprite, removeTimer, removeUserData, removeVelocity, renderListItems, renderProgressString, renderSliderString, resetAnimationStore, resetBehaviorStore, resetButtonStore, resetCheckboxStore, resetContentStore, resetCursorBlink, resetFocusState, resetForm, resetFormStore, resetLabelStore, resetListStore, resetProgress, resetProgressBarStore, resetRadioButtonStore, resetScreenSingleton, resetSelectStore, resetSelectionStore, resetSliderStore, resetSpinner, resetSpinnerStore, resetSpriteStore, resetTextInputStore, resetTimer, resetTimerStore, resizeScreen, resumeAnimation, resumeTimer, screenToWorld, scrollPage, selectAll, selectAllItems, selectByValue, selectFirst, selectHighlighted, selectLast, selectLine, selectLineRange, selectNext, selectOptionByIndex, selectOptionByValue, selectPrev, selectRadioButton, selectRadioByValue, selectStore, sendButtonEvent, sendCheckboxEvent, sendEvent, sendListEvent, sendRadioButtonEvent, sendSelectEvent, sendSliderEvent, sendTextInputEvent, sendToBack, setAbsolute, setAcceleration, setAnimationDirection, setAnimationLoop, setAnimationSpeed, setAutoPadding, setBehavior, setBehaviorSpeed, setBehaviorTarget, setCamera, setCameraBounds, setCameraDeadZone, setCameraPosition, setCameraTarget, setChase, setCheckboxDisplay, setChecked, setClickable, setContent, setCurrentHealth, setCursorBlinkEnabled, setCursorConfig, setCursorMode, setCursorPos, setCustomBehavior, setDetectionRange, setDraggable, setFieldValue, setFirstVisible, setFlee, setFocusEffect, setFocusable, setFocusedState, setFrame, setFriction, setFullUnicode, setHealth, setHighlightedIndex, setHoverable, setHovered, setIdle, setInputBuffer, setInputBufferSelection, setInputBufferText, setInteractive, setInvulnerable, setItems, setKeyable, setKeyboardInput, setLabel, setLabelOffset, setLabelPosition, setLazyLoadCallback, setListDisplay, setListFilter, setListInteractive, setListKeys, setListLoading, setListMouse, setListMultiSelect, setListSearchEnabled, setListSearchQuery, setSelectedIndex as setListSelectedIndex, setLoadingPlaceholder, setMaxHealth, setMaxSpeed, setMouseInput, setPadding, setPaddingAll, setPaddingHV, setParent, setParseTags, setPatrol, setPosition, setPositionKeyword, setPositionPercent, setPressed, setProgress, setProgressBarDisplay, setProgressOrientation, setProgressRange, setRadioButtonDisplay, setRadioSet, setRadioValue, setRegen, setScreenCursor, setScreenCursorShape, setScreenCursorVisible, setScreenFocus, setScreenHover, setScrollbar, setScrollbarChars, setScrollbarColors, setSelectDisplay, setSelectOptions, setSelection, setSelectionMode, setShadow, setShadowBlend, setShadowChar, setShadowColor, setShadowOffset, setShadowOpacity, setShowPercentage, setShowSliderValue, setSliderDisplay, setSliderFromPercentage, setSliderOrientation, setSliderRange, setSliderStep, setSliderToMax, setSliderToMin, setSliderValue, setSpinnerFrames, setSpinnerInterval, setSprite, setSpriteByName, setTabIndex, setText, setTextAlign, setTextInputConfig, setTextInputError, setTextVAlign, setTextWrap, setTimer, setTotalCount, setUserData, setVelocity, setVelocityOptions, setVisibleCount, setZIndex, shouldShowHorizontalScrollbar, shouldShowVerticalScrollbar, sliderStore, snapshotSelection, spriteStore, startDragging, startEditingTextInput, startListSearch, startSelection, startTimer, stopAnimation, stopDragging, stopEntity, stopTimer, submitForm, swapZIndex, textInputStore, toggleCheckbox, toggleCursorMode, toggleMultiSelect, toggleSelect, toggleShadow, triggerListCancel, uncheckCheckbox, unpackModifiers, unregisterAnimation, unregisterFormField, unregisterSprite, updateAnimationEntity, updateBehaviorTimer, updateCameraFollow, updateEntityMovement, updateHealth, updateItem, updateSelection, updateSpinner, updateStateAge, updateTimers, worldToScreen };
|