elit 3.6.5 → 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 (154) hide show
  1. package/Cargo.lock +1 -1
  2. package/Cargo.toml +1 -1
  3. package/README.md +6 -0
  4. package/dist/build.cjs +421 -331
  5. package/dist/build.d.ts +1 -16
  6. package/dist/build.js +420 -330
  7. package/dist/build.mjs +420 -330
  8. package/dist/chokidar.cjs +219 -182
  9. package/dist/chokidar.d.ts +25 -10
  10. package/dist/chokidar.js +217 -182
  11. package/dist/chokidar.mjs +218 -183
  12. package/dist/cli.cjs +21608 -20241
  13. package/dist/cli.d.ts +19 -37
  14. package/dist/cli.mjs +21262 -19910
  15. package/dist/config.cjs +357 -350
  16. package/dist/config.d.ts +19 -240
  17. package/dist/config.js +520 -515
  18. package/dist/config.mjs +346 -341
  19. package/dist/contracts-BeW9k0yZ.d.ts +54 -0
  20. package/dist/contracts-D7KIS-TK.d.ts +36 -0
  21. package/dist/coverage.cjs +448 -485
  22. package/dist/coverage.d.ts +13 -59
  23. package/dist/coverage.js +447 -484
  24. package/dist/coverage.mjs +447 -484
  25. package/dist/database.cjs +819 -828
  26. package/dist/database.d.ts +8 -24
  27. package/dist/database.js +818 -829
  28. package/dist/database.mjs +818 -829
  29. package/dist/desktop-auto-render.cjs +1700 -1522
  30. package/dist/desktop-auto-render.d.ts +4 -9
  31. package/dist/desktop-auto-render.js +1695 -1517
  32. package/dist/desktop-auto-render.mjs +1696 -1518
  33. package/dist/desktop.cjs +3 -1
  34. package/dist/desktop.d.ts +4 -1
  35. package/dist/desktop.js +1 -1
  36. package/dist/desktop.mjs +1 -1
  37. package/dist/dev-build.cjs +830 -0
  38. package/dist/dev-build.d.ts +53 -0
  39. package/dist/dev-build.js +3318 -0
  40. package/dist/dev-build.mjs +797 -0
  41. package/dist/dom.cjs +717 -590
  42. package/dist/dom.d.ts +2 -15
  43. package/dist/dom.js +714 -587
  44. package/dist/dom.mjs +716 -589
  45. package/dist/el.cjs +62 -52
  46. package/dist/el.d.ts +5 -10
  47. package/dist/el.js +60 -52
  48. package/dist/el.mjs +60 -52
  49. package/dist/fs.cjs +72 -63
  50. package/dist/fs.d.ts +22 -19
  51. package/dist/fs.js +71 -62
  52. package/dist/fs.mjs +71 -62
  53. package/dist/hmr.cjs +40 -14
  54. package/dist/hmr.d.ts +11 -23
  55. package/dist/hmr.js +38 -14
  56. package/dist/hmr.mjs +38 -14
  57. package/dist/http.cjs +251 -99
  58. package/dist/http.d.ts +38 -104
  59. package/dist/http.js +249 -99
  60. package/dist/http.mjs +249 -99
  61. package/dist/https.cjs +524 -228
  62. package/dist/https.d.ts +44 -36
  63. package/dist/https.js +520 -226
  64. package/dist/https.mjs +522 -228
  65. package/dist/index.cjs +7502 -7690
  66. package/dist/index.d.ts +8 -3
  67. package/dist/index.js +7486 -7676
  68. package/dist/index.mjs +7497 -7686
  69. package/dist/mime-types.cjs +10 -4
  70. package/dist/mime-types.d.ts +8 -11
  71. package/dist/mime-types.js +9 -3
  72. package/dist/mime-types.mjs +9 -3
  73. package/dist/native.cjs +8616 -8869
  74. package/dist/native.d.ts +7 -8
  75. package/dist/native.js +8682 -8935
  76. package/dist/native.mjs +8615 -8868
  77. package/dist/path.cjs +83 -77
  78. package/dist/path.d.ts +29 -29
  79. package/dist/path.js +82 -76
  80. package/dist/path.mjs +82 -76
  81. package/dist/pm.cjs +3300 -0
  82. package/dist/pm.d.ts +256 -0
  83. package/dist/pm.js +5638 -0
  84. package/dist/pm.mjs +3196 -0
  85. package/dist/preview-build.cjs +712 -0
  86. package/dist/preview-build.d.ts +59 -0
  87. package/dist/preview-build.js +3194 -0
  88. package/dist/preview-build.mjs +676 -0
  89. package/dist/render-context.cjs +13 -2
  90. package/dist/render-context.d.ts +9 -31
  91. package/dist/render-context.js +11 -2
  92. package/dist/render-context.mjs +11 -2
  93. package/dist/router.cjs +787 -645
  94. package/dist/router.d.ts +8 -12
  95. package/dist/router.js +786 -644
  96. package/dist/router.mjs +786 -644
  97. package/dist/runtime.cjs +1 -1
  98. package/dist/runtime.js +1 -1
  99. package/dist/runtime.mjs +1 -1
  100. package/dist/server.cjs +3315 -2603
  101. package/dist/server.d.ts +49 -4
  102. package/dist/server.js +7611 -2834
  103. package/dist/server.mjs +3317 -2607
  104. package/dist/smtp-server.cjs +128 -0
  105. package/dist/smtp-server.d.ts +27 -0
  106. package/dist/smtp-server.js +4199 -0
  107. package/dist/smtp-server.mjs +100 -0
  108. package/dist/state-DvEkDehk.d.ts +195 -0
  109. package/dist/state.cjs +768 -658
  110. package/dist/state.d.ts +11 -69
  111. package/dist/state.js +760 -650
  112. package/dist/state.mjs +767 -657
  113. package/dist/style.cjs +1011 -968
  114. package/dist/style.d.ts +13 -127
  115. package/dist/style.js +1009 -970
  116. package/dist/style.mjs +1011 -971
  117. package/dist/test-reporter.cjs +332 -316
  118. package/dist/test-reporter.d.ts +28 -33
  119. package/dist/test-reporter.js +328 -312
  120. package/dist/test-reporter.mjs +328 -312
  121. package/dist/test-runtime.cjs +927 -968
  122. package/dist/test-runtime.d.ts +24 -99
  123. package/dist/test-runtime.js +922 -965
  124. package/dist/test-runtime.mjs +922 -965
  125. package/dist/test.cjs +4428 -4273
  126. package/dist/test.d.ts +2 -8
  127. package/dist/test.js +4307 -4154
  128. package/dist/test.mjs +4419 -4267
  129. package/dist/types-BONVzPtp.d.ts +59 -0
  130. package/dist/types-BR4wMiVx.d.ts +32 -0
  131. package/dist/types-C4gKykuG.d.ts +23 -0
  132. package/dist/types-CIhpN1-K.d.ts +64 -0
  133. package/dist/types-Ckj8md_j.d.ts +84 -0
  134. package/dist/types-CpjQTAkX.d.ts +24 -0
  135. package/dist/types-D0LjrYjS.d.ts +14 -0
  136. package/dist/types-DAisuVr5.d.ts +75 -0
  137. package/dist/types-tJn88E1N.d.ts +242 -0
  138. package/dist/types.d.ts +71 -226
  139. package/dist/universal.cjs +1 -1
  140. package/dist/universal.d.ts +1 -5
  141. package/dist/universal.js +1 -1
  142. package/dist/universal.mjs +1 -1
  143. package/dist/websocket-XfyK23zD.d.ts +119 -0
  144. package/dist/ws.cjs +129 -108
  145. package/dist/ws.d.ts +21 -131
  146. package/dist/ws.js +128 -109
  147. package/dist/ws.mjs +128 -109
  148. package/dist/wss.cjs +757 -479
  149. package/dist/wss.d.ts +31 -28
  150. package/dist/wss.js +755 -479
  151. package/dist/wss.mjs +758 -482
  152. package/package.json +16 -1
  153. package/vendor/epaint-0.31.1/src/image.rs +418 -0
  154. package/dist/server-CcBFc2F5.d.ts +0 -449
@@ -1,449 +0,0 @@
1
- import { IncomingMessage, ServerResponse } from './http.js';
2
- import { WebSocket } from './ws.js';
3
- import { Server } from 'http';
4
- import { WebSocketServer } from 'ws';
5
-
6
- /**
7
- * Elit - Types and Interfaces
8
- */
9
- interface VNode {
10
- tagName: string;
11
- props: Props;
12
- children: Children;
13
- }
14
- type Child = VNode | string | number | boolean | null | undefined | Child[];
15
- type Children = Child[];
16
- interface Props {
17
- [key: string]: any;
18
- className?: string | string[];
19
- class?: string | string[];
20
- style?: Partial<CSSStyleDeclaration> | string;
21
- dangerouslySetInnerHTML?: {
22
- __html: string;
23
- };
24
- ref?: RefCallback | RefObject;
25
- onClick?: (event: MouseEvent) => void;
26
- onChange?: (event: Event) => void;
27
- onInput?: (event: Event) => void;
28
- onSubmit?: (event: Event) => void;
29
- value?: string | number | string[];
30
- checked?: boolean;
31
- }
32
- type RefCallback = (element: HTMLElement | SVGElement) => void;
33
- interface RefObject {
34
- current: HTMLElement | SVGElement | null;
35
- }
36
- type Router = ServerRouter;
37
- type StateManager$1 = StateManager;
38
- type WebSocketConnection = WebSocket;
39
- type WebSocketRequest = IncomingMessage;
40
- interface WebSocketEndpointContext {
41
- /** Accepted WebSocket connection */
42
- ws: WebSocketConnection;
43
- /** Upgrade request metadata */
44
- req: WebSocketRequest;
45
- /** Matched request path without query string */
46
- path: string;
47
- /** Parsed query string values */
48
- query: Record<string, string>;
49
- /** Request headers */
50
- headers: Record<string, string | string[] | undefined>;
51
- }
52
- type WebSocketEndpointHandler = (ctx: WebSocketEndpointContext) => void | Promise<void>;
53
- interface WebSocketEndpointConfig {
54
- /** Path to listen for WebSocket upgrades (e.g., '/ws', '/chat') */
55
- path: string;
56
- /** Connection handler invoked after a successful WebSocket upgrade */
57
- handler: WebSocketEndpointHandler;
58
- }
59
- interface ClientConfig {
60
- /** Root directory to serve files from */
61
- root: string;
62
- /** Optional fallback root used when the primary root is unavailable in packaged standalone runs */
63
- fallbackRoot?: string;
64
- /** Base path for the client application (e.g., '/app1', '/app2') */
65
- basePath: string;
66
- /** Custom index file path (relative to root, e.g., './public/index.html') */
67
- index?: string;
68
- /** SSR render function - returns HTML VNode or string */
69
- ssr?: () => Child | string;
70
- /** Watch patterns for file changes */
71
- watch?: string[];
72
- /** Ignore patterns for file watching */
73
- ignore?: string[];
74
- /** Proxy configuration specific to this client */
75
- proxy?: ProxyConfig[];
76
- /** Worker scripts specific to this client */
77
- worker?: WorkerConfig[];
78
- /** API router for REST endpoints specific to this client */
79
- api?: Router;
80
- /** WebSocket endpoints specific to this client */
81
- ws?: WebSocketEndpointConfig[];
82
- /** Server mode: 'dev' uses source files, 'preview' uses built files (default: 'dev') */
83
- mode?: 'dev' | 'preview';
84
- }
85
- interface ProxyConfig {
86
- /** Path prefix to match for proxying (e.g., '/api', '/graphql') */
87
- context: string;
88
- /** Target URL to proxy to (e.g., 'http://localhost:8080') */
89
- target: string;
90
- /** Change the origin of the host header to the target URL */
91
- changeOrigin?: boolean;
92
- /** Rewrite path before sending to target */
93
- pathRewrite?: Record<string, string>;
94
- /** Additional headers to add to the proxied request */
95
- headers?: Record<string, string>;
96
- /** Enable WebSocket proxying */
97
- ws?: boolean;
98
- }
99
- interface WorkerConfig {
100
- /** Worker script path relative to root directory */
101
- path: string;
102
- /** Worker name/identifier (optional, defaults to filename) */
103
- name?: string;
104
- /** Worker type: 'module' (ESM) or 'classic' (default: 'module') */
105
- type?: 'module' | 'classic';
106
- }
107
- interface DevServerOptions {
108
- /** Port to run the server on (default: 3000) */
109
- port?: number;
110
- /** Host to bind to (default: 'localhost') */
111
- host?: string;
112
- /** Domain to map (e.g., 'idevcoder.com') - redirects domain traffic to this server's port */
113
- domain?: string;
114
- /** Root directory to serve files from */
115
- root?: string;
116
- /** Optional fallback root used when the primary root is unavailable in packaged standalone runs */
117
- fallbackRoot?: string;
118
- /** Base path for the client application (e.g., '/app1', '/app2') */
119
- basePath?: string;
120
- /** Custom index file path (relative to root, e.g., './public/index.html') */
121
- index?: string;
122
- /** Array of client configurations - allows multiple clients on same port */
123
- clients?: ClientConfig[];
124
- /** Enable HTTPS (default: false) */
125
- https?: boolean;
126
- /** Open browser automatically (default: true) */
127
- open?: boolean;
128
- /** Watch patterns for file changes */
129
- watch?: string[];
130
- /** Ignore patterns for file watcher */
131
- ignore?: string[];
132
- /** Global worker scripts (applies to all clients) */
133
- worker?: WorkerConfig[];
134
- /** Enable logging (default: true) */
135
- logging?: boolean;
136
- /** API router for REST endpoints */
137
- api?: Router;
138
- /** WebSocket endpoints */
139
- ws?: WebSocketEndpointConfig[];
140
- /** SSR render function - returns HTML VNode or string */
141
- ssr?: () => Child | string;
142
- /** Proxy configuration for API requests */
143
- proxy?: ProxyConfig[];
144
- /** Server mode: 'dev' uses source files, 'preview' uses built files (default: 'dev') */
145
- mode?: 'dev' | 'preview';
146
- /** Environment variables to inject (prefix with VITE_ for client access) */
147
- env?: Record<string, string>;
148
- /** Emit a bundled development server during elit build */
149
- standalone?: boolean;
150
- /** Output directory for a bundled standalone development server (default: dev-dist) */
151
- outDir?: string;
152
- /** Output filename for a bundled standalone development server (default: index.js) */
153
- outFile?: string;
154
- }
155
- interface DevServer {
156
- /** HTTP server instance */
157
- server: Server;
158
- /** WebSocket server for HMR */
159
- wss: WebSocketServer;
160
- /** Server URL */
161
- url: string;
162
- /** Shared state manager */
163
- state: StateManager$1;
164
- /** Close the server */
165
- close: () => Promise<void>;
166
- }
167
- interface BuildOptions {
168
- /** Entry file to build */
169
- entry: string;
170
- /** Output directory */
171
- outDir?: string;
172
- /** Output filename */
173
- outFile?: string;
174
- /** Enable minification */
175
- minify?: boolean;
176
- /** Generate sourcemap */
177
- sourcemap?: boolean;
178
- /** Target environment */
179
- target?: 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
180
- /** Output format */
181
- format?: 'esm' | 'cjs' | 'iife';
182
- /** Global name for IIFE format */
183
- globalName?: string;
184
- /** Target platform */
185
- platform?: 'browser' | 'node' | 'neutral';
186
- /** Base path for the application (injected into HTML) */
187
- basePath?: string;
188
- /** External dependencies (not bundled) */
189
- external?: string[];
190
- /** Module resolution options */
191
- resolve?: {
192
- /** Alias imports to other paths or modules */
193
- alias?: Record<string, string>;
194
- };
195
- /** Enable tree shaking */
196
- treeshake?: boolean;
197
- /** Enable logging */
198
- logging?: boolean;
199
- /** Environment variables to inject (prefix with VITE_ for client access) */
200
- env?: Record<string, string>;
201
- /** Copy static files after build */
202
- copy?: Array<{
203
- from: string;
204
- to: string;
205
- transform?: (content: string, config: BuildOptions) => string;
206
- }>;
207
- /** Post-build hook */
208
- onBuildEnd?: (result: BuildResult) => void | Promise<void>;
209
- /** Emit a standalone preview server bundle after the client build */
210
- standalonePreview?: boolean;
211
- /** Emit a standalone development server bundle after the client build */
212
- standaloneDev?: boolean;
213
- /** Output filename for the standalone development server bundle (default: index.js) */
214
- standaloneDevOutFile?: string;
215
- /** Output filename for the standalone preview server bundle (default: index.js) */
216
- standalonePreviewOutFile?: string;
217
- }
218
- interface BuildResult {
219
- /** Output file path */
220
- outputPath: string;
221
- /** Build time in milliseconds */
222
- buildTime: number;
223
- /** Output file size in bytes */
224
- size: number;
225
- }
226
- interface PreviewOptions {
227
- /** Port to run the preview server on (default: 4173) */
228
- port?: number;
229
- /** Host to bind to (default: 'localhost') */
230
- host?: string;
231
- /** Domain to map (e.g., 'idevcoder.com') - redirects domain traffic to this server's port */
232
- domain?: string;
233
- /** Root directory to serve files from (default: dist or build.outDir) */
234
- root?: string;
235
- /** Base path for the application (e.g., '/app') */
236
- basePath?: string;
237
- /** Custom index file path (relative to root, e.g., './public/index.html') */
238
- index?: string;
239
- /** Array of client configurations - allows multiple clients on same port */
240
- clients?: ClientConfig[];
241
- /** Enable HTTPS (default: false) */
242
- https?: boolean;
243
- /** Open browser automatically (default: true) */
244
- open?: boolean;
245
- /** Enable logging (default: true) */
246
- logging?: boolean;
247
- /** API router for REST endpoints */
248
- api?: Router;
249
- /** WebSocket endpoints */
250
- ws?: WebSocketEndpointConfig[];
251
- /** SSR render function - returns HTML VNode or string */
252
- ssr?: () => Child | string;
253
- /** Proxy configuration for API requests */
254
- proxy?: ProxyConfig[];
255
- /** Global worker scripts (applies to all clients) */
256
- worker?: WorkerConfig[];
257
- /** Environment variables to inject (prefix with VITE_ for client access) */
258
- env?: Record<string, string>;
259
- /** Emit a bundled preview server during elit build */
260
- standalone?: boolean;
261
- /** Output filename for the standalone preview server bundle (default: index.js) */
262
- outFile?: string;
263
- }
264
- type TestEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
265
- type TestCoverageProvider = 'v8' | 'istanbul';
266
- type TestCoverageReporter = 'text' | 'json' | 'html' | 'lcov' | 'lcovonly' | 'coverage-final.json' | 'clover';
267
- interface TestCoverageOptions {
268
- provider?: TestCoverageProvider;
269
- reporter?: TestCoverageReporter[];
270
- dir?: string;
271
- include?: string[];
272
- exclude?: string[];
273
- thresholds?: {
274
- lines?: number;
275
- functions?: number;
276
- branches?: number;
277
- statements?: number;
278
- };
279
- all?: boolean;
280
- }
281
- interface TestOptions {
282
- environment?: TestEnvironment;
283
- globals?: boolean;
284
- setupFiles?: string[];
285
- include?: string[];
286
- exclude?: string[];
287
- testTimeout?: number;
288
- isolate?: boolean;
289
- pool?: string;
290
- poolOptions?: {
291
- threads?: {
292
- singleThread?: boolean;
293
- minThreads?: number;
294
- maxThreads?: number;
295
- isolate?: boolean;
296
- };
297
- forks?: {
298
- singleFork?: boolean;
299
- minForks?: number;
300
- maxForks?: number;
301
- isolate?: boolean;
302
- };
303
- };
304
- coverage?: TestCoverageOptions;
305
- watch?: boolean;
306
- ui?: boolean;
307
- reporter?: 'verbose' | 'dot' | 'json' | 'tap';
308
- bail?: number | boolean;
309
- pattern?: string | RegExp;
310
- colors?: boolean;
311
- retry?: number;
312
- includeSrc?: string[];
313
- excludeSrc?: string[];
314
- env?: Record<string, string>;
315
- }
316
-
317
- /**
318
- * Development server with HMR support
319
- * Cross-runtime transpilation support
320
- * - Node.js: uses stripTypeScriptTypes with esbuild fallback
321
- * - Bun: uses Bun.Transpiler
322
- * - Deno: uses Deno.emit
323
- */
324
-
325
- type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'ALL';
326
- interface ElitRequest extends IncomingMessage {
327
- body?: any;
328
- query?: Record<string, string>;
329
- params?: Record<string, string>;
330
- }
331
- interface ElitResponse extends ServerResponse {
332
- json(data: any, statusCode?: number): this;
333
- send(data: any): this;
334
- status(code: number): this;
335
- }
336
- interface ServerRouteContext {
337
- req: ElitRequest;
338
- res: ElitResponse;
339
- params: Record<string, string>;
340
- query: Record<string, string>;
341
- body: any;
342
- headers: Record<string, string | string[] | undefined>;
343
- user?: any;
344
- }
345
- type ServerRouteHandler = (ctx: ServerRouteContext, next?: () => Promise<void>) => void | Promise<void>;
346
- type Middleware = (ctx: ServerRouteContext, next: () => Promise<void>) => void | Promise<void>;
347
- declare class ServerRouter {
348
- private routes;
349
- private middlewares;
350
- use(...args: Array<any>): this;
351
- all: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
352
- get: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
353
- post: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
354
- put: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
355
- delete: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
356
- patch: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
357
- options: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
358
- head: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
359
- private toMiddleware;
360
- private addRoute;
361
- private pathToRegex;
362
- private parseQuery;
363
- /**
364
- * List all registered routes for debugging
365
- */
366
- listRoutes(): Array<{
367
- method: string;
368
- pattern: string;
369
- paramNames: string[];
370
- handler: string;
371
- }>;
372
- private parseBody;
373
- handle(req: IncomingMessage, res: ServerResponse): Promise<boolean>;
374
- }
375
- declare const json: (res: ServerResponse, data: any, status?: number) => ServerResponse;
376
- declare const text: (res: ServerResponse, data: string, status?: number) => ServerResponse;
377
- declare const html: (res: ServerResponse, data: string, status?: number) => ServerResponse;
378
- declare const status: (res: ServerResponse, code: number, message?: string) => ServerResponse;
379
- declare function resolveWorkspaceElitImportBasePath(rootDir: string, basePath: string, _mode: 'dev' | 'preview'): Promise<string | undefined>;
380
- declare const createElitImportMap: (rootDir: string, basePath?: string, mode?: "dev" | "preview") => Promise<string>;
381
- /**
382
- * Clear import map cache (useful when packages are added/removed)
383
- */
384
- declare function clearImportMapCache(): void;
385
- declare function cors(options?: {
386
- origin?: string | string[];
387
- methods?: string[];
388
- credentials?: boolean;
389
- maxAge?: number;
390
- }): Middleware;
391
- declare function logger(options?: {
392
- format?: 'simple' | 'detailed';
393
- }): Middleware;
394
- declare function errorHandler(): Middleware;
395
- declare function rateLimit(options?: {
396
- windowMs?: number;
397
- max?: number;
398
- message?: string;
399
- }): Middleware;
400
- declare function bodyLimit(options?: {
401
- limit?: number;
402
- }): Middleware;
403
- declare function cacheControl(options?: {
404
- maxAge?: number;
405
- public?: boolean;
406
- }): Middleware;
407
- declare function compress(): Middleware;
408
- declare function security(): Middleware;
409
- declare function createProxyHandler(proxyConfigs: ProxyConfig[]): (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
410
- type StateChangeHandler<T = any> = (value: T, oldValue: T) => void;
411
- interface SharedStateOptions<T = any> {
412
- initial: T;
413
- persist?: boolean;
414
- validate?: (value: T) => boolean;
415
- }
416
- declare class SharedState<T = any> {
417
- readonly key: string;
418
- private _value;
419
- private listeners;
420
- private changeHandlers;
421
- private options;
422
- constructor(key: string, options: SharedStateOptions<T>);
423
- get value(): T;
424
- set value(newValue: T);
425
- update(updater: (current: T) => T): void;
426
- subscribe(ws: WebSocket): void;
427
- unsubscribe(ws: WebSocket): void;
428
- onChange(handler: StateChangeHandler<T>): () => void;
429
- private broadcast;
430
- private sendTo;
431
- get subscriberCount(): number;
432
- clear(): void;
433
- }
434
- declare class StateManager {
435
- private states;
436
- create<T>(key: string, options: SharedStateOptions<T>): SharedState<T>;
437
- get<T>(key: string): SharedState<T> | undefined;
438
- has(key: string): boolean;
439
- delete(key: string): boolean;
440
- subscribe(key: string, ws: WebSocket): void;
441
- unsubscribe(key: string, ws: WebSocket): void;
442
- unsubscribeAll(ws: WebSocket): void;
443
- handleStateChange(key: string, value: any): void;
444
- keys(): string[];
445
- clear(): void;
446
- }
447
- declare function createDevServer(options: DevServerOptions): DevServer;
448
-
449
- export { type BuildOptions as B, type DevServerOptions as D, type ElitRequest as E, type HttpMethod as H, type Middleware as M, type PreviewOptions as P, type ServerRouteContext as S, type TestOptions as T, type VNode as V, type BuildResult as a, type TestCoverageReporter as b, type ElitResponse as c, type ServerRouteHandler as d, ServerRouter as e, SharedState as f, type SharedStateOptions as g, type StateChangeHandler as h, StateManager as i, bodyLimit as j, cacheControl as k, clearImportMapCache as l, compress as m, cors as n, createDevServer as o, createElitImportMap as p, createProxyHandler as q, errorHandler as r, html as s, json as t, logger as u, rateLimit as v, resolveWorkspaceElitImportBasePath as w, security as x, status as y, text as z };