elit 3.5.6 → 3.5.8

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 (128) hide show
  1. package/Cargo.toml +1 -1
  2. package/README.md +1 -1
  3. package/desktop/build.rs +83 -0
  4. package/desktop/icon.rs +106 -0
  5. package/desktop/lib.rs +2 -0
  6. package/desktop/main.rs +235 -0
  7. package/desktop/native_main.rs +128 -0
  8. package/desktop/native_renderer/action_widgets.rs +184 -0
  9. package/desktop/native_renderer/app_models.rs +171 -0
  10. package/desktop/native_renderer/app_runtime.rs +140 -0
  11. package/desktop/native_renderer/container_rendering.rs +610 -0
  12. package/desktop/native_renderer/content_widgets.rs +634 -0
  13. package/desktop/native_renderer/css_models.rs +371 -0
  14. package/desktop/native_renderer/embedded_surfaces.rs +414 -0
  15. package/desktop/native_renderer/form_controls.rs +516 -0
  16. package/desktop/native_renderer/interaction_dispatch.rs +89 -0
  17. package/desktop/native_renderer/runtime_support.rs +135 -0
  18. package/desktop/native_renderer/utilities.rs +495 -0
  19. package/desktop/native_renderer/vector_drawing.rs +491 -0
  20. package/desktop/native_renderer.rs +4122 -0
  21. package/desktop/runtime/external.rs +422 -0
  22. package/desktop/runtime/mod.rs +67 -0
  23. package/desktop/runtime/quickjs.rs +106 -0
  24. package/desktop/window.rs +383 -0
  25. package/dist/build.d.ts +1 -1
  26. package/dist/cli.cjs +16 -2
  27. package/dist/cli.mjs +16 -2
  28. package/dist/config.d.ts +1 -1
  29. package/dist/coverage.d.ts +1 -1
  30. package/dist/desktop-auto-render.cjs +2370 -0
  31. package/dist/desktop-auto-render.d.ts +13 -0
  32. package/dist/desktop-auto-render.js +2341 -0
  33. package/dist/desktop-auto-render.mjs +2344 -0
  34. package/dist/render-context.cjs +118 -0
  35. package/dist/render-context.d.ts +39 -0
  36. package/dist/render-context.js +77 -0
  37. package/dist/render-context.mjs +87 -0
  38. package/dist/{server-CNgDUgSZ.d.ts → server-FCdUqabc.d.ts} +1 -1
  39. package/dist/server.d.ts +1 -1
  40. package/package.json +26 -3
  41. package/dist/build.d.mts +0 -20
  42. package/dist/chokidar.d.mts +0 -134
  43. package/dist/cli.d.mts +0 -81
  44. package/dist/config.d.mts +0 -254
  45. package/dist/coverage.d.mts +0 -85
  46. package/dist/database.d.mts +0 -52
  47. package/dist/desktop.d.mts +0 -68
  48. package/dist/dom.d.mts +0 -87
  49. package/dist/el.d.mts +0 -208
  50. package/dist/fs.d.mts +0 -255
  51. package/dist/hmr.d.mts +0 -38
  52. package/dist/http.d.mts +0 -169
  53. package/dist/https.d.mts +0 -108
  54. package/dist/index.d.mts +0 -13
  55. package/dist/mime-types.d.mts +0 -48
  56. package/dist/native.d.mts +0 -136
  57. package/dist/path.d.mts +0 -163
  58. package/dist/router.d.mts +0 -49
  59. package/dist/runtime.d.mts +0 -97
  60. package/dist/server-D0Dp4R5z.d.mts +0 -449
  61. package/dist/server.d.mts +0 -7
  62. package/dist/state.d.mts +0 -117
  63. package/dist/style.d.mts +0 -232
  64. package/dist/test-reporter.d.mts +0 -77
  65. package/dist/test-runtime.d.mts +0 -122
  66. package/dist/test.d.mts +0 -39
  67. package/dist/types.d.mts +0 -586
  68. package/dist/universal.d.mts +0 -21
  69. package/dist/ws.d.mts +0 -200
  70. package/dist/wss.d.mts +0 -108
  71. package/src/build.ts +0 -362
  72. package/src/chokidar.ts +0 -427
  73. package/src/cli.ts +0 -1162
  74. package/src/config.ts +0 -509
  75. package/src/coverage.ts +0 -1479
  76. package/src/database.ts +0 -1410
  77. package/src/desktop-auto-render.ts +0 -317
  78. package/src/desktop-cli.ts +0 -1533
  79. package/src/desktop.ts +0 -99
  80. package/src/dev-build.ts +0 -340
  81. package/src/dom.ts +0 -901
  82. package/src/el.ts +0 -183
  83. package/src/fs.ts +0 -609
  84. package/src/hmr.ts +0 -149
  85. package/src/http.ts +0 -856
  86. package/src/https.ts +0 -411
  87. package/src/index.ts +0 -16
  88. package/src/mime-types.ts +0 -222
  89. package/src/mobile-cli.ts +0 -2313
  90. package/src/native-background.ts +0 -444
  91. package/src/native-border.ts +0 -343
  92. package/src/native-canvas.ts +0 -260
  93. package/src/native-cli.ts +0 -414
  94. package/src/native-color.ts +0 -904
  95. package/src/native-estimation.ts +0 -194
  96. package/src/native-grid.ts +0 -590
  97. package/src/native-interaction.ts +0 -1289
  98. package/src/native-layout.ts +0 -568
  99. package/src/native-link.ts +0 -76
  100. package/src/native-render-support.ts +0 -361
  101. package/src/native-spacing.ts +0 -231
  102. package/src/native-state.ts +0 -318
  103. package/src/native-strings.ts +0 -46
  104. package/src/native-transform.ts +0 -120
  105. package/src/native-types.ts +0 -439
  106. package/src/native-typography.ts +0 -254
  107. package/src/native-units.ts +0 -441
  108. package/src/native-vector.ts +0 -910
  109. package/src/native.ts +0 -5606
  110. package/src/path.ts +0 -493
  111. package/src/pm-cli.ts +0 -2498
  112. package/src/preview-build.ts +0 -294
  113. package/src/render-context.ts +0 -138
  114. package/src/router.ts +0 -260
  115. package/src/runtime.ts +0 -97
  116. package/src/server.ts +0 -2294
  117. package/src/state.ts +0 -556
  118. package/src/style.ts +0 -1790
  119. package/src/test-globals.d.ts +0 -184
  120. package/src/test-reporter.ts +0 -609
  121. package/src/test-runtime.ts +0 -1359
  122. package/src/test.ts +0 -368
  123. package/src/types.ts +0 -381
  124. package/src/universal.ts +0 -81
  125. package/src/wapk-cli.ts +0 -3213
  126. package/src/workspace-package.ts +0 -102
  127. package/src/ws.ts +0 -648
  128. package/src/wss.ts +0 -241
package/dist/config.d.mts DELETED
@@ -1,254 +0,0 @@
1
- import { D as DevServerOptions, B as BuildOptions, P as PreviewOptions, T as TestOptions } from './server-D0Dp4R5z.mjs';
2
- import './http.mjs';
3
- import 'node:events';
4
- import './ws.mjs';
5
- import 'events';
6
- import 'http';
7
- import 'ws';
8
-
9
- /**
10
- * Config loader for elit.config.{ts,mts,js,mjs,cjs,json}
11
- */
12
-
13
- interface ElitConfig {
14
- /** Development server configuration */
15
- dev?: DevServerOptions;
16
- /** Build configuration - supports single build or multiple builds */
17
- build?: BuildOptions | BuildOptions[];
18
- /** Preview server configuration */
19
- preview?: PreviewOptions;
20
- /** Test configuration */
21
- test?: TestOptions;
22
- /** Desktop command configuration */
23
- desktop?: DesktopConfig;
24
- /** Mobile command configuration */
25
- mobile?: MobileConfig;
26
- /** Process manager configuration */
27
- pm?: PmConfig;
28
- /** WAPK packaging configuration */
29
- wapk?: WapkConfig;
30
- }
31
- type MobileMode = 'native' | 'hybrid';
32
- type DesktopMode = 'native' | 'hybrid';
33
- type PmRuntimeName = 'node' | 'bun' | 'deno';
34
- type PmRestartPolicy = 'always' | 'on-failure' | 'never';
35
- interface PmHealthCheckConfig {
36
- /** HTTP endpoint polled while the process is online */
37
- url?: string;
38
- /** Delay before the first health check in milliseconds */
39
- gracePeriod?: number;
40
- /** Interval between health checks in milliseconds */
41
- interval?: number;
42
- /** Per-request timeout in milliseconds */
43
- timeout?: number;
44
- /** Consecutive failed checks before the process is restarted */
45
- maxFailures?: number;
46
- }
47
- interface PmAppConfig {
48
- /** Unique process name used by elit pm list/stop/restart */
49
- name: string;
50
- /** Shell command to execute, for example: npm start */
51
- script?: string;
52
- /** JavaScript or TypeScript entry file executed by the selected runtime */
53
- file?: string;
54
- /** Packaged .wapk file or remote archive source executed through elit wapk run */
55
- wapk?: string;
56
- /** Runtime used for file or wapk targets */
57
- runtime?: PmRuntimeName;
58
- /** Working directory for the managed process */
59
- cwd?: string;
60
- /** Extra environment variables injected into the process */
61
- env?: Record<string, string | number | boolean>;
62
- /** Disable automatic restart when the process exits */
63
- autorestart?: boolean;
64
- /** Delay between restart attempts in milliseconds */
65
- restartDelay?: number;
66
- /** Maximum restart attempts before marking the process as errored */
67
- maxRestarts?: number;
68
- /** Password forwarded to elit wapk run for locked archives */
69
- password?: string;
70
- /** Extra WAPK run settings, including direct Google Drive access and live-sync options */
71
- wapkRun?: WapkRunConfig;
72
- /** Restart strategy used after the child process exits */
73
- restartPolicy?: PmRestartPolicy;
74
- /** Minimum healthy uptime before restart attempt counters reset */
75
- minUptime?: number;
76
- /** Restart the process when watched files change */
77
- watch?: boolean;
78
- /** Files or directories watched when watch mode is enabled */
79
- watchPaths?: string[];
80
- /** Glob-like patterns ignored by watch mode */
81
- watchIgnore?: string[];
82
- /** Debounce delay before restarting after a file change */
83
- watchDebounce?: number;
84
- /** Optional HTTP health checks for long-running services */
85
- healthCheck?: PmHealthCheckConfig;
86
- }
87
- interface PmConfig {
88
- /** Directory used to store pm metadata and log files (default: ./.elit/pm) */
89
- dataDir?: string;
90
- /** File used by pm save/resurrect (default: <dataDir>/dump.json) */
91
- dumpFile?: string;
92
- /** Managed applications available to elit pm start */
93
- apps?: PmAppConfig[];
94
- }
95
- interface MobileConfig {
96
- /** Project directory for native mobile artifacts */
97
- cwd?: string;
98
- /** Native app bundle identifier */
99
- appId?: string;
100
- /** Native app display name */
101
- appName?: string;
102
- /** Built web assets directory synced into native projects */
103
- webDir?: string;
104
- /** Mobile runtime mode: native uses generated UI, hybrid keeps the WebView shell active */
105
- mode?: MobileMode;
106
- /** Mobile app icon image path (recommended: .png or .webp) */
107
- icon?: string;
108
- /** Android permissions written to AndroidManifest uses-permission tags */
109
- permissions?: string[];
110
- /** Platform-specific Android CLI defaults */
111
- android?: MobileAndroidConfig;
112
- /** Platform-specific iOS CLI defaults */
113
- ios?: MobileIosConfig;
114
- /** Optional native UI generation targets using the same Elit syntax */
115
- native?: MobileNativeConfig;
116
- }
117
- interface MobileAndroidConfig {
118
- /** Default Android device/emulator id used when --target is omitted */
119
- target?: string;
120
- }
121
- interface MobileIosConfig {
122
- /** Default iOS simulator name, UDID, booted alias, or full xcodebuild destination */
123
- target?: string;
124
- }
125
- interface MobileNativeConfig {
126
- /** Elit entry file that exports a VNode tree or zero-argument factory */
127
- entry?: string;
128
- /** Explicit export name to read from the native entry module */
129
- exportName?: string;
130
- /** Android-specific native generation options */
131
- android?: MobileNativeAndroidConfig;
132
- /** iOS-specific native generation options */
133
- ios?: MobileNativeIosConfig;
134
- }
135
- interface MobileNativeAndroidConfig {
136
- /** Disable Android native code generation while keeping iOS enabled */
137
- enabled?: boolean;
138
- /** Kotlin package name for generated native screen files */
139
- packageName?: string;
140
- /** Output file path for generated Compose screen, relative to mobile.cwd */
141
- output?: string;
142
- }
143
- interface MobileNativeIosConfig {
144
- /** Disable iOS native code generation while keeping Android enabled */
145
- enabled?: boolean;
146
- /** Output file path for generated SwiftUI file, relative to mobile.cwd */
147
- output?: string;
148
- }
149
- interface DesktopConfig {
150
- /** Desktop runtime mode: native prefers desktop.native.entry and hybrid prefers desktop.entry */
151
- mode?: DesktopMode;
152
- /** Desktop entry file used when the CLI command omits <entry> in hybrid mode */
153
- entry?: string;
154
- /** Optional native desktop entry defaults */
155
- native?: DesktopNativeConfig;
156
- /** Native desktop runtime: quickjs, bun, node, deno */
157
- runtime?: 'quickjs' | 'bun' | 'node' | 'deno';
158
- /** Desktop entry compiler: auto, none, esbuild, tsx, tsup */
159
- compiler?: 'auto' | 'none' | 'esbuild' | 'tsx' | 'tsup';
160
- /** Build or run with release desktop runtime */
161
- release?: boolean;
162
- /** Desktop build output directory */
163
- outDir?: string;
164
- /** Desktop build target platform */
165
- platform?: 'windows' | 'win' | 'windows-arm' | 'win-arm' | 'linux' | 'linux-musl' | 'linux-arm' | 'macos' | 'mac' | 'darwin' | 'macos-arm' | 'mac-arm';
166
- /** Desktop WAPK mode defaults */
167
- wapk?: {
168
- /** Packaged runtime to execute inside desktop mode */
169
- runtime?: 'node' | 'bun' | 'deno';
170
- /** Polling interval for WAPK live sync */
171
- syncInterval?: number;
172
- /** Use event-driven file watcher for WAPK live sync */
173
- useWatcher?: boolean;
174
- /** Use release desktop runtime binary */
175
- release?: boolean;
176
- };
177
- }
178
- interface DesktopNativeConfig {
179
- /** Elit entry file used when desktop.mode is native or --mode native is passed */
180
- entry?: string;
181
- /** Explicit export name to read from the desktop native entry module */
182
- exportName?: string;
183
- }
184
- interface WapkLockConfig {
185
- /** Plain-text password used to encrypt the archive */
186
- password?: string;
187
- }
188
- interface WapkLiveSyncConfig {
189
- /** Polling interval for live sync writes back into the archive */
190
- syncInterval?: number;
191
- /** Use event-driven file watching for local workdir changes */
192
- useWatcher?: boolean;
193
- /** Pull archive changes back into the temp workdir */
194
- watchArchive?: boolean;
195
- /** Polling interval for reading external archive changes */
196
- archiveSyncInterval?: number;
197
- }
198
- interface WapkGoogleDriveConfig {
199
- /** Google Drive file id for the remote .wapk archive */
200
- fileId?: string;
201
- /** OAuth access token used for Google Drive API calls */
202
- accessToken?: string;
203
- /** Environment variable name that contains the OAuth access token */
204
- accessTokenEnv?: string;
205
- /** Include supportsAllDrives=true when accessing shared drive files */
206
- supportsAllDrives?: boolean;
207
- }
208
- interface WapkRunConfig extends WapkLiveSyncConfig {
209
- /** Default archive file used by elit wapk run when no file argument is provided */
210
- file?: string;
211
- /** Remote Google Drive archive used by elit wapk run */
212
- googleDrive?: WapkGoogleDriveConfig;
213
- /** Create an online Elit Run shared session instead of starting the local runtime */
214
- online?: boolean;
215
- /** Elit Run base URL used when online hosting targets a non-default origin */
216
- onlineUrl?: string;
217
- /** Default runtime override used by elit wapk run */
218
- runtime?: 'node' | 'bun' | 'deno';
219
- /** Default password used to unlock a locked archive at runtime */
220
- password?: string;
221
- }
222
- interface WapkConfig {
223
- name?: string;
224
- version?: string;
225
- runtime?: string;
226
- engine?: string;
227
- entry?: string;
228
- scripts?: Record<string, string>;
229
- port?: number;
230
- env?: Record<string, string | number | boolean>;
231
- desktop?: Record<string, unknown>;
232
- lock?: WapkLockConfig;
233
- run?: WapkRunConfig;
234
- }
235
- /**
236
- * Helper function for type-safe config definition
237
- */
238
- declare function defineConfig(config: ElitConfig): ElitConfig;
239
- declare const ELIT_CONFIG_FILES: readonly ["elit.config.ts", "elit.config.mts", "elit.config.js", "elit.config.mjs", "elit.config.cjs", "elit.config.json"];
240
- declare function resolveConfigPath(cwd?: string): string | null;
241
- /**
242
- * Load environment variables from .env files
243
- */
244
- declare function loadEnv(mode?: string, cwd?: string): Record<string, string>;
245
- /**
246
- * Load elit config from current directory
247
- */
248
- declare function loadConfig(cwd?: string): Promise<ElitConfig | null>;
249
- /**
250
- * Merge CLI args with config file
251
- */
252
- declare function mergeConfig<T extends Record<string, any>>(config: T | undefined, cliArgs: Partial<T>): T;
253
-
254
- export { type DesktopConfig, type DesktopMode, type DesktopNativeConfig, ELIT_CONFIG_FILES, type ElitConfig, type MobileAndroidConfig, type MobileConfig, type MobileIosConfig, type MobileMode, type MobileNativeAndroidConfig, type MobileNativeConfig, type MobileNativeIosConfig, type PmAppConfig, type PmConfig, type PmHealthCheckConfig, type PmRestartPolicy, type PmRuntimeName, type WapkConfig, type WapkGoogleDriveConfig, type WapkLiveSyncConfig, type WapkLockConfig, type WapkRunConfig, defineConfig, loadConfig, loadEnv, mergeConfig, resolveConfigPath };
@@ -1,85 +0,0 @@
1
- import { b as TestCoverageReporter } from './server-D0Dp4R5z.mjs';
2
- import './http.mjs';
3
- import 'node:events';
4
- import './ws.mjs';
5
- import 'events';
6
- import 'http';
7
- import 'ws';
8
-
9
- /**
10
- * Coverage collection and reporting with vitest-style output
11
- *
12
- * This module provides coverage collection using V8 native coverage
13
- * with beautiful vitest-style text and HTML reports.
14
- */
15
-
16
- /**
17
- * Mark a file as covered (being tracked)
18
- * This is called when a file is imported/loaded during tests
19
- * NOTE: We DON'T mark all lines as executed here - we just track that the file is loaded
20
- * The coveredFiles Set in test-runner already tracks this
21
- */
22
- declare function markFileAsCovered(_filePath: string): void;
23
- /**
24
- * Track that a specific line was executed during testing
25
- * Call this during test execution to mark lines as covered
26
- */
27
- declare function markLineExecuted(filePath: string, lineNumber: number): void;
28
- /**
29
- * Get all executed lines for a file
30
- */
31
- declare function getExecutedLines(filePath: string): Set<number>;
32
- /**
33
- * Calculate uncovered lines by comparing executable lines vs executed lines
34
- */
35
- declare function calculateUncoveredLines(filePath: string): number[];
36
- /**
37
- * Reset coverage tracking (call before running tests)
38
- */
39
- declare function resetCoverageTracking(): void;
40
- /**
41
- * Initialize coverage tracking in the global scope
42
- * Call this once before running tests
43
- */
44
- declare function initializeCoverageTracking(): void;
45
- interface CoverageOptions {
46
- reportsDirectory: string;
47
- include?: string[];
48
- exclude?: string[];
49
- reporter?: TestCoverageReporter[];
50
- coveredFiles?: Set<string>;
51
- }
52
- interface FileCoverage {
53
- path: string;
54
- statements: number;
55
- coveredStatements: number;
56
- branches: number;
57
- coveredBranches: number;
58
- functions: number;
59
- coveredFunctions: number;
60
- lines: number;
61
- coveredLines: number;
62
- uncoveredLines?: number[];
63
- }
64
- /**
65
- * Process coverage data and map it to source files
66
- */
67
- declare function processCoverage(options: CoverageOptions): Promise<Map<string, FileCoverage>>;
68
- /**
69
- * Generate vitest-style text coverage report
70
- */
71
- declare function generateTextReport(coverageMap: Map<string, FileCoverage>, testResults?: any[]): string;
72
- /**
73
- * Generate HTML coverage report - vitest dark theme style
74
- */
75
- declare function generateHtmlReport(coverageMap: Map<string, FileCoverage>, reportsDir: string): void;
76
- /**
77
- * Generate coverage-final.json (Code Climate/Codecov format)
78
- */
79
- declare function generateCoverageFinalJson(coverageMap: Map<string, FileCoverage>, reportsDir: string): void;
80
- /**
81
- * Generate clover.xml report
82
- */
83
- declare function generateCloverXml(coverageMap: Map<string, FileCoverage>, reportsDir: string): void;
84
-
85
- export { type CoverageOptions, type FileCoverage, calculateUncoveredLines, generateCloverXml, generateCoverageFinalJson, generateHtmlReport, generateTextReport, getExecutedLines, initializeCoverageTracking, markFileAsCovered, markLineExecuted, processCoverage, resetCoverageTracking };
@@ -1,52 +0,0 @@
1
- interface VMOptions {
2
- language?: 'ts' | 'js';
3
- registerModules?: {
4
- [key: string]: any;
5
- };
6
- dir?: string;
7
- }
8
- declare function create(dbName: string, code: string | Function, options?: VMOptions): void;
9
- declare function read(dbName: string, options?: VMOptions): string;
10
- declare function remove(dbName: string, fnName: string, options?: VMOptions): string | false;
11
- declare function rename(oldName: string, newName: string, options?: VMOptions): string;
12
- type UpdateValue = unknown;
13
- declare function save(dbName: string, code: unknown, options?: VMOptions): void;
14
- declare function update(dbName: string, fnName: string, code: UpdateValue, options?: VMOptions): string;
15
- declare class Database {
16
- private vm;
17
- private options;
18
- constructor(options?: VMOptions);
19
- register(context: {
20
- [key: string]: any;
21
- }): void;
22
- execute(code: string): Promise<{
23
- namespace: any;
24
- logs: any[];
25
- }>;
26
- /**
27
- * Create a new database file with the given code
28
- */
29
- create(dbName: string, code: string | Function): void;
30
- /**
31
- * Read the contents of a database file
32
- */
33
- read(dbName: string): string;
34
- /**
35
- * Remove a function or the entire database file
36
- */
37
- remove(dbName: string, fnName?: string): string | boolean;
38
- /**
39
- * Rename a database file
40
- */
41
- rename(oldName: string, newName: string): string;
42
- /**
43
- * Save code to a database file (overwrites existing content)
44
- */
45
- save(dbName: string, code: unknown): void;
46
- /**
47
- * Update a function in a database file
48
- */
49
- update(dbName: string, fnName: string, code: unknown): string;
50
- }
51
-
52
- export { Database, create, read, remove, rename, save, update };
@@ -1,68 +0,0 @@
1
- type DesktopRuntimeName = 'quickjs' | 'bun' | 'node' | 'deno';
2
- interface WindowOptions {
3
- url?: string;
4
- html?: string;
5
- title?: string;
6
- width?: number;
7
- height?: number;
8
- x?: number;
9
- y?: number;
10
- center?: boolean;
11
- maximized?: boolean;
12
- resizable?: boolean;
13
- decorations?: boolean;
14
- transparent?: boolean;
15
- always_on_top?: boolean;
16
- minimizable?: boolean;
17
- maximizable?: boolean;
18
- closable?: boolean;
19
- skip_taskbar?: boolean;
20
- icon?: string;
21
- devtools?: boolean;
22
- proxy_port?: number;
23
- proxy_pipe?: string;
24
- proxy_secret?: string;
25
- }
26
- interface ServeWindowOptions extends Omit<WindowOptions, 'url'> {
27
- port?: number;
28
- exposePort?: boolean;
29
- }
30
- interface ServeWindowResultExposed {
31
- port: number;
32
- host: string;
33
- url: string;
34
- }
35
- interface ServeWindowResultPipe {
36
- pipe: string;
37
- }
38
- type ServeWindowResult = ServeWindowResultExposed | ServeWindowResultPipe;
39
- declare const createWindow: (opts: WindowOptions) => void;
40
- declare const createWindowServer: (app: (req: any, res: any) => void, opts?: ServeWindowOptions) => Promise<ServeWindowResult>;
41
- declare const windowEval: (code: string) => void;
42
- declare const onMessage: (handler: (msg: string) => void) => void;
43
- declare const windowMinimize: () => void;
44
- declare const windowMaximize: () => void;
45
- declare const windowUnmaximize: () => void;
46
- declare const windowSetTitle: (title: string) => void;
47
- declare const windowDrag: () => void;
48
- declare const windowSetPosition: (x: number, y: number) => void;
49
- declare const windowSetSize: (w: number, h: number) => void;
50
- declare const windowSetAlwaysOnTop: (value: boolean) => void;
51
- declare const windowQuit: () => void;
52
- declare global {
53
- function createWindow(opts: WindowOptions): void;
54
- function windowEval(code: string): void;
55
- function onMessage(handler: (msg: string) => void): void;
56
- function windowMinimize(): void;
57
- function windowMaximize(): void;
58
- function windowUnmaximize(): void;
59
- function windowSetTitle(title: string): void;
60
- function windowDrag(): void;
61
- function windowSetPosition(x: number, y: number): void;
62
- function windowSetSize(w: number, h: number): void;
63
- function windowSetAlwaysOnTop(value: boolean): void;
64
- function windowQuit(): void;
65
- function createWindowServer(app: (req: any, res: any) => void, opts?: ServeWindowOptions): Promise<ServeWindowResult>;
66
- }
67
-
68
- export { type DesktopRuntimeName, type ServeWindowOptions, type ServeWindowResult, type ServeWindowResultExposed, type ServeWindowResultPipe, type WindowOptions, createWindow, createWindowServer, onMessage, windowDrag, windowEval, windowMaximize, windowMinimize, windowQuit, windowSetAlwaysOnTop, windowSetPosition, windowSetSize, windowSetTitle, windowUnmaximize };
package/dist/dom.d.mts DELETED
@@ -1,87 +0,0 @@
1
- import { Props, Children, VNode, Child, StateOptions, State, VirtualListController, JsonNode, VNodeJson } from './types.mjs';
2
- import 'node:events';
3
- import 'events';
4
- import 'http';
5
- import 'ws';
6
-
7
- /**
8
- * Elit - DomNode Core Class
9
- */
10
-
11
- declare class DomNode {
12
- private elementCache;
13
- createElement(tagName: string, props?: Props, children?: Children): VNode;
14
- renderToDOM(vNode: Child, parent: HTMLElement | SVGElement | DocumentFragment): void;
15
- render(rootElement: string | HTMLElement, vNode: VNode): HTMLElement;
16
- batchRender(rootElement: string | HTMLElement, vNodes: VNode[]): HTMLElement;
17
- renderChunked(rootElement: string | HTMLElement, vNodes: VNode[], chunkSize?: number, onProgress?: (current: number, total: number) => void): HTMLElement;
18
- renderToHead(...vNodes: Array<VNode | VNode[]>): HTMLHeadElement | null;
19
- addStyle(cssText: string): HTMLStyleElement;
20
- addMeta(attrs: Record<string, string>): HTMLMetaElement;
21
- addLink(attrs: Record<string, string>): HTMLLinkElement;
22
- setTitle(text: string): string;
23
- createState<T>(initialValue: T, options?: StateOptions): State<T>;
24
- computed<T extends any[], R>(states: {
25
- [K in keyof T]: State<T[K]>;
26
- }, computeFn: (...values: T) => R): State<R>;
27
- effect(stateFn: () => void): void;
28
- createVirtualList<T>(container: HTMLElement, items: T[], renderItem: (item: T, index: number) => VNode, itemHeight?: number, bufferSize?: number): VirtualListController;
29
- lazy<T extends any[], R>(loadFn: () => Promise<(...args: T) => R>): (...args: T) => Promise<R | VNode>;
30
- cleanupUnusedElements(root: HTMLElement): number;
31
- renderToString(vNode: Child, options?: {
32
- pretty?: boolean;
33
- indent?: number;
34
- }): string;
35
- private resolveStateValue;
36
- private isReactiveWrapper;
37
- private unwrapReactive;
38
- private escapeHtml;
39
- private isSelfClosingTag;
40
- private propsToAttributes;
41
- private styleToString;
42
- private isState;
43
- private reactiveNodes;
44
- private createReactiveChild;
45
- jsonToVNode(json: JsonNode | string | number | boolean | null | undefined | State<any>): Child;
46
- vNodeJsonToVNode(json: VNodeJson | State<any>): Child;
47
- renderJson(rootElement: string | HTMLElement, json: JsonNode): HTMLElement;
48
- renderVNode(rootElement: string | HTMLElement, json: VNodeJson): HTMLElement;
49
- renderJsonToString(json: JsonNode, options?: {
50
- pretty?: boolean;
51
- indent?: number;
52
- }): string;
53
- renderVNodeToString(json: VNodeJson, options?: {
54
- pretty?: boolean;
55
- indent?: number;
56
- }): string;
57
- renderToHTMLDocument(vNode: Child, options?: {
58
- title?: string;
59
- meta?: Array<Record<string, string>>;
60
- links?: Array<Record<string, string>>;
61
- scripts?: Array<{
62
- src?: string;
63
- content?: string;
64
- async?: boolean;
65
- defer?: boolean;
66
- type?: string;
67
- }>;
68
- styles?: Array<{
69
- href?: string;
70
- content?: string;
71
- }>;
72
- lang?: string;
73
- head?: string;
74
- bodyAttrs?: Record<string, string>;
75
- pretty?: boolean;
76
- }): string;
77
- getElementCache(): WeakMap<Element, boolean>;
78
- }
79
- declare const dom: DomNode;
80
- declare const render: (rootElement: string | HTMLElement, vNode: VNode) => HTMLElement;
81
- declare const renderToString: (vNode: Child, options?: {
82
- pretty?: boolean;
83
- indent?: number;
84
- }) => string;
85
- declare const mount: (rootElement: string | HTMLElement, vNode: VNode) => HTMLElement;
86
-
87
- export { DomNode, dom, mount, render, renderToString };