blecsd 0.1.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 +20 -0
- package/README.md +220 -0
- package/dist/3d/index.d.ts +5 -0
- package/dist/3d/index.js +1 -0
- package/dist/audio/index.d.ts +177 -0
- package/dist/audio/index.js +1 -0
- package/dist/border-D_Jb4ZJV.d.ts +257 -0
- package/dist/cell-DwIu2ryP.d.ts +505 -0
- package/dist/chunk-2UBBZFE4.js +1 -0
- package/dist/chunk-35LCBY6P.js +1 -0
- package/dist/chunk-3B7MIVW6.js +1 -0
- package/dist/chunk-3EGGGI5J.js +3 -0
- package/dist/chunk-4LWWONFK.js +1 -0
- package/dist/chunk-4X4N4HNQ.js +2 -0
- package/dist/chunk-5PELJRUQ.js +1 -0
- package/dist/chunk-AEJIX2MW.js +1 -0
- package/dist/chunk-AQ7LW75B.js +1 -0
- package/dist/chunk-AXZQAH4X.js +1 -0
- package/dist/chunk-B6Z2JFRY.js +1 -0
- package/dist/chunk-BCADUCOZ.js +1 -0
- package/dist/chunk-C5PCEQ6G.js +1 -0
- package/dist/chunk-CIK4AMUA.js +1 -0
- package/dist/chunk-DNRXW56C.js +1 -0
- package/dist/chunk-FC5FFAAC.js +12 -0
- package/dist/chunk-FGHEFXLK.js +1 -0
- package/dist/chunk-FYEBZAWN.js +1 -0
- package/dist/chunk-G7GIWWLE.js +1 -0
- package/dist/chunk-GYHI26UE.js +1 -0
- package/dist/chunk-H2YAOJDW.js +1 -0
- package/dist/chunk-J4JZ2NU2.js +1 -0
- package/dist/chunk-JKVHO4LH.js +1 -0
- package/dist/chunk-K2B2OXQ5.js +5 -0
- package/dist/chunk-K37L3G4Z.js +4 -0
- package/dist/chunk-KD55INV7.js +1 -0
- package/dist/chunk-KFAK4A3G.js +1 -0
- package/dist/chunk-LCN2ZITE.js +1 -0
- package/dist/chunk-LYSK5S63.js +1 -0
- package/dist/chunk-NZ55KBM6.js +1 -0
- package/dist/chunk-OMMJ7B5P.js +1 -0
- package/dist/chunk-OUXUPF3V.js +33 -0
- package/dist/chunk-OVT2PPGW.js +19 -0
- package/dist/chunk-P6CJO3BC.js +1 -0
- package/dist/chunk-PSXXMBVJ.js +1 -0
- package/dist/chunk-PXXGH3BV.js +1 -0
- package/dist/chunk-QIKIOVP2.js +1 -0
- package/dist/chunk-SHUC6JWA.js +1 -0
- package/dist/chunk-TDXJDLY6.js +6 -0
- package/dist/chunk-TWSWTBYL.js +1 -0
- package/dist/chunk-TYMY2TBR.js +3 -0
- package/dist/chunk-VNZ6CWJA.js +2 -0
- package/dist/chunk-VOCM5T2G.js +5 -0
- package/dist/chunk-W5OU7Z6J.js +1 -0
- package/dist/chunk-WNG4A3K7.js +4 -0
- package/dist/chunk-XQIGERNI.js +1 -0
- package/dist/chunk-XZA63ZPO.js +1 -0
- package/dist/chunk-YAMOSPWB.js +4 -0
- package/dist/chunk-YD6ULIUR.js +1 -0
- package/dist/chunk-Z4EZERNE.js +1 -0
- package/dist/cli/init.d.ts +86 -0
- package/dist/cli/init.js +179 -0
- package/dist/color-B78w3zH-.d.ts +79 -0
- package/dist/components/index.d.ts +10298 -0
- package/dist/components/index.js +1 -0
- package/dist/core/index.d.ts +6700 -0
- package/dist/core/index.js +1 -0
- package/dist/debug/index.d.ts +711 -0
- package/dist/debug/index.js +1 -0
- package/dist/doubleBuffer-CKQFmlPN.d.ts +95 -0
- package/dist/errors/index.d.ts +1110 -0
- package/dist/errors/index.js +1 -0
- package/dist/events-BbbxkgvX.d.ts +125 -0
- package/dist/game/index.d.ts +486 -0
- package/dist/game/index.js +1 -0
- package/dist/gameLoop-BIPW7-OY.d.ts +219 -0
- package/dist/index-zSGJ2eUk.d.ts +3156 -0
- package/dist/index.d.ts +246 -0
- package/dist/index.js +1 -0
- package/dist/input/index.d.ts +158 -0
- package/dist/input/index.js +1 -0
- package/dist/inputActions-CefRUBuT.d.ts +2637 -0
- package/dist/keyParser-Bwm8-l7v.d.ts +229 -0
- package/dist/mouseParser-Cfrbn3AX.d.ts +177 -0
- package/dist/parser-iMHmQuUh.d.ts +265 -0
- package/dist/program-BZaKqDKH.d.ts +141 -0
- package/dist/renderable-jTMOA-GK.d.ts +302 -0
- package/dist/scheduler-DcfoFuum.d.ts +86 -0
- package/dist/schemas/index.d.ts +936 -0
- package/dist/schemas/index.js +1 -0
- package/dist/systems/index.d.ts +4036 -0
- package/dist/systems/index.js +1 -0
- package/dist/terminal/index.d.ts +7357 -0
- package/dist/terminal/index.js +1 -0
- package/dist/terminus-14-bold-HWSPRLJD.js +1 -0
- package/dist/terminus-14-normal-T3SWMH4D.js +1 -0
- package/dist/tilemap-D1HJvKy3.d.ts +1211 -0
- package/dist/types-BcsvoKzf.d.ts +68 -0
- package/dist/utils/index.d.ts +6104 -0
- package/dist/utils/index.js +1 -0
- package/dist/viewport3d-xI33-_wq.d.ts +182 -0
- package/dist/virtualScrollback-DvZTRU8a.d.ts +274 -0
- package/dist/virtualViewport-Dx2iJliO.d.ts +2334 -0
- package/dist/virtualizedLineStore-DwPEvPkk.d.ts +297 -0
- package/dist/widgets/bigText.d.ts +230 -0
- package/dist/widgets/bigText.js +1 -0
- package/dist/widgets/fonts/index.d.ts +211 -0
- package/dist/widgets/fonts/index.js +1 -0
- package/dist/widgets/index.d.ts +8591 -0
- package/dist/widgets/index.js +1 -0
- package/package.json +213 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { W as World, E as Entity } from './types-BcsvoKzf.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Border component for element borders.
|
|
5
|
+
* @module components/border
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Border type enumeration.
|
|
10
|
+
*/
|
|
11
|
+
declare enum BorderType {
|
|
12
|
+
/** No border */
|
|
13
|
+
None = 0,
|
|
14
|
+
/** Line border using box-drawing characters */
|
|
15
|
+
Line = 1,
|
|
16
|
+
/** Background color border */
|
|
17
|
+
Background = 2,
|
|
18
|
+
/** Custom characters border */
|
|
19
|
+
Custom = 3
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Preset border character sets.
|
|
23
|
+
*/
|
|
24
|
+
interface BorderCharset {
|
|
25
|
+
readonly topLeft: number;
|
|
26
|
+
readonly topRight: number;
|
|
27
|
+
readonly bottomLeft: number;
|
|
28
|
+
readonly bottomRight: number;
|
|
29
|
+
readonly horizontal: number;
|
|
30
|
+
readonly vertical: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Single line border characters (─ │ ┌ ┐ └ ┘).
|
|
34
|
+
*/
|
|
35
|
+
declare const BORDER_SINGLE: BorderCharset;
|
|
36
|
+
/**
|
|
37
|
+
* Double line border characters (═ ║ ╔ ╗ ╚ ╝).
|
|
38
|
+
*/
|
|
39
|
+
declare const BORDER_DOUBLE: BorderCharset;
|
|
40
|
+
/**
|
|
41
|
+
* Rounded border characters (─ │ ╭ ╮ ╰ ╯).
|
|
42
|
+
*/
|
|
43
|
+
declare const BORDER_ROUNDED: BorderCharset;
|
|
44
|
+
/**
|
|
45
|
+
* Bold/thick border characters (━ ┃ ┏ ┓ ┗ ┛).
|
|
46
|
+
*/
|
|
47
|
+
declare const BORDER_BOLD: BorderCharset;
|
|
48
|
+
/**
|
|
49
|
+
* ASCII border characters (- | + + + +).
|
|
50
|
+
*/
|
|
51
|
+
declare const BORDER_ASCII: BorderCharset;
|
|
52
|
+
/**
|
|
53
|
+
* Default foreground color for borders (white).
|
|
54
|
+
*/
|
|
55
|
+
declare const DEFAULT_BORDER_FG = 4294967295;
|
|
56
|
+
/**
|
|
57
|
+
* Default background color for borders (transparent).
|
|
58
|
+
*/
|
|
59
|
+
declare const DEFAULT_BORDER_BG = 0;
|
|
60
|
+
/**
|
|
61
|
+
* Border component store using SoA (Structure of Arrays) for performance.
|
|
62
|
+
*
|
|
63
|
+
* - `type`: Border type (0=none, 1=line, 2=bg, 3=custom)
|
|
64
|
+
* - `left`, `top`, `right`, `bottom`: Which sides have borders (0=no, 1=yes)
|
|
65
|
+
* - `fg`, `bg`: Border colors (packed RGBA)
|
|
66
|
+
* - `charTopLeft`, etc.: Unicode codepoints for border characters
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* import { Border, setBorder, getBorder, BorderType, BORDER_DOUBLE } from 'blecsd';
|
|
71
|
+
*
|
|
72
|
+
* setBorder(world, entity, { type: BorderType.Line });
|
|
73
|
+
* setBorderChars(world, entity, BORDER_DOUBLE);
|
|
74
|
+
*
|
|
75
|
+
* const border = getBorder(world, entity);
|
|
76
|
+
* console.log(border.type); // BorderType.Line
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
declare const Border: {
|
|
80
|
+
/** Border type (0=none, 1=line, 2=bg, 3=custom) */
|
|
81
|
+
type: Uint8Array<ArrayBuffer>;
|
|
82
|
+
/** Left side enabled (0=no, 1=yes) */
|
|
83
|
+
left: Uint8Array<ArrayBuffer>;
|
|
84
|
+
/** Top side enabled (0=no, 1=yes) */
|
|
85
|
+
top: Uint8Array<ArrayBuffer>;
|
|
86
|
+
/** Right side enabled (0=no, 1=yes) */
|
|
87
|
+
right: Uint8Array<ArrayBuffer>;
|
|
88
|
+
/** Bottom side enabled (0=no, 1=yes) */
|
|
89
|
+
bottom: Uint8Array<ArrayBuffer>;
|
|
90
|
+
/** Foreground color (packed RGBA) */
|
|
91
|
+
fg: Uint32Array<ArrayBuffer>;
|
|
92
|
+
/** Background color (packed RGBA) */
|
|
93
|
+
bg: Uint32Array<ArrayBuffer>;
|
|
94
|
+
/** Top-left corner character (Unicode codepoint) */
|
|
95
|
+
charTopLeft: Uint32Array<ArrayBuffer>;
|
|
96
|
+
/** Top-right corner character (Unicode codepoint) */
|
|
97
|
+
charTopRight: Uint32Array<ArrayBuffer>;
|
|
98
|
+
/** Bottom-left corner character (Unicode codepoint) */
|
|
99
|
+
charBottomLeft: Uint32Array<ArrayBuffer>;
|
|
100
|
+
/** Bottom-right corner character (Unicode codepoint) */
|
|
101
|
+
charBottomRight: Uint32Array<ArrayBuffer>;
|
|
102
|
+
/** Horizontal edge character (Unicode codepoint) */
|
|
103
|
+
charHorizontal: Uint32Array<ArrayBuffer>;
|
|
104
|
+
/** Vertical edge character (Unicode codepoint) */
|
|
105
|
+
charVertical: Uint32Array<ArrayBuffer>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Border configuration options.
|
|
109
|
+
*/
|
|
110
|
+
interface BorderOptions {
|
|
111
|
+
/** Border type */
|
|
112
|
+
type?: BorderType;
|
|
113
|
+
/** Enable left side */
|
|
114
|
+
left?: boolean;
|
|
115
|
+
/** Enable top side */
|
|
116
|
+
top?: boolean;
|
|
117
|
+
/** Enable right side */
|
|
118
|
+
right?: boolean;
|
|
119
|
+
/** Enable bottom side */
|
|
120
|
+
bottom?: boolean;
|
|
121
|
+
/** Foreground color (hex string or packed number) */
|
|
122
|
+
fg?: string | number;
|
|
123
|
+
/** Background color (hex string or packed number) */
|
|
124
|
+
bg?: string | number;
|
|
125
|
+
/** Preset border charset or custom characters */
|
|
126
|
+
chars?: BorderCharset;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Border data returned by getBorder.
|
|
130
|
+
*/
|
|
131
|
+
interface BorderData {
|
|
132
|
+
readonly type: BorderType;
|
|
133
|
+
readonly left: boolean;
|
|
134
|
+
readonly top: boolean;
|
|
135
|
+
readonly right: boolean;
|
|
136
|
+
readonly bottom: boolean;
|
|
137
|
+
readonly fg: number;
|
|
138
|
+
readonly bg: number;
|
|
139
|
+
readonly charTopLeft: number;
|
|
140
|
+
readonly charTopRight: number;
|
|
141
|
+
readonly charBottomLeft: number;
|
|
142
|
+
readonly charBottomRight: number;
|
|
143
|
+
readonly charHorizontal: number;
|
|
144
|
+
readonly charVertical: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Sets the border configuration of an entity.
|
|
148
|
+
* Adds the Border component if not already present.
|
|
149
|
+
*
|
|
150
|
+
* @param world - The ECS world
|
|
151
|
+
* @param eid - The entity ID
|
|
152
|
+
* @param options - Border configuration options
|
|
153
|
+
* @returns The entity ID for chaining
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* import { createWorld, addEntity } from '../core/ecs';
|
|
158
|
+
* import { setBorder, BorderType, BORDER_DOUBLE } from 'blecsd';
|
|
159
|
+
*
|
|
160
|
+
* const world = createWorld();
|
|
161
|
+
* const entity = addEntity(world);
|
|
162
|
+
*
|
|
163
|
+
* // Set a line border with double characters
|
|
164
|
+
* setBorder(world, entity, {
|
|
165
|
+
* type: BorderType.Line,
|
|
166
|
+
* chars: BORDER_DOUBLE,
|
|
167
|
+
* fg: '#ff0000',
|
|
168
|
+
* });
|
|
169
|
+
*
|
|
170
|
+
* // Enable only top and bottom borders
|
|
171
|
+
* setBorder(world, entity, {
|
|
172
|
+
* type: BorderType.Line,
|
|
173
|
+
* left: false,
|
|
174
|
+
* right: false,
|
|
175
|
+
* });
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
declare function setBorder(world: World, eid: Entity, options: BorderOptions): Entity;
|
|
179
|
+
/**
|
|
180
|
+
* Sets the border characters of an entity.
|
|
181
|
+
* Adds the Border component if not already present.
|
|
182
|
+
*
|
|
183
|
+
* @param world - The ECS world
|
|
184
|
+
* @param eid - The entity ID
|
|
185
|
+
* @param chars - Border character set
|
|
186
|
+
* @returns The entity ID for chaining
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```typescript
|
|
190
|
+
* import { setBorderChars, BORDER_ROUNDED } from 'blecsd';
|
|
191
|
+
*
|
|
192
|
+
* setBorderChars(world, entity, BORDER_ROUNDED);
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
declare function setBorderChars(world: World, eid: Entity, chars: BorderCharset): Entity;
|
|
196
|
+
/**
|
|
197
|
+
* Gets the border data of an entity.
|
|
198
|
+
* Returns undefined if the entity doesn't have a Border component.
|
|
199
|
+
*
|
|
200
|
+
* @param world - The ECS world
|
|
201
|
+
* @param eid - The entity ID
|
|
202
|
+
* @returns Border data or undefined
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* import { getBorder } from 'blecsd';
|
|
207
|
+
*
|
|
208
|
+
* const border = getBorder(world, entity);
|
|
209
|
+
* if (border) {
|
|
210
|
+
* console.log(`Type: ${border.type}, Left: ${border.left}`);
|
|
211
|
+
* }
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
declare function getBorder(world: World, eid: Entity): BorderData | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Checks if an entity has a Border component.
|
|
217
|
+
*
|
|
218
|
+
* @param world - The ECS world
|
|
219
|
+
* @param eid - The entity ID
|
|
220
|
+
* @returns true if entity has Border component
|
|
221
|
+
*/
|
|
222
|
+
declare function hasBorder(world: World, eid: Entity): boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Checks if an entity has any visible border (type !== None and at least one side enabled).
|
|
225
|
+
*
|
|
226
|
+
* @param world - The ECS world
|
|
227
|
+
* @param eid - The entity ID
|
|
228
|
+
* @returns true if border is visible
|
|
229
|
+
*/
|
|
230
|
+
declare function hasBorderVisible(world: World, eid: Entity): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Enables all border sides.
|
|
233
|
+
*
|
|
234
|
+
* @param world - The ECS world
|
|
235
|
+
* @param eid - The entity ID
|
|
236
|
+
* @returns The entity ID for chaining
|
|
237
|
+
*/
|
|
238
|
+
declare function enableAllBorders(world: World, eid: Entity): Entity;
|
|
239
|
+
/**
|
|
240
|
+
* Disables all border sides.
|
|
241
|
+
*
|
|
242
|
+
* @param world - The ECS world
|
|
243
|
+
* @param eid - The entity ID
|
|
244
|
+
* @returns The entity ID for chaining
|
|
245
|
+
*/
|
|
246
|
+
declare function disableAllBorders(world: World, eid: Entity): Entity;
|
|
247
|
+
/**
|
|
248
|
+
* Gets the border character for a specific position.
|
|
249
|
+
*
|
|
250
|
+
* @param world - The ECS world
|
|
251
|
+
* @param eid - The entity ID
|
|
252
|
+
* @param position - Position name
|
|
253
|
+
* @returns Unicode codepoint or undefined
|
|
254
|
+
*/
|
|
255
|
+
declare function getBorderChar(world: World, eid: Entity, position: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'horizontal' | 'vertical'): number | undefined;
|
|
256
|
+
|
|
257
|
+
export { BORDER_ASCII as B, DEFAULT_BORDER_BG as D, BORDER_BOLD as a, BORDER_DOUBLE as b, BORDER_ROUNDED as c, BORDER_SINGLE as d, Border as e, type BorderCharset as f, type BorderData as g, type BorderOptions as h, BorderType as i, DEFAULT_BORDER_FG as j, disableAllBorders as k, enableAllBorders as l, getBorder as m, getBorderChar as n, hasBorder as o, hasBorderVisible as p, setBorderChars as q, setBorder as s };
|