elit 3.0.1 → 3.0.2

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 (87) hide show
  1. package/dist/build.d.ts +4 -12
  2. package/dist/build.d.ts.map +1 -0
  3. package/dist/chokidar.d.ts +7 -9
  4. package/dist/chokidar.d.ts.map +1 -0
  5. package/dist/cli.d.ts +6 -0
  6. package/dist/cli.d.ts.map +1 -0
  7. package/dist/cli.js +17 -4
  8. package/dist/config.d.ts +29 -0
  9. package/dist/config.d.ts.map +1 -0
  10. package/dist/dom.d.ts +7 -14
  11. package/dist/dom.d.ts.map +1 -0
  12. package/dist/el.d.ts +19 -191
  13. package/dist/el.d.ts.map +1 -0
  14. package/dist/fs.d.ts +35 -35
  15. package/dist/fs.d.ts.map +1 -0
  16. package/dist/hmr.d.ts +3 -3
  17. package/dist/hmr.d.ts.map +1 -0
  18. package/dist/http.d.ts +20 -22
  19. package/dist/http.d.ts.map +1 -0
  20. package/dist/https.d.ts +12 -15
  21. package/dist/https.d.ts.map +1 -0
  22. package/dist/index.d.ts +10 -629
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/mime-types.d.ts +9 -9
  25. package/dist/mime-types.d.ts.map +1 -0
  26. package/dist/path.d.ts +22 -19
  27. package/dist/path.d.ts.map +1 -0
  28. package/dist/router.d.ts +10 -17
  29. package/dist/router.d.ts.map +1 -0
  30. package/dist/runtime.d.ts +5 -6
  31. package/dist/runtime.d.ts.map +1 -0
  32. package/dist/server.d.ts +105 -7
  33. package/dist/server.d.ts.map +1 -0
  34. package/dist/server.js +14 -2
  35. package/dist/server.mjs +14 -2
  36. package/dist/state.d.ts +21 -27
  37. package/dist/state.d.ts.map +1 -0
  38. package/dist/style.d.ts +14 -55
  39. package/dist/style.d.ts.map +1 -0
  40. package/dist/types.d.ts +26 -240
  41. package/dist/types.d.ts.map +1 -0
  42. package/dist/ws.d.ts +14 -17
  43. package/dist/ws.d.ts.map +1 -0
  44. package/dist/wss.d.ts +16 -16
  45. package/dist/wss.d.ts.map +1 -0
  46. package/package.json +3 -2
  47. package/src/build.ts +337 -0
  48. package/src/chokidar.ts +401 -0
  49. package/src/cli.ts +638 -0
  50. package/src/config.ts +205 -0
  51. package/src/dom.ts +817 -0
  52. package/src/el.ts +164 -0
  53. package/src/fs.ts +727 -0
  54. package/src/hmr.ts +137 -0
  55. package/src/http.ts +775 -0
  56. package/src/https.ts +411 -0
  57. package/src/index.ts +14 -0
  58. package/src/mime-types.ts +222 -0
  59. package/src/path.ts +493 -0
  60. package/src/router.ts +237 -0
  61. package/src/runtime.ts +97 -0
  62. package/src/server.ts +1290 -0
  63. package/src/state.ts +468 -0
  64. package/src/style.ts +524 -0
  65. package/{dist/types-Du6kfwTm.d.ts → src/types.ts} +58 -141
  66. package/src/ws.ts +506 -0
  67. package/src/wss.ts +241 -0
  68. package/dist/build.d.mts +0 -20
  69. package/dist/chokidar.d.mts +0 -134
  70. package/dist/dom.d.mts +0 -87
  71. package/dist/el.d.mts +0 -207
  72. package/dist/fs.d.mts +0 -255
  73. package/dist/hmr.d.mts +0 -38
  74. package/dist/http.d.mts +0 -163
  75. package/dist/https.d.mts +0 -108
  76. package/dist/index.d.mts +0 -629
  77. package/dist/mime-types.d.mts +0 -48
  78. package/dist/path.d.mts +0 -163
  79. package/dist/router.d.mts +0 -47
  80. package/dist/runtime.d.mts +0 -97
  81. package/dist/server.d.mts +0 -7
  82. package/dist/state.d.mts +0 -111
  83. package/dist/style.d.mts +0 -159
  84. package/dist/types-C0nGi6MX.d.mts +0 -346
  85. package/dist/types.d.mts +0 -452
  86. package/dist/ws.d.mts +0 -195
  87. package/dist/wss.d.mts +0 -108
package/dist/wss.d.mts DELETED
@@ -1,108 +0,0 @@
1
- import { EventEmitter } from 'events';
2
- import { IncomingMessage } from './http.mjs';
3
- import { WebSocket, ServerOptions, ReadyState } from './ws.mjs';
4
- export { CLOSE_CODES, Data } from './ws.mjs';
5
- import 'node:events';
6
-
7
- /**
8
- * WebSocket Secure (WSS) module with unified API across runtimes
9
- * Pure implementation without external dependencies
10
- * Compatible with 'ws' package WSS API
11
- * - Node.js: uses native WebSocket with HTTPS
12
- * - Bun: uses native WebSocket with TLS
13
- * - Deno: uses native WebSocket with TLS
14
- */
15
-
16
- /**
17
- * WSS Server options (extends WebSocket ServerOptions with TLS)
18
- */
19
- interface WSSServerOptions extends ServerOptions {
20
- key?: string | Buffer;
21
- cert?: string | Buffer;
22
- ca?: string | Buffer;
23
- passphrase?: string;
24
- rejectUnauthorized?: boolean;
25
- requestCert?: boolean;
26
- httpsServer?: any;
27
- }
28
- /**
29
- * WebSocket Secure client class
30
- */
31
- declare class WSSClient extends WebSocket {
32
- constructor(address: string | URL, protocols?: string | string[], options?: any);
33
- }
34
- /**
35
- * WebSocket Secure Server class
36
- */
37
- declare class WSSServer extends EventEmitter {
38
- clients: Set<WebSocket>;
39
- options: WSSServerOptions;
40
- path: string;
41
- private _httpsServer;
42
- private _wsServer;
43
- constructor(options?: WSSServerOptions, callback?: () => void);
44
- private _setupServer;
45
- /**
46
- * Handle HTTP upgrade for WebSocket
47
- */
48
- handleUpgrade(request: IncomingMessage, socket: any, head: Buffer, callback: (client: WebSocket) => void): void;
49
- /**
50
- * Check if server should handle request
51
- */
52
- shouldHandle(request: IncomingMessage): boolean;
53
- /**
54
- * Close the server
55
- */
56
- close(callback?: (err?: Error) => void): void;
57
- /**
58
- * Get server address
59
- */
60
- address(): {
61
- port: number;
62
- family: string;
63
- address: string;
64
- } | null;
65
- }
66
- /**
67
- * Create WebSocket Secure client
68
- */
69
- declare function createWSSClient(address: string | URL, protocols?: string | string[], options?: any): WSSClient;
70
- /**
71
- * Create WebSocket Secure server
72
- */
73
- declare function createWSSServer(options?: WSSServerOptions, callback?: () => void): WSSServer;
74
- /**
75
- * Get current runtime
76
- */
77
- declare function getRuntime(): 'node' | 'bun' | 'deno';
78
-
79
- /**
80
- * Default export
81
- */
82
- declare const _default: {
83
- WSSClient: typeof WSSClient;
84
- WSSServer: typeof WSSServer;
85
- createWSSClient: typeof createWSSClient;
86
- createWSSServer: typeof createWSSServer;
87
- ReadyState: typeof ReadyState;
88
- CLOSE_CODES: {
89
- readonly NORMAL: 1000;
90
- readonly GOING_AWAY: 1001;
91
- readonly PROTOCOL_ERROR: 1002;
92
- readonly UNSUPPORTED_DATA: 1003;
93
- readonly NO_STATUS: 1005;
94
- readonly ABNORMAL: 1006;
95
- readonly INVALID_DATA: 1007;
96
- readonly POLICY_VIOLATION: 1008;
97
- readonly MESSAGE_TOO_BIG: 1009;
98
- readonly EXTENSION_REQUIRED: 1010;
99
- readonly INTERNAL_ERROR: 1011;
100
- readonly SERVICE_RESTART: 1012;
101
- readonly TRY_AGAIN_LATER: 1013;
102
- readonly BAD_GATEWAY: 1014;
103
- readonly TLS_HANDSHAKE_FAIL: 1015;
104
- };
105
- getRuntime: typeof getRuntime;
106
- };
107
-
108
- export { ReadyState, ServerOptions, WSSClient, WSSServer, type WSSServerOptions, createWSSClient, createWSSServer, _default as default, getRuntime };