hightjs 0.5.3 → 0.5.4

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 (45) hide show
  1. package/dist/adapters/express.d.ts +7 -0
  2. package/dist/adapters/express.js +63 -0
  3. package/dist/adapters/factory.d.ts +23 -0
  4. package/dist/adapters/factory.js +122 -0
  5. package/dist/adapters/fastify.d.ts +25 -0
  6. package/dist/adapters/fastify.js +61 -0
  7. package/dist/adapters/native.d.ts +8 -0
  8. package/dist/adapters/native.js +198 -0
  9. package/dist/api/console.d.ts +94 -0
  10. package/dist/api/console.js +294 -0
  11. package/dist/api/http.d.ts +180 -0
  12. package/dist/api/http.js +469 -0
  13. package/dist/bin/hightjs.d.ts +2 -0
  14. package/dist/bin/hightjs.js +214 -0
  15. package/dist/builder.d.ts +32 -0
  16. package/dist/builder.js +581 -0
  17. package/dist/client/DefaultNotFound.d.ts +1 -0
  18. package/dist/client/DefaultNotFound.js +79 -0
  19. package/dist/client/client.d.ts +3 -0
  20. package/dist/client/client.js +24 -0
  21. package/dist/client/clientRouter.d.ts +58 -0
  22. package/dist/client/clientRouter.js +132 -0
  23. package/dist/client/entry.client.d.ts +1 -0
  24. package/dist/client/entry.client.js +455 -0
  25. package/dist/components/Link.d.ts +7 -0
  26. package/dist/components/Link.js +13 -0
  27. package/dist/global/global.d.ts +117 -0
  28. package/dist/global/global.js +17 -0
  29. package/dist/helpers.d.ts +20 -0
  30. package/dist/helpers.js +583 -0
  31. package/dist/hotReload.d.ts +32 -0
  32. package/dist/hotReload.js +545 -0
  33. package/dist/index.d.ts +18 -0
  34. package/dist/index.js +494 -0
  35. package/dist/loaders.d.ts +1 -0
  36. package/dist/loaders.js +46 -0
  37. package/dist/renderer.d.ts +14 -0
  38. package/dist/renderer.js +380 -0
  39. package/dist/router.d.ts +101 -0
  40. package/dist/router.js +659 -0
  41. package/dist/types/framework.d.ts +37 -0
  42. package/dist/types/framework.js +2 -0
  43. package/dist/types.d.ts +192 -0
  44. package/dist/types.js +2 -0
  45. package/package.json +1 -1
@@ -0,0 +1,545 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.HotReloadManager = void 0;
37
+ /*
38
+ * This file is part of the HightJS Project.
39
+ * Copyright (c) 2025 itsmuzin
40
+ *
41
+ * Licensed under the Apache License, Version 2.0 (the "License");
42
+ * you may not use this file except in compliance with the License.
43
+ * You may obtain a copy of the License at
44
+ *
45
+ * http://www.apache.org/licenses/LICENSE-2.0
46
+ *
47
+ * Unless required by applicable law or agreed to in writing, software
48
+ * distributed under the License is distributed on an "AS IS" BASIS,
49
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50
+ * See the License for the specific language governing permissions and
51
+ * limitations under the License.
52
+ */
53
+ const ws_1 = require("ws");
54
+ const chokidar = __importStar(require("chokidar"));
55
+ const path = __importStar(require("path"));
56
+ const router_1 = require("./router");
57
+ const console_1 = __importStar(require("./api/console"));
58
+ class HotReloadManager {
59
+ constructor(projectDir) {
60
+ this.wss = null;
61
+ this.watchers = [];
62
+ this.clients = new Map();
63
+ this.backendApiChangeCallback = null;
64
+ this.frontendChangeCallback = null;
65
+ this.isShuttingDown = false;
66
+ this.debounceTimers = new Map();
67
+ this.customHotReloadListener = null;
68
+ this.isBuilding = false;
69
+ this.buildCompleteResolve = null;
70
+ this.projectDir = projectDir;
71
+ }
72
+ async start() {
73
+ this.setupWatchers();
74
+ }
75
+ // Método para integrar com Express
76
+ handleUpgrade(request, socket, head) {
77
+ if (this.isShuttingDown) {
78
+ socket.destroy();
79
+ return;
80
+ }
81
+ if (!this.wss) {
82
+ this.wss = new ws_1.WebSocketServer({
83
+ noServer: true,
84
+ perMessageDeflate: false, // Desabilita compressão para melhor performance
85
+ maxPayload: 1024 * 1024 // Limite de 1MB por mensagem
86
+ });
87
+ this.setupWebSocketServer();
88
+ }
89
+ this.wss.handleUpgrade(request, socket, head, (ws) => {
90
+ this.wss.emit('connection', ws, request);
91
+ });
92
+ }
93
+ setupWebSocketServer() {
94
+ if (!this.wss)
95
+ return;
96
+ this.wss.on('connection', (ws) => {
97
+ if (this.isShuttingDown) {
98
+ ws.close();
99
+ return;
100
+ }
101
+ // Setup ping/pong para detectar conexões mortas
102
+ const pingTimer = setInterval(() => {
103
+ const client = this.clients.get(ws);
104
+ if (client && ws.readyState === ws_1.WebSocket.OPEN) {
105
+ // Se não recebeu pong há mais de 60 segundos, desconecta
106
+ if (Date.now() - client.lastPong > 60000) {
107
+ ws.terminate();
108
+ return;
109
+ }
110
+ ws.ping();
111
+ }
112
+ }, 30000);
113
+ const clientConnection = {
114
+ ws,
115
+ pingTimer,
116
+ lastPong: Date.now()
117
+ };
118
+ this.clients.set(ws, clientConnection);
119
+ ws.on('pong', () => {
120
+ const client = this.clients.get(ws);
121
+ if (client) {
122
+ client.lastPong = Date.now();
123
+ }
124
+ });
125
+ ws.on('close', () => {
126
+ this.cleanupClient(ws);
127
+ });
128
+ ws.on('error', (error) => {
129
+ console_1.default.logWithout(console_1.Levels.ERROR, console_1.Colors.BgRed, `WebSocket error: ${error.message}`);
130
+ this.cleanupClient(ws);
131
+ });
132
+ });
133
+ }
134
+ cleanupClient(ws) {
135
+ const client = this.clients.get(ws);
136
+ if (client) {
137
+ clearInterval(client.pingTimer);
138
+ this.clients.delete(ws);
139
+ }
140
+ }
141
+ setupWatchers() {
142
+ // Remove watchers antigos e use apenas um watcher global para src
143
+ const debouncedChange = this.debounce((filePath) => {
144
+ this.handleAnySrcChange(filePath);
145
+ }, 100);
146
+ const watcher = chokidar.watch([
147
+ path.join(this.projectDir, 'src/**/*'),
148
+ ], {
149
+ ignored: [
150
+ /(^|[\/\\])\../, // arquivos ocultos
151
+ '**/node_modules/**',
152
+ '**/.git/**',
153
+ '**/dist/**'
154
+ ],
155
+ persistent: true,
156
+ ignoreInitial: true,
157
+ usePolling: false,
158
+ awaitWriteFinish: {
159
+ stabilityThreshold: 100,
160
+ pollInterval: 50
161
+ }
162
+ });
163
+ watcher.on('change', debouncedChange);
164
+ watcher.on('add', debouncedChange);
165
+ watcher.on('unlink', (filePath) => {
166
+ console_1.default.info(`🗑️ Arquivo removido: ${path.basename(filePath)}`);
167
+ (0, router_1.clearFileCache)(filePath);
168
+ this.clearBackendCache(filePath);
169
+ this.frontendChangeCallback?.();
170
+ this.backendApiChangeCallback?.();
171
+ this.notifyClients('src-reload', { file: filePath, event: 'unlink' });
172
+ });
173
+ this.watchers.push(watcher);
174
+ }
175
+ debounce(func, wait) {
176
+ return (...args) => {
177
+ const key = args[0]; // usa o primeiro argumento como chave
178
+ const existingTimer = this.debounceTimers.get(key);
179
+ if (existingTimer) {
180
+ clearTimeout(existingTimer);
181
+ }
182
+ const timer = setTimeout(() => {
183
+ this.debounceTimers.delete(key);
184
+ func.apply(this, args);
185
+ }, wait);
186
+ this.debounceTimers.set(key, timer);
187
+ };
188
+ }
189
+ async handleAnySrcChange(filePath) {
190
+ console_1.default.logWithout(console_1.Levels.INFO, console_1.Colors.BgRed, `🔄 Arquivo alterado: ${path.basename(filePath)}`);
191
+ // Detecta se é arquivo de frontend ou backend
192
+ const isFrontendFile = filePath.includes(path.join('src', 'web', 'routes')) ||
193
+ filePath.includes(path.join('src', 'web', 'components')) ||
194
+ filePath.includes('layout.tsx') ||
195
+ filePath.includes('not-found.tsx') ||
196
+ filePath.endsWith('.tsx');
197
+ const isBackendFile = filePath.includes(path.join('src', 'backend')) && !isFrontendFile;
198
+ // Limpa o cache do arquivo alterado
199
+ (0, router_1.clearFileCache)(filePath);
200
+ this.clearBackendCache(filePath);
201
+ // Se for arquivo de frontend, aguarda o build terminar antes de recarregar
202
+ if (isFrontendFile) {
203
+ console_1.default.logWithout(console_1.Levels.INFO, console_1.Colors.BgRed, `📄 Waiting for frontend build...`);
204
+ // Marca que estamos esperando um build
205
+ this.isBuilding = true;
206
+ // Cria uma promise que será resolvida quando o build terminar
207
+ const buildPromise = new Promise((resolve) => {
208
+ this.buildCompleteResolve = resolve;
209
+ });
210
+ // Aguarda o build terminar (com timeout de 30 segundos)
211
+ const timeoutPromise = new Promise((_, reject) => {
212
+ setTimeout(() => reject(new Error('Build timeout')), 30000);
213
+ });
214
+ try {
215
+ this.frontendChangeCallback?.();
216
+ await Promise.race([buildPromise, timeoutPromise]);
217
+ console_1.default.logWithout(console_1.Levels.INFO, console_1.Colors.BgRed, `✅ Build complete, reloading frontend...`);
218
+ this.frontendChangeCallback?.();
219
+ this.notifyClients('frontend-reload', { file: filePath, event: 'change' });
220
+ }
221
+ catch (error) {
222
+ console_1.default.logWithout(console_1.Levels.ERROR, console_1.Colors.BgRed, `⚠️ Timeout in build, reloading anyway...`);
223
+ this.frontendChangeCallback?.();
224
+ this.notifyClients('frontend-reload', { file: filePath, event: 'change' });
225
+ }
226
+ finally {
227
+ this.isBuilding = false;
228
+ this.buildCompleteResolve = null;
229
+ }
230
+ }
231
+ // Se for arquivo de backend, recarrega o módulo e notifica
232
+ if (isBackendFile) {
233
+ console_1.default.logWithout(console_1.Levels.INFO, console_1.Colors.BgRed, `⚙️ Reloading backend...`);
234
+ this.backendApiChangeCallback?.();
235
+ this.notifyClients('backend-api-reload', { file: filePath, event: 'change' });
236
+ }
237
+ // Fallback: se não for nem frontend nem backend detectado, recarrega tudo
238
+ if (!isFrontendFile && !isBackendFile) {
239
+ console_1.default.logWithout(console_1.Levels.INFO, console_1.Colors.BgRed, `🔄 Reloading application...`);
240
+ this.frontendChangeCallback?.();
241
+ this.backendApiChangeCallback?.();
242
+ this.notifyClients('src-reload', { file: filePath, event: 'change' });
243
+ }
244
+ // Chama listener customizado se definido
245
+ if (this.customHotReloadListener) {
246
+ try {
247
+ await this.customHotReloadListener(filePath);
248
+ }
249
+ catch (error) {
250
+ // @ts-ignore
251
+ console_1.default.logWithout(console_1.Levels.ERROR, `Error in custom listener: ${error.message}`);
252
+ }
253
+ }
254
+ }
255
+ notifyClients(type, data) {
256
+ if (this.isShuttingDown || this.clients.size === 0) {
257
+ return;
258
+ }
259
+ const message = JSON.stringify({ type, data, timestamp: Date.now() });
260
+ const deadClients = [];
261
+ this.clients.forEach((client, ws) => {
262
+ if (ws.readyState === ws_1.WebSocket.OPEN) {
263
+ try {
264
+ ws.send(message);
265
+ }
266
+ catch (error) {
267
+ console_1.default.logWithout(console_1.Levels.ERROR, console_1.Colors.BgRed, `Error sending WebSocket message: ${error}`);
268
+ deadClients.push(ws);
269
+ }
270
+ }
271
+ else {
272
+ deadClients.push(ws);
273
+ }
274
+ });
275
+ // Remove clientes mortos
276
+ deadClients.forEach(ws => this.cleanupClient(ws));
277
+ }
278
+ restartServer() {
279
+ this.notifyClients('server-restart');
280
+ setTimeout(() => {
281
+ this.notifyClients('server-ready');
282
+ }, 2000);
283
+ }
284
+ stop() {
285
+ this.isShuttingDown = true;
286
+ // Limpa todos os debounce timers
287
+ this.debounceTimers.forEach(timer => clearTimeout(timer));
288
+ this.debounceTimers.clear();
289
+ // Para todos os watchers
290
+ this.watchers.forEach(watcher => watcher.close());
291
+ this.watchers = [];
292
+ // Limpa todos os clientes
293
+ this.clients.forEach((client, ws) => {
294
+ clearInterval(client.pingTimer);
295
+ if (ws.readyState === ws_1.WebSocket.OPEN) {
296
+ ws.close();
297
+ }
298
+ });
299
+ this.clients.clear();
300
+ // Fecha WebSocket server
301
+ if (this.wss) {
302
+ this.wss.close();
303
+ this.wss = null;
304
+ }
305
+ }
306
+ // Script do cliente otimizado com reconnection backoff
307
+ getClientScript() {
308
+ return `
309
+ <script>
310
+ (function() {
311
+ if (typeof window !== 'undefined') {
312
+ let ws;
313
+ let reconnectAttempts = 0;
314
+ let maxReconnectInterval = 30000;
315
+ let reconnectInterval = 1000;
316
+ let reconnectTimer;
317
+ let isConnected = false;
318
+
319
+ function connect() {
320
+ const url = window.location; // Objeto com info da URL atual
321
+ const protocol = url.protocol === "https:" ? "wss:" : "ws:"; // Usa wss se for https
322
+ const wsUrl = protocol + '//' + url.host + '/hweb-hotreload/';
323
+ if (ws && (ws.readyState === WebSocket.CONNECTING || ws.readyState === WebSocket.OPEN)) {
324
+ return;
325
+ }
326
+
327
+ try {
328
+ ws = new WebSocket(wsUrl);
329
+
330
+ ws.onopen = function() {
331
+ console.log('🔌 Hot-reload connected');
332
+ isConnected = true;
333
+ reconnectAttempts = 0;
334
+ reconnectInterval = 1000;
335
+ clearTimeout(reconnectTimer);
336
+ };
337
+
338
+ ws.onmessage = function(event) {
339
+ try {
340
+ const message = JSON.parse(event.data);
341
+
342
+ switch(message.type) {
343
+ case 'frontend-reload':
344
+ handleFrontendReload(message.data);
345
+ break;
346
+ case 'backend-api-reload':
347
+ // Backend sempre precisa recarregar
348
+ console.log('🔄 Backend changed, reloading...');
349
+ window.location.reload();
350
+ break;
351
+ case 'server-restart':
352
+ console.log('🔄 Server restarting...');
353
+ break;
354
+ case 'server-ready':
355
+ setTimeout(() => window.location.reload(), 500);
356
+ break;
357
+ case 'frontend-error':
358
+ console.error('❌ Frontend error:', message.data);
359
+ break;
360
+ case 'hmr-update':
361
+ handleHMRUpdate(message.data);
362
+ break;
363
+ }
364
+ } catch (e) {
365
+ console.error('Erro ao processar mensagem do hot-reload:', e);
366
+ }
367
+ };
368
+
369
+ function handleFrontendReload(data) {
370
+ if (!data || !data.file) {
371
+ window.location.reload();
372
+ return;
373
+ }
374
+
375
+ const file = data.file.toLowerCase();
376
+
377
+ // Mudanças que exigem reload completo
378
+ const needsFullReload =
379
+ file.includes('layout.tsx') ||
380
+ file.includes('not-found.tsx') ||
381
+ file.endsWith('.css');
382
+
383
+ if (needsFullReload) {
384
+ console.log('⚡ Layout/CSS changed, full reload...');
385
+ window.location.reload();
386
+ return;
387
+ }
388
+
389
+ // Mudanças em rotas: tenta HMR
390
+ if (file.includes('/routes/') || file.includes('routes')) {
391
+ console.log('⚡ Route component changed, hot reloading...');
392
+
393
+ // Dispara evento para forçar re-render
394
+ const event = new CustomEvent('hmr:component-update', {
395
+ detail: { file: data.file, timestamp: Date.now() }
396
+ });
397
+ window.dispatchEvent(event);
398
+
399
+ // Aguarda 500ms para ver se o HMR foi bem-sucedido
400
+ setTimeout(() => {
401
+ const hmrSuccess = window.__HMR_SUCCESS__;
402
+ if (!hmrSuccess) {
403
+ console.log('⚠️ HMR failed, falling back to full reload');
404
+ window.location.reload();
405
+ } else {
406
+ console.log('✅ HMR successful!');
407
+ }
408
+ }, 500);
409
+ } else {
410
+ // Outros arquivos: reload completo por segurança
411
+ window.location.reload();
412
+ }
413
+ }
414
+
415
+ function handleHMRUpdate(data) {
416
+ console.log('🔥 HMR Update:', data);
417
+
418
+ // Dispara evento customizado para o React capturar
419
+ const event = new CustomEvent('hmr:update', {
420
+ detail: data
421
+ });
422
+ window.dispatchEvent(event);
423
+ }
424
+
425
+ function attemptHMR(changedFile) {
426
+ // Tenta fazer Hot Module Replacement
427
+ // Dispara evento para o React App capturar
428
+ const event = new CustomEvent('hmr:component-update', {
429
+ detail: { file: changedFile, timestamp: Date.now() }
430
+ });
431
+ window.dispatchEvent(event);
432
+
433
+ // Fallback: se após 2s não houve sucesso, reload
434
+ setTimeout(() => {
435
+ const hmrSuccess = window.__HMR_SUCCESS__;
436
+ if (!hmrSuccess) {
437
+ console.log('⚠️ HMR failed, falling back to full reload');
438
+ window.location.reload();
439
+ }
440
+ }, 2000);
441
+ }
442
+
443
+ ws.onclose = function(event) {
444
+ isConnected = false;
445
+
446
+ // Não tenta reconectar se foi fechamento intencional
447
+ if (event.code === 1000) {
448
+ return;
449
+ }
450
+
451
+ scheduleReconnect();
452
+ };
453
+
454
+ ws.onerror = function(error) {
455
+ isConnected = false;
456
+ // Não loga erros de conexão para evitar spam no console
457
+ };
458
+
459
+ } catch (error) {
460
+ console.error('Error creating WebSocket:', error);
461
+ scheduleReconnect();
462
+ }
463
+ }
464
+
465
+ function scheduleReconnect() {
466
+ if (reconnectTimer) {
467
+ clearTimeout(reconnectTimer);
468
+ }
469
+
470
+ reconnectAttempts++;
471
+
472
+ // Exponential backoff com jitter
473
+ const baseInterval = Math.min(reconnectInterval * Math.pow(1.5, reconnectAttempts - 1), maxReconnectInterval);
474
+ const jitter = Math.random() * 1000; // Adiciona até 1 segundo de variação
475
+ const finalInterval = baseInterval + jitter;
476
+
477
+ reconnectTimer = setTimeout(() => {
478
+ if (!isConnected) {
479
+ connect();
480
+ }
481
+ }, finalInterval);
482
+ }
483
+
484
+ // Detecta quando a página está sendo fechada para evitar reconexões desnecessárias
485
+ window.addEventListener('beforeunload', function() {
486
+ if (ws && ws.readyState === WebSocket.OPEN) {
487
+ ws.close(1000, 'Page unloading');
488
+ }
489
+ clearTimeout(reconnectTimer);
490
+ });
491
+
492
+ // Detecta quando a aba fica visível novamente para reconectar se necessário
493
+ document.addEventListener('visibilitychange', function() {
494
+ if (!document.hidden && !isConnected) {
495
+ reconnectAttempts = 0; // Reset do contador quando a aba fica ativa
496
+ connect();
497
+ }
498
+ });
499
+
500
+ connect();
501
+ }
502
+ })();
503
+ </script>
504
+ `;
505
+ }
506
+ clearBackendCache(filePath) {
507
+ const absolutePath = path.resolve(filePath);
508
+ delete require.cache[absolutePath];
509
+ // Limpa dependências relacionadas de forma mais eficiente
510
+ const dirname = path.dirname(absolutePath);
511
+ Object.keys(require.cache).forEach(key => {
512
+ if (key.startsWith(dirname)) {
513
+ delete require.cache[key];
514
+ }
515
+ });
516
+ }
517
+ onBackendApiChange(callback) {
518
+ this.backendApiChangeCallback = callback;
519
+ }
520
+ onFrontendChange(callback) {
521
+ this.frontendChangeCallback = callback;
522
+ }
523
+ setHotReloadListener(listener) {
524
+ this.customHotReloadListener = listener;
525
+ console_1.default.info('🔌 Hot reload custom listener registered');
526
+ }
527
+ removeHotReloadListener() {
528
+ this.customHotReloadListener = null;
529
+ }
530
+ onBuildComplete(success) {
531
+ if (this.buildCompleteResolve) {
532
+ this.buildCompleteResolve();
533
+ this.buildCompleteResolve = null;
534
+ }
535
+ this.isBuilding = false;
536
+ // Notifica os clientes que o build terminou
537
+ if (success) {
538
+ this.notifyClients('build-complete', { success: true });
539
+ }
540
+ else {
541
+ this.notifyClients('build-error', { success: false });
542
+ }
543
+ }
544
+ }
545
+ exports.HotReloadManager = HotReloadManager;
@@ -0,0 +1,18 @@
1
+ import { BackendHandler, BackendRouteConfig, HightJSOptions, RequestHandler } from './types';
2
+ import { HightJSRequest, HightJSResponse } from './api/http';
3
+ export { HightJSRequest, HightJSResponse };
4
+ export type { BackendRouteConfig, BackendHandler };
5
+ export { ExpressAdapter } from './adapters/express';
6
+ export { FastifyAdapter } from './adapters/fastify';
7
+ export { FrameworkAdapterFactory } from './adapters/factory';
8
+ export type { GenericRequest, GenericResponse, CookieOptions } from './types/framework';
9
+ export { app } from './helpers';
10
+ export type { WebSocketContext, WebSocketHandler } from './types';
11
+ export type { HightConfig, HightConfigFunction } from './types';
12
+ export default function hweb(options: HightJSOptions): {
13
+ prepare: () => Promise<void>;
14
+ executeInstrumentation: () => void;
15
+ getRequestHandler: () => RequestHandler;
16
+ setupWebSocket: (server: any) => void;
17
+ stop: () => void;
18
+ };