vimd 0.5.7 → 0.5.9

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.
@@ -0,0 +1,265 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ja">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta name="generator" content="vimd">
7
+ <title>{{title}} - vimd</title>
8
+ <style>
9
+ {{theme_css}}
10
+ </style>
11
+ <style>
12
+ /* Single file mode styles */
13
+ * {
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ html {
18
+ margin: 0;
19
+ padding: 0;
20
+ width: 100%;
21
+ height: 100%;
22
+ }
23
+
24
+ /* Reset theme's body constraints for full-width container */
25
+ body {
26
+ margin: 0 !important;
27
+ padding: 0 !important;
28
+ max-width: none !important;
29
+ width: 100% !important;
30
+ height: 100%;
31
+ overflow: hidden;
32
+ }
33
+
34
+ .vimd-single-container {
35
+ width: 100%;
36
+ height: 100vh;
37
+ overflow-y: auto;
38
+ overflow-x: hidden;
39
+ }
40
+
41
+ .vimd-single-content {
42
+ padding: 32px;
43
+ max-width: 720px;
44
+ margin: 0 auto;
45
+ }
46
+
47
+ .vimd-single-content pre,
48
+ .vimd-single-content table {
49
+ overflow-x: auto;
50
+ }
51
+
52
+ /* Connection status indicator */
53
+ .vimd-connection-status {
54
+ position: fixed;
55
+ bottom: 16px;
56
+ right: 16px;
57
+ padding: 8px 12px;
58
+ background: rgba(0, 0, 0, 0.7);
59
+ color: #fff;
60
+ font-size: 12px;
61
+ border-radius: 4px;
62
+ opacity: 0;
63
+ transition: opacity 0.3s;
64
+ pointer-events: none;
65
+ z-index: 1000;
66
+ }
67
+
68
+ .vimd-connection-status.visible {
69
+ opacity: 1;
70
+ }
71
+
72
+ .vimd-connection-status.error {
73
+ background: rgba(211, 47, 47, 0.9);
74
+ }
75
+ </style>
76
+ {{#if math_enabled}}
77
+ <style>
78
+ /* Block math centering */
79
+ .math-block {
80
+ display: block;
81
+ text-align: center;
82
+ margin: 1em 0;
83
+ }
84
+ mjx-container[display="true"] {
85
+ display: block !important;
86
+ text-align: center !important;
87
+ margin: 1em 0 !important;
88
+ }
89
+ </style>
90
+ <script>
91
+ MathJax = {
92
+ loader: {load: ['[tex]/bussproofs', '[tex]/ams', '[tex]/physics', '[tex]/boldsymbol']},
93
+ tex: {
94
+ packages: {'[+]': ['bussproofs', 'ams', 'physics', 'boldsymbol']},
95
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
96
+ displayMath: [['$$', '$$'], ['\\[', '\\]']],
97
+ tags: 'ams',
98
+ macros: {
99
+ bm: ['\\boldsymbol{#1}', 1]
100
+ }
101
+ }
102
+ };
103
+ </script>
104
+ <script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
105
+ {{/if}}
106
+ </head>
107
+ <body>
108
+ <div class="vimd-single-container" id="container">
109
+ <article class="vimd-single-content markdown-body" id="content">
110
+ <!-- Content will be loaded via WebSocket -->
111
+ </article>
112
+ </div>
113
+
114
+ <div class="vimd-connection-status" id="status"></div>
115
+
116
+ <script>
117
+ (function() {
118
+ 'use strict';
119
+
120
+ var container = document.getElementById('container');
121
+ var content = document.getElementById('content');
122
+ var status = document.getElementById('status');
123
+ var ws = null;
124
+ var reconnectAttempts = 0;
125
+ var maxReconnectAttempts = 10;
126
+ var reconnectDelay = 1000;
127
+
128
+ /**
129
+ * Show connection status message
130
+ */
131
+ function showStatus(message, isError) {
132
+ status.textContent = message;
133
+ status.classList.toggle('error', isError);
134
+ status.classList.add('visible');
135
+
136
+ // Hide after 3 seconds for non-error messages
137
+ if (!isError) {
138
+ setTimeout(function() {
139
+ status.classList.remove('visible');
140
+ }, 3000);
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Hide connection status
146
+ */
147
+ function hideStatus() {
148
+ status.classList.remove('visible');
149
+ }
150
+
151
+ /**
152
+ * Connect to WebSocket server
153
+ */
154
+ function connect() {
155
+ var protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
156
+ ws = new WebSocket(protocol + '//' + location.host);
157
+
158
+ ws.onopen = function() {
159
+ console.log('[vimd] WebSocket connected');
160
+ reconnectAttempts = 0;
161
+ hideStatus();
162
+ };
163
+
164
+ ws.onmessage = function(event) {
165
+ try {
166
+ var msg = JSON.parse(event.data);
167
+ handleMessage(msg);
168
+ } catch (e) {
169
+ console.error('[vimd] Failed to parse message:', e);
170
+ }
171
+ };
172
+
173
+ ws.onclose = function() {
174
+ console.log('[vimd] WebSocket disconnected');
175
+
176
+ if (reconnectAttempts < maxReconnectAttempts) {
177
+ reconnectAttempts++;
178
+ showStatus('Reconnecting... (' + reconnectAttempts + '/' + maxReconnectAttempts + ')', false);
179
+ setTimeout(connect, reconnectDelay);
180
+ } else {
181
+ showStatus('Connection lost. Please refresh the page.', true);
182
+ }
183
+ };
184
+
185
+ ws.onerror = function(error) {
186
+ console.error('[vimd] WebSocket error:', error);
187
+ };
188
+ }
189
+
190
+ /**
191
+ * Handle incoming WebSocket message
192
+ */
193
+ function handleMessage(msg) {
194
+ switch (msg.type) {
195
+ case 'content':
196
+ updateContent(msg.data.html);
197
+ if (msg.data.title) {
198
+ document.title = msg.data.title + ' - vimd';
199
+ }
200
+ break;
201
+
202
+ case 'error':
203
+ showError(msg.data.message);
204
+ break;
205
+
206
+ default:
207
+ console.warn('[vimd] Unknown message type:', msg.type);
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Update content with scroll position preservation
213
+ */
214
+ function updateContent(html) {
215
+ // Save scroll position
216
+ var scrollTop = container.scrollTop;
217
+
218
+ // Update content
219
+ content.innerHTML = html;
220
+
221
+ // Re-render MathJax if available
222
+ if (window.MathJax && window.MathJax.typeset) {
223
+ // MathJax.typeset returns a promise in v3
224
+ var promise = window.MathJax.typeset([content]);
225
+
226
+ // Restore scroll position after MathJax completes
227
+ if (promise && promise.then) {
228
+ promise.then(function() {
229
+ container.scrollTop = scrollTop;
230
+ }).catch(function() {
231
+ // Restore scroll even if MathJax fails
232
+ container.scrollTop = scrollTop;
233
+ });
234
+ } else {
235
+ // Fallback: restore scroll immediately
236
+ container.scrollTop = scrollTop;
237
+ }
238
+ } else {
239
+ // No MathJax: restore scroll immediately
240
+ container.scrollTop = scrollTop;
241
+ }
242
+ }
243
+
244
+ /**
245
+ * Show error message
246
+ */
247
+ function showError(message) {
248
+ content.innerHTML = '<div class="vimd-error"><h2>Error</h2><p>' + escapeHtml(message) + '</p></div>';
249
+ }
250
+
251
+ /**
252
+ * Escape HTML special characters
253
+ */
254
+ function escapeHtml(text) {
255
+ var div = document.createElement('div');
256
+ div.textContent = text;
257
+ return div.innerHTML;
258
+ }
259
+
260
+ // Initialize connection
261
+ connect();
262
+ })();
263
+ </script>
264
+ </body>
265
+ </html>
@@ -1 +1 @@
1
- {"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../src/utils/session-manager.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAkC;IACtE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAGnC;IAEF;;OAEG;WACU,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC;IAWlD;;OAEG;WACU,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhE;;OAEG;WACU,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAKlE;;OAEG;WACU,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7D;;OAEG;WACU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvD;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAS3C;;OAEG;WACU,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgBvD;;OAEG;WACU,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IA0BjD;;OAEG;WACU,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAmCvE;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYtD;;OAEG;WACU,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAcnE"}
1
+ {"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../src/utils/session-manager.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAkC;IACtE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAGnC;IAEF;;OAEG;WACU,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC;IAWlD;;OAEG;WACU,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhE;;OAEG;WACU,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAKlE;;OAEG;WACU,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7D;;OAEG;WACU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvD;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAS3C;;OAEG;WACU,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgBvD;;OAEG;WACU,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IA2BjD;;OAEG;WACU,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAmCvE;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYtD;;OAEG;WACU,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAcnE"}
@@ -87,8 +87,9 @@ export class SessionManager {
87
87
  for (const [port, session] of Object.entries(sessions)) {
88
88
  if (!this.isProcessAlive(session.pid)) {
89
89
  // Process is dead, clean up HTML if exists
90
+ // Skip if htmlPath is empty (single file / folder mode)
90
91
  try {
91
- if (await fs.pathExists(session.htmlPath)) {
92
+ if (session.htmlPath && await fs.pathExists(session.htmlPath)) {
92
93
  await fs.remove(session.htmlPath);
93
94
  }
94
95
  }
@@ -122,9 +123,9 @@ export class SessionManager {
122
123
  if (this.isProcessAlive(session.pid)) {
123
124
  result.killed = await this.killProcess(session.pid);
124
125
  }
125
- // Remove HTML file
126
+ // Remove HTML file (skip if htmlPath is empty - single file / folder mode)
126
127
  try {
127
- if (await fs.pathExists(session.htmlPath)) {
128
+ if (session.htmlPath && await fs.pathExists(session.htmlPath)) {
128
129
  await fs.remove(session.htmlPath);
129
130
  result.htmlRemoved = true;
130
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vimd",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "Real-time Markdown preview tool with pandoc (view markdown)",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -0,0 +1,265 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ja">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta name="generator" content="vimd">
7
+ <title>{{title}} - vimd</title>
8
+ <style>
9
+ {{theme_css}}
10
+ </style>
11
+ <style>
12
+ /* Single file mode styles */
13
+ * {
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ html {
18
+ margin: 0;
19
+ padding: 0;
20
+ width: 100%;
21
+ height: 100%;
22
+ }
23
+
24
+ /* Reset theme's body constraints for full-width container */
25
+ body {
26
+ margin: 0 !important;
27
+ padding: 0 !important;
28
+ max-width: none !important;
29
+ width: 100% !important;
30
+ height: 100%;
31
+ overflow: hidden;
32
+ }
33
+
34
+ .vimd-single-container {
35
+ width: 100%;
36
+ height: 100vh;
37
+ overflow-y: auto;
38
+ overflow-x: hidden;
39
+ }
40
+
41
+ .vimd-single-content {
42
+ padding: 32px;
43
+ max-width: 720px;
44
+ margin: 0 auto;
45
+ }
46
+
47
+ .vimd-single-content pre,
48
+ .vimd-single-content table {
49
+ overflow-x: auto;
50
+ }
51
+
52
+ /* Connection status indicator */
53
+ .vimd-connection-status {
54
+ position: fixed;
55
+ bottom: 16px;
56
+ right: 16px;
57
+ padding: 8px 12px;
58
+ background: rgba(0, 0, 0, 0.7);
59
+ color: #fff;
60
+ font-size: 12px;
61
+ border-radius: 4px;
62
+ opacity: 0;
63
+ transition: opacity 0.3s;
64
+ pointer-events: none;
65
+ z-index: 1000;
66
+ }
67
+
68
+ .vimd-connection-status.visible {
69
+ opacity: 1;
70
+ }
71
+
72
+ .vimd-connection-status.error {
73
+ background: rgba(211, 47, 47, 0.9);
74
+ }
75
+ </style>
76
+ {{#if math_enabled}}
77
+ <style>
78
+ /* Block math centering */
79
+ .math-block {
80
+ display: block;
81
+ text-align: center;
82
+ margin: 1em 0;
83
+ }
84
+ mjx-container[display="true"] {
85
+ display: block !important;
86
+ text-align: center !important;
87
+ margin: 1em 0 !important;
88
+ }
89
+ </style>
90
+ <script>
91
+ MathJax = {
92
+ loader: {load: ['[tex]/bussproofs', '[tex]/ams', '[tex]/physics', '[tex]/boldsymbol']},
93
+ tex: {
94
+ packages: {'[+]': ['bussproofs', 'ams', 'physics', 'boldsymbol']},
95
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
96
+ displayMath: [['$$', '$$'], ['\\[', '\\]']],
97
+ tags: 'ams',
98
+ macros: {
99
+ bm: ['\\boldsymbol{#1}', 1]
100
+ }
101
+ }
102
+ };
103
+ </script>
104
+ <script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
105
+ {{/if}}
106
+ </head>
107
+ <body>
108
+ <div class="vimd-single-container" id="container">
109
+ <article class="vimd-single-content markdown-body" id="content">
110
+ <!-- Content will be loaded via WebSocket -->
111
+ </article>
112
+ </div>
113
+
114
+ <div class="vimd-connection-status" id="status"></div>
115
+
116
+ <script>
117
+ (function() {
118
+ 'use strict';
119
+
120
+ var container = document.getElementById('container');
121
+ var content = document.getElementById('content');
122
+ var status = document.getElementById('status');
123
+ var ws = null;
124
+ var reconnectAttempts = 0;
125
+ var maxReconnectAttempts = 10;
126
+ var reconnectDelay = 1000;
127
+
128
+ /**
129
+ * Show connection status message
130
+ */
131
+ function showStatus(message, isError) {
132
+ status.textContent = message;
133
+ status.classList.toggle('error', isError);
134
+ status.classList.add('visible');
135
+
136
+ // Hide after 3 seconds for non-error messages
137
+ if (!isError) {
138
+ setTimeout(function() {
139
+ status.classList.remove('visible');
140
+ }, 3000);
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Hide connection status
146
+ */
147
+ function hideStatus() {
148
+ status.classList.remove('visible');
149
+ }
150
+
151
+ /**
152
+ * Connect to WebSocket server
153
+ */
154
+ function connect() {
155
+ var protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
156
+ ws = new WebSocket(protocol + '//' + location.host);
157
+
158
+ ws.onopen = function() {
159
+ console.log('[vimd] WebSocket connected');
160
+ reconnectAttempts = 0;
161
+ hideStatus();
162
+ };
163
+
164
+ ws.onmessage = function(event) {
165
+ try {
166
+ var msg = JSON.parse(event.data);
167
+ handleMessage(msg);
168
+ } catch (e) {
169
+ console.error('[vimd] Failed to parse message:', e);
170
+ }
171
+ };
172
+
173
+ ws.onclose = function() {
174
+ console.log('[vimd] WebSocket disconnected');
175
+
176
+ if (reconnectAttempts < maxReconnectAttempts) {
177
+ reconnectAttempts++;
178
+ showStatus('Reconnecting... (' + reconnectAttempts + '/' + maxReconnectAttempts + ')', false);
179
+ setTimeout(connect, reconnectDelay);
180
+ } else {
181
+ showStatus('Connection lost. Please refresh the page.', true);
182
+ }
183
+ };
184
+
185
+ ws.onerror = function(error) {
186
+ console.error('[vimd] WebSocket error:', error);
187
+ };
188
+ }
189
+
190
+ /**
191
+ * Handle incoming WebSocket message
192
+ */
193
+ function handleMessage(msg) {
194
+ switch (msg.type) {
195
+ case 'content':
196
+ updateContent(msg.data.html);
197
+ if (msg.data.title) {
198
+ document.title = msg.data.title + ' - vimd';
199
+ }
200
+ break;
201
+
202
+ case 'error':
203
+ showError(msg.data.message);
204
+ break;
205
+
206
+ default:
207
+ console.warn('[vimd] Unknown message type:', msg.type);
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Update content with scroll position preservation
213
+ */
214
+ function updateContent(html) {
215
+ // Save scroll position
216
+ var scrollTop = container.scrollTop;
217
+
218
+ // Update content
219
+ content.innerHTML = html;
220
+
221
+ // Re-render MathJax if available
222
+ if (window.MathJax && window.MathJax.typeset) {
223
+ // MathJax.typeset returns a promise in v3
224
+ var promise = window.MathJax.typeset([content]);
225
+
226
+ // Restore scroll position after MathJax completes
227
+ if (promise && promise.then) {
228
+ promise.then(function() {
229
+ container.scrollTop = scrollTop;
230
+ }).catch(function() {
231
+ // Restore scroll even if MathJax fails
232
+ container.scrollTop = scrollTop;
233
+ });
234
+ } else {
235
+ // Fallback: restore scroll immediately
236
+ container.scrollTop = scrollTop;
237
+ }
238
+ } else {
239
+ // No MathJax: restore scroll immediately
240
+ container.scrollTop = scrollTop;
241
+ }
242
+ }
243
+
244
+ /**
245
+ * Show error message
246
+ */
247
+ function showError(message) {
248
+ content.innerHTML = '<div class="vimd-error"><h2>Error</h2><p>' + escapeHtml(message) + '</p></div>';
249
+ }
250
+
251
+ /**
252
+ * Escape HTML special characters
253
+ */
254
+ function escapeHtml(text) {
255
+ var div = document.createElement('div');
256
+ div.textContent = text;
257
+ return div.innerHTML;
258
+ }
259
+
260
+ // Initialize connection
261
+ connect();
262
+ })();
263
+ </script>
264
+ </body>
265
+ </html>
@@ -1,52 +0,0 @@
1
- /**
2
- * WebSocketServer options
3
- * Note: 'open' property is not included (handled by dev.ts)
4
- */
5
- export interface WebSocketServerOptions {
6
- port: number;
7
- root: string;
8
- host?: string;
9
- }
10
- /**
11
- * Result of server start operation
12
- * Same interface as previous LiveServer for compatibility
13
- */
14
- export interface ServerStartResult {
15
- actualPort: number;
16
- requestedPort: number;
17
- portChanged: boolean;
18
- }
19
- /**
20
- * WebSocket server for live reload functionality
21
- * Replaces live-server with direct WebSocket control
22
- */
23
- export declare class WebSocketServer {
24
- private httpServer;
25
- private wsServer;
26
- private clients;
27
- private options;
28
- private _port;
29
- constructor(options: WebSocketServerOptions);
30
- /**
31
- * Get the actual port the server is running on
32
- */
33
- get port(): number;
34
- /**
35
- * Start the HTTP and WebSocket servers
36
- */
37
- start(): Promise<ServerStartResult>;
38
- /**
39
- * Stop the server
40
- * Uses force termination to ensure immediate shutdown
41
- */
42
- stop(): Promise<void>;
43
- /**
44
- * Broadcast a message to all connected clients
45
- */
46
- broadcast(type: string, data?: unknown): void;
47
- /**
48
- * Inject reload script into HTML content
49
- */
50
- private injectReloadScript;
51
- }
52
- //# sourceMappingURL=websocket-server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"websocket-server.d.ts","sourceRoot":"","sources":["../../src/core/websocket-server.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACtB;AA0CD;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,KAAK,CAAS;gBAEV,OAAO,EAAE,sBAAsB;IAQ3C;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;IA4GzC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAiC3B;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAU7C;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAc3B"}