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/index.d.mts DELETED
@@ -1,629 +0,0 @@
1
- import { P as Props, C as Children, V as VNode, a as Child, S as StateOptions, b as State, c as VirtualListController, J as JsonNode, d as VNodeJson, E as ElementFactory } from './types-C0nGi6MX.mjs';
2
- export { B as BuildOptions, j as BuildResult, g as ClientConfig, i as DevServer, D as DevServerOptions, H as HMRMessage, k as PreviewOptions, h as ProxyConfig, R as RefCallback, e as RefObject, f as StateManager, W as WorkerConfig } from './types-C0nGi6MX.mjs';
3
- import './http.mjs';
4
- import 'node:events';
5
- import './ws.mjs';
6
- import 'events';
7
- import 'http';
8
- import 'ws';
9
-
10
- /**
11
- * Elit - DomNode Core Class
12
- */
13
-
14
- declare class DomNode {
15
- private elementCache;
16
- createElement(tagName: string, props?: Props, children?: Children): VNode;
17
- renderToDOM(vNode: Child, parent: HTMLElement | SVGElement | DocumentFragment): void;
18
- render(rootElement: string | HTMLElement, vNode: VNode): HTMLElement;
19
- batchRender(rootElement: string | HTMLElement, vNodes: VNode[]): HTMLElement;
20
- renderChunked(rootElement: string | HTMLElement, vNodes: VNode[], chunkSize?: number, onProgress?: (current: number, total: number) => void): HTMLElement;
21
- renderToHead(...vNodes: Array<VNode | VNode[]>): HTMLHeadElement | null;
22
- addStyle(cssText: string): HTMLStyleElement;
23
- addMeta(attrs: Record<string, string>): HTMLMetaElement;
24
- addLink(attrs: Record<string, string>): HTMLLinkElement;
25
- setTitle(text: string): string;
26
- createState<T>(initialValue: T, options?: StateOptions): State<T>;
27
- computed<T extends any[], R>(states: {
28
- [K in keyof T]: State<T[K]>;
29
- }, computeFn: (...values: T) => R): State<R>;
30
- effect(stateFn: () => void): void;
31
- createVirtualList<T>(container: HTMLElement, items: T[], renderItem: (item: T, index: number) => VNode, itemHeight?: number, bufferSize?: number): VirtualListController;
32
- lazy<T extends any[], R>(loadFn: () => Promise<(...args: T) => R>): (...args: T) => Promise<R | VNode>;
33
- cleanupUnusedElements(root: HTMLElement): number;
34
- renderToString(vNode: Child, options?: {
35
- pretty?: boolean;
36
- indent?: number;
37
- }): string;
38
- private resolveStateValue;
39
- private isReactiveWrapper;
40
- private unwrapReactive;
41
- private escapeHtml;
42
- private isSelfClosingTag;
43
- private propsToAttributes;
44
- private styleToString;
45
- private isState;
46
- private reactiveNodes;
47
- private createReactiveChild;
48
- jsonToVNode(json: JsonNode | string | number | boolean | null | undefined | State<any>): Child;
49
- vNodeJsonToVNode(json: VNodeJson | State<any>): Child;
50
- renderJson(rootElement: string | HTMLElement, json: JsonNode): HTMLElement;
51
- renderVNode(rootElement: string | HTMLElement, json: VNodeJson): HTMLElement;
52
- renderJsonToString(json: JsonNode, options?: {
53
- pretty?: boolean;
54
- indent?: number;
55
- }): string;
56
- renderVNodeToString(json: VNodeJson, options?: {
57
- pretty?: boolean;
58
- indent?: number;
59
- }): string;
60
- renderToHTMLDocument(vNode: Child, options?: {
61
- title?: string;
62
- meta?: Array<Record<string, string>>;
63
- links?: Array<Record<string, string>>;
64
- scripts?: Array<{
65
- src?: string;
66
- content?: string;
67
- async?: boolean;
68
- defer?: boolean;
69
- type?: string;
70
- }>;
71
- styles?: Array<{
72
- href?: string;
73
- content?: string;
74
- }>;
75
- lang?: string;
76
- head?: string;
77
- bodyAttrs?: Record<string, string>;
78
- pretty?: boolean;
79
- }): string;
80
- getElementCache(): WeakMap<Element, boolean>;
81
- }
82
- declare const dom: DomNode;
83
- declare const render: (rootElement: string | HTMLElement, vNode: VNode) => HTMLElement;
84
- declare const renderToString: (vNode: Child, options?: {
85
- pretty?: boolean;
86
- indent?: number;
87
- }) => string;
88
- declare const mount: (rootElement: string | HTMLElement, vNode: VNode) => HTMLElement;
89
-
90
- /**
91
- * Elit - State Management
92
- */
93
-
94
- declare const createState: <T>(initial: T, options?: StateOptions) => State<T>;
95
- declare const computed: <T extends any[], R>(states: { [K in keyof T]: State<T[K]>; }, fn: (...values: T) => R) => State<R>;
96
- declare const effect: (fn: () => void) => void;
97
- declare const batchRender: (container: string | HTMLElement, vNodes: VNode[]) => HTMLElement;
98
- declare const renderChunked: (container: string | HTMLElement, vNodes: VNode[], chunkSize?: number, onProgress?: (current: number, total: number) => void) => HTMLElement;
99
- declare const createVirtualList: <T>(container: HTMLElement, items: T[], renderItem: (item: T, index: number) => VNode, itemHeight?: number, bufferSize?: number) => VirtualListController;
100
- declare const lazy: <T extends any[], R>(loadFn: () => Promise<(...args: T) => R>) => (...args: T) => Promise<VNode | R>;
101
- declare const cleanupUnused: (root: HTMLElement) => number;
102
- declare const throttle: <T extends any[]>(fn: (...args: T) => void, delay: number) => (...args: T) => void;
103
- declare const debounce: <T extends any[]>(fn: (...args: T) => void, delay: number) => (...args: T) => void;
104
- type StateChangeCallback<T = any> = (value: T, oldValue: T) => void;
105
- /**
106
- * Shared State - syncs with elit-server
107
- */
108
- declare class SharedState<T = any> {
109
- readonly key: string;
110
- private wsUrl?;
111
- private localState;
112
- private ws;
113
- private pendingUpdates;
114
- private previousValue;
115
- constructor(key: string, defaultValue: T, wsUrl?: string | undefined);
116
- /**
117
- * Get current value
118
- */
119
- get value(): T;
120
- /**
121
- * Set new value and sync to server
122
- */
123
- set value(newValue: T);
124
- /**
125
- * Get the underlying Elit State (for reactive binding)
126
- */
127
- get state(): State<T>;
128
- /**
129
- * Subscribe to changes (returns Elit State for reactive)
130
- */
131
- onChange(callback: StateChangeCallback<T>): () => void;
132
- /**
133
- * Update value using a function
134
- */
135
- update(updater: (current: T) => T): void;
136
- /**
137
- * Connect to WebSocket
138
- */
139
- private connect;
140
- /**
141
- * Subscribe to server state
142
- */
143
- private subscribe;
144
- /**
145
- * Handle message from server
146
- */
147
- private handleMessage;
148
- /**
149
- * Send value to server
150
- */
151
- private sendToServer;
152
- /**
153
- * Disconnect
154
- */
155
- disconnect(): void;
156
- /**
157
- * Destroy state and cleanup
158
- */
159
- destroy(): void;
160
- }
161
- /**
162
- * Create a shared state that syncs with elit-server
163
- */
164
- declare function createSharedState<T>(key: string, defaultValue: T, wsUrl?: string): SharedState<T>;
165
- /**
166
- * Shared State Manager for managing multiple shared states
167
- */
168
- declare class SharedStateManager {
169
- private states;
170
- /**
171
- * Create or get a shared state
172
- */
173
- create<T>(key: string, defaultValue: T, wsUrl?: string): SharedState<T>;
174
- /**
175
- * Get existing state
176
- */
177
- get<T>(key: string): SharedState<T> | undefined;
178
- /**
179
- * Delete a state
180
- */
181
- delete(key: string): boolean;
182
- /**
183
- * Clear all states
184
- */
185
- clear(): void;
186
- }
187
- declare const sharedStateManager: SharedStateManager;
188
- declare const reactive: <T>(state: State<T>, renderFn: (value: T) => VNode | Child) => VNode;
189
- declare const reactiveAs: <T>(tagName: string, state: State<T>, renderFn: (value: T) => VNode | Child, props?: Props) => VNode;
190
- declare const text: (state: State<any> | any) => VNode | string;
191
- declare const bindValue: <T extends string | number>(state: State<T>) => Props;
192
- declare const bindChecked: (state: State<boolean>) => Props;
193
-
194
- /**
195
- * Elit - CreateStyle CSS Generation System
196
- */
197
- interface CSSVariable {
198
- name: string;
199
- value: string;
200
- toString(): string;
201
- }
202
- interface CSSRule {
203
- selector: string;
204
- styles: Record<string, string | number>;
205
- nested?: CSSRule[];
206
- type: 'tag' | 'class' | 'id' | 'pseudo-class' | 'pseudo-element' | 'name' | 'custom' | 'media' | 'attribute';
207
- }
208
- interface MediaRule {
209
- type: string;
210
- condition: string;
211
- rules: CSSRule[];
212
- }
213
- interface KeyframeStep {
214
- step: string | number;
215
- styles: Record<string, string | number>;
216
- }
217
- interface Keyframes {
218
- name: string;
219
- steps: KeyframeStep[];
220
- }
221
- interface FontFace {
222
- fontFamily: string;
223
- src: string;
224
- fontWeight?: string | number;
225
- fontStyle?: string;
226
- fontDisplay?: string;
227
- unicodeRange?: string;
228
- }
229
- interface ContainerRule {
230
- name?: string;
231
- condition: string;
232
- rules: CSSRule[];
233
- }
234
- interface SupportsRule {
235
- condition: string;
236
- rules: CSSRule[];
237
- }
238
- interface LayerRule {
239
- name: string;
240
- rules: CSSRule[];
241
- }
242
- declare class CreateStyle {
243
- private variables;
244
- private rules;
245
- private mediaRules;
246
- private keyframes;
247
- private fontFaces;
248
- private imports;
249
- private containerRules;
250
- private supportsRules;
251
- private layerRules;
252
- private _layerOrder;
253
- addVar(name: string, value: string): CSSVariable;
254
- var(variable: CSSVariable | string, fallback?: string): string;
255
- addTag(tag: string, styles: Record<string, string | number>): CSSRule;
256
- addClass(name: string, styles: Record<string, string | number>): CSSRule;
257
- addId(name: string, styles: Record<string, string | number>): CSSRule;
258
- addPseudoClass(pseudo: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
259
- addPseudoElement(pseudo: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
260
- addAttribute(attr: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
261
- attrEquals(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
262
- attrContainsWord(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
263
- attrStartsWith(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
264
- attrEndsWith(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
265
- attrContains(attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string): CSSRule;
266
- descendant(ancestor: string, descendant: string, styles: Record<string, string | number>): CSSRule;
267
- child(parent: string, childSel: string, styles: Record<string, string | number>): CSSRule;
268
- adjacentSibling(element: string, sibling: string, styles: Record<string, string | number>): CSSRule;
269
- generalSibling(element: string, sibling: string, styles: Record<string, string | number>): CSSRule;
270
- multiple(selectors: string[], styles: Record<string, string | number>): CSSRule;
271
- addName(name: string, styles: Record<string, string | number>): CSSRule;
272
- nesting(parentRule: CSSRule, ...childRules: CSSRule[]): CSSRule;
273
- keyframe(name: string, steps: Record<string | number, Record<string, string | number>>): Keyframes;
274
- keyframeFromTo(name: string, from: Record<string, string | number>, to: Record<string, string | number>): Keyframes;
275
- fontFace(options: FontFace): FontFace;
276
- import(url: string, mediaQuery?: string): string;
277
- media(type: string, condition: string, rules: Record<string, Record<string, string | number>>): MediaRule;
278
- mediaScreen(condition: string, rules: Record<string, Record<string, string | number>>): MediaRule;
279
- mediaPrint(rules: Record<string, Record<string, string | number>>): MediaRule;
280
- mediaMinWidth(minWidth: string, rules: Record<string, Record<string, string | number>>): MediaRule;
281
- mediaMaxWidth(maxWidth: string, rules: Record<string, Record<string, string | number>>): MediaRule;
282
- mediaDark(rules: Record<string, Record<string, string | number>>): MediaRule;
283
- mediaLight(rules: Record<string, Record<string, string | number>>): MediaRule;
284
- mediaReducedMotion(rules: Record<string, Record<string, string | number>>): MediaRule;
285
- container(condition: string, rules: Record<string, Record<string, string | number>>, name?: string): ContainerRule;
286
- addContainer(name: string, styles: Record<string, string | number>): CSSRule;
287
- supports(condition: string, rules: Record<string, Record<string, string | number>>): SupportsRule;
288
- layerOrder(...layers: string[]): void;
289
- layer(name: string, rules: Record<string, Record<string, string | number>>): LayerRule;
290
- add(rules: Record<string, Record<string, string | number>>): CSSRule[];
291
- important(value: string | number): string;
292
- private toKebabCase;
293
- private createAndAddRule;
294
- private rulesToCSSRules;
295
- private renderRulesWithIndent;
296
- private stylesToString;
297
- private renderRule;
298
- private renderMediaRule;
299
- private renderKeyframes;
300
- private renderFontFace;
301
- private renderContainerRule;
302
- private renderSupportsRule;
303
- private renderLayerRule;
304
- render(...additionalRules: (CSSRule | CSSRule[] | MediaRule | Keyframes | ContainerRule | SupportsRule | LayerRule | undefined | null)[]): string;
305
- inject(styleId?: string): HTMLStyleElement;
306
- clear(): void;
307
- }
308
- declare const styles: CreateStyle;
309
- declare const addVar: (name: string, value: string) => CSSVariable;
310
- declare const getVar: (variable: CSSVariable | string, fallback?: string) => string;
311
- declare const addTag: (tag: string, styles: Record<string, string | number>) => CSSRule;
312
- declare const addClass: (name: string, styles: Record<string, string | number>) => CSSRule;
313
- declare const addId: (name: string, styles: Record<string, string | number>) => CSSRule;
314
- declare const addPseudoClass: (pseudo: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
315
- declare const addPseudoElement: (pseudo: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
316
- declare const addAttribute: (attr: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
317
- declare const attrEquals: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
318
- declare const attrContainsWord: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
319
- declare const attrStartsWith: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
320
- declare const attrEndsWith: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
321
- declare const attrContains: (attr: string, value: string, styles: Record<string, string | number>, baseSelector?: string) => CSSRule;
322
- declare const descendant: (ancestor: string, descendant: string, styles: Record<string, string | number>) => CSSRule;
323
- declare const childStyle: (parent: string, childSel: string, styles: Record<string, string | number>) => CSSRule;
324
- declare const adjacentSibling: (element: string, sibling: string, styles: Record<string, string | number>) => CSSRule;
325
- declare const generalSibling: (element: string, sibling: string, styles: Record<string, string | number>) => CSSRule;
326
- declare const multipleStyle: (selectors: string[], styles: Record<string, string | number>) => CSSRule;
327
- declare const addName: (name: string, styles: Record<string, string | number>) => CSSRule;
328
- declare const nesting: (parentRule: CSSRule, ...childRules: CSSRule[]) => CSSRule;
329
- declare const keyframe: (name: string, steps: Record<string | number, Record<string, string | number>>) => Keyframes;
330
- declare const keyframeFromTo: (name: string, from: Record<string, string | number>, to: Record<string, string | number>) => Keyframes;
331
- declare const fontFace: (options: FontFace) => FontFace;
332
- declare const importStyle: (url: string, mediaQuery?: string) => string;
333
- declare const mediaStyle: (type: string, condition: string, rules: Record<string, Record<string, string | number>>) => MediaRule;
334
- declare const mediaScreen: (condition: string, rules: Record<string, Record<string, string | number>>) => MediaRule;
335
- declare const mediaPrint: (rules: Record<string, Record<string, string | number>>) => MediaRule;
336
- declare const mediaMinWidth: (minWidth: string, rules: Record<string, Record<string, string | number>>) => MediaRule;
337
- declare const mediaMaxWidth: (maxWidth: string, rules: Record<string, Record<string, string | number>>) => MediaRule;
338
- declare const mediaDark: (rules: Record<string, Record<string, string | number>>) => MediaRule;
339
- declare const mediaLight: (rules: Record<string, Record<string, string | number>>) => MediaRule;
340
- declare const mediaReducedMotion: (rules: Record<string, Record<string, string | number>>) => MediaRule;
341
- declare const container: (condition: string, rules: Record<string, Record<string, string | number>>, name?: string) => ContainerRule;
342
- declare const addContainer: (name: string, styles: Record<string, string | number>) => CSSRule;
343
- declare const supportsStyle: (condition: string, rules: Record<string, Record<string, string | number>>) => SupportsRule;
344
- declare const layerOrder: (...layers: string[]) => void;
345
- declare const layer: (name: string, rules: Record<string, Record<string, string | number>>) => LayerRule;
346
- declare const addStyle: (rules: Record<string, Record<string, string | number>>) => CSSRule[];
347
- declare const important: (value: string | number) => string;
348
- declare const renderStyle: (...additionalRules: (CSSRule | CSSRule[] | MediaRule | Keyframes | ContainerRule | SupportsRule | LayerRule | undefined | null)[]) => string;
349
- declare const injectStyle: (styleId?: string) => HTMLStyleElement;
350
- declare const clearStyle: () => void;
351
-
352
- /**
353
- * Elit - Element Factories
354
- */
355
-
356
- declare const createElementFactory: (tag: string) => ElementFactory;
357
- 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"];
358
- 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"];
359
- declare const mathTags: readonly ["math", "mi", "mn", "mo", "ms", "mtext", "mrow", "mfrac", "msqrt", "mroot", "msub", "msup"];
360
- type Elements = {
361
- [K in typeof tags[number]]: ElementFactory;
362
- } & {
363
- [K in typeof svgTags[number] as `svg${Capitalize<K>}`]: ElementFactory;
364
- } & {
365
- [K in typeof mathTags[number] as `math${Capitalize<K>}`]: ElementFactory;
366
- } & {
367
- varElement: ElementFactory;
368
- };
369
- declare const elements: Partial<Elements>;
370
- declare const html: ElementFactory;
371
- declare const head: ElementFactory;
372
- declare const body: ElementFactory;
373
- declare const title: ElementFactory;
374
- declare const base: ElementFactory;
375
- declare const link: ElementFactory;
376
- declare const meta: ElementFactory;
377
- declare const style: ElementFactory;
378
- declare const address: ElementFactory;
379
- declare const article: ElementFactory;
380
- declare const aside: ElementFactory;
381
- declare const footer: ElementFactory;
382
- declare const header: ElementFactory;
383
- declare const h1: ElementFactory;
384
- declare const h2: ElementFactory;
385
- declare const h3: ElementFactory;
386
- declare const h4: ElementFactory;
387
- declare const h5: ElementFactory;
388
- declare const h6: ElementFactory;
389
- declare const main: ElementFactory;
390
- declare const nav: ElementFactory;
391
- declare const section: ElementFactory;
392
- declare const blockquote: ElementFactory;
393
- declare const dd: ElementFactory;
394
- declare const div: ElementFactory;
395
- declare const dl: ElementFactory;
396
- declare const dt: ElementFactory;
397
- declare const figcaption: ElementFactory;
398
- declare const figure: ElementFactory;
399
- declare const hr: ElementFactory;
400
- declare const li: ElementFactory;
401
- declare const ol: ElementFactory;
402
- declare const p: ElementFactory;
403
- declare const pre: ElementFactory;
404
- declare const ul: ElementFactory;
405
- declare const a: ElementFactory;
406
- declare const abbr: ElementFactory;
407
- declare const b: ElementFactory;
408
- declare const bdi: ElementFactory;
409
- declare const bdo: ElementFactory;
410
- declare const br: ElementFactory;
411
- declare const cite: ElementFactory;
412
- declare const code: ElementFactory;
413
- declare const data: ElementFactory;
414
- declare const dfn: ElementFactory;
415
- declare const em: ElementFactory;
416
- declare const i: ElementFactory;
417
- declare const kbd: ElementFactory;
418
- declare const mark: ElementFactory;
419
- declare const q: ElementFactory;
420
- declare const rp: ElementFactory;
421
- declare const rt: ElementFactory;
422
- declare const ruby: ElementFactory;
423
- declare const s: ElementFactory;
424
- declare const samp: ElementFactory;
425
- declare const small: ElementFactory;
426
- declare const span: ElementFactory;
427
- declare const strong: ElementFactory;
428
- declare const sub: ElementFactory;
429
- declare const sup: ElementFactory;
430
- declare const time: ElementFactory;
431
- declare const u: ElementFactory;
432
- declare const wbr: ElementFactory;
433
- declare const area: ElementFactory;
434
- declare const audio: ElementFactory;
435
- declare const img: ElementFactory;
436
- declare const map: ElementFactory;
437
- declare const track: ElementFactory;
438
- declare const video: ElementFactory;
439
- declare const embed: ElementFactory;
440
- declare const iframe: ElementFactory;
441
- declare const object: ElementFactory;
442
- declare const param: ElementFactory;
443
- declare const picture: ElementFactory;
444
- declare const portal: ElementFactory;
445
- declare const source: ElementFactory;
446
- declare const canvas: ElementFactory;
447
- declare const noscript: ElementFactory;
448
- declare const script: ElementFactory;
449
- declare const del: ElementFactory;
450
- declare const ins: ElementFactory;
451
- declare const caption: ElementFactory;
452
- declare const col: ElementFactory;
453
- declare const colgroup: ElementFactory;
454
- declare const table: ElementFactory;
455
- declare const tbody: ElementFactory;
456
- declare const td: ElementFactory;
457
- declare const tfoot: ElementFactory;
458
- declare const th: ElementFactory;
459
- declare const thead: ElementFactory;
460
- declare const tr: ElementFactory;
461
- declare const button: ElementFactory;
462
- declare const datalist: ElementFactory;
463
- declare const fieldset: ElementFactory;
464
- declare const form: ElementFactory;
465
- declare const input: ElementFactory;
466
- declare const label: ElementFactory;
467
- declare const legend: ElementFactory;
468
- declare const meter: ElementFactory;
469
- declare const optgroup: ElementFactory;
470
- declare const option: ElementFactory;
471
- declare const output: ElementFactory;
472
- declare const progress: ElementFactory;
473
- declare const select: ElementFactory;
474
- declare const textarea: ElementFactory;
475
- declare const details: ElementFactory;
476
- declare const dialog: ElementFactory;
477
- declare const menu: ElementFactory;
478
- declare const summary: ElementFactory;
479
- declare const slot: ElementFactory;
480
- declare const template: ElementFactory;
481
- declare const svgSvg: ElementFactory;
482
- declare const svgCircle: ElementFactory;
483
- declare const svgRect: ElementFactory;
484
- declare const svgPath: ElementFactory;
485
- declare const svgLine: ElementFactory;
486
- declare const svgPolyline: ElementFactory;
487
- declare const svgPolygon: ElementFactory;
488
- declare const svgEllipse: ElementFactory;
489
- declare const svgG: ElementFactory;
490
- declare const svgText: ElementFactory;
491
- declare const svgTspan: ElementFactory;
492
- declare const svgDefs: ElementFactory;
493
- declare const svgLinearGradient: ElementFactory;
494
- declare const svgRadialGradient: ElementFactory;
495
- declare const svgStop: ElementFactory;
496
- declare const svgPattern: ElementFactory;
497
- declare const svgMask: ElementFactory;
498
- declare const svgClipPath: ElementFactory;
499
- declare const svgUse: ElementFactory;
500
- declare const svgSymbol: ElementFactory;
501
- declare const svgMarker: ElementFactory;
502
- declare const svgImage: ElementFactory;
503
- declare const svgForeignObject: ElementFactory;
504
- declare const svgAnimate: ElementFactory;
505
- declare const svgAnimateTransform: ElementFactory;
506
- declare const svgAnimateMotion: ElementFactory;
507
- declare const svgSet: ElementFactory;
508
- declare const svgFilter: ElementFactory;
509
- declare const svgFeBlend: ElementFactory;
510
- declare const svgFeColorMatrix: ElementFactory;
511
- declare const svgFeComponentTransfer: ElementFactory;
512
- declare const svgFeComposite: ElementFactory;
513
- declare const svgFeConvolveMatrix: ElementFactory;
514
- declare const svgFeDiffuseLighting: ElementFactory;
515
- declare const svgFeDisplacementMap: ElementFactory;
516
- declare const svgFeFlood: ElementFactory;
517
- declare const svgFeGaussianBlur: ElementFactory;
518
- declare const svgFeMorphology: ElementFactory;
519
- declare const svgFeOffset: ElementFactory;
520
- declare const svgFeSpecularLighting: ElementFactory;
521
- declare const svgFeTile: ElementFactory;
522
- declare const svgFeTurbulence: ElementFactory;
523
- declare const mathMath: ElementFactory;
524
- declare const mathMi: ElementFactory;
525
- declare const mathMn: ElementFactory;
526
- declare const mathMo: ElementFactory;
527
- declare const mathMs: ElementFactory;
528
- declare const mathMtext: ElementFactory;
529
- declare const mathMrow: ElementFactory;
530
- declare const mathMfrac: ElementFactory;
531
- declare const mathMsqrt: ElementFactory;
532
- declare const mathMroot: ElementFactory;
533
- declare const mathMsub: ElementFactory;
534
- declare const mathMsup: ElementFactory;
535
- declare const varElement: ElementFactory;
536
- declare const el: Partial<Elements>;
537
-
538
- declare const doc: any;
539
- declare const getEl: any;
540
- declare const getEls: any;
541
- declare const createEl: any;
542
- declare const createSvgEl: any;
543
- declare const createMathEl: any;
544
- declare const fragment: any;
545
- declare const textNode: any;
546
- declare const commentNode: any;
547
- declare const getElId: any;
548
- declare const getElClass: any;
549
- declare const getElTag: any;
550
- declare const getElName: any;
551
-
552
- /**
553
- * Elit - Router - Client-side routing
554
- */
555
-
556
- interface Route {
557
- path: string;
558
- component: (params: RouteParams) => VNode | Child;
559
- beforeEnter?: (to: RouteLocation, from: RouteLocation | null) => boolean | string | void;
560
- }
561
- interface RouteParams {
562
- [key: string]: string;
563
- }
564
- interface RouteLocation {
565
- path: string;
566
- params: RouteParams;
567
- query: Record<string, string>;
568
- hash: string;
569
- }
570
- interface RouterOptions {
571
- mode?: 'history' | 'hash';
572
- base?: string;
573
- routes: Route[];
574
- notFound?: (params: RouteParams) => VNode | Child;
575
- }
576
- interface Router {
577
- currentRoute: State<RouteLocation>;
578
- push: (path: string) => void;
579
- replace: (path: string) => void;
580
- back: () => void;
581
- forward: () => void;
582
- go: (delta: number) => void;
583
- beforeEach: (guard: (to: RouteLocation, from: RouteLocation | null) => boolean | string | void) => void;
584
- destroy: () => void;
585
- }
586
- declare function createRouter(options: RouterOptions): Router;
587
- declare function createRouterView(router: Router, options: RouterOptions): () => VNode;
588
- declare const routerLink: (router: Router, props: Props & {
589
- to: string;
590
- }, ...children: Child[]) => VNode;
591
-
592
- /**
593
- * Client-side HMR runtime for Elit
594
- * Import this in your app to enable hot module replacement
595
- */
596
- interface HMRClient {
597
- /** Check if HMR is enabled */
598
- enabled: boolean;
599
- /** Manually reload the page */
600
- reload: () => void;
601
- /** Accept HMR updates for current module */
602
- accept: (callback?: () => void) => void;
603
- /** Decline HMR updates (forces full reload) */
604
- decline: () => void;
605
- /** Dispose callback before module is replaced */
606
- dispose: (callback: () => void) => void;
607
- }
608
- declare global {
609
- interface Window {
610
- __ELIT_HMR__: HMRClient;
611
- }
612
- }
613
- declare class ElitHMR implements HMRClient {
614
- enabled: boolean;
615
- private ws;
616
- private acceptCallbacks;
617
- private disposeCallbacks;
618
- private declined;
619
- constructor();
620
- private connect;
621
- private handleMessage;
622
- reload(): void;
623
- accept(callback?: () => void): void;
624
- decline(): void;
625
- dispose(callback: () => void): void;
626
- }
627
- declare const hmr: ElitHMR;
628
-
629
- export { type CSSRule, type CSSVariable, Child, Children, type ContainerRule, CreateStyle, DomNode, ElementFactory, type FontFace, type HMRClient, JsonNode, type KeyframeStep, type Keyframes, type LayerRule, type MediaRule, Props, type Route, type RouteLocation, type RouteParams, type Router, type RouterOptions, SharedState, State, StateOptions, type SupportsRule, VNode, VNodeJson, VirtualListController, a, abbr, addAttribute, addClass, addContainer, addId, addName, addPseudoClass, addPseudoElement, addStyle, addTag, addVar, address, adjacentSibling, area, article, aside, attrContains, attrContainsWord, attrEndsWith, attrEquals, attrStartsWith, audio, b, base, batchRender, bdi, bdo, bindChecked, bindValue, blockquote, body, br, button, canvas, caption, childStyle, cite, cleanupUnused, clearStyle, code, col, colgroup, commentNode, computed, container, createEl, createElementFactory, createMathEl, createRouter, createRouterView, createSharedState, createState, createSvgEl, createVirtualList, data, datalist, dd, debounce, del, descendant, details, dfn, dialog, div, dl, doc, dom, dt, effect, el, elements, em, embed, fieldset, figcaption, figure, fontFace, footer, form, fragment, generalSibling, getEl, getElClass, getElId, getElName, getElTag, getEls, getVar, h1, h2, h3, h4, h5, h6, head, header, hmr, hr, html, i, iframe, img, importStyle, important, injectStyle, input, ins, kbd, keyframe, keyframeFromTo, label, layer, layerOrder, lazy, legend, li, link, main, map, mark, mathMath, mathMfrac, mathMi, mathMn, mathMo, mathMroot, mathMrow, mathMs, mathMsqrt, mathMsub, mathMsup, mathMtext, mediaDark, mediaLight, mediaMaxWidth, mediaMinWidth, mediaPrint, mediaReducedMotion, mediaScreen, mediaStyle, menu, meta, meter, mount, multipleStyle, nav, nesting, noscript, object, ol, optgroup, option, output, p, param, picture, portal, pre, progress, q, reactive, reactiveAs, render, renderChunked, renderStyle, renderToString, routerLink, rp, rt, ruby, s, samp, script, section, select, sharedStateManager, slot, small, source, span, strong, style, styles, sub, summary, sup, supportsStyle, 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, text, textNode, textarea, tfoot, th, thead, throttle, time, title, tr, track, u, ul, varElement, video, wbr };
@@ -1,48 +0,0 @@
1
- /**
2
- * MIME Types module with unified API across runtimes
3
- * Pure implementation without external dependencies
4
- * Compatible with 'mime-types' package API
5
- * Works on Node.js, Bun, and Deno
6
- */
7
- /**
8
- * Lookup MIME type from file path or extension
9
- */
10
- declare function lookup(path: string): string | false;
11
- /**
12
- * Get the default extension for a MIME type
13
- */
14
- declare function extension(type: string): string | false;
15
- /**
16
- * Get all extensions for a MIME type
17
- */
18
- declare function extensions(type: string): string[] | undefined;
19
- /**
20
- * Get the default charset for a MIME type
21
- */
22
- declare function charset(type: string): string | false;
23
- /**
24
- * Create a full Content-Type header value
25
- */
26
- declare function contentType(typeOrExt: string): string | false;
27
- /**
28
- * Get all MIME types
29
- */
30
- declare const types: Record<string, string>;
31
- /**
32
- * Get current runtime
33
- */
34
- declare function getRuntime(): 'node' | 'bun' | 'deno';
35
- /**
36
- * Default export
37
- */
38
- declare const _default: {
39
- lookup: typeof lookup;
40
- extension: typeof extension;
41
- extensions: typeof extensions;
42
- charset: typeof charset;
43
- contentType: typeof contentType;
44
- types: Record<string, string>;
45
- getRuntime: typeof getRuntime;
46
- };
47
-
48
- export { charset, contentType, _default as default, extension, extensions, getRuntime, lookup, types };