elit 3.6.6 → 3.6.7

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 (153) hide show
  1. package/Cargo.lock +1 -1
  2. package/Cargo.toml +1 -1
  3. package/dist/build.cjs +421 -331
  4. package/dist/build.d.ts +1 -19
  5. package/dist/build.js +420 -330
  6. package/dist/build.mjs +420 -330
  7. package/dist/chokidar.cjs +219 -182
  8. package/dist/chokidar.d.ts +25 -10
  9. package/dist/chokidar.js +217 -182
  10. package/dist/chokidar.mjs +218 -183
  11. package/dist/cli.cjs +22439 -21563
  12. package/dist/cli.d.ts +19 -37
  13. package/dist/cli.mjs +24113 -23252
  14. package/dist/config.cjs +357 -350
  15. package/dist/config.d.ts +17 -245
  16. package/dist/config.js +520 -515
  17. package/dist/config.mjs +346 -341
  18. package/dist/contracts-BeW9k0yZ.d.ts +54 -0
  19. package/dist/contracts-D7KIS-TK.d.ts +36 -0
  20. package/dist/coverage.cjs +448 -485
  21. package/dist/coverage.d.ts +13 -62
  22. package/dist/coverage.js +447 -484
  23. package/dist/coverage.mjs +447 -484
  24. package/dist/database.cjs +819 -828
  25. package/dist/database.d.ts +8 -24
  26. package/dist/database.js +818 -829
  27. package/dist/database.mjs +818 -829
  28. package/dist/desktop-auto-render.cjs +1700 -1523
  29. package/dist/desktop-auto-render.d.ts +4 -12
  30. package/dist/desktop-auto-render.js +1695 -1518
  31. package/dist/desktop-auto-render.mjs +1696 -1519
  32. package/dist/desktop.cjs +3 -1
  33. package/dist/desktop.d.ts +4 -1
  34. package/dist/desktop.js +1 -1
  35. package/dist/desktop.mjs +1 -1
  36. package/dist/dev-build.cjs +830 -0
  37. package/dist/dev-build.d.ts +53 -0
  38. package/dist/dev-build.js +3318 -0
  39. package/dist/dev-build.mjs +797 -0
  40. package/dist/dom.cjs +717 -591
  41. package/dist/dom.d.ts +2 -17
  42. package/dist/dom.js +714 -588
  43. package/dist/dom.mjs +716 -590
  44. package/dist/el.cjs +62 -52
  45. package/dist/el.d.ts +5 -12
  46. package/dist/el.js +60 -52
  47. package/dist/el.mjs +60 -52
  48. package/dist/fs.cjs +72 -63
  49. package/dist/fs.d.ts +22 -19
  50. package/dist/fs.js +71 -62
  51. package/dist/fs.mjs +71 -62
  52. package/dist/hmr.cjs +40 -14
  53. package/dist/hmr.d.ts +11 -23
  54. package/dist/hmr.js +38 -14
  55. package/dist/hmr.mjs +38 -14
  56. package/dist/http.cjs +251 -99
  57. package/dist/http.d.ts +38 -104
  58. package/dist/http.js +249 -99
  59. package/dist/http.mjs +249 -99
  60. package/dist/https.cjs +524 -228
  61. package/dist/https.d.ts +44 -36
  62. package/dist/https.js +520 -226
  63. package/dist/https.mjs +522 -228
  64. package/dist/index.cjs +7502 -7691
  65. package/dist/index.d.ts +6 -3
  66. package/dist/index.js +7486 -7677
  67. package/dist/index.mjs +7497 -7687
  68. package/dist/mime-types.cjs +10 -4
  69. package/dist/mime-types.d.ts +8 -11
  70. package/dist/mime-types.js +9 -3
  71. package/dist/mime-types.mjs +9 -3
  72. package/dist/native.cjs +8616 -8870
  73. package/dist/native.d.ts +7 -10
  74. package/dist/native.js +8682 -8936
  75. package/dist/native.mjs +8615 -8869
  76. package/dist/path.cjs +83 -77
  77. package/dist/path.d.ts +29 -29
  78. package/dist/path.js +82 -76
  79. package/dist/path.mjs +82 -76
  80. package/dist/pm.cjs +3300 -0
  81. package/dist/pm.d.ts +256 -0
  82. package/dist/pm.js +5638 -0
  83. package/dist/pm.mjs +3196 -0
  84. package/dist/preview-build.cjs +712 -0
  85. package/dist/preview-build.d.ts +59 -0
  86. package/dist/preview-build.js +3194 -0
  87. package/dist/preview-build.mjs +676 -0
  88. package/dist/render-context.cjs +13 -2
  89. package/dist/render-context.d.ts +9 -34
  90. package/dist/render-context.js +11 -2
  91. package/dist/render-context.mjs +11 -2
  92. package/dist/router.cjs +787 -646
  93. package/dist/router.d.ts +8 -14
  94. package/dist/router.js +786 -645
  95. package/dist/router.mjs +786 -645
  96. package/dist/runtime.cjs +1 -1
  97. package/dist/runtime.js +1 -1
  98. package/dist/runtime.mjs +1 -1
  99. package/dist/server.cjs +3254 -2684
  100. package/dist/server.d.ts +47 -5
  101. package/dist/server.js +3427 -2859
  102. package/dist/server.mjs +3397 -2829
  103. package/dist/smtp-server.cjs +16 -3
  104. package/dist/smtp-server.d.ts +12 -26
  105. package/dist/smtp-server.js +18 -5
  106. package/dist/smtp-server.mjs +16 -3
  107. package/dist/state-DvEkDehk.d.ts +195 -0
  108. package/dist/state.cjs +768 -659
  109. package/dist/state.d.ts +11 -71
  110. package/dist/state.js +760 -651
  111. package/dist/state.mjs +767 -658
  112. package/dist/style.cjs +1011 -968
  113. package/dist/style.d.ts +13 -127
  114. package/dist/style.js +1009 -970
  115. package/dist/style.mjs +1011 -971
  116. package/dist/test-reporter.cjs +332 -316
  117. package/dist/test-reporter.d.ts +28 -33
  118. package/dist/test-reporter.js +328 -312
  119. package/dist/test-reporter.mjs +328 -312
  120. package/dist/test-runtime.cjs +927 -968
  121. package/dist/test-runtime.d.ts +24 -99
  122. package/dist/test-runtime.js +922 -965
  123. package/dist/test-runtime.mjs +922 -965
  124. package/dist/test.cjs +4428 -4273
  125. package/dist/test.d.ts +2 -8
  126. package/dist/test.js +4307 -4154
  127. package/dist/test.mjs +4419 -4267
  128. package/dist/types-BONVzPtp.d.ts +59 -0
  129. package/dist/types-BR4wMiVx.d.ts +32 -0
  130. package/dist/types-C4gKykuG.d.ts +23 -0
  131. package/dist/types-CIhpN1-K.d.ts +64 -0
  132. package/dist/types-Ckj8md_j.d.ts +84 -0
  133. package/dist/types-CpjQTAkX.d.ts +24 -0
  134. package/dist/types-D0LjrYjS.d.ts +14 -0
  135. package/dist/types-DAisuVr5.d.ts +75 -0
  136. package/dist/types-tJn88E1N.d.ts +242 -0
  137. package/dist/types.d.ts +50 -237
  138. package/dist/universal.cjs +1 -1
  139. package/dist/universal.d.ts +1 -7
  140. package/dist/universal.js +1 -1
  141. package/dist/universal.mjs +1 -1
  142. package/dist/websocket-XfyK23zD.d.ts +119 -0
  143. package/dist/ws.cjs +129 -108
  144. package/dist/ws.d.ts +21 -131
  145. package/dist/ws.js +128 -109
  146. package/dist/ws.mjs +128 -109
  147. package/dist/wss.cjs +757 -479
  148. package/dist/wss.d.ts +31 -28
  149. package/dist/wss.js +755 -479
  150. package/dist/wss.mjs +758 -482
  151. package/package.json +8 -1
  152. package/vendor/epaint-0.31.1/src/image.rs +418 -0
  153. package/dist/server-uMQvZAll.d.ts +0 -458
package/dist/state.d.ts CHANGED
@@ -1,21 +1,5 @@
1
- import { State, VNode, Props, StateOptions, VirtualListController, Child } from './types.js';
2
- import 'node:events';
3
- import 'events';
4
- import 'http';
5
- import 'ws';
6
- import 'net';
7
- import 'smtp-server';
1
+ import { V as VNode, S as State, c as StateOptions, e as VirtualListController, P as Props, C as Child } from './types-BONVzPtp.js';
8
2
 
9
- /**
10
- * Elit - State Management
11
- */
12
-
13
- type NativeBindingKind = 'value' | 'checked';
14
- interface NativeBindingMetadata<T = unknown> {
15
- kind: NativeBindingKind;
16
- state: State<T>;
17
- }
18
- declare const ELIT_NATIVE_BINDING: unique symbol;
19
3
  declare const createState: <T>(initial: T, options?: StateOptions) => State<T>;
20
4
  declare const computed: <T extends any[], R>(states: { [K in keyof T]: State<T[K]>; }, fn: (...values: T) => R) => State<R>;
21
5
  declare const effect: (fn: () => void) => void;
@@ -24,14 +8,20 @@ declare const renderChunked: (container: string | HTMLElement, vNodes: VNode[],
24
8
  declare const createVirtualList: <T>(container: HTMLElement, items: T[], renderItem: (item: T, index: number) => VNode, itemHeight?: number, bufferSize?: number) => VirtualListController;
25
9
  declare const lazy: <T extends any[], R>(loadFn: () => Promise<(...args: T) => R>) => (...args: T) => Promise<VNode | R>;
26
10
  declare const cleanupUnused: (root: HTMLElement) => number;
11
+
27
12
  declare const throttle: <T extends any[]>(fn: (...args: T) => void, delay: number) => (...args: T) => void;
28
13
  declare const debounce: <T extends any[]>(fn: (...args: T) => void, delay: number) => (...args: T) => void;
14
+
15
+ type NativeBindingKind = 'value' | 'checked';
16
+ interface NativeBindingMetadata<T = unknown> {
17
+ kind: NativeBindingKind;
18
+ state: State<T>;
19
+ }
20
+ declare const ELIT_NATIVE_BINDING: unique symbol;
29
21
  declare function bindValue<T extends string | number | string[]>(state: State<T>): Props;
30
22
  declare function bindChecked(state: State<boolean>): Props;
23
+
31
24
  type StateChangeCallback<T = any> = (value: T, oldValue: T) => void;
32
- /**
33
- * Shared State - syncs with elit-server
34
- */
35
25
  declare class SharedState<T = any> {
36
26
  readonly key: string;
37
27
  private wsUrl?;
@@ -40,78 +30,28 @@ declare class SharedState<T = any> {
40
30
  private pendingUpdates;
41
31
  private previousValue;
42
32
  constructor(key: string, defaultValue: T, wsUrl?: string | undefined);
43
- /**
44
- * Get current value
45
- */
46
33
  get value(): T;
47
- /**
48
- * Set new value and sync to server
49
- */
50
34
  set value(newValue: T);
51
- /**
52
- * Get the underlying Elit State (for reactive binding)
53
- */
54
35
  get state(): State<T>;
55
- /**
56
- * Subscribe to changes (returns Elit State for reactive)
57
- */
58
36
  onChange(callback: StateChangeCallback<T>): () => void;
59
- /**
60
- * Update value using a function
61
- */
62
37
  update(updater: (current: T) => T): void;
63
- /**
64
- * Connect to WebSocket
65
- */
66
38
  private connect;
67
- /**
68
- * Subscribe to server state
69
- */
70
39
  private subscribe;
71
- /**
72
- * Handle message from server
73
- */
74
40
  private handleMessage;
75
- /**
76
- * Send value to server
77
- */
78
41
  private sendToServer;
79
- /**
80
- * Disconnect
81
- */
82
42
  disconnect(): void;
83
- /**
84
- * Destroy state and cleanup
85
- */
86
43
  destroy(): void;
87
44
  }
88
- /**
89
- * Create a shared state that syncs with elit-server
90
- */
91
45
  declare function createSharedState<T>(key: string, defaultValue: T, wsUrl?: string): SharedState<T>;
92
- /**
93
- * Shared State Manager for managing multiple shared states
94
- */
95
46
  declare class SharedStateManager {
96
47
  private states;
97
- /**
98
- * Create or get a shared state
99
- */
100
48
  create<T>(key: string, defaultValue: T, wsUrl?: string): SharedState<T>;
101
- /**
102
- * Get existing state
103
- */
104
49
  get<T>(key: string): SharedState<T> | undefined;
105
- /**
106
- * Delete a state
107
- */
108
50
  delete(key: string): boolean;
109
- /**
110
- * Clear all states
111
- */
112
51
  clear(): void;
113
52
  }
114
53
  declare const sharedStateManager: SharedStateManager;
54
+
115
55
  declare const reactive: <T>(state: State<T>, renderFn: (value: T) => VNode | Child | Child[]) => VNode;
116
56
  declare const reactiveAs: <T>(tagName: string, state: State<T>, renderFn: (value: T) => VNode | Child | Child[], props?: Props) => VNode;
117
57
  declare const text: (state: State<any> | any) => VNode | string;