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.
- package/Cargo.toml +1 -1
- package/README.md +1 -1
- package/desktop/build.rs +83 -0
- package/desktop/icon.rs +106 -0
- package/desktop/lib.rs +2 -0
- package/desktop/main.rs +235 -0
- package/desktop/native_main.rs +128 -0
- package/desktop/native_renderer/action_widgets.rs +184 -0
- package/desktop/native_renderer/app_models.rs +171 -0
- package/desktop/native_renderer/app_runtime.rs +140 -0
- package/desktop/native_renderer/container_rendering.rs +610 -0
- package/desktop/native_renderer/content_widgets.rs +634 -0
- package/desktop/native_renderer/css_models.rs +371 -0
- package/desktop/native_renderer/embedded_surfaces.rs +414 -0
- package/desktop/native_renderer/form_controls.rs +516 -0
- package/desktop/native_renderer/interaction_dispatch.rs +89 -0
- package/desktop/native_renderer/runtime_support.rs +135 -0
- package/desktop/native_renderer/utilities.rs +495 -0
- package/desktop/native_renderer/vector_drawing.rs +491 -0
- package/desktop/native_renderer.rs +4122 -0
- package/desktop/runtime/external.rs +422 -0
- package/desktop/runtime/mod.rs +67 -0
- package/desktop/runtime/quickjs.rs +106 -0
- package/desktop/window.rs +383 -0
- package/package.json +6 -3
- package/dist/build.d.mts +0 -20
- package/dist/chokidar.d.mts +0 -134
- package/dist/cli.d.mts +0 -81
- package/dist/config.d.mts +0 -254
- package/dist/coverage.d.mts +0 -85
- package/dist/database.d.mts +0 -52
- package/dist/desktop.d.mts +0 -68
- package/dist/dom.d.mts +0 -87
- package/dist/el.d.mts +0 -208
- package/dist/fs.d.mts +0 -255
- package/dist/hmr.d.mts +0 -38
- package/dist/http.d.mts +0 -169
- package/dist/https.d.mts +0 -108
- package/dist/index.d.mts +0 -13
- package/dist/mime-types.d.mts +0 -48
- package/dist/native.d.mts +0 -136
- package/dist/path.d.mts +0 -163
- package/dist/router.d.mts +0 -49
- package/dist/runtime.d.mts +0 -97
- package/dist/server-D0Dp4R5z.d.mts +0 -449
- package/dist/server.d.mts +0 -7
- package/dist/state.d.mts +0 -117
- package/dist/style.d.mts +0 -232
- package/dist/test-reporter.d.mts +0 -77
- package/dist/test-runtime.d.mts +0 -122
- package/dist/test.d.mts +0 -39
- package/dist/types.d.mts +0 -586
- package/dist/universal.d.mts +0 -21
- package/dist/ws.d.mts +0 -200
- package/dist/wss.d.mts +0 -108
- package/src/build.ts +0 -362
- package/src/chokidar.ts +0 -427
- package/src/cli.ts +0 -1162
- package/src/config.ts +0 -509
- package/src/coverage.ts +0 -1479
- package/src/database.ts +0 -1410
- package/src/desktop-auto-render.ts +0 -317
- package/src/desktop-cli.ts +0 -1533
- package/src/desktop.ts +0 -99
- package/src/dev-build.ts +0 -340
- package/src/dom.ts +0 -901
- package/src/el.ts +0 -183
- package/src/fs.ts +0 -609
- package/src/hmr.ts +0 -149
- package/src/http.ts +0 -856
- package/src/https.ts +0 -411
- package/src/index.ts +0 -16
- package/src/mime-types.ts +0 -222
- package/src/mobile-cli.ts +0 -2313
- package/src/native-background.ts +0 -444
- package/src/native-border.ts +0 -343
- package/src/native-canvas.ts +0 -260
- package/src/native-cli.ts +0 -414
- package/src/native-color.ts +0 -904
- package/src/native-estimation.ts +0 -194
- package/src/native-grid.ts +0 -590
- package/src/native-interaction.ts +0 -1289
- package/src/native-layout.ts +0 -568
- package/src/native-link.ts +0 -76
- package/src/native-render-support.ts +0 -361
- package/src/native-spacing.ts +0 -231
- package/src/native-state.ts +0 -318
- package/src/native-strings.ts +0 -46
- package/src/native-transform.ts +0 -120
- package/src/native-types.ts +0 -439
- package/src/native-typography.ts +0 -254
- package/src/native-units.ts +0 -441
- package/src/native-vector.ts +0 -910
- package/src/native.ts +0 -5606
- package/src/path.ts +0 -493
- package/src/pm-cli.ts +0 -2498
- package/src/preview-build.ts +0 -294
- package/src/render-context.ts +0 -138
- package/src/router.ts +0 -260
- package/src/runtime.ts +0 -97
- package/src/server.ts +0 -2294
- package/src/state.ts +0 -556
- package/src/style.ts +0 -1790
- package/src/test-globals.d.ts +0 -184
- package/src/test-reporter.ts +0 -609
- package/src/test-runtime.ts +0 -1359
- package/src/test.ts +0 -368
- package/src/types.ts +0 -381
- package/src/universal.ts +0 -81
- package/src/wapk-cli.ts +0 -3213
- package/src/workspace-package.ts +0 -102
- package/src/ws.ts +0 -648
- package/src/wss.ts +0 -241
package/dist/types.d.mts
DELETED
|
@@ -1,586 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'node:events';
|
|
2
|
-
import { EventEmitter as EventEmitter$1 } from 'events';
|
|
3
|
-
import { Server } from 'http';
|
|
4
|
-
import { WebSocketServer } from 'ws';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* HTTP module with unified API across runtimes
|
|
8
|
-
* Ultra-optimized for maximum performance across Node.js, Bun, and Deno
|
|
9
|
-
*
|
|
10
|
-
* Performance optimizations:
|
|
11
|
-
* - Bun fast path: Zero class instantiation (object literals only)
|
|
12
|
-
* - Eliminated EventEmitter overhead for Bun/Deno
|
|
13
|
-
* - Zero-copy headers conversion
|
|
14
|
-
* - Inline response creation
|
|
15
|
-
* - Reduced object allocations
|
|
16
|
-
* - Direct closure capture (no resolver indirection)
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* HTTP Headers type
|
|
21
|
-
*/
|
|
22
|
-
type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
|
|
23
|
-
type OutgoingHttpHeaders = Record<string, string | string[] | number>;
|
|
24
|
-
/**
|
|
25
|
-
* IncomingMessage - Ultra-optimized for zero-copy operations
|
|
26
|
-
*/
|
|
27
|
-
declare class IncomingMessage extends EventEmitter {
|
|
28
|
-
method: string;
|
|
29
|
-
url: string;
|
|
30
|
-
headers: IncomingHttpHeaders;
|
|
31
|
-
statusCode?: number;
|
|
32
|
-
statusMessage?: string;
|
|
33
|
-
httpVersion: string;
|
|
34
|
-
rawHeaders: string[];
|
|
35
|
-
socket: any;
|
|
36
|
-
private _req;
|
|
37
|
-
constructor(req: any);
|
|
38
|
-
text(): Promise<string>;
|
|
39
|
-
json(): Promise<any>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* ServerResponse - Ultra-optimized write operations
|
|
43
|
-
*/
|
|
44
|
-
declare class ServerResponse extends EventEmitter {
|
|
45
|
-
statusCode: number;
|
|
46
|
-
statusMessage: string;
|
|
47
|
-
headersSent: boolean;
|
|
48
|
-
private _headers;
|
|
49
|
-
private _body;
|
|
50
|
-
private _resolve?;
|
|
51
|
-
private _finished;
|
|
52
|
-
private _nodeRes?;
|
|
53
|
-
constructor(_req?: IncomingMessage, nodeRes?: any);
|
|
54
|
-
setHeader(name: string, value: string | string[] | number): this;
|
|
55
|
-
getHeader(name: string): string | string[] | number | undefined;
|
|
56
|
-
getHeaders(): OutgoingHttpHeaders;
|
|
57
|
-
getHeaderNames(): string[];
|
|
58
|
-
hasHeader(name: string): boolean;
|
|
59
|
-
removeHeader(name: string): void;
|
|
60
|
-
writeHead(statusCode: number, statusMessage?: string | OutgoingHttpHeaders, headers?: OutgoingHttpHeaders): this;
|
|
61
|
-
write(chunk: any, encoding?: BufferEncoding | (() => void), callback?: () => void): boolean;
|
|
62
|
-
end(chunk?: any, encoding?: BufferEncoding | (() => void), callback?: () => void): this;
|
|
63
|
-
_setResolver(resolve: (response: Response) => void): void;
|
|
64
|
-
json(data: any, statusCode?: number): this;
|
|
65
|
-
send(data: any): this;
|
|
66
|
-
status(code: number): this;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* WebSocket module with unified API across runtimes
|
|
71
|
-
* Pure implementation without external dependencies
|
|
72
|
-
* - Node.js: uses native 'ws' module (built-in WebSocket implementation)
|
|
73
|
-
* - Bun: uses native WebSocket
|
|
74
|
-
* - Deno: uses native WebSocket
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* WebSocket ready state
|
|
79
|
-
*/
|
|
80
|
-
declare enum ReadyState {
|
|
81
|
-
CONNECTING = 0,
|
|
82
|
-
OPEN = 1,
|
|
83
|
-
CLOSING = 2,
|
|
84
|
-
CLOSED = 3
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* WebSocket data types
|
|
88
|
-
*/
|
|
89
|
-
type Data = string | Buffer | ArrayBuffer | Buffer[];
|
|
90
|
-
/**
|
|
91
|
-
* WebSocket send options
|
|
92
|
-
*/
|
|
93
|
-
interface SendOptions {
|
|
94
|
-
binary?: boolean;
|
|
95
|
-
compress?: boolean;
|
|
96
|
-
fin?: boolean;
|
|
97
|
-
mask?: boolean;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* WebSocket class - Pure implementation
|
|
101
|
-
*/
|
|
102
|
-
declare class WebSocket extends EventEmitter$1 {
|
|
103
|
-
readyState: ReadyState;
|
|
104
|
-
url: string;
|
|
105
|
-
protocol: string;
|
|
106
|
-
extensions: string;
|
|
107
|
-
binaryType: 'nodebuffer' | 'arraybuffer' | 'fragments';
|
|
108
|
-
/** @internal */
|
|
109
|
-
_socket: any;
|
|
110
|
-
constructor(address: string | URL, protocols?: string | string[], _options?: any);
|
|
111
|
-
private _setupNativeSocket;
|
|
112
|
-
/**
|
|
113
|
-
* Send data through WebSocket
|
|
114
|
-
*/
|
|
115
|
-
send(data: Data, options?: SendOptions | ((err?: Error) => void), callback?: (err?: Error) => void): void;
|
|
116
|
-
/**
|
|
117
|
-
* Close the WebSocket connection
|
|
118
|
-
*/
|
|
119
|
-
close(code?: number, reason?: string | Buffer): void;
|
|
120
|
-
/**
|
|
121
|
-
* Pause the socket (no-op for native WebSocket)
|
|
122
|
-
*/
|
|
123
|
-
pause(): void;
|
|
124
|
-
/**
|
|
125
|
-
* Resume the socket (no-op for native WebSocket)
|
|
126
|
-
*/
|
|
127
|
-
resume(): void;
|
|
128
|
-
/**
|
|
129
|
-
* Send a ping frame (no-op for native WebSocket)
|
|
130
|
-
*/
|
|
131
|
-
ping(_data?: Data, _mask?: boolean, callback?: (err?: Error) => void): void;
|
|
132
|
-
/**
|
|
133
|
-
* Send a pong frame (no-op for native WebSocket)
|
|
134
|
-
*/
|
|
135
|
-
pong(_data?: Data, _mask?: boolean, callback?: (err?: Error) => void): void;
|
|
136
|
-
/**
|
|
137
|
-
* Terminate the connection
|
|
138
|
-
*/
|
|
139
|
-
terminate(): void;
|
|
140
|
-
/**
|
|
141
|
-
* Get buffered amount
|
|
142
|
-
*/
|
|
143
|
-
get bufferedAmount(): number;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Development server with HMR support
|
|
148
|
-
* Cross-runtime transpilation support
|
|
149
|
-
* - Node.js: uses stripTypeScriptTypes with esbuild fallback
|
|
150
|
-
* - Bun: uses Bun.Transpiler
|
|
151
|
-
* - Deno: uses Deno.emit
|
|
152
|
-
*/
|
|
153
|
-
|
|
154
|
-
interface ElitRequest extends IncomingMessage {
|
|
155
|
-
body?: any;
|
|
156
|
-
query?: Record<string, string>;
|
|
157
|
-
params?: Record<string, string>;
|
|
158
|
-
}
|
|
159
|
-
interface ElitResponse extends ServerResponse {
|
|
160
|
-
json(data: any, statusCode?: number): this;
|
|
161
|
-
send(data: any): this;
|
|
162
|
-
status(code: number): this;
|
|
163
|
-
}
|
|
164
|
-
interface ServerRouteContext {
|
|
165
|
-
req: ElitRequest;
|
|
166
|
-
res: ElitResponse;
|
|
167
|
-
params: Record<string, string>;
|
|
168
|
-
query: Record<string, string>;
|
|
169
|
-
body: any;
|
|
170
|
-
headers: Record<string, string | string[] | undefined>;
|
|
171
|
-
user?: any;
|
|
172
|
-
}
|
|
173
|
-
type ServerRouteHandler = (ctx: ServerRouteContext, next?: () => Promise<void>) => void | Promise<void>;
|
|
174
|
-
type Middleware = (ctx: ServerRouteContext, next: () => Promise<void>) => void | Promise<void>;
|
|
175
|
-
declare class ServerRouter {
|
|
176
|
-
private routes;
|
|
177
|
-
private middlewares;
|
|
178
|
-
use(...args: Array<any>): this;
|
|
179
|
-
all: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
|
|
180
|
-
get: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
|
|
181
|
-
post: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
|
|
182
|
-
put: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
|
|
183
|
-
delete: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
|
|
184
|
-
patch: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
|
|
185
|
-
options: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
|
|
186
|
-
head: (path: string, ...handlers: Array<Middleware | ServerRouteHandler | ((req: ElitRequest, res: ServerResponse, next?: () => void) => any)>) => this;
|
|
187
|
-
private toMiddleware;
|
|
188
|
-
private addRoute;
|
|
189
|
-
private pathToRegex;
|
|
190
|
-
private parseQuery;
|
|
191
|
-
/**
|
|
192
|
-
* List all registered routes for debugging
|
|
193
|
-
*/
|
|
194
|
-
listRoutes(): Array<{
|
|
195
|
-
method: string;
|
|
196
|
-
pattern: string;
|
|
197
|
-
paramNames: string[];
|
|
198
|
-
handler: string;
|
|
199
|
-
}>;
|
|
200
|
-
private parseBody;
|
|
201
|
-
handle(req: IncomingMessage, res: ServerResponse): Promise<boolean>;
|
|
202
|
-
}
|
|
203
|
-
type StateChangeHandler<T = any> = (value: T, oldValue: T) => void;
|
|
204
|
-
interface SharedStateOptions<T = any> {
|
|
205
|
-
initial: T;
|
|
206
|
-
persist?: boolean;
|
|
207
|
-
validate?: (value: T) => boolean;
|
|
208
|
-
}
|
|
209
|
-
declare class SharedState<T = any> {
|
|
210
|
-
readonly key: string;
|
|
211
|
-
private _value;
|
|
212
|
-
private listeners;
|
|
213
|
-
private changeHandlers;
|
|
214
|
-
private options;
|
|
215
|
-
constructor(key: string, options: SharedStateOptions<T>);
|
|
216
|
-
get value(): T;
|
|
217
|
-
set value(newValue: T);
|
|
218
|
-
update(updater: (current: T) => T): void;
|
|
219
|
-
subscribe(ws: WebSocket): void;
|
|
220
|
-
unsubscribe(ws: WebSocket): void;
|
|
221
|
-
onChange(handler: StateChangeHandler<T>): () => void;
|
|
222
|
-
private broadcast;
|
|
223
|
-
private sendTo;
|
|
224
|
-
get subscriberCount(): number;
|
|
225
|
-
clear(): void;
|
|
226
|
-
}
|
|
227
|
-
declare class StateManager$1 {
|
|
228
|
-
private states;
|
|
229
|
-
create<T>(key: string, options: SharedStateOptions<T>): SharedState<T>;
|
|
230
|
-
get<T>(key: string): SharedState<T> | undefined;
|
|
231
|
-
has(key: string): boolean;
|
|
232
|
-
delete(key: string): boolean;
|
|
233
|
-
subscribe(key: string, ws: WebSocket): void;
|
|
234
|
-
unsubscribe(key: string, ws: WebSocket): void;
|
|
235
|
-
unsubscribeAll(ws: WebSocket): void;
|
|
236
|
-
handleStateChange(key: string, value: any): void;
|
|
237
|
-
keys(): string[];
|
|
238
|
-
clear(): void;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Elit - Types and Interfaces
|
|
243
|
-
*/
|
|
244
|
-
interface VNode {
|
|
245
|
-
tagName: string;
|
|
246
|
-
props: Props;
|
|
247
|
-
children: Children;
|
|
248
|
-
}
|
|
249
|
-
type Child = VNode | string | number | boolean | null | undefined | Child[];
|
|
250
|
-
type Children = Child[];
|
|
251
|
-
interface Props {
|
|
252
|
-
[key: string]: any;
|
|
253
|
-
className?: string | string[];
|
|
254
|
-
class?: string | string[];
|
|
255
|
-
style?: Partial<CSSStyleDeclaration> | string;
|
|
256
|
-
dangerouslySetInnerHTML?: {
|
|
257
|
-
__html: string;
|
|
258
|
-
};
|
|
259
|
-
ref?: RefCallback | RefObject;
|
|
260
|
-
onClick?: (event: MouseEvent) => void;
|
|
261
|
-
onChange?: (event: Event) => void;
|
|
262
|
-
onInput?: (event: Event) => void;
|
|
263
|
-
onSubmit?: (event: Event) => void;
|
|
264
|
-
value?: string | number | string[];
|
|
265
|
-
checked?: boolean;
|
|
266
|
-
}
|
|
267
|
-
type RefCallback = (element: HTMLElement | SVGElement) => void;
|
|
268
|
-
interface RefObject {
|
|
269
|
-
current: HTMLElement | SVGElement | null;
|
|
270
|
-
}
|
|
271
|
-
interface State<T> {
|
|
272
|
-
value: T;
|
|
273
|
-
subscribe(fn: (value: T) => void): () => void;
|
|
274
|
-
destroy(): void;
|
|
275
|
-
}
|
|
276
|
-
interface StateOptions {
|
|
277
|
-
throttle?: number;
|
|
278
|
-
deep?: boolean;
|
|
279
|
-
}
|
|
280
|
-
interface VirtualListController {
|
|
281
|
-
render: () => void;
|
|
282
|
-
destroy: () => void;
|
|
283
|
-
}
|
|
284
|
-
interface JsonNode {
|
|
285
|
-
tag: string;
|
|
286
|
-
attributes?: Record<string, any>;
|
|
287
|
-
children?: JsonNode | JsonNode[] | string | number | boolean | null;
|
|
288
|
-
}
|
|
289
|
-
type VNodeJson = {
|
|
290
|
-
tagName: string;
|
|
291
|
-
props?: Record<string, any>;
|
|
292
|
-
children?: (VNodeJson | string | number | boolean | null)[];
|
|
293
|
-
} | string | number | boolean | null;
|
|
294
|
-
type ElementFactory = {
|
|
295
|
-
(...children: Child[]): VNode;
|
|
296
|
-
(props: Props | null, ...children: Child[]): VNode;
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
type Router = ServerRouter;
|
|
300
|
-
type StateManager = StateManager$1;
|
|
301
|
-
type WebSocketConnection = WebSocket;
|
|
302
|
-
type WebSocketRequest = IncomingMessage;
|
|
303
|
-
interface WebSocketEndpointContext {
|
|
304
|
-
/** Accepted WebSocket connection */
|
|
305
|
-
ws: WebSocketConnection;
|
|
306
|
-
/** Upgrade request metadata */
|
|
307
|
-
req: WebSocketRequest;
|
|
308
|
-
/** Matched request path without query string */
|
|
309
|
-
path: string;
|
|
310
|
-
/** Parsed query string values */
|
|
311
|
-
query: Record<string, string>;
|
|
312
|
-
/** Request headers */
|
|
313
|
-
headers: Record<string, string | string[] | undefined>;
|
|
314
|
-
}
|
|
315
|
-
type WebSocketEndpointHandler = (ctx: WebSocketEndpointContext) => void | Promise<void>;
|
|
316
|
-
interface WebSocketEndpointConfig {
|
|
317
|
-
/** Path to listen for WebSocket upgrades (e.g., '/ws', '/chat') */
|
|
318
|
-
path: string;
|
|
319
|
-
/** Connection handler invoked after a successful WebSocket upgrade */
|
|
320
|
-
handler: WebSocketEndpointHandler;
|
|
321
|
-
}
|
|
322
|
-
interface ClientConfig {
|
|
323
|
-
/** Root directory to serve files from */
|
|
324
|
-
root: string;
|
|
325
|
-
/** Optional fallback root used when the primary root is unavailable in packaged standalone runs */
|
|
326
|
-
fallbackRoot?: string;
|
|
327
|
-
/** Base path for the client application (e.g., '/app1', '/app2') */
|
|
328
|
-
basePath: string;
|
|
329
|
-
/** Custom index file path (relative to root, e.g., './public/index.html') */
|
|
330
|
-
index?: string;
|
|
331
|
-
/** SSR render function - returns HTML VNode or string */
|
|
332
|
-
ssr?: () => Child | string;
|
|
333
|
-
/** Watch patterns for file changes */
|
|
334
|
-
watch?: string[];
|
|
335
|
-
/** Ignore patterns for file watching */
|
|
336
|
-
ignore?: string[];
|
|
337
|
-
/** Proxy configuration specific to this client */
|
|
338
|
-
proxy?: ProxyConfig[];
|
|
339
|
-
/** Worker scripts specific to this client */
|
|
340
|
-
worker?: WorkerConfig[];
|
|
341
|
-
/** API router for REST endpoints specific to this client */
|
|
342
|
-
api?: Router;
|
|
343
|
-
/** WebSocket endpoints specific to this client */
|
|
344
|
-
ws?: WebSocketEndpointConfig[];
|
|
345
|
-
/** Server mode: 'dev' uses source files, 'preview' uses built files (default: 'dev') */
|
|
346
|
-
mode?: 'dev' | 'preview';
|
|
347
|
-
}
|
|
348
|
-
interface ProxyConfig {
|
|
349
|
-
/** Path prefix to match for proxying (e.g., '/api', '/graphql') */
|
|
350
|
-
context: string;
|
|
351
|
-
/** Target URL to proxy to (e.g., 'http://localhost:8080') */
|
|
352
|
-
target: string;
|
|
353
|
-
/** Change the origin of the host header to the target URL */
|
|
354
|
-
changeOrigin?: boolean;
|
|
355
|
-
/** Rewrite path before sending to target */
|
|
356
|
-
pathRewrite?: Record<string, string>;
|
|
357
|
-
/** Additional headers to add to the proxied request */
|
|
358
|
-
headers?: Record<string, string>;
|
|
359
|
-
/** Enable WebSocket proxying */
|
|
360
|
-
ws?: boolean;
|
|
361
|
-
}
|
|
362
|
-
interface WorkerConfig {
|
|
363
|
-
/** Worker script path relative to root directory */
|
|
364
|
-
path: string;
|
|
365
|
-
/** Worker name/identifier (optional, defaults to filename) */
|
|
366
|
-
name?: string;
|
|
367
|
-
/** Worker type: 'module' (ESM) or 'classic' (default: 'module') */
|
|
368
|
-
type?: 'module' | 'classic';
|
|
369
|
-
}
|
|
370
|
-
interface DevServerOptions {
|
|
371
|
-
/** Port to run the server on (default: 3000) */
|
|
372
|
-
port?: number;
|
|
373
|
-
/** Host to bind to (default: 'localhost') */
|
|
374
|
-
host?: string;
|
|
375
|
-
/** Domain to map (e.g., 'idevcoder.com') - redirects domain traffic to this server's port */
|
|
376
|
-
domain?: string;
|
|
377
|
-
/** Root directory to serve files from */
|
|
378
|
-
root?: string;
|
|
379
|
-
/** Optional fallback root used when the primary root is unavailable in packaged standalone runs */
|
|
380
|
-
fallbackRoot?: string;
|
|
381
|
-
/** Base path for the client application (e.g., '/app1', '/app2') */
|
|
382
|
-
basePath?: string;
|
|
383
|
-
/** Custom index file path (relative to root, e.g., './public/index.html') */
|
|
384
|
-
index?: string;
|
|
385
|
-
/** Array of client configurations - allows multiple clients on same port */
|
|
386
|
-
clients?: ClientConfig[];
|
|
387
|
-
/** Enable HTTPS (default: false) */
|
|
388
|
-
https?: boolean;
|
|
389
|
-
/** Open browser automatically (default: true) */
|
|
390
|
-
open?: boolean;
|
|
391
|
-
/** Watch patterns for file changes */
|
|
392
|
-
watch?: string[];
|
|
393
|
-
/** Ignore patterns for file watcher */
|
|
394
|
-
ignore?: string[];
|
|
395
|
-
/** Global worker scripts (applies to all clients) */
|
|
396
|
-
worker?: WorkerConfig[];
|
|
397
|
-
/** Enable logging (default: true) */
|
|
398
|
-
logging?: boolean;
|
|
399
|
-
/** API router for REST endpoints */
|
|
400
|
-
api?: Router;
|
|
401
|
-
/** WebSocket endpoints */
|
|
402
|
-
ws?: WebSocketEndpointConfig[];
|
|
403
|
-
/** SSR render function - returns HTML VNode or string */
|
|
404
|
-
ssr?: () => Child | string;
|
|
405
|
-
/** Proxy configuration for API requests */
|
|
406
|
-
proxy?: ProxyConfig[];
|
|
407
|
-
/** Server mode: 'dev' uses source files, 'preview' uses built files (default: 'dev') */
|
|
408
|
-
mode?: 'dev' | 'preview';
|
|
409
|
-
/** Environment variables to inject (prefix with VITE_ for client access) */
|
|
410
|
-
env?: Record<string, string>;
|
|
411
|
-
/** Emit a bundled development server during elit build */
|
|
412
|
-
standalone?: boolean;
|
|
413
|
-
/** Output directory for a bundled standalone development server (default: dev-dist) */
|
|
414
|
-
outDir?: string;
|
|
415
|
-
/** Output filename for a bundled standalone development server (default: index.js) */
|
|
416
|
-
outFile?: string;
|
|
417
|
-
}
|
|
418
|
-
interface DevServer {
|
|
419
|
-
/** HTTP server instance */
|
|
420
|
-
server: Server;
|
|
421
|
-
/** WebSocket server for HMR */
|
|
422
|
-
wss: WebSocketServer;
|
|
423
|
-
/** Server URL */
|
|
424
|
-
url: string;
|
|
425
|
-
/** Shared state manager */
|
|
426
|
-
state: StateManager;
|
|
427
|
-
/** Close the server */
|
|
428
|
-
close: () => Promise<void>;
|
|
429
|
-
}
|
|
430
|
-
interface HMRMessage {
|
|
431
|
-
type: 'update' | 'reload' | 'error' | 'connected';
|
|
432
|
-
path?: string;
|
|
433
|
-
timestamp?: number;
|
|
434
|
-
error?: string;
|
|
435
|
-
}
|
|
436
|
-
interface BuildOptions {
|
|
437
|
-
/** Entry file to build */
|
|
438
|
-
entry: string;
|
|
439
|
-
/** Output directory */
|
|
440
|
-
outDir?: string;
|
|
441
|
-
/** Output filename */
|
|
442
|
-
outFile?: string;
|
|
443
|
-
/** Enable minification */
|
|
444
|
-
minify?: boolean;
|
|
445
|
-
/** Generate sourcemap */
|
|
446
|
-
sourcemap?: boolean;
|
|
447
|
-
/** Target environment */
|
|
448
|
-
target?: 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
|
|
449
|
-
/** Output format */
|
|
450
|
-
format?: 'esm' | 'cjs' | 'iife';
|
|
451
|
-
/** Global name for IIFE format */
|
|
452
|
-
globalName?: string;
|
|
453
|
-
/** Target platform */
|
|
454
|
-
platform?: 'browser' | 'node' | 'neutral';
|
|
455
|
-
/** Base path for the application (injected into HTML) */
|
|
456
|
-
basePath?: string;
|
|
457
|
-
/** External dependencies (not bundled) */
|
|
458
|
-
external?: string[];
|
|
459
|
-
/** Module resolution options */
|
|
460
|
-
resolve?: {
|
|
461
|
-
/** Alias imports to other paths or modules */
|
|
462
|
-
alias?: Record<string, string>;
|
|
463
|
-
};
|
|
464
|
-
/** Enable tree shaking */
|
|
465
|
-
treeshake?: boolean;
|
|
466
|
-
/** Enable logging */
|
|
467
|
-
logging?: boolean;
|
|
468
|
-
/** Environment variables to inject (prefix with VITE_ for client access) */
|
|
469
|
-
env?: Record<string, string>;
|
|
470
|
-
/** Copy static files after build */
|
|
471
|
-
copy?: Array<{
|
|
472
|
-
from: string;
|
|
473
|
-
to: string;
|
|
474
|
-
transform?: (content: string, config: BuildOptions) => string;
|
|
475
|
-
}>;
|
|
476
|
-
/** Post-build hook */
|
|
477
|
-
onBuildEnd?: (result: BuildResult) => void | Promise<void>;
|
|
478
|
-
/** Emit a standalone preview server bundle after the client build */
|
|
479
|
-
standalonePreview?: boolean;
|
|
480
|
-
/** Emit a standalone development server bundle after the client build */
|
|
481
|
-
standaloneDev?: boolean;
|
|
482
|
-
/** Output filename for the standalone development server bundle (default: index.js) */
|
|
483
|
-
standaloneDevOutFile?: string;
|
|
484
|
-
/** Output filename for the standalone preview server bundle (default: index.js) */
|
|
485
|
-
standalonePreviewOutFile?: string;
|
|
486
|
-
}
|
|
487
|
-
interface BuildResult {
|
|
488
|
-
/** Output file path */
|
|
489
|
-
outputPath: string;
|
|
490
|
-
/** Build time in milliseconds */
|
|
491
|
-
buildTime: number;
|
|
492
|
-
/** Output file size in bytes */
|
|
493
|
-
size: number;
|
|
494
|
-
}
|
|
495
|
-
interface PreviewOptions {
|
|
496
|
-
/** Port to run the preview server on (default: 4173) */
|
|
497
|
-
port?: number;
|
|
498
|
-
/** Host to bind to (default: 'localhost') */
|
|
499
|
-
host?: string;
|
|
500
|
-
/** Domain to map (e.g., 'idevcoder.com') - redirects domain traffic to this server's port */
|
|
501
|
-
domain?: string;
|
|
502
|
-
/** Root directory to serve files from (default: dist or build.outDir) */
|
|
503
|
-
root?: string;
|
|
504
|
-
/** Base path for the application (e.g., '/app') */
|
|
505
|
-
basePath?: string;
|
|
506
|
-
/** Custom index file path (relative to root, e.g., './public/index.html') */
|
|
507
|
-
index?: string;
|
|
508
|
-
/** Array of client configurations - allows multiple clients on same port */
|
|
509
|
-
clients?: ClientConfig[];
|
|
510
|
-
/** Enable HTTPS (default: false) */
|
|
511
|
-
https?: boolean;
|
|
512
|
-
/** Open browser automatically (default: true) */
|
|
513
|
-
open?: boolean;
|
|
514
|
-
/** Enable logging (default: true) */
|
|
515
|
-
logging?: boolean;
|
|
516
|
-
/** API router for REST endpoints */
|
|
517
|
-
api?: Router;
|
|
518
|
-
/** WebSocket endpoints */
|
|
519
|
-
ws?: WebSocketEndpointConfig[];
|
|
520
|
-
/** SSR render function - returns HTML VNode or string */
|
|
521
|
-
ssr?: () => Child | string;
|
|
522
|
-
/** Proxy configuration for API requests */
|
|
523
|
-
proxy?: ProxyConfig[];
|
|
524
|
-
/** Global worker scripts (applies to all clients) */
|
|
525
|
-
worker?: WorkerConfig[];
|
|
526
|
-
/** Environment variables to inject (prefix with VITE_ for client access) */
|
|
527
|
-
env?: Record<string, string>;
|
|
528
|
-
/** Emit a bundled preview server during elit build */
|
|
529
|
-
standalone?: boolean;
|
|
530
|
-
/** Output filename for the standalone preview server bundle (default: index.js) */
|
|
531
|
-
outFile?: string;
|
|
532
|
-
}
|
|
533
|
-
type TestEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
|
|
534
|
-
type TestCoverageProvider = 'v8' | 'istanbul';
|
|
535
|
-
type TestCoverageReporter = 'text' | 'json' | 'html' | 'lcov' | 'lcovonly' | 'coverage-final.json' | 'clover';
|
|
536
|
-
interface TestCoverageOptions {
|
|
537
|
-
provider?: TestCoverageProvider;
|
|
538
|
-
reporter?: TestCoverageReporter[];
|
|
539
|
-
dir?: string;
|
|
540
|
-
include?: string[];
|
|
541
|
-
exclude?: string[];
|
|
542
|
-
thresholds?: {
|
|
543
|
-
lines?: number;
|
|
544
|
-
functions?: number;
|
|
545
|
-
branches?: number;
|
|
546
|
-
statements?: number;
|
|
547
|
-
};
|
|
548
|
-
all?: boolean;
|
|
549
|
-
}
|
|
550
|
-
interface TestOptions {
|
|
551
|
-
environment?: TestEnvironment;
|
|
552
|
-
globals?: boolean;
|
|
553
|
-
setupFiles?: string[];
|
|
554
|
-
include?: string[];
|
|
555
|
-
exclude?: string[];
|
|
556
|
-
testTimeout?: number;
|
|
557
|
-
isolate?: boolean;
|
|
558
|
-
pool?: string;
|
|
559
|
-
poolOptions?: {
|
|
560
|
-
threads?: {
|
|
561
|
-
singleThread?: boolean;
|
|
562
|
-
minThreads?: number;
|
|
563
|
-
maxThreads?: number;
|
|
564
|
-
isolate?: boolean;
|
|
565
|
-
};
|
|
566
|
-
forks?: {
|
|
567
|
-
singleFork?: boolean;
|
|
568
|
-
minForks?: number;
|
|
569
|
-
maxForks?: number;
|
|
570
|
-
isolate?: boolean;
|
|
571
|
-
};
|
|
572
|
-
};
|
|
573
|
-
coverage?: TestCoverageOptions;
|
|
574
|
-
watch?: boolean;
|
|
575
|
-
ui?: boolean;
|
|
576
|
-
reporter?: 'verbose' | 'dot' | 'json' | 'tap';
|
|
577
|
-
bail?: number | boolean;
|
|
578
|
-
pattern?: string | RegExp;
|
|
579
|
-
colors?: boolean;
|
|
580
|
-
retry?: number;
|
|
581
|
-
includeSrc?: string[];
|
|
582
|
-
excludeSrc?: string[];
|
|
583
|
-
env?: Record<string, string>;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
export type { BuildOptions, BuildResult, Child, Children, ClientConfig, DevServer, DevServerOptions, ElementFactory, HMRMessage, JsonNode, PreviewOptions, Props, ProxyConfig, RefCallback, RefObject, Router, State, StateManager, StateOptions, TestCoverageOptions, TestCoverageProvider, TestCoverageReporter, TestEnvironment, TestOptions, VNode, VNodeJson, VirtualListController, WebSocketConnection, WebSocketEndpointConfig, WebSocketEndpointContext, WebSocketEndpointHandler, WebSocketRequest, WorkerConfig };
|
package/dist/universal.d.mts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Props } from './types.mjs';
|
|
2
|
-
import 'node:events';
|
|
3
|
-
import 'events';
|
|
4
|
-
import 'http';
|
|
5
|
-
import 'ws';
|
|
6
|
-
|
|
7
|
-
type UniversalPayload = string | number | boolean | null | UniversalPayload[] | {
|
|
8
|
-
[key: string]: UniversalPayload;
|
|
9
|
-
};
|
|
10
|
-
interface UniversalBridgeOptions {
|
|
11
|
-
action?: string;
|
|
12
|
-
route?: string;
|
|
13
|
-
payload?: UniversalPayload;
|
|
14
|
-
desktopMessage?: string;
|
|
15
|
-
}
|
|
16
|
-
declare function isExternalUniversalDestination(destination: string): boolean;
|
|
17
|
-
declare function createUniversalBridgeProps(options: UniversalBridgeOptions): Props;
|
|
18
|
-
declare function createUniversalLinkProps(destination: string, options?: UniversalBridgeOptions): Props;
|
|
19
|
-
declare function mergeUniversalProps(...sources: Array<Props | undefined | null>): Props;
|
|
20
|
-
|
|
21
|
-
export { type UniversalBridgeOptions, type UniversalPayload, createUniversalBridgeProps, createUniversalLinkProps, isExternalUniversalDestination, mergeUniversalProps };
|