elit 3.5.6 → 3.5.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 (113) hide show
  1. package/Cargo.toml +1 -1
  2. package/README.md +1 -1
  3. package/desktop/build.rs +83 -0
  4. package/desktop/icon.rs +106 -0
  5. package/desktop/lib.rs +2 -0
  6. package/desktop/main.rs +235 -0
  7. package/desktop/native_main.rs +128 -0
  8. package/desktop/native_renderer/action_widgets.rs +184 -0
  9. package/desktop/native_renderer/app_models.rs +171 -0
  10. package/desktop/native_renderer/app_runtime.rs +140 -0
  11. package/desktop/native_renderer/container_rendering.rs +610 -0
  12. package/desktop/native_renderer/content_widgets.rs +634 -0
  13. package/desktop/native_renderer/css_models.rs +371 -0
  14. package/desktop/native_renderer/embedded_surfaces.rs +414 -0
  15. package/desktop/native_renderer/form_controls.rs +516 -0
  16. package/desktop/native_renderer/interaction_dispatch.rs +89 -0
  17. package/desktop/native_renderer/runtime_support.rs +135 -0
  18. package/desktop/native_renderer/utilities.rs +495 -0
  19. package/desktop/native_renderer/vector_drawing.rs +491 -0
  20. package/desktop/native_renderer.rs +4122 -0
  21. package/desktop/runtime/external.rs +422 -0
  22. package/desktop/runtime/mod.rs +67 -0
  23. package/desktop/runtime/quickjs.rs +106 -0
  24. package/desktop/window.rs +383 -0
  25. package/package.json +6 -3
  26. package/dist/build.d.mts +0 -20
  27. package/dist/chokidar.d.mts +0 -134
  28. package/dist/cli.d.mts +0 -81
  29. package/dist/config.d.mts +0 -254
  30. package/dist/coverage.d.mts +0 -85
  31. package/dist/database.d.mts +0 -52
  32. package/dist/desktop.d.mts +0 -68
  33. package/dist/dom.d.mts +0 -87
  34. package/dist/el.d.mts +0 -208
  35. package/dist/fs.d.mts +0 -255
  36. package/dist/hmr.d.mts +0 -38
  37. package/dist/http.d.mts +0 -169
  38. package/dist/https.d.mts +0 -108
  39. package/dist/index.d.mts +0 -13
  40. package/dist/mime-types.d.mts +0 -48
  41. package/dist/native.d.mts +0 -136
  42. package/dist/path.d.mts +0 -163
  43. package/dist/router.d.mts +0 -49
  44. package/dist/runtime.d.mts +0 -97
  45. package/dist/server-D0Dp4R5z.d.mts +0 -449
  46. package/dist/server.d.mts +0 -7
  47. package/dist/state.d.mts +0 -117
  48. package/dist/style.d.mts +0 -232
  49. package/dist/test-reporter.d.mts +0 -77
  50. package/dist/test-runtime.d.mts +0 -122
  51. package/dist/test.d.mts +0 -39
  52. package/dist/types.d.mts +0 -586
  53. package/dist/universal.d.mts +0 -21
  54. package/dist/ws.d.mts +0 -200
  55. package/dist/wss.d.mts +0 -108
  56. package/src/build.ts +0 -362
  57. package/src/chokidar.ts +0 -427
  58. package/src/cli.ts +0 -1162
  59. package/src/config.ts +0 -509
  60. package/src/coverage.ts +0 -1479
  61. package/src/database.ts +0 -1410
  62. package/src/desktop-auto-render.ts +0 -317
  63. package/src/desktop-cli.ts +0 -1533
  64. package/src/desktop.ts +0 -99
  65. package/src/dev-build.ts +0 -340
  66. package/src/dom.ts +0 -901
  67. package/src/el.ts +0 -183
  68. package/src/fs.ts +0 -609
  69. package/src/hmr.ts +0 -149
  70. package/src/http.ts +0 -856
  71. package/src/https.ts +0 -411
  72. package/src/index.ts +0 -16
  73. package/src/mime-types.ts +0 -222
  74. package/src/mobile-cli.ts +0 -2313
  75. package/src/native-background.ts +0 -444
  76. package/src/native-border.ts +0 -343
  77. package/src/native-canvas.ts +0 -260
  78. package/src/native-cli.ts +0 -414
  79. package/src/native-color.ts +0 -904
  80. package/src/native-estimation.ts +0 -194
  81. package/src/native-grid.ts +0 -590
  82. package/src/native-interaction.ts +0 -1289
  83. package/src/native-layout.ts +0 -568
  84. package/src/native-link.ts +0 -76
  85. package/src/native-render-support.ts +0 -361
  86. package/src/native-spacing.ts +0 -231
  87. package/src/native-state.ts +0 -318
  88. package/src/native-strings.ts +0 -46
  89. package/src/native-transform.ts +0 -120
  90. package/src/native-types.ts +0 -439
  91. package/src/native-typography.ts +0 -254
  92. package/src/native-units.ts +0 -441
  93. package/src/native-vector.ts +0 -910
  94. package/src/native.ts +0 -5606
  95. package/src/path.ts +0 -493
  96. package/src/pm-cli.ts +0 -2498
  97. package/src/preview-build.ts +0 -294
  98. package/src/render-context.ts +0 -138
  99. package/src/router.ts +0 -260
  100. package/src/runtime.ts +0 -97
  101. package/src/server.ts +0 -2294
  102. package/src/state.ts +0 -556
  103. package/src/style.ts +0 -1790
  104. package/src/test-globals.d.ts +0 -184
  105. package/src/test-reporter.ts +0 -609
  106. package/src/test-runtime.ts +0 -1359
  107. package/src/test.ts +0 -368
  108. package/src/types.ts +0 -381
  109. package/src/universal.ts +0 -81
  110. package/src/wapk-cli.ts +0 -3213
  111. package/src/workspace-package.ts +0 -102
  112. package/src/ws.ts +0 -648
  113. package/src/wss.ts +0 -241
package/dist/el.d.mts DELETED
@@ -1,208 +0,0 @@
1
- import { ElementFactory } from './types.mjs';
2
- import 'node:events';
3
- import 'events';
4
- import 'http';
5
- import 'ws';
6
-
7
- /**
8
- * Elit - Element Factories
9
- */
10
-
11
- declare const createElementFactory: (tag: string) => ElementFactory;
12
- declare const tags: readonly ["html", "head", "body", "title", "base", "link", "meta", "style", "address", "article", "aside", "footer", "header", "h1", "h2", "h3", "h4", "h5", "h6", "main", "nav", "section", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "slot", "template"];
13
- declare const svgTags: readonly ["svg", "circle", "rect", "path", "line", "polyline", "polygon", "ellipse", "g", "text", "tspan", "defs", "linearGradient", "radialGradient", "stop", "pattern", "mask", "clipPath", "use", "symbol", "marker", "image", "foreignObject", "animate", "animateTransform", "animateMotion", "set", "filter", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feFlood", "feGaussianBlur", "feMorphology", "feOffset", "feSpecularLighting", "feTile", "feTurbulence"];
14
- declare const mathTags: readonly ["math", "mi", "mn", "mo", "ms", "mtext", "mrow", "mfrac", "msqrt", "mroot", "msub", "msup"];
15
- type Elements = {
16
- [K in typeof tags[number]]: ElementFactory;
17
- } & {
18
- [K in typeof svgTags[number] as `svg${Capitalize<K>}`]: ElementFactory;
19
- } & {
20
- [K in typeof mathTags[number] as `math${Capitalize<K>}`]: ElementFactory;
21
- } & {
22
- varElement: ElementFactory;
23
- };
24
- declare const elements: Partial<Elements>;
25
- declare const html: ElementFactory;
26
- declare const head: ElementFactory;
27
- declare const body: ElementFactory;
28
- declare const title: ElementFactory;
29
- declare const base: ElementFactory;
30
- declare const link: ElementFactory;
31
- declare const meta: ElementFactory;
32
- declare const style: ElementFactory;
33
- declare const address: ElementFactory;
34
- declare const article: ElementFactory;
35
- declare const aside: ElementFactory;
36
- declare const footer: ElementFactory;
37
- declare const header: ElementFactory;
38
- declare const h1: ElementFactory;
39
- declare const h2: ElementFactory;
40
- declare const h3: ElementFactory;
41
- declare const h4: ElementFactory;
42
- declare const h5: ElementFactory;
43
- declare const h6: ElementFactory;
44
- declare const main: ElementFactory;
45
- declare const nav: ElementFactory;
46
- declare const section: ElementFactory;
47
- declare const blockquote: ElementFactory;
48
- declare const dd: ElementFactory;
49
- declare const div: ElementFactory;
50
- declare const dl: ElementFactory;
51
- declare const dt: ElementFactory;
52
- declare const figcaption: ElementFactory;
53
- declare const figure: ElementFactory;
54
- declare const hr: ElementFactory;
55
- declare const li: ElementFactory;
56
- declare const ol: ElementFactory;
57
- declare const p: ElementFactory;
58
- declare const pre: ElementFactory;
59
- declare const ul: ElementFactory;
60
- declare const a: ElementFactory;
61
- declare const abbr: ElementFactory;
62
- declare const b: ElementFactory;
63
- declare const bdi: ElementFactory;
64
- declare const bdo: ElementFactory;
65
- declare const br: ElementFactory;
66
- declare const cite: ElementFactory;
67
- declare const code: ElementFactory;
68
- declare const data: ElementFactory;
69
- declare const dfn: ElementFactory;
70
- declare const em: ElementFactory;
71
- declare const i: ElementFactory;
72
- declare const kbd: ElementFactory;
73
- declare const mark: ElementFactory;
74
- declare const q: ElementFactory;
75
- declare const rp: ElementFactory;
76
- declare const rt: ElementFactory;
77
- declare const ruby: ElementFactory;
78
- declare const s: ElementFactory;
79
- declare const samp: ElementFactory;
80
- declare const small: ElementFactory;
81
- declare const span: ElementFactory;
82
- declare const strong: ElementFactory;
83
- declare const sub: ElementFactory;
84
- declare const sup: ElementFactory;
85
- declare const time: ElementFactory;
86
- declare const u: ElementFactory;
87
- declare const wbr: ElementFactory;
88
- declare const area: ElementFactory;
89
- declare const audio: ElementFactory;
90
- declare const img: ElementFactory;
91
- declare const map: ElementFactory;
92
- declare const track: ElementFactory;
93
- declare const video: ElementFactory;
94
- declare const embed: ElementFactory;
95
- declare const iframe: ElementFactory;
96
- declare const object: ElementFactory;
97
- declare const param: ElementFactory;
98
- declare const picture: ElementFactory;
99
- declare const portal: ElementFactory;
100
- declare const source: ElementFactory;
101
- declare const canvas: ElementFactory;
102
- declare const noscript: ElementFactory;
103
- declare const script: ElementFactory;
104
- declare const del: ElementFactory;
105
- declare const ins: ElementFactory;
106
- declare const caption: ElementFactory;
107
- declare const col: ElementFactory;
108
- declare const colgroup: ElementFactory;
109
- declare const table: ElementFactory;
110
- declare const tbody: ElementFactory;
111
- declare const td: ElementFactory;
112
- declare const tfoot: ElementFactory;
113
- declare const th: ElementFactory;
114
- declare const thead: ElementFactory;
115
- declare const tr: ElementFactory;
116
- declare const button: ElementFactory;
117
- declare const datalist: ElementFactory;
118
- declare const fieldset: ElementFactory;
119
- declare const form: ElementFactory;
120
- declare const input: ElementFactory;
121
- declare const label: ElementFactory;
122
- declare const legend: ElementFactory;
123
- declare const meter: ElementFactory;
124
- declare const optgroup: ElementFactory;
125
- declare const option: ElementFactory;
126
- declare const output: ElementFactory;
127
- declare const progress: ElementFactory;
128
- declare const select: ElementFactory;
129
- declare const textarea: ElementFactory;
130
- declare const details: ElementFactory;
131
- declare const dialog: ElementFactory;
132
- declare const menu: ElementFactory;
133
- declare const summary: ElementFactory;
134
- declare const slot: ElementFactory;
135
- declare const template: ElementFactory;
136
- declare const svgSvg: ElementFactory;
137
- declare const svgCircle: ElementFactory;
138
- declare const svgRect: ElementFactory;
139
- declare const svgPath: ElementFactory;
140
- declare const svgLine: ElementFactory;
141
- declare const svgPolyline: ElementFactory;
142
- declare const svgPolygon: ElementFactory;
143
- declare const svgEllipse: ElementFactory;
144
- declare const svgG: ElementFactory;
145
- declare const svgText: ElementFactory;
146
- declare const svgTspan: ElementFactory;
147
- declare const svgDefs: ElementFactory;
148
- declare const svgLinearGradient: ElementFactory;
149
- declare const svgRadialGradient: ElementFactory;
150
- declare const svgStop: ElementFactory;
151
- declare const svgPattern: ElementFactory;
152
- declare const svgMask: ElementFactory;
153
- declare const svgClipPath: ElementFactory;
154
- declare const svgUse: ElementFactory;
155
- declare const svgSymbol: ElementFactory;
156
- declare const svgMarker: ElementFactory;
157
- declare const svgImage: ElementFactory;
158
- declare const svgForeignObject: ElementFactory;
159
- declare const svgAnimate: ElementFactory;
160
- declare const svgAnimateTransform: ElementFactory;
161
- declare const svgAnimateMotion: ElementFactory;
162
- declare const svgSet: ElementFactory;
163
- declare const svgFilter: ElementFactory;
164
- declare const svgFeBlend: ElementFactory;
165
- declare const svgFeColorMatrix: ElementFactory;
166
- declare const svgFeComponentTransfer: ElementFactory;
167
- declare const svgFeComposite: ElementFactory;
168
- declare const svgFeConvolveMatrix: ElementFactory;
169
- declare const svgFeDiffuseLighting: ElementFactory;
170
- declare const svgFeDisplacementMap: ElementFactory;
171
- declare const svgFeFlood: ElementFactory;
172
- declare const svgFeGaussianBlur: ElementFactory;
173
- declare const svgFeMorphology: ElementFactory;
174
- declare const svgFeOffset: ElementFactory;
175
- declare const svgFeSpecularLighting: ElementFactory;
176
- declare const svgFeTile: ElementFactory;
177
- declare const svgFeTurbulence: ElementFactory;
178
- declare const mathMath: ElementFactory;
179
- declare const mathMi: ElementFactory;
180
- declare const mathMn: ElementFactory;
181
- declare const mathMo: ElementFactory;
182
- declare const mathMs: ElementFactory;
183
- declare const mathMtext: ElementFactory;
184
- declare const mathMrow: ElementFactory;
185
- declare const mathMfrac: ElementFactory;
186
- declare const mathMsqrt: ElementFactory;
187
- declare const mathMroot: ElementFactory;
188
- declare const mathMsub: ElementFactory;
189
- declare const mathMsup: ElementFactory;
190
- declare const varElement: ElementFactory;
191
- declare const el: Partial<Elements>;
192
-
193
- declare const frag: ElementFactory;
194
- declare const doc: any;
195
- declare const getEl: any;
196
- declare const getEls: any;
197
- declare const createEl: any;
198
- declare const createSvgEl: any;
199
- declare const createMathEl: any;
200
- declare const fragment: any;
201
- declare const textNode: any;
202
- declare const commentNode: any;
203
- declare const getElId: any;
204
- declare const getElClass: any;
205
- declare const getElTag: any;
206
- declare const getElName: any;
207
-
208
- export { a, abbr, address, area, article, aside, audio, b, base, bdi, bdo, blockquote, body, br, button, canvas, caption, cite, code, col, colgroup, commentNode, createEl, createElementFactory, createMathEl, createSvgEl, data, datalist, dd, del, details, dfn, dialog, div, dl, doc, dt, el, elements, em, embed, fieldset, figcaption, figure, footer, form, frag, fragment, getEl, getElClass, getElId, getElName, getElTag, getEls, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, kbd, label, legend, li, link, main, map, mark, mathMath, mathMfrac, mathMi, mathMn, mathMo, mathMroot, mathMrow, mathMs, mathMsqrt, mathMsub, mathMsup, mathMtext, menu, meta, meter, nav, noscript, object, ol, optgroup, option, output, p, param, picture, portal, pre, progress, q, rp, rt, ruby, s, samp, script, section, select, slot, small, source, span, strong, style, sub, summary, sup, svgAnimate, svgAnimateMotion, svgAnimateTransform, svgCircle, svgClipPath, svgDefs, svgEllipse, svgFeBlend, svgFeColorMatrix, svgFeComponentTransfer, svgFeComposite, svgFeConvolveMatrix, svgFeDiffuseLighting, svgFeDisplacementMap, svgFeFlood, svgFeGaussianBlur, svgFeMorphology, svgFeOffset, svgFeSpecularLighting, svgFeTile, svgFeTurbulence, svgFilter, svgForeignObject, svgG, svgImage, svgLine, svgLinearGradient, svgMarker, svgMask, svgPath, svgPattern, svgPolygon, svgPolyline, svgRadialGradient, svgRect, svgSet, svgStop, svgSvg, svgSymbol, svgText, svgTspan, svgUse, table, tbody, td, template, textNode, textarea, tfoot, th, thead, time, title, tr, track, u, ul, varElement, video, wbr };
package/dist/fs.d.mts DELETED
@@ -1,255 +0,0 @@
1
- /**
2
- * File System module with unified API across runtimes
3
- * Compatible with Node.js 'fs' module API
4
- * - Node.js: uses 'fs' module
5
- * - Bun: uses Bun.file() and native APIs
6
- * - Deno: uses Deno.readFile(), etc.
7
- */
8
- /**
9
- * File encoding types
10
- */
11
- type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex';
12
- /**
13
- * Read file options
14
- */
15
- interface ReadFileOptions {
16
- encoding?: BufferEncoding | null;
17
- flag?: string;
18
- signal?: AbortSignal;
19
- }
20
- /**
21
- * Write file options
22
- */
23
- interface WriteFileOptions {
24
- encoding?: BufferEncoding | null;
25
- mode?: number;
26
- flag?: string;
27
- signal?: AbortSignal;
28
- }
29
- /**
30
- * Mkdir options
31
- */
32
- interface MkdirOptions {
33
- recursive?: boolean;
34
- mode?: number;
35
- }
36
- /**
37
- * Readdir options
38
- */
39
- interface ReaddirOptions {
40
- encoding?: BufferEncoding | null;
41
- withFileTypes?: boolean;
42
- recursive?: boolean;
43
- }
44
- /**
45
- * File stats
46
- */
47
- interface Stats {
48
- isFile(): boolean;
49
- isDirectory(): boolean;
50
- isBlockDevice(): boolean;
51
- isCharacterDevice(): boolean;
52
- isSymbolicLink(): boolean;
53
- isFIFO(): boolean;
54
- isSocket(): boolean;
55
- dev: number;
56
- ino: number;
57
- mode: number;
58
- nlink: number;
59
- uid: number;
60
- gid: number;
61
- rdev: number;
62
- size: number;
63
- blksize: number;
64
- blocks: number;
65
- atimeMs: number;
66
- mtimeMs: number;
67
- ctimeMs: number;
68
- birthtimeMs: number;
69
- atime: Date;
70
- mtime: Date;
71
- ctime: Date;
72
- birthtime: Date;
73
- }
74
- /**
75
- * Directory entry
76
- */
77
- interface Dirent {
78
- name: string;
79
- isFile(): boolean;
80
- isDirectory(): boolean;
81
- isBlockDevice(): boolean;
82
- isCharacterDevice(): boolean;
83
- isSymbolicLink(): boolean;
84
- isFIFO(): boolean;
85
- isSocket(): boolean;
86
- }
87
- /**
88
- * Read file (async)
89
- */
90
- declare function readFile(path: string, options?: ReadFileOptions | BufferEncoding): Promise<string | Buffer>;
91
- /**
92
- * Read file (sync)
93
- */
94
- declare function readFileSync(path: string, options?: ReadFileOptions | BufferEncoding): string | Buffer;
95
- /**
96
- * Write file (async)
97
- */
98
- declare function writeFile(path: string, data: string | Buffer | Uint8Array, options?: WriteFileOptions | BufferEncoding): Promise<void>;
99
- /**
100
- * Write file (sync)
101
- */
102
- declare function writeFileSync(path: string, data: string | Buffer | Uint8Array, options?: WriteFileOptions | BufferEncoding): void;
103
- /**
104
- * Append file (async)
105
- */
106
- declare function appendFile(path: string, data: string | Buffer, options?: WriteFileOptions | BufferEncoding): Promise<void>;
107
- /**
108
- * Append file (sync)
109
- */
110
- declare function appendFileSync(path: string, data: string | Buffer, options?: WriteFileOptions | BufferEncoding): void;
111
- /**
112
- * Check if file/directory exists (async)
113
- */
114
- declare function exists(path: string): Promise<boolean>;
115
- /**
116
- * Check if file/directory exists (sync)
117
- */
118
- declare function existsSync(path: string): boolean;
119
- /**
120
- * Get file stats (async)
121
- */
122
- declare function stat(path: string): Promise<Stats>;
123
- /**
124
- * Get file stats (sync)
125
- */
126
- declare function statSync(path: string): Stats;
127
- /**
128
- * Create directory (async)
129
- */
130
- declare function mkdir(path: string, options?: MkdirOptions | number): Promise<void>;
131
- /**
132
- * Create directory (sync)
133
- */
134
- declare function mkdirSync(path: string, options?: MkdirOptions | number): void;
135
- /**
136
- * Read directory (async)
137
- */
138
- declare function readdir(path: string, options?: ReaddirOptions | BufferEncoding): Promise<string[] | Dirent[]>;
139
- /**
140
- * Read directory (sync)
141
- */
142
- declare function readdirSync(path: string, options?: ReaddirOptions | BufferEncoding): string[] | Dirent[];
143
- /**
144
- * Remove file (async)
145
- */
146
- declare function unlink(path: string): Promise<void>;
147
- /**
148
- * Remove file (sync)
149
- */
150
- declare function unlinkSync(path: string): void;
151
- /**
152
- * Remove directory (async)
153
- */
154
- declare function rmdir(path: string, options?: {
155
- recursive?: boolean;
156
- }): Promise<void>;
157
- /**
158
- * Remove directory (sync)
159
- */
160
- declare function rmdirSync(path: string, options?: {
161
- recursive?: boolean;
162
- }): void;
163
- /**
164
- * Rename/move file (async)
165
- */
166
- declare function rename(oldPath: string, newPath: string): Promise<void>;
167
- /**
168
- * Rename/move file (sync)
169
- */
170
- declare function renameSync(oldPath: string, newPath: string): void;
171
- /**
172
- * Copy file (async)
173
- */
174
- declare function copyFile(src: string, dest: string, flags?: number): Promise<void>;
175
- /**
176
- * Copy file (sync)
177
- */
178
- declare function copyFileSync(src: string, dest: string, flags?: number): void;
179
- /**
180
- * Resolve pathname to absolute path (async)
181
- */
182
- declare function realpath(path: string, options?: {
183
- encoding?: BufferEncoding;
184
- }): Promise<string>;
185
- /**
186
- * Resolve pathname to absolute path (sync)
187
- */
188
- declare function realpathSync(path: string, options?: {
189
- encoding?: BufferEncoding;
190
- }): string;
191
- /**
192
- * Get current runtime
193
- */
194
- declare function getRuntime(): 'node' | 'bun' | 'deno';
195
- /**
196
- * Promises API (re-export for compatibility)
197
- */
198
- declare const promises: {
199
- readFile: typeof readFile;
200
- writeFile: typeof writeFile;
201
- appendFile: typeof appendFile;
202
- stat: typeof stat;
203
- mkdir: typeof mkdir;
204
- readdir: typeof readdir;
205
- unlink: typeof unlink;
206
- rmdir: typeof rmdir;
207
- rename: typeof rename;
208
- copyFile: typeof copyFile;
209
- realpath: typeof realpath;
210
- };
211
- /**
212
- * Default export
213
- */
214
- declare const _default: {
215
- readFile: typeof readFile;
216
- readFileSync: typeof readFileSync;
217
- writeFile: typeof writeFile;
218
- writeFileSync: typeof writeFileSync;
219
- appendFile: typeof appendFile;
220
- appendFileSync: typeof appendFileSync;
221
- exists: typeof exists;
222
- existsSync: typeof existsSync;
223
- stat: typeof stat;
224
- statSync: typeof statSync;
225
- mkdir: typeof mkdir;
226
- mkdirSync: typeof mkdirSync;
227
- readdir: typeof readdir;
228
- readdirSync: typeof readdirSync;
229
- unlink: typeof unlink;
230
- unlinkSync: typeof unlinkSync;
231
- rmdir: typeof rmdir;
232
- rmdirSync: typeof rmdirSync;
233
- rename: typeof rename;
234
- renameSync: typeof renameSync;
235
- copyFile: typeof copyFile;
236
- copyFileSync: typeof copyFileSync;
237
- realpath: typeof realpath;
238
- realpathSync: typeof realpathSync;
239
- promises: {
240
- readFile: typeof readFile;
241
- writeFile: typeof writeFile;
242
- appendFile: typeof appendFile;
243
- stat: typeof stat;
244
- mkdir: typeof mkdir;
245
- readdir: typeof readdir;
246
- unlink: typeof unlink;
247
- rmdir: typeof rmdir;
248
- rename: typeof rename;
249
- copyFile: typeof copyFile;
250
- realpath: typeof realpath;
251
- };
252
- getRuntime: typeof getRuntime;
253
- };
254
-
255
- export { type BufferEncoding, type Dirent, type MkdirOptions, type ReadFileOptions, type ReaddirOptions, type Stats, type WriteFileOptions, appendFile, appendFileSync, copyFile, copyFileSync, _default as default, exists, existsSync, getRuntime, mkdir, mkdirSync, promises, readFile, readFileSync, readdir, readdirSync, realpath, realpathSync, rename, renameSync, rmdir, rmdirSync, stat, statSync, unlink, unlinkSync, writeFile, writeFileSync };
package/dist/hmr.d.mts DELETED
@@ -1,38 +0,0 @@
1
- /**
2
- * Client-side HMR runtime for Elit
3
- * Import this in your app to enable hot module replacement
4
- */
5
- interface HMRClient {
6
- /** Check if HMR is enabled */
7
- enabled: boolean;
8
- /** Manually reload the page */
9
- reload: () => void;
10
- /** Accept HMR updates for current module */
11
- accept: (callback?: () => void) => void;
12
- /** Decline HMR updates (forces full reload) */
13
- decline: () => void;
14
- /** Dispose callback before module is replaced */
15
- dispose: (callback: () => void) => void;
16
- }
17
- declare global {
18
- interface Window {
19
- __ELIT_HMR__: HMRClient;
20
- }
21
- }
22
- declare class ElitHMR implements HMRClient {
23
- enabled: boolean;
24
- private ws;
25
- private acceptCallbacks;
26
- private disposeCallbacks;
27
- private declined;
28
- constructor();
29
- private connect;
30
- private handleMessage;
31
- reload(): void;
32
- accept(callback?: () => void): void;
33
- decline(): void;
34
- dispose(callback: () => void): void;
35
- }
36
- declare const hmr: ElitHMR;
37
-
38
- export { type HMRClient, hmr as default };
package/dist/http.d.mts DELETED
@@ -1,169 +0,0 @@
1
- import { EventEmitter } from 'node:events';
2
-
3
- /**
4
- * HTTP module with unified API across runtimes
5
- * Ultra-optimized for maximum performance across Node.js, Bun, and Deno
6
- *
7
- * Performance optimizations:
8
- * - Bun fast path: Zero class instantiation (object literals only)
9
- * - Eliminated EventEmitter overhead for Bun/Deno
10
- * - Zero-copy headers conversion
11
- * - Inline response creation
12
- * - Reduced object allocations
13
- * - Direct closure capture (no resolver indirection)
14
- */
15
-
16
- /**
17
- * HTTP Methods
18
- */
19
- declare const METHODS: readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
20
- /**
21
- * HTTP Status Codes (compact object)
22
- */
23
- declare const STATUS_CODES: Record<number, string>;
24
- /**
25
- * HTTP Headers type
26
- */
27
- type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
28
- type OutgoingHttpHeaders = Record<string, string | string[] | number>;
29
- /**
30
- * IncomingMessage - Ultra-optimized for zero-copy operations
31
- */
32
- declare class IncomingMessage extends EventEmitter {
33
- method: string;
34
- url: string;
35
- headers: IncomingHttpHeaders;
36
- statusCode?: number;
37
- statusMessage?: string;
38
- httpVersion: string;
39
- rawHeaders: string[];
40
- socket: any;
41
- private _req;
42
- constructor(req: any);
43
- text(): Promise<string>;
44
- json(): Promise<any>;
45
- }
46
- /**
47
- * ServerResponse - Ultra-optimized write operations
48
- */
49
- declare class ServerResponse extends EventEmitter {
50
- statusCode: number;
51
- statusMessage: string;
52
- headersSent: boolean;
53
- private _headers;
54
- private _body;
55
- private _resolve?;
56
- private _finished;
57
- private _nodeRes?;
58
- constructor(_req?: IncomingMessage, nodeRes?: any);
59
- setHeader(name: string, value: string | string[] | number): this;
60
- getHeader(name: string): string | string[] | number | undefined;
61
- getHeaders(): OutgoingHttpHeaders;
62
- getHeaderNames(): string[];
63
- hasHeader(name: string): boolean;
64
- removeHeader(name: string): void;
65
- writeHead(statusCode: number, statusMessage?: string | OutgoingHttpHeaders, headers?: OutgoingHttpHeaders): this;
66
- write(chunk: any, encoding?: BufferEncoding | (() => void), callback?: () => void): boolean;
67
- end(chunk?: any, encoding?: BufferEncoding | (() => void), callback?: () => void): this;
68
- _setResolver(resolve: (response: Response) => void): void;
69
- json(data: any, statusCode?: number): this;
70
- send(data: any): this;
71
- status(code: number): this;
72
- }
73
- /**
74
- * Server - Optimized for each runtime
75
- */
76
- declare class Server extends EventEmitter {
77
- private nativeServer?;
78
- private requestListener?;
79
- private _bunWebSocketServers;
80
- _listening: boolean;
81
- constructor(requestListener?: RequestListener);
82
- registerWebSocketServer(wsServer: any): void;
83
- unregisterWebSocketServer(wsServer: any): void;
84
- listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
85
- listen(port?: number, hostname?: string, listeningListener?: () => void): this;
86
- listen(port?: number, listeningListener?: () => void): this;
87
- listen(options?: {
88
- port?: number;
89
- hostname?: string;
90
- backlog?: number;
91
- }, listeningListener?: () => void): this;
92
- close(callback?: (err?: Error) => void): this;
93
- address(): {
94
- port: number;
95
- family: string;
96
- address: string;
97
- } | null;
98
- get listening(): boolean;
99
- }
100
- /**
101
- * Request listener type
102
- */
103
- type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
104
- /**
105
- * Request options
106
- */
107
- interface RequestOptions {
108
- method?: string;
109
- headers?: OutgoingHttpHeaders;
110
- timeout?: number;
111
- signal?: AbortSignal;
112
- }
113
- /**
114
- * Server options
115
- */
116
- interface ServerOptions {
117
- IncomingMessage?: typeof IncomingMessage;
118
- ServerResponse?: typeof ServerResponse;
119
- }
120
- /**
121
- * Client request - lightweight wrapper
122
- */
123
- declare class ClientRequest extends EventEmitter {
124
- constructor(_url: string | URL, _options?: RequestOptions);
125
- write(_chunk: any): boolean;
126
- end(callback?: () => void): void;
127
- }
128
- /**
129
- * HTTP Agent
130
- */
131
- declare class Agent {
132
- options?: any | undefined;
133
- constructor(options?: any | undefined);
134
- }
135
- /**
136
- * Create HTTP server
137
- */
138
- declare function createServer(requestListener?: RequestListener): Server;
139
- declare function createServer(options: ServerOptions, requestListener?: RequestListener): Server;
140
- /**
141
- * Make HTTP request - optimized per runtime
142
- */
143
- declare function request(url: string | URL, options?: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
144
- /**
145
- * Make HTTP GET request
146
- */
147
- declare function get(url: string | URL, options?: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
148
- /**
149
- * Get current runtime
150
- */
151
- declare function getRuntime(): 'node' | 'bun' | 'deno';
152
- /**
153
- * Default export
154
- */
155
- declare const _default: {
156
- createServer: typeof createServer;
157
- request: typeof request;
158
- get: typeof get;
159
- Server: typeof Server;
160
- IncomingMessage: typeof IncomingMessage;
161
- ServerResponse: typeof ServerResponse;
162
- Agent: typeof Agent;
163
- ClientRequest: typeof ClientRequest;
164
- METHODS: readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
165
- STATUS_CODES: Record<number, string>;
166
- getRuntime: typeof getRuntime;
167
- };
168
-
169
- export { Agent, ClientRequest, type IncomingHttpHeaders, IncomingMessage, METHODS, type OutgoingHttpHeaders, type RequestListener, type RequestOptions, STATUS_CODES, Server, type ServerOptions, ServerResponse, createServer, _default as default, get, getRuntime, request };