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.
Files changed (109) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +220 -0
  3. package/dist/3d/index.d.ts +5 -0
  4. package/dist/3d/index.js +1 -0
  5. package/dist/audio/index.d.ts +177 -0
  6. package/dist/audio/index.js +1 -0
  7. package/dist/border-D_Jb4ZJV.d.ts +257 -0
  8. package/dist/cell-DwIu2ryP.d.ts +505 -0
  9. package/dist/chunk-2UBBZFE4.js +1 -0
  10. package/dist/chunk-35LCBY6P.js +1 -0
  11. package/dist/chunk-3B7MIVW6.js +1 -0
  12. package/dist/chunk-3EGGGI5J.js +3 -0
  13. package/dist/chunk-4LWWONFK.js +1 -0
  14. package/dist/chunk-4X4N4HNQ.js +2 -0
  15. package/dist/chunk-5PELJRUQ.js +1 -0
  16. package/dist/chunk-AEJIX2MW.js +1 -0
  17. package/dist/chunk-AQ7LW75B.js +1 -0
  18. package/dist/chunk-AXZQAH4X.js +1 -0
  19. package/dist/chunk-B6Z2JFRY.js +1 -0
  20. package/dist/chunk-BCADUCOZ.js +1 -0
  21. package/dist/chunk-C5PCEQ6G.js +1 -0
  22. package/dist/chunk-CIK4AMUA.js +1 -0
  23. package/dist/chunk-DNRXW56C.js +1 -0
  24. package/dist/chunk-FC5FFAAC.js +12 -0
  25. package/dist/chunk-FGHEFXLK.js +1 -0
  26. package/dist/chunk-FYEBZAWN.js +1 -0
  27. package/dist/chunk-G7GIWWLE.js +1 -0
  28. package/dist/chunk-GYHI26UE.js +1 -0
  29. package/dist/chunk-H2YAOJDW.js +1 -0
  30. package/dist/chunk-J4JZ2NU2.js +1 -0
  31. package/dist/chunk-JKVHO4LH.js +1 -0
  32. package/dist/chunk-K2B2OXQ5.js +5 -0
  33. package/dist/chunk-K37L3G4Z.js +4 -0
  34. package/dist/chunk-KD55INV7.js +1 -0
  35. package/dist/chunk-KFAK4A3G.js +1 -0
  36. package/dist/chunk-LCN2ZITE.js +1 -0
  37. package/dist/chunk-LYSK5S63.js +1 -0
  38. package/dist/chunk-NZ55KBM6.js +1 -0
  39. package/dist/chunk-OMMJ7B5P.js +1 -0
  40. package/dist/chunk-OUXUPF3V.js +33 -0
  41. package/dist/chunk-OVT2PPGW.js +19 -0
  42. package/dist/chunk-P6CJO3BC.js +1 -0
  43. package/dist/chunk-PSXXMBVJ.js +1 -0
  44. package/dist/chunk-PXXGH3BV.js +1 -0
  45. package/dist/chunk-QIKIOVP2.js +1 -0
  46. package/dist/chunk-SHUC6JWA.js +1 -0
  47. package/dist/chunk-TDXJDLY6.js +6 -0
  48. package/dist/chunk-TWSWTBYL.js +1 -0
  49. package/dist/chunk-TYMY2TBR.js +3 -0
  50. package/dist/chunk-VNZ6CWJA.js +2 -0
  51. package/dist/chunk-VOCM5T2G.js +5 -0
  52. package/dist/chunk-W5OU7Z6J.js +1 -0
  53. package/dist/chunk-WNG4A3K7.js +4 -0
  54. package/dist/chunk-XQIGERNI.js +1 -0
  55. package/dist/chunk-XZA63ZPO.js +1 -0
  56. package/dist/chunk-YAMOSPWB.js +4 -0
  57. package/dist/chunk-YD6ULIUR.js +1 -0
  58. package/dist/chunk-Z4EZERNE.js +1 -0
  59. package/dist/cli/init.d.ts +86 -0
  60. package/dist/cli/init.js +179 -0
  61. package/dist/color-B78w3zH-.d.ts +79 -0
  62. package/dist/components/index.d.ts +10298 -0
  63. package/dist/components/index.js +1 -0
  64. package/dist/core/index.d.ts +6700 -0
  65. package/dist/core/index.js +1 -0
  66. package/dist/debug/index.d.ts +711 -0
  67. package/dist/debug/index.js +1 -0
  68. package/dist/doubleBuffer-CKQFmlPN.d.ts +95 -0
  69. package/dist/errors/index.d.ts +1110 -0
  70. package/dist/errors/index.js +1 -0
  71. package/dist/events-BbbxkgvX.d.ts +125 -0
  72. package/dist/game/index.d.ts +486 -0
  73. package/dist/game/index.js +1 -0
  74. package/dist/gameLoop-BIPW7-OY.d.ts +219 -0
  75. package/dist/index-zSGJ2eUk.d.ts +3156 -0
  76. package/dist/index.d.ts +246 -0
  77. package/dist/index.js +1 -0
  78. package/dist/input/index.d.ts +158 -0
  79. package/dist/input/index.js +1 -0
  80. package/dist/inputActions-CefRUBuT.d.ts +2637 -0
  81. package/dist/keyParser-Bwm8-l7v.d.ts +229 -0
  82. package/dist/mouseParser-Cfrbn3AX.d.ts +177 -0
  83. package/dist/parser-iMHmQuUh.d.ts +265 -0
  84. package/dist/program-BZaKqDKH.d.ts +141 -0
  85. package/dist/renderable-jTMOA-GK.d.ts +302 -0
  86. package/dist/scheduler-DcfoFuum.d.ts +86 -0
  87. package/dist/schemas/index.d.ts +936 -0
  88. package/dist/schemas/index.js +1 -0
  89. package/dist/systems/index.d.ts +4036 -0
  90. package/dist/systems/index.js +1 -0
  91. package/dist/terminal/index.d.ts +7357 -0
  92. package/dist/terminal/index.js +1 -0
  93. package/dist/terminus-14-bold-HWSPRLJD.js +1 -0
  94. package/dist/terminus-14-normal-T3SWMH4D.js +1 -0
  95. package/dist/tilemap-D1HJvKy3.d.ts +1211 -0
  96. package/dist/types-BcsvoKzf.d.ts +68 -0
  97. package/dist/utils/index.d.ts +6104 -0
  98. package/dist/utils/index.js +1 -0
  99. package/dist/viewport3d-xI33-_wq.d.ts +182 -0
  100. package/dist/virtualScrollback-DvZTRU8a.d.ts +274 -0
  101. package/dist/virtualViewport-Dx2iJliO.d.ts +2334 -0
  102. package/dist/virtualizedLineStore-DwPEvPkk.d.ts +297 -0
  103. package/dist/widgets/bigText.d.ts +230 -0
  104. package/dist/widgets/bigText.js +1 -0
  105. package/dist/widgets/fonts/index.d.ts +211 -0
  106. package/dist/widgets/fonts/index.js +1 -0
  107. package/dist/widgets/index.d.ts +8591 -0
  108. package/dist/widgets/index.js +1 -0
  109. package/package.json +213 -0
@@ -0,0 +1,95 @@
1
+ import { S as ScreenBufferData, C as Cell } from './cell-DwIu2ryP.js';
2
+
3
+ /**
4
+ * Double Buffering System
5
+ *
6
+ * Provides efficient rendering through double buffering. The system maintains
7
+ * two buffers (front and back), tracks dirty regions, and computes minimal
8
+ * update sets for efficient terminal output.
9
+ *
10
+ * @module terminal/screen/doubleBuffer
11
+ * @internal This module is internal and used by the rendering system.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import {
16
+ * createDoubleBuffer,
17
+ * getBackBuffer,
18
+ * markDirtyRegion,
19
+ * swapBuffers,
20
+ * getMinimalUpdates,
21
+ * } from 'blecsd';
22
+ *
23
+ * // Create a double buffer
24
+ * const db = createDoubleBuffer(80, 24);
25
+ *
26
+ * // Write to back buffer
27
+ * const back = getBackBuffer(db);
28
+ * setCell(back, 10, 5, createCell('X'));
29
+ *
30
+ * // Mark the region as dirty
31
+ * markDirtyRegion(db, 10, 5, 1, 1);
32
+ *
33
+ * // Get minimal updates and swap
34
+ * const updates = getMinimalUpdates(db);
35
+ * swapBuffers(db);
36
+ *
37
+ * // Output only the changed cells
38
+ * for (const { x, y, cell } of updates) {
39
+ * outputCell(x, y, cell);
40
+ * }
41
+ * ```
42
+ */
43
+
44
+ /**
45
+ * A rectangular region of the screen.
46
+ */
47
+ interface Rect {
48
+ /** Left edge X coordinate */
49
+ readonly x: number;
50
+ /** Top edge Y coordinate */
51
+ readonly y: number;
52
+ /** Width of region */
53
+ readonly w: number;
54
+ /** Height of region */
55
+ readonly h: number;
56
+ }
57
+ /**
58
+ * Double buffer data structure.
59
+ *
60
+ * Maintains front and back buffers for efficient rendering,
61
+ * along with dirty region tracking.
62
+ */
63
+ interface DoubleBufferData {
64
+ /** Width of buffers */
65
+ readonly width: number;
66
+ /** Height of buffers */
67
+ readonly height: number;
68
+ /** Front buffer (currently displayed) */
69
+ frontBuffer: ScreenBufferData;
70
+ /** Back buffer (being rendered to) */
71
+ backBuffer: ScreenBufferData;
72
+ /** Dirty regions that need updating */
73
+ readonly dirtyRegions: Rect[];
74
+ /** Full redraw flag */
75
+ fullRedraw: boolean;
76
+ }
77
+ /**
78
+ * Creates a new double buffer system.
79
+ *
80
+ * @param width - Buffer width in cells
81
+ * @param height - Buffer height in cells
82
+ * @param defaultCell - Optional default cell for initialization
83
+ * @returns A new DoubleBufferData
84
+ * @throws {Error} If dimensions are not positive
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * import { createDoubleBuffer } from 'blecsd';
89
+ *
90
+ * const db = createDoubleBuffer(80, 24);
91
+ * ```
92
+ */
93
+ declare function createDoubleBuffer(width: number, height: number, defaultCell?: Cell): DoubleBufferData;
94
+
95
+ export { type DoubleBufferData as D, createDoubleBuffer as c };