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,936 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Common Zod schemas used across the library
|
|
5
|
+
* @module schemas/common
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Schema for positive integers (1, 2, 3, ...).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { PositiveIntSchema } from 'blecsd';
|
|
14
|
+
*
|
|
15
|
+
* const count = PositiveIntSchema.parse(5); // OK
|
|
16
|
+
* PositiveIntSchema.parse(0); // throws
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const PositiveIntSchema: z.ZodNumber;
|
|
20
|
+
type PositiveInt = z.infer<typeof PositiveIntSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* Schema for non-negative integers (0, 1, 2, 3, ...).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { NonNegativeIntSchema } from 'blecsd';
|
|
27
|
+
*
|
|
28
|
+
* const index = NonNegativeIntSchema.parse(0); // OK
|
|
29
|
+
* NonNegativeIntSchema.parse(-1); // throws
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const NonNegativeIntSchema: z.ZodNumber;
|
|
33
|
+
type NonNegativeInt = z.infer<typeof NonNegativeIntSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* Schema for percentage values (0-100).
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { PercentageSchema } from 'blecsd';
|
|
40
|
+
*
|
|
41
|
+
* const pct = PercentageSchema.parse(75); // OK
|
|
42
|
+
* PercentageSchema.parse(101); // throws
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare const PercentageSchema: z.ZodNumber;
|
|
46
|
+
type Percentage = z.infer<typeof PercentageSchema>;
|
|
47
|
+
/**
|
|
48
|
+
* Schema for color strings — hex (#fff, #ffffff, #ffffffff), rgb(), hsl(), or named colors.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { ColorStringSchema } from 'blecsd';
|
|
53
|
+
*
|
|
54
|
+
* ColorStringSchema.parse('#ff0000'); // OK
|
|
55
|
+
* ColorStringSchema.parse('rgb(255, 0, 0)'); // OK
|
|
56
|
+
* ColorStringSchema.parse('red'); // OK
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare const ColorStringSchema: z.ZodString;
|
|
60
|
+
type ColorString = z.infer<typeof ColorStringSchema>;
|
|
61
|
+
/**
|
|
62
|
+
* Schema for dimensions — number (absolute cells) or percentage string ("50%").
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { DimensionSchema } from 'blecsd';
|
|
67
|
+
*
|
|
68
|
+
* DimensionSchema.parse(80); // OK
|
|
69
|
+
* DimensionSchema.parse('50%'); // OK
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
declare const DimensionSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
73
|
+
type Dimension = z.infer<typeof DimensionSchema>;
|
|
74
|
+
/**
|
|
75
|
+
* Schema for position values — number, percentage string, or keyword.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* import { PositionValueSchema } from 'blecsd';
|
|
80
|
+
*
|
|
81
|
+
* PositionValueSchema.parse(10); // OK
|
|
82
|
+
* PositionValueSchema.parse('50%'); // OK
|
|
83
|
+
* PositionValueSchema.parse('center'); // OK
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
declare const PositionValueSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodEnum<{
|
|
87
|
+
left: "left";
|
|
88
|
+
top: "top";
|
|
89
|
+
right: "right";
|
|
90
|
+
bottom: "bottom";
|
|
91
|
+
center: "center";
|
|
92
|
+
}>]>;
|
|
93
|
+
type PositionValue = z.infer<typeof PositionValueSchema>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Zod validation schemas for component setter functions.
|
|
97
|
+
* @module schemas/components
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Schema for setPosition parameters.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import { SetPositionSchema } from 'blecsd';
|
|
106
|
+
*
|
|
107
|
+
* const pos = SetPositionSchema.parse({ x: 10, y: 20, z: 5 });
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
declare const SetPositionSchema: z.ZodObject<{
|
|
111
|
+
x: z.ZodNumber;
|
|
112
|
+
y: z.ZodNumber;
|
|
113
|
+
z: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
/**
|
|
116
|
+
* Schema for z-index values (0-65535).
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* import { ZIndexSchema } from 'blecsd';
|
|
121
|
+
*
|
|
122
|
+
* const z = ZIndexSchema.parse(100);
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
declare const ZIndexSchema: z.ZodNumber;
|
|
126
|
+
/**
|
|
127
|
+
* Schema for dimension values (number, percentage string, or 'auto').
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* import { DimensionValueSchema } from 'blecsd';
|
|
132
|
+
*
|
|
133
|
+
* DimensionValueSchema.parse(80); // absolute cells
|
|
134
|
+
* DimensionValueSchema.parse('50%'); // percentage
|
|
135
|
+
* DimensionValueSchema.parse('auto'); // auto-size
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
declare const DimensionValueSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodLiteral<"auto">]>;
|
|
139
|
+
/**
|
|
140
|
+
* Schema for setDimensions parameters.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* import { SetDimensionsSchema } from 'blecsd';
|
|
145
|
+
*
|
|
146
|
+
* const dims = SetDimensionsSchema.parse({ width: 80, height: '50%' });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare const SetDimensionsSchema: z.ZodObject<{
|
|
150
|
+
width: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodLiteral<"auto">]>;
|
|
151
|
+
height: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodLiteral<"auto">]>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
/**
|
|
154
|
+
* Schema for dimension constraints (min/max width and height).
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```typescript
|
|
158
|
+
* import { DimensionConstraintsSchema } from 'blecsd';
|
|
159
|
+
*
|
|
160
|
+
* const constraints = DimensionConstraintsSchema.parse({
|
|
161
|
+
* minWidth: 20, maxWidth: 100,
|
|
162
|
+
* minHeight: 5, maxHeight: 50,
|
|
163
|
+
* });
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
declare const DimensionConstraintsSchema: z.ZodObject<{
|
|
167
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
/**
|
|
173
|
+
* Schema for padding values (stored as Uint8, so 0-255).
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* import { PaddingValueSchema } from 'blecsd';
|
|
178
|
+
*
|
|
179
|
+
* const pad = PaddingValueSchema.parse(4);
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
declare const PaddingValueSchema: z.ZodNumber;
|
|
183
|
+
/**
|
|
184
|
+
* Schema for setPadding options with per-side values.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* import { PaddingOptionsSchema } from 'blecsd';
|
|
189
|
+
*
|
|
190
|
+
* const padding = PaddingOptionsSchema.parse({ left: 2, right: 2 });
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
declare const PaddingOptionsSchema: z.ZodObject<{
|
|
194
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
/**
|
|
200
|
+
* Schema for style color values (hex string or packed RGBA number).
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* import { StyleColorSchema } from 'blecsd';
|
|
205
|
+
*
|
|
206
|
+
* StyleColorSchema.parse('#ff0000'); // hex string
|
|
207
|
+
* StyleColorSchema.parse(0xff0000ff); // packed RGBA
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
declare const StyleColorSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
211
|
+
/**
|
|
212
|
+
* Schema for setStyle options (foreground, background, text attributes).
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* import { StyleOptionsSchema } from 'blecsd';
|
|
217
|
+
*
|
|
218
|
+
* const style = StyleOptionsSchema.parse({
|
|
219
|
+
* fg: '#ff0000', bg: '#000000', bold: true,
|
|
220
|
+
* });
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
declare const StyleOptionsSchema: z.ZodObject<{
|
|
224
|
+
fg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
225
|
+
bg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
226
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
227
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
blink: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
+
inverse: z.ZodOptional<z.ZodBoolean>;
|
|
230
|
+
transparent: z.ZodOptional<z.ZodBoolean>;
|
|
231
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
/**
|
|
234
|
+
* Schema for scrollable component options.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```typescript
|
|
238
|
+
* import { ScrollableOptionsSchema } from 'blecsd';
|
|
239
|
+
*
|
|
240
|
+
* const opts = ScrollableOptionsSchema.parse({
|
|
241
|
+
* scrollX: 0, scrollY: 10, scrollHeight: 200,
|
|
242
|
+
* });
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
declare const ScrollableOptionsSchema: z.ZodObject<{
|
|
246
|
+
scrollX: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
scrollY: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
scrollWidth: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
scrollHeight: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
viewportWidth: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
viewportHeight: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
scrollbarVisible: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
trackVisible: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
alwaysScroll: z.ZodOptional<z.ZodBoolean>;
|
|
255
|
+
clampEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
/**
|
|
258
|
+
* Schema for a single animation frame (index + duration).
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```typescript
|
|
262
|
+
* import { AnimationFrameSchema } from 'blecsd';
|
|
263
|
+
*
|
|
264
|
+
* const frame = AnimationFrameSchema.parse({ frameIndex: 0, duration: 100 });
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
declare const AnimationFrameSchema: z.ZodObject<{
|
|
268
|
+
frameIndex: z.ZodNumber;
|
|
269
|
+
duration: z.ZodNumber;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
/**
|
|
272
|
+
* Schema for registerAnimation options (name + frame sequence).
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```typescript
|
|
276
|
+
* import { AnimationOptionsSchema } from 'blecsd';
|
|
277
|
+
*
|
|
278
|
+
* const anim = AnimationOptionsSchema.parse({
|
|
279
|
+
* name: 'walk',
|
|
280
|
+
* frames: [
|
|
281
|
+
* { frameIndex: 0, duration: 100 },
|
|
282
|
+
* { frameIndex: 1, duration: 100 },
|
|
283
|
+
* ],
|
|
284
|
+
* });
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
declare const AnimationOptionsSchema: z.ZodObject<{
|
|
288
|
+
name: z.ZodString;
|
|
289
|
+
frames: z.ZodArray<z.ZodObject<{
|
|
290
|
+
frameIndex: z.ZodNumber;
|
|
291
|
+
duration: z.ZodNumber;
|
|
292
|
+
}, z.core.$strip>>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
/**
|
|
295
|
+
* Schema for slider range (min must be less than max).
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* import { SliderRangeSchema } from 'blecsd';
|
|
300
|
+
*
|
|
301
|
+
* const range = SliderRangeSchema.parse({ min: 0, max: 100 });
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
declare const SliderRangeSchema: z.ZodObject<{
|
|
305
|
+
min: z.ZodNumber;
|
|
306
|
+
max: z.ZodNumber;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
/**
|
|
309
|
+
* Schema for slider step value (must be positive).
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```typescript
|
|
313
|
+
* import { SliderStepSchema } from 'blecsd';
|
|
314
|
+
*
|
|
315
|
+
* const step = SliderStepSchema.parse(0.5);
|
|
316
|
+
* ```
|
|
317
|
+
*/
|
|
318
|
+
declare const SliderStepSchema: z.ZodNumber;
|
|
319
|
+
/**
|
|
320
|
+
* Schema for slider percentage value (0-1).
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```typescript
|
|
324
|
+
* import { SliderPercentageSchema } from 'blecsd';
|
|
325
|
+
*
|
|
326
|
+
* const pct = SliderPercentageSchema.parse(0.75);
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
329
|
+
declare const SliderPercentageSchema: z.ZodNumber;
|
|
330
|
+
/**
|
|
331
|
+
* Schema for list behavior options (interactivity, navigation).
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* import { ListBehaviorOptionsSchema } from 'blecsd';
|
|
336
|
+
*
|
|
337
|
+
* const opts = ListBehaviorOptionsSchema.parse({
|
|
338
|
+
* interactive: true, mouse: true, keys: true,
|
|
339
|
+
* });
|
|
340
|
+
* ```
|
|
341
|
+
*/
|
|
342
|
+
declare const ListBehaviorOptionsSchema: z.ZodObject<{
|
|
343
|
+
interactive: z.ZodOptional<z.ZodBoolean>;
|
|
344
|
+
mouse: z.ZodOptional<z.ZodBoolean>;
|
|
345
|
+
keys: z.ZodOptional<z.ZodBoolean>;
|
|
346
|
+
search: z.ZodOptional<z.ZodBoolean>;
|
|
347
|
+
selectedIndex: z.ZodOptional<z.ZodNumber>;
|
|
348
|
+
visibleCount: z.ZodOptional<z.ZodNumber>;
|
|
349
|
+
}, z.core.$strip>;
|
|
350
|
+
/**
|
|
351
|
+
* Schema for a list item (text, optional value, disabled state).
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```typescript
|
|
355
|
+
* import { ListItemSchema } from 'blecsd';
|
|
356
|
+
*
|
|
357
|
+
* const item = ListItemSchema.parse({ text: 'Option A', value: 'a' });
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
declare const ListItemSchema: z.ZodObject<{
|
|
361
|
+
text: z.ZodString;
|
|
362
|
+
value: z.ZodOptional<z.ZodString>;
|
|
363
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
364
|
+
}, z.core.$strip>;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Zod validation schemas for game loop configuration.
|
|
368
|
+
*
|
|
369
|
+
* Validates timing, fixed timestep, and FPS configuration
|
|
370
|
+
* used by the game loop and scheduler.
|
|
371
|
+
*
|
|
372
|
+
* @module schemas/gameLoop
|
|
373
|
+
*/
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Schema for fixed timestep mode configuration.
|
|
377
|
+
*
|
|
378
|
+
* Fixed timestep runs game logic at a consistent rate, independent
|
|
379
|
+
* of the rendering frame rate. Essential for deterministic physics,
|
|
380
|
+
* network synchronization, and replays.
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```typescript
|
|
384
|
+
* import { FixedTimestepConfigSchema } from 'blecsd';
|
|
385
|
+
*
|
|
386
|
+
* const config = FixedTimestepConfigSchema.parse({
|
|
387
|
+
* tickRate: 60,
|
|
388
|
+
* maxUpdatesPerFrame: 5,
|
|
389
|
+
* interpolate: true,
|
|
390
|
+
* });
|
|
391
|
+
* ```
|
|
392
|
+
*/
|
|
393
|
+
declare const FixedTimestepConfigSchema: z.ZodObject<{
|
|
394
|
+
tickRate: z.ZodNumber;
|
|
395
|
+
maxUpdatesPerFrame: z.ZodNumber;
|
|
396
|
+
interpolate: z.ZodBoolean;
|
|
397
|
+
}, z.core.$strip>;
|
|
398
|
+
/**
|
|
399
|
+
* Schema for game loop configuration options.
|
|
400
|
+
*
|
|
401
|
+
* Controls frame rate, timestep capping, and optional fixed
|
|
402
|
+
* timestep mode for deterministic updates.
|
|
403
|
+
*
|
|
404
|
+
* @example
|
|
405
|
+
* ```typescript
|
|
406
|
+
* import { GameLoopOptionsSchema } from 'blecsd';
|
|
407
|
+
*
|
|
408
|
+
* const options = GameLoopOptionsSchema.parse({
|
|
409
|
+
* targetFPS: 60,
|
|
410
|
+
* maxDeltaTime: 0.1,
|
|
411
|
+
* });
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
declare const GameLoopOptionsSchema: z.ZodObject<{
|
|
415
|
+
targetFPS: z.ZodOptional<z.ZodNumber>;
|
|
416
|
+
fixedTimestep: z.ZodOptional<z.ZodBoolean>;
|
|
417
|
+
maxDeltaTime: z.ZodOptional<z.ZodNumber>;
|
|
418
|
+
fixedTimestepMode: z.ZodOptional<z.ZodObject<{
|
|
419
|
+
tickRate: z.ZodNumber;
|
|
420
|
+
maxUpdatesPerFrame: z.ZodNumber;
|
|
421
|
+
interpolate: z.ZodBoolean;
|
|
422
|
+
}, z.core.$strip>>;
|
|
423
|
+
}, z.core.$strip>;
|
|
424
|
+
/**
|
|
425
|
+
* Schema for loop performance statistics.
|
|
426
|
+
*
|
|
427
|
+
* Validates the shape of performance data returned by the game loop,
|
|
428
|
+
* including FPS, frame time, tick counts, and interpolation state.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```typescript
|
|
432
|
+
* import { LoopStatsSchema } from 'blecsd';
|
|
433
|
+
*
|
|
434
|
+
* const stats = LoopStatsSchema.parse({
|
|
435
|
+
* fps: 60,
|
|
436
|
+
* frameTime: 16.67,
|
|
437
|
+
* frameCount: 3600,
|
|
438
|
+
* runningTime: 60,
|
|
439
|
+
* tickCount: 3600,
|
|
440
|
+
* ticksPerSecond: 60,
|
|
441
|
+
* interpolationAlpha: 0.5,
|
|
442
|
+
* skippedUpdates: 0,
|
|
443
|
+
* });
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
446
|
+
declare const LoopStatsSchema: z.ZodObject<{
|
|
447
|
+
fps: z.ZodNumber;
|
|
448
|
+
frameTime: z.ZodNumber;
|
|
449
|
+
frameCount: z.ZodNumber;
|
|
450
|
+
runningTime: z.ZodNumber;
|
|
451
|
+
tickCount: z.ZodNumber;
|
|
452
|
+
ticksPerSecond: z.ZodNumber;
|
|
453
|
+
interpolationAlpha: z.ZodNumber;
|
|
454
|
+
skippedUpdates: z.ZodNumber;
|
|
455
|
+
}, z.core.$strip>;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Zod validation schemas for system configuration and boundaries.
|
|
459
|
+
* @module schemas/systems
|
|
460
|
+
*/
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Schema for grid snap configuration (positive x/y step sizes).
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* ```typescript
|
|
467
|
+
* import { SnapToGridSchema } from 'blecsd';
|
|
468
|
+
*
|
|
469
|
+
* const snap = SnapToGridSchema.parse({ x: 10, y: 10 });
|
|
470
|
+
* ```
|
|
471
|
+
*/
|
|
472
|
+
declare const SnapToGridSchema: z.ZodNullable<z.ZodObject<{
|
|
473
|
+
x: z.ZodNumber;
|
|
474
|
+
y: z.ZodNumber;
|
|
475
|
+
}, z.core.$strip>>;
|
|
476
|
+
/**
|
|
477
|
+
* Schema for drag constraint configuration with axis locking, bounds, and grid snapping.
|
|
478
|
+
*
|
|
479
|
+
* @example
|
|
480
|
+
* ```typescript
|
|
481
|
+
* import { DragConstraintsSchema } from 'blecsd';
|
|
482
|
+
*
|
|
483
|
+
* const constraints = DragConstraintsSchema.parse({
|
|
484
|
+
* constrainToParent: true,
|
|
485
|
+
* constrainAxis: 'x',
|
|
486
|
+
* minX: 0, maxX: 100,
|
|
487
|
+
* });
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
declare const DragConstraintsSchema: z.ZodObject<{
|
|
491
|
+
constrainToParent: z.ZodOptional<z.ZodBoolean>;
|
|
492
|
+
constrainAxis: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
493
|
+
x: "x";
|
|
494
|
+
y: "y";
|
|
495
|
+
}>>>;
|
|
496
|
+
snapToGrid: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
497
|
+
x: z.ZodNumber;
|
|
498
|
+
y: z.ZodNumber;
|
|
499
|
+
}, z.core.$strip>>>;
|
|
500
|
+
minX: z.ZodOptional<z.ZodNumber>;
|
|
501
|
+
maxX: z.ZodOptional<z.ZodNumber>;
|
|
502
|
+
minY: z.ZodOptional<z.ZodNumber>;
|
|
503
|
+
maxY: z.ZodOptional<z.ZodNumber>;
|
|
504
|
+
bringToFront: z.ZodOptional<z.ZodBoolean>;
|
|
505
|
+
frontZIndex: z.ZodOptional<z.ZodNumber>;
|
|
506
|
+
}, z.core.$strip>;
|
|
507
|
+
/**
|
|
508
|
+
* Schema for queued key event data.
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* ```typescript
|
|
512
|
+
* import { QueuedKeyEventSchema } from 'blecsd';
|
|
513
|
+
*
|
|
514
|
+
* const event = QueuedKeyEventSchema.parse({ type: 'key', key: 'enter' });
|
|
515
|
+
* ```
|
|
516
|
+
*/
|
|
517
|
+
declare const QueuedKeyEventSchema: z.ZodObject<{
|
|
518
|
+
type: z.ZodLiteral<"key">;
|
|
519
|
+
key: z.ZodString;
|
|
520
|
+
raw: z.ZodOptional<z.ZodString>;
|
|
521
|
+
}, z.core.$strip>;
|
|
522
|
+
/**
|
|
523
|
+
* Schema for queued mouse event data.
|
|
524
|
+
*
|
|
525
|
+
* @example
|
|
526
|
+
* ```typescript
|
|
527
|
+
* import { QueuedMouseEventSchema } from 'blecsd';
|
|
528
|
+
*
|
|
529
|
+
* const event = QueuedMouseEventSchema.parse({
|
|
530
|
+
* type: 'mouse', action: 'click', x: 10, y: 20,
|
|
531
|
+
* });
|
|
532
|
+
* ```
|
|
533
|
+
*/
|
|
534
|
+
declare const QueuedMouseEventSchema: z.ZodObject<{
|
|
535
|
+
type: z.ZodLiteral<"mouse">;
|
|
536
|
+
action: z.ZodString;
|
|
537
|
+
x: z.ZodNumber;
|
|
538
|
+
y: z.ZodNumber;
|
|
539
|
+
button: z.ZodOptional<z.ZodString>;
|
|
540
|
+
}, z.core.$strip>;
|
|
541
|
+
/**
|
|
542
|
+
* Schema for queued input events — discriminated union of key and mouse events.
|
|
543
|
+
*
|
|
544
|
+
* @example
|
|
545
|
+
* ```typescript
|
|
546
|
+
* import { QueuedInputEventSchema } from 'blecsd';
|
|
547
|
+
*
|
|
548
|
+
* const event = QueuedInputEventSchema.parse({ type: 'key', key: 'a' });
|
|
549
|
+
* ```
|
|
550
|
+
*/
|
|
551
|
+
declare const QueuedInputEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
552
|
+
type: z.ZodLiteral<"key">;
|
|
553
|
+
key: z.ZodString;
|
|
554
|
+
raw: z.ZodOptional<z.ZodString>;
|
|
555
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
556
|
+
type: z.ZodLiteral<"mouse">;
|
|
557
|
+
action: z.ZodString;
|
|
558
|
+
x: z.ZodNumber;
|
|
559
|
+
y: z.ZodNumber;
|
|
560
|
+
button: z.ZodOptional<z.ZodString>;
|
|
561
|
+
}, z.core.$strip>], "type">;
|
|
562
|
+
/**
|
|
563
|
+
* Schema for output state tracking (cursor position, colors, screen mode).
|
|
564
|
+
*
|
|
565
|
+
* @example
|
|
566
|
+
* ```typescript
|
|
567
|
+
* import { OutputStateSchema } from 'blecsd';
|
|
568
|
+
*
|
|
569
|
+
* const state = OutputStateSchema.parse({
|
|
570
|
+
* lastX: 0, lastY: 0,
|
|
571
|
+
* lastFg: 0xffffffff, lastBg: 0x000000ff,
|
|
572
|
+
* lastAttrs: 0, alternateScreen: false,
|
|
573
|
+
* });
|
|
574
|
+
* ```
|
|
575
|
+
*/
|
|
576
|
+
declare const OutputStateSchema: z.ZodObject<{
|
|
577
|
+
lastX: z.ZodNumber;
|
|
578
|
+
lastY: z.ZodNumber;
|
|
579
|
+
lastFg: z.ZodNumber;
|
|
580
|
+
lastBg: z.ZodNumber;
|
|
581
|
+
lastAttrs: z.ZodNumber;
|
|
582
|
+
alternateScreen: z.ZodBoolean;
|
|
583
|
+
}, z.core.$strip>;
|
|
584
|
+
/**
|
|
585
|
+
* Schema for computed layout data (position + dimensions).
|
|
586
|
+
*
|
|
587
|
+
* @example
|
|
588
|
+
* ```typescript
|
|
589
|
+
* import { ComputedLayoutSchema } from 'blecsd';
|
|
590
|
+
*
|
|
591
|
+
* const layout = ComputedLayoutSchema.parse({ x: 10, y: 5, width: 80, height: 24 });
|
|
592
|
+
* ```
|
|
593
|
+
*/
|
|
594
|
+
declare const ComputedLayoutSchema: z.ZodObject<{
|
|
595
|
+
x: z.ZodNumber;
|
|
596
|
+
y: z.ZodNumber;
|
|
597
|
+
width: z.ZodNumber;
|
|
598
|
+
height: z.ZodNumber;
|
|
599
|
+
}, z.core.$strip>;
|
|
600
|
+
/**
|
|
601
|
+
* Schema for entity bounds used in rendering (position, size, z-order).
|
|
602
|
+
*
|
|
603
|
+
* @example
|
|
604
|
+
* ```typescript
|
|
605
|
+
* import { EntityBoundsSchema } from 'blecsd';
|
|
606
|
+
*
|
|
607
|
+
* const bounds = EntityBoundsSchema.parse({ x: 0, y: 0, width: 40, height: 12, z: 10 });
|
|
608
|
+
* ```
|
|
609
|
+
*/
|
|
610
|
+
declare const EntityBoundsSchema: z.ZodObject<{
|
|
611
|
+
x: z.ZodNumber;
|
|
612
|
+
y: z.ZodNumber;
|
|
613
|
+
width: z.ZodNumber;
|
|
614
|
+
height: z.ZodNumber;
|
|
615
|
+
z: z.ZodNumber;
|
|
616
|
+
}, z.core.$strip>;
|
|
617
|
+
/**
|
|
618
|
+
* Schema for focus event types ('focus' | 'blur').
|
|
619
|
+
*
|
|
620
|
+
* @example
|
|
621
|
+
* ```typescript
|
|
622
|
+
* import { FocusEventTypeSchema } from 'blecsd';
|
|
623
|
+
*
|
|
624
|
+
* const type = FocusEventTypeSchema.parse('focus');
|
|
625
|
+
* ```
|
|
626
|
+
*/
|
|
627
|
+
declare const FocusEventTypeSchema: z.ZodEnum<{
|
|
628
|
+
focus: "focus";
|
|
629
|
+
blur: "blur";
|
|
630
|
+
}>;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Zod validation schemas for terminal module configuration.
|
|
634
|
+
*
|
|
635
|
+
* Provides runtime validation for process spawning, command execution,
|
|
636
|
+
* and editor options used by the terminal process utilities.
|
|
637
|
+
*
|
|
638
|
+
* @module schemas/terminal
|
|
639
|
+
*/
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Schema for valid Node.js buffer encodings.
|
|
643
|
+
*
|
|
644
|
+
* @example
|
|
645
|
+
* ```typescript
|
|
646
|
+
* import { BufferEncodingSchema } from 'blecsd';
|
|
647
|
+
*
|
|
648
|
+
* const encoding = BufferEncodingSchema.parse('utf8'); // OK
|
|
649
|
+
* BufferEncodingSchema.parse('invalid'); // throws
|
|
650
|
+
* ```
|
|
651
|
+
*/
|
|
652
|
+
declare const BufferEncodingSchema: z.ZodEnum<{
|
|
653
|
+
ascii: "ascii";
|
|
654
|
+
utf8: "utf8";
|
|
655
|
+
"utf-8": "utf-8";
|
|
656
|
+
utf16le: "utf16le";
|
|
657
|
+
"utf-16le": "utf-16le";
|
|
658
|
+
ucs2: "ucs2";
|
|
659
|
+
"ucs-2": "ucs-2";
|
|
660
|
+
base64: "base64";
|
|
661
|
+
base64url: "base64url";
|
|
662
|
+
latin1: "latin1";
|
|
663
|
+
binary: "binary";
|
|
664
|
+
hex: "hex";
|
|
665
|
+
}>;
|
|
666
|
+
/**
|
|
667
|
+
* Schema for process spawn options.
|
|
668
|
+
*
|
|
669
|
+
* Validates the configuration for spawning child processes with
|
|
670
|
+
* proper terminal state management. Stream and callback fields
|
|
671
|
+
* are not validated at runtime (they rely on TypeScript types).
|
|
672
|
+
*
|
|
673
|
+
* @example
|
|
674
|
+
* ```typescript
|
|
675
|
+
* import { SpawnOptionsSchema } from 'blecsd';
|
|
676
|
+
*
|
|
677
|
+
* const options = SpawnOptionsSchema.parse({
|
|
678
|
+
* isAlternateBuffer: true,
|
|
679
|
+
* isMouseEnabled: false,
|
|
680
|
+
* });
|
|
681
|
+
* ```
|
|
682
|
+
*/
|
|
683
|
+
declare const SpawnOptionsSchema: z.ZodObject<{
|
|
684
|
+
isAlternateBuffer: z.ZodOptional<z.ZodBoolean>;
|
|
685
|
+
isMouseEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
686
|
+
}, z.core.$strip>;
|
|
687
|
+
/**
|
|
688
|
+
* Schema for process execution options.
|
|
689
|
+
*
|
|
690
|
+
* Extends spawn options with timeout, buffer size, and encoding
|
|
691
|
+
* for capturing process output.
|
|
692
|
+
*
|
|
693
|
+
* @example
|
|
694
|
+
* ```typescript
|
|
695
|
+
* import { ExecOptionsSchema } from 'blecsd';
|
|
696
|
+
*
|
|
697
|
+
* const options = ExecOptionsSchema.parse({
|
|
698
|
+
* timeout: 5000,
|
|
699
|
+
* maxBuffer: 1024 * 1024,
|
|
700
|
+
* encoding: 'utf8',
|
|
701
|
+
* isAlternateBuffer: false,
|
|
702
|
+
* });
|
|
703
|
+
* ```
|
|
704
|
+
*/
|
|
705
|
+
declare const ExecOptionsSchema: z.ZodObject<{
|
|
706
|
+
isAlternateBuffer: z.ZodOptional<z.ZodBoolean>;
|
|
707
|
+
isMouseEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
708
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
709
|
+
maxBuffer: z.ZodOptional<z.ZodNumber>;
|
|
710
|
+
encoding: z.ZodOptional<z.ZodEnum<{
|
|
711
|
+
ascii: "ascii";
|
|
712
|
+
utf8: "utf8";
|
|
713
|
+
"utf-8": "utf-8";
|
|
714
|
+
utf16le: "utf16le";
|
|
715
|
+
"utf-16le": "utf-16le";
|
|
716
|
+
ucs2: "ucs2";
|
|
717
|
+
"ucs-2": "ucs-2";
|
|
718
|
+
base64: "base64";
|
|
719
|
+
base64url: "base64url";
|
|
720
|
+
latin1: "latin1";
|
|
721
|
+
binary: "binary";
|
|
722
|
+
hex: "hex";
|
|
723
|
+
}>>;
|
|
724
|
+
}, z.core.$strip>;
|
|
725
|
+
/**
|
|
726
|
+
* Schema for external editor options.
|
|
727
|
+
*
|
|
728
|
+
* Validates configuration for opening an external text editor,
|
|
729
|
+
* including initial content, file extension, and editor command.
|
|
730
|
+
*
|
|
731
|
+
* @example
|
|
732
|
+
* ```typescript
|
|
733
|
+
* import { EditorOptionsSchema } from 'blecsd';
|
|
734
|
+
*
|
|
735
|
+
* const options = EditorOptionsSchema.parse({
|
|
736
|
+
* content: '# Hello',
|
|
737
|
+
* extension: '.md',
|
|
738
|
+
* editor: 'vim',
|
|
739
|
+
* });
|
|
740
|
+
* ```
|
|
741
|
+
*/
|
|
742
|
+
declare const EditorOptionsSchema: z.ZodObject<{
|
|
743
|
+
content: z.ZodOptional<z.ZodString>;
|
|
744
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
745
|
+
editor: z.ZodOptional<z.ZodString>;
|
|
746
|
+
isAlternateBuffer: z.ZodOptional<z.ZodBoolean>;
|
|
747
|
+
isMouseEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
748
|
+
}, z.core.$strip>;
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Zod validation schemas for widget configurations.
|
|
752
|
+
*
|
|
753
|
+
* Enhances existing widget schemas with proper bounds validation
|
|
754
|
+
* for colors, dimensions, intervals, and paths.
|
|
755
|
+
*
|
|
756
|
+
* @module schemas/widgets
|
|
757
|
+
*/
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Schema for packed RGBA color values (0x00000000 - 0xFFFFFFFF).
|
|
761
|
+
*
|
|
762
|
+
* @example
|
|
763
|
+
* ```typescript
|
|
764
|
+
* import { PackedColorSchema } from 'blecsd';
|
|
765
|
+
*
|
|
766
|
+
* const color = PackedColorSchema.parse(0xff0000ff); // red, full opacity
|
|
767
|
+
* ```
|
|
768
|
+
*/
|
|
769
|
+
declare const PackedColorSchema: z.ZodNumber;
|
|
770
|
+
/**
|
|
771
|
+
* Schema for color values — hex strings (#rgb, #rrggbb, #rrggbbaa) or packed numbers.
|
|
772
|
+
*
|
|
773
|
+
* @example
|
|
774
|
+
* ```typescript
|
|
775
|
+
* import { WidgetColorSchema } from 'blecsd';
|
|
776
|
+
*
|
|
777
|
+
* WidgetColorSchema.parse('#ff0000'); // hex string
|
|
778
|
+
* WidgetColorSchema.parse(0xff0000ff); // packed RGBA
|
|
779
|
+
* ```
|
|
780
|
+
*/
|
|
781
|
+
declare const WidgetColorSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
782
|
+
/**
|
|
783
|
+
* Schema for positive widget dimensions — number (cells), percentage, or 'auto'.
|
|
784
|
+
*
|
|
785
|
+
* @example
|
|
786
|
+
* ```typescript
|
|
787
|
+
* import { WidgetDimensionSchema } from 'blecsd';
|
|
788
|
+
*
|
|
789
|
+
* WidgetDimensionSchema.parse(80); // 80 cells
|
|
790
|
+
* WidgetDimensionSchema.parse('50%'); // 50% of parent
|
|
791
|
+
* WidgetDimensionSchema.parse('auto'); // auto-size
|
|
792
|
+
* ```
|
|
793
|
+
*/
|
|
794
|
+
declare const WidgetDimensionSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodLiteral<"auto">]>;
|
|
795
|
+
/**
|
|
796
|
+
* Schema for widget position values — number, percentage, or keyword.
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
* ```typescript
|
|
800
|
+
* import { WidgetPositionSchema } from 'blecsd';
|
|
801
|
+
*
|
|
802
|
+
* WidgetPositionSchema.parse(10); // absolute position
|
|
803
|
+
* WidgetPositionSchema.parse('center'); // centered
|
|
804
|
+
* ```
|
|
805
|
+
*/
|
|
806
|
+
declare const WidgetPositionSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodEnum<{
|
|
807
|
+
left: "left";
|
|
808
|
+
top: "top";
|
|
809
|
+
right: "right";
|
|
810
|
+
bottom: "bottom";
|
|
811
|
+
center: "center";
|
|
812
|
+
}>]>;
|
|
813
|
+
/**
|
|
814
|
+
* Schema for animation/spinner interval in milliseconds (10-60000).
|
|
815
|
+
*
|
|
816
|
+
* @example
|
|
817
|
+
* ```typescript
|
|
818
|
+
* import { IntervalSchema } from 'blecsd';
|
|
819
|
+
*
|
|
820
|
+
* const interval = IntervalSchema.parse(200); // 200ms
|
|
821
|
+
* ```
|
|
822
|
+
*/
|
|
823
|
+
declare const IntervalSchema: z.ZodNumber;
|
|
824
|
+
/**
|
|
825
|
+
* Schema for speed multiplier (0.1x to 10x).
|
|
826
|
+
*
|
|
827
|
+
* @example
|
|
828
|
+
* ```typescript
|
|
829
|
+
* import { SpeedMultiplierSchema } from 'blecsd';
|
|
830
|
+
*
|
|
831
|
+
* const speed = SpeedMultiplierSchema.parse(2.0); // 2x speed
|
|
832
|
+
* ```
|
|
833
|
+
*/
|
|
834
|
+
declare const SpeedMultiplierSchema: z.ZodNumber;
|
|
835
|
+
/**
|
|
836
|
+
* Schema for file/directory paths. Rejects empty strings and null byte injection.
|
|
837
|
+
*
|
|
838
|
+
* @example
|
|
839
|
+
* ```typescript
|
|
840
|
+
* import { FilePathSchema } from 'blecsd';
|
|
841
|
+
*
|
|
842
|
+
* const path = FilePathSchema.parse('/usr/local/bin/app');
|
|
843
|
+
* ```
|
|
844
|
+
*/
|
|
845
|
+
declare const FilePathSchema: z.ZodString;
|
|
846
|
+
/**
|
|
847
|
+
* Schema for text alignment ('left' | 'center' | 'right').
|
|
848
|
+
*
|
|
849
|
+
* @example
|
|
850
|
+
* ```typescript
|
|
851
|
+
* import { TextAlignSchema } from 'blecsd';
|
|
852
|
+
*
|
|
853
|
+
* const align = TextAlignSchema.parse('center');
|
|
854
|
+
* ```
|
|
855
|
+
*/
|
|
856
|
+
declare const TextAlignSchema: z.ZodEnum<{
|
|
857
|
+
left: "left";
|
|
858
|
+
right: "right";
|
|
859
|
+
center: "center";
|
|
860
|
+
}>;
|
|
861
|
+
/**
|
|
862
|
+
* Schema for vertical alignment ('top' | 'middle' | 'bottom').
|
|
863
|
+
*
|
|
864
|
+
* @example
|
|
865
|
+
* ```typescript
|
|
866
|
+
* import { VAlignSchema } from 'blecsd';
|
|
867
|
+
*
|
|
868
|
+
* const valign = VAlignSchema.parse('middle');
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
declare const VAlignSchema: z.ZodEnum<{
|
|
872
|
+
top: "top";
|
|
873
|
+
bottom: "bottom";
|
|
874
|
+
middle: "middle";
|
|
875
|
+
}>;
|
|
876
|
+
/**
|
|
877
|
+
* Schema for border configuration — boolean toggle or detailed object.
|
|
878
|
+
*
|
|
879
|
+
* @example
|
|
880
|
+
* ```typescript
|
|
881
|
+
* import { WidgetBorderSchema } from 'blecsd';
|
|
882
|
+
*
|
|
883
|
+
* WidgetBorderSchema.parse(true); // simple toggle
|
|
884
|
+
* WidgetBorderSchema.parse({ type: 'line', fg: '#ff0000' }); // detailed
|
|
885
|
+
* ```
|
|
886
|
+
*/
|
|
887
|
+
declare const WidgetBorderSchema: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
888
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
889
|
+
bg: "bg";
|
|
890
|
+
none: "none";
|
|
891
|
+
line: "line";
|
|
892
|
+
}>>;
|
|
893
|
+
fg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
894
|
+
bg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
895
|
+
}, z.core.$strip>]>>;
|
|
896
|
+
/**
|
|
897
|
+
* Schema for widget padding — uniform number or per-side object.
|
|
898
|
+
*
|
|
899
|
+
* @example
|
|
900
|
+
* ```typescript
|
|
901
|
+
* import { WidgetPaddingSchema } from 'blecsd';
|
|
902
|
+
*
|
|
903
|
+
* WidgetPaddingSchema.parse(2); // uniform padding
|
|
904
|
+
* WidgetPaddingSchema.parse({ left: 1, right: 1 }); // per-side
|
|
905
|
+
* ```
|
|
906
|
+
*/
|
|
907
|
+
declare const WidgetPaddingSchema: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
908
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
909
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
910
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
911
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
912
|
+
}, z.core.$strip>]>>;
|
|
913
|
+
/**
|
|
914
|
+
* Schema for opacity value (0 = transparent, 1 = opaque).
|
|
915
|
+
*
|
|
916
|
+
* @example
|
|
917
|
+
* ```typescript
|
|
918
|
+
* import { OpacitySchema } from 'blecsd';
|
|
919
|
+
*
|
|
920
|
+
* const opacity = OpacitySchema.parse(0.5);
|
|
921
|
+
* ```
|
|
922
|
+
*/
|
|
923
|
+
declare const OpacitySchema: z.ZodNumber;
|
|
924
|
+
/**
|
|
925
|
+
* Schema for tree widget path format. Rejects empty strings and null bytes.
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* ```typescript
|
|
929
|
+
* import { TreePathSchema } from 'blecsd';
|
|
930
|
+
*
|
|
931
|
+
* const path = TreePathSchema.parse('/root/child/leaf');
|
|
932
|
+
* ```
|
|
933
|
+
*/
|
|
934
|
+
declare const TreePathSchema: z.ZodString;
|
|
935
|
+
|
|
936
|
+
export { AnimationFrameSchema, AnimationOptionsSchema, BufferEncodingSchema, type ColorString, ColorStringSchema, ComputedLayoutSchema, type Dimension, DimensionConstraintsSchema, DimensionSchema, DimensionValueSchema, DragConstraintsSchema, EditorOptionsSchema, EntityBoundsSchema, ExecOptionsSchema, FilePathSchema, FixedTimestepConfigSchema, FocusEventTypeSchema, GameLoopOptionsSchema, IntervalSchema, ListBehaviorOptionsSchema, ListItemSchema, LoopStatsSchema, type NonNegativeInt, NonNegativeIntSchema, OpacitySchema, OutputStateSchema, PackedColorSchema, PaddingOptionsSchema, PaddingValueSchema, type Percentage, PercentageSchema, type PositionValue, PositionValueSchema, type PositiveInt, PositiveIntSchema, QueuedInputEventSchema, QueuedKeyEventSchema, QueuedMouseEventSchema, ScrollableOptionsSchema, SetDimensionsSchema, SetPositionSchema, SliderPercentageSchema, SliderRangeSchema, SliderStepSchema, SnapToGridSchema, SpawnOptionsSchema, SpeedMultiplierSchema, StyleColorSchema, StyleOptionsSchema, TextAlignSchema, TreePathSchema, VAlignSchema, WidgetBorderSchema, WidgetColorSchema, WidgetDimensionSchema, WidgetPaddingSchema, WidgetPositionSchema, ZIndexSchema };
|