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