green-screen-react 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VisionBridge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # green-screen-react
2
+
3
+ Multi-protocol legacy terminal React component supporting TN5250, TN3270, VT220, and HP 6530.
4
+
5
+ ## Features
6
+
7
+ - **Multi-protocol** — TN5250 (IBM i), TN3270 (mainframe), VT220, HP 6530
8
+ - Protocol-specific color conventions and screen dimensions
9
+ - Keyboard input: text, function keys (F1-F24), tab, arrow keys
10
+ - Field-aware rendering with input field underlines
11
+ - Typing animation with correction detection
12
+ - Auto-reconnect with exponential backoff
13
+ - Fully themeable via CSS custom properties
14
+ - Zero runtime dependencies (peer deps: React 18+)
15
+ - Optional inline sign-in form (host, credentials, protocol picker)
16
+ - Pluggable adapter interface for any backend
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install green-screen-react
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```tsx
27
+ import { GreenScreenTerminal, RestAdapter } from 'green-screen-react';
28
+ import 'green-screen-react/styles.css';
29
+
30
+ const adapter = new RestAdapter({
31
+ baseUrl: 'https://your-server.com/api/terminal',
32
+ headers: { Authorization: 'Bearer your-token' },
33
+ });
34
+
35
+ function App() {
36
+ return <GreenScreenTerminal adapter={adapter} protocol="tn5250" />;
37
+ }
38
+ ```
39
+
40
+ ### Switching Protocols
41
+
42
+ ```tsx
43
+ <GreenScreenTerminal adapter={adapter} protocol="tn3270" />
44
+ <GreenScreenTerminal adapter={adapter} protocol="vt" />
45
+ <GreenScreenTerminal adapter={adapter} protocol="hp6530" />
46
+ ```
47
+
48
+ ### Inline Sign-In
49
+
50
+ Enable a built-in connection form that collects host, credentials, and protocol:
51
+
52
+ ```tsx
53
+ <GreenScreenTerminal
54
+ adapter={adapter}
55
+ inlineSignIn
56
+ defaultProtocol="tn5250"
57
+ onSignIn={(config) => console.log('Connecting to', config.host)}
58
+ />
59
+ ```
60
+
61
+ The form renders inside the terminal when disconnected. On submit, it calls `adapter.connect(config)` with `{ host, port, protocol, username, password }`.
62
+
63
+ ## Adapter Interface
64
+
65
+ The terminal communicates with your backend through an adapter. Implement the `TerminalAdapter` interface or use the built-in `RestAdapter`.
66
+
67
+ ```typescript
68
+ interface TerminalAdapter {
69
+ getScreen(): Promise<ScreenData | null>;
70
+ getStatus(): Promise<ConnectionStatus>;
71
+ sendText(text: string): Promise<SendResult>;
72
+ sendKey(key: string): Promise<SendResult>;
73
+ connect(config?: ConnectConfig): Promise<SendResult>;
74
+ disconnect(): Promise<SendResult>;
75
+ reconnect(): Promise<SendResult>;
76
+ }
77
+ ```
78
+
79
+ ### RestAdapter
80
+
81
+ For HTTP-based backends with these endpoints (relative to `baseUrl`):
82
+
83
+ | Method | Path | Description |
84
+ |--------|------|-------------|
85
+ | GET | `/screen` | Get current screen content |
86
+ | GET | `/status` | Get connection status |
87
+ | POST | `/send-text` | Send text input `{ text }` |
88
+ | POST | `/send-key` | Send special key `{ key }` |
89
+ | POST | `/connect` | Establish connection |
90
+ | POST | `/disconnect` | Close connection |
91
+ | POST | `/reconnect` | Reconnect |
92
+
93
+ ## Props
94
+
95
+ | Prop | Type | Default | Description |
96
+ |------|------|---------|-------------|
97
+ | `adapter` | `TerminalAdapter` | **required** | Backend communication adapter |
98
+ | `protocol` | `'tn5250' \| 'tn3270' \| 'vt' \| 'hp6530'` | `'tn5250'` | Terminal protocol |
99
+ | `protocolProfile` | `ProtocolProfile` | - | Custom protocol profile (overrides `protocol`) |
100
+ | `screenData` | `ScreenData` | - | Direct screen data injection (bypasses polling) |
101
+ | `connectionStatus` | `ConnectionStatus` | - | Direct status injection |
102
+ | `inlineSignIn` | `boolean` | `false` | Show sign-in form when disconnected |
103
+ | `defaultProtocol` | `TerminalProtocol` | `'tn5250'` | Pre-selected protocol in sign-in form |
104
+ | `onSignIn` | `(config) => void` | - | Sign-in submit callback |
105
+ | `readOnly` | `boolean` | `false` | Disable keyboard input |
106
+ | `pollInterval` | `number` | `2000` | Polling interval in ms (0 to disable) |
107
+ | `autoReconnect` | `boolean` | `true` | Auto-reconnect on disconnect |
108
+ | `maxReconnectAttempts` | `number` | `5` | Max reconnect attempts |
109
+ | `embedded` | `boolean` | `false` | Compact embedded mode |
110
+ | `showHeader` | `boolean` | `true` | Show header bar |
111
+ | `typingAnimation` | `boolean` | `true` | Enable typing animation |
112
+ | `bootLoader` | `ReactNode \| false` | default | Custom boot loader or `false` to disable |
113
+ | `headerRight` | `ReactNode` | - | Content for right side of header |
114
+ | `overlay` | `ReactNode` | - | Custom overlay content |
115
+ | `onNotification` | `(msg, type) => void` | - | Notification callback |
116
+ | `onScreenChange` | `(screen) => void` | - | Screen change callback |
117
+ | `className` | `string` | - | Additional CSS class |
118
+ | `style` | `CSSProperties` | - | Inline styles |
119
+
120
+ ## Theming
121
+
122
+ Override CSS custom properties to customize the look:
123
+
124
+ ```css
125
+ :root {
126
+ --terminal-green: #10b981;
127
+ --terminal-white: #FFFFFF;
128
+ --terminal-blue: #7B93FF;
129
+ --terminal-bg: #000000;
130
+ --terminal-card-bg: #0e1422;
131
+ --terminal-card-border: #1e293b;
132
+ --terminal-header-bg: #090e1a;
133
+ --terminal-font: 'JetBrains Mono', 'Courier New', monospace;
134
+ }
135
+ ```
136
+
137
+ ## Exports
138
+
139
+ ### Hooks
140
+
141
+ - `useTerminalConnection(adapter)` — Connection lifecycle
142
+ - `useTerminalScreen(adapter, interval, enabled)` — Screen polling
143
+ - `useTerminalInput(adapter)` — Send text/key operations
144
+ - `useTypingAnimation(content, enabled, budgetMs)` — Typing animation
145
+
146
+ ### Protocol Profiles
147
+
148
+ - `getProtocolProfile(protocol)` — Get built-in profile by name
149
+ - `tn5250Profile`, `tn3270Profile`, `vtProfile`, `hp6530Profile`
150
+
151
+ ### Utilities
152
+
153
+ - `positionToRowCol(content, position)` — Convert linear position to row/col
154
+ - `isFieldEntry(prev, next)` — Detect field entry vs screen transition
155
+ - `getRowColorClass(rowIndex, content)` — Row color convention
156
+ - `parseHeaderRow(line)` — Parse header row into colored segments
157
+
158
+ ## License
159
+
160
+ MIT
@@ -0,0 +1,400 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+
4
+ /**
5
+ * Supported terminal protocol types.
6
+ */
7
+ type TerminalProtocol = 'tn5250' | 'tn3270' | 'vt' | 'hp6530';
8
+ /**
9
+ * Protocol-specific color/rendering conventions.
10
+ */
11
+ interface ProtocolColorProfile {
12
+ /** CSS class for a row based on its index and content */
13
+ getRowColorClass(rowIndex: number, rowContent: string, totalRows: number): string;
14
+ /** Parse the header row into colored segments, or null for default rendering */
15
+ parseHeaderRow(line: string): {
16
+ text: string;
17
+ colorClass: string;
18
+ }[] | null;
19
+ }
20
+ /**
21
+ * Protocol profile — configures terminal behavior per legacy system type.
22
+ */
23
+ interface ProtocolProfile {
24
+ /** Protocol identifier */
25
+ protocol: TerminalProtocol;
26
+ /** Human-readable name */
27
+ displayName: string;
28
+ /** Default terminal dimensions */
29
+ defaultRows: number;
30
+ defaultCols: number;
31
+ /** Color/rendering profile */
32
+ colors: ProtocolColorProfile;
33
+ /** Header label shown in terminal chrome */
34
+ headerLabel: string;
35
+ /** Boot loader default text */
36
+ bootText: string;
37
+ }
38
+ /**
39
+ * Field definition from the terminal data stream.
40
+ * Describes an input or protected field on the terminal screen.
41
+ */
42
+ interface Field {
43
+ /** 0-based row index */
44
+ row: number;
45
+ /** 0-based column index */
46
+ col: number;
47
+ /** Field length in characters */
48
+ length: number;
49
+ /** Whether the field accepts user input */
50
+ is_input: boolean;
51
+ /** Whether the field is protected (read-only) */
52
+ is_protected: boolean;
53
+ /** Whether the field is displayed with high intensity (bright/white) */
54
+ is_highlighted?: boolean;
55
+ /** Whether the field is displayed in reverse video */
56
+ is_reverse?: boolean;
57
+ }
58
+ /**
59
+ * Screen data returned by the adapter.
60
+ * Represents the current state of the terminal screen.
61
+ */
62
+ interface ScreenData {
63
+ /** Screen content as newline-separated text (e.g. 24 lines of 80 chars) */
64
+ content: string;
65
+ /** 0-based cursor row */
66
+ cursor_row: number;
67
+ /** 0-based cursor column */
68
+ cursor_col: number;
69
+ /** Number of rows (default 24) */
70
+ rows?: number;
71
+ /** Number of columns (default 80) */
72
+ cols?: number;
73
+ /** Field definitions on the current screen */
74
+ fields?: Field[];
75
+ /** Unique identifier for the current screen state */
76
+ screen_signature?: string;
77
+ /** ISO timestamp of when this screen was captured */
78
+ timestamp?: string;
79
+ }
80
+ /**
81
+ * Connection status information.
82
+ */
83
+ interface ConnectionStatus {
84
+ /** Whether a TCP connection is established */
85
+ connected: boolean;
86
+ /** Current connection state */
87
+ status: 'disconnected' | 'connecting' | 'connected' | 'authenticated' | 'error';
88
+ /** Terminal protocol in use */
89
+ protocol?: TerminalProtocol;
90
+ /** Host address */
91
+ host?: string;
92
+ /** Authenticated username */
93
+ username?: string;
94
+ /** Error message if status is 'error' */
95
+ error?: string;
96
+ }
97
+ /**
98
+ * Result from a send operation (text or key).
99
+ */
100
+ interface SendResult {
101
+ /** Whether the operation succeeded */
102
+ success: boolean;
103
+ /** Updated cursor row after the operation */
104
+ cursor_row?: number;
105
+ /** Updated cursor column after the operation */
106
+ cursor_col?: number;
107
+ /** Updated screen content after the operation (for key presses that change screens) */
108
+ content?: string;
109
+ /** Updated screen signature */
110
+ screen_signature?: string;
111
+ /** Error message on failure */
112
+ error?: string;
113
+ }
114
+ /**
115
+ * Adapter interface for terminal communication.
116
+ *
117
+ * Implement this interface to connect the terminal component to your backend.
118
+ * The package ships a `RestAdapter` for HTTP-based backends.
119
+ */
120
+ interface TerminalAdapter {
121
+ /** Fetch the current screen content */
122
+ getScreen(): Promise<ScreenData | null>;
123
+ /** Fetch the current connection status */
124
+ getStatus(): Promise<ConnectionStatus>;
125
+ /** Send text input to the terminal */
126
+ sendText(text: string): Promise<SendResult>;
127
+ /** Send a special key (ENTER, F1-F24, TAB, etc.) */
128
+ sendKey(key: string): Promise<SendResult>;
129
+ /** Establish a connection, optionally with sign-in config */
130
+ connect(config?: ConnectConfig): Promise<SendResult>;
131
+ /** Close the connection */
132
+ disconnect(): Promise<SendResult>;
133
+ /** Reconnect to the host */
134
+ reconnect(): Promise<SendResult>;
135
+ }
136
+ /**
137
+ * Configuration passed from the inline sign-in form to adapter.connect().
138
+ */
139
+ interface ConnectConfig {
140
+ /** Target host address */
141
+ host: string;
142
+ /** Target port (optional, adapter/server can default per protocol) */
143
+ port?: number;
144
+ /** Terminal protocol */
145
+ protocol: TerminalProtocol;
146
+ /** Username for authentication */
147
+ username: string;
148
+ /** Password for authentication */
149
+ password: string;
150
+ }
151
+ /** @deprecated Use `TerminalAdapter` instead */
152
+ type TN5250Adapter = TerminalAdapter;
153
+
154
+ interface GreenScreenTerminalProps {
155
+ /** Adapter for communicating with the terminal backend */
156
+ adapter: TerminalAdapter;
157
+ /** Terminal protocol (determines color conventions, header label, etc.) */
158
+ protocol?: TerminalProtocol;
159
+ /** Custom protocol profile (overrides protocol param) */
160
+ protocolProfile?: ProtocolProfile;
161
+ /** Direct screen data injection (bypasses polling) */
162
+ screenData?: ScreenData | null;
163
+ /** Direct connection status injection */
164
+ connectionStatus?: ConnectionStatus | null;
165
+ /** Whether the terminal is read-only (no keyboard input) */
166
+ readOnly?: boolean;
167
+ /** Polling interval in ms (0 to disable polling; default 2000) */
168
+ pollInterval?: number;
169
+ /** Whether to auto-reconnect on disconnect (default true) */
170
+ autoReconnect?: boolean;
171
+ /** Max auto-reconnect attempts (default 5) */
172
+ maxReconnectAttempts?: number;
173
+ /** Compact embedded mode */
174
+ embedded?: boolean;
175
+ /** Show the header bar (default true) */
176
+ showHeader?: boolean;
177
+ /** Enable typing animation (default true) */
178
+ typingAnimation?: boolean;
179
+ /** Typing animation budget in ms (default 60) */
180
+ typingBudgetMs?: number;
181
+ /** Show inline sign-in form when disconnected (default false) */
182
+ inlineSignIn?: boolean;
183
+ /** Default protocol for the sign-in form dropdown (default 'tn5250') */
184
+ defaultProtocol?: TerminalProtocol;
185
+ /** Callback when sign-in form is submitted */
186
+ onSignIn?: (config: ConnectConfig) => void;
187
+ /** Custom boot loader element, or false to disable */
188
+ bootLoader?: React.ReactNode | false;
189
+ /** Content for the right side of the header */
190
+ headerRight?: React.ReactNode;
191
+ /** Overlay content (e.g. "Extracting..." state) */
192
+ overlay?: React.ReactNode;
193
+ /** Callback for notifications (replaces toast) */
194
+ onNotification?: (message: string, type: 'info' | 'error') => void;
195
+ /** Callback when screen content changes */
196
+ onScreenChange?: (screen: ScreenData) => void;
197
+ /** Callback for minimize action (embedded mode) */
198
+ onMinimize?: () => void;
199
+ /** Additional CSS class name */
200
+ className?: string;
201
+ /** Inline styles */
202
+ style?: React.CSSProperties;
203
+ }
204
+ /** @deprecated Use GreenScreenTerminalProps instead */
205
+ type TN5250TerminalProps = GreenScreenTerminalProps;
206
+ /**
207
+ * GreenScreenTerminal — Multi-protocol legacy terminal emulator component.
208
+ *
209
+ * Renders a terminal screen with:
210
+ * - Green-on-black terminal aesthetic with protocol-specific color conventions
211
+ * - Connection status indicator
212
+ * - Keyboard input support (text, function keys, tab)
213
+ * - Auto-reconnect with exponential backoff
214
+ * - Typing animation for field entries
215
+ * - Focus lock mode for keyboard capture
216
+ *
217
+ * Supports: TN5250 (IBM i), TN3270 (z/OS), VT (OpenVMS/Pick), HP 6530 (NonStop)
218
+ */
219
+ declare function GreenScreenTerminal({ adapter, protocol, protocolProfile: customProfile, screenData: externalScreenData, connectionStatus: externalStatus, readOnly, pollInterval, autoReconnect: autoReconnectEnabled, maxReconnectAttempts: maxAttempts, embedded, showHeader, typingAnimation, typingBudgetMs, inlineSignIn, defaultProtocol: signInDefaultProtocol, onSignIn, bootLoader, headerRight, overlay, onNotification, onScreenChange, onMinimize, className, style, }: GreenScreenTerminalProps): react_jsx_runtime.JSX.Element;
220
+ /** @deprecated Use GreenScreenTerminal instead */
221
+ declare const TN5250Terminal: typeof GreenScreenTerminal;
222
+
223
+ interface TerminalBootLoaderProps {
224
+ /** Text to display during boot animation */
225
+ brandText?: string;
226
+ /** Speed in ms per character */
227
+ charSpeed?: number;
228
+ /** Optional logo element to render alongside the text */
229
+ logo?: React.ReactNode;
230
+ /** Height of the boot loader container */
231
+ height?: number | string;
232
+ }
233
+ /**
234
+ * Animated boot loader for the terminal.
235
+ * Shows a typewriter-style text reveal animation.
236
+ */
237
+ declare function TerminalBootLoader({ brandText, charSpeed, logo, height, }: TerminalBootLoaderProps): react_jsx_runtime.JSX.Element;
238
+
239
+ interface RestAdapterOptions {
240
+ /** Base URL for the terminal API (e.g. "https://myhost.com/api/terminal") */
241
+ baseUrl: string;
242
+ /** Optional headers to include with every request (e.g. Authorization) */
243
+ headers?: Record<string, string>;
244
+ /** Optional function that returns headers (called per-request, useful for dynamic tokens) */
245
+ getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
246
+ }
247
+ /**
248
+ * REST API adapter for terminal communication.
249
+ *
250
+ * Expects a backend that exposes these endpoints relative to `baseUrl`:
251
+ * - GET /screen → ScreenData
252
+ * - GET /status → ConnectionStatus
253
+ * - POST /send-text → SendResult (body: { text })
254
+ * - POST /send-key → SendResult (body: { key })
255
+ * - POST /connect → SendResult
256
+ * - POST /disconnect → SendResult
257
+ * - POST /reconnect → SendResult
258
+ */
259
+ declare class RestAdapter implements TerminalAdapter {
260
+ private baseUrl;
261
+ private staticHeaders;
262
+ private getHeaders?;
263
+ constructor(options: RestAdapterOptions);
264
+ private buildHeaders;
265
+ private request;
266
+ getScreen(): Promise<ScreenData | null>;
267
+ getStatus(): Promise<ConnectionStatus>;
268
+ sendText(text: string): Promise<SendResult>;
269
+ sendKey(key: string): Promise<SendResult>;
270
+ connect(config?: ConnectConfig): Promise<SendResult>;
271
+ disconnect(): Promise<SendResult>;
272
+ reconnect(): Promise<SendResult>;
273
+ }
274
+
275
+ /**
276
+ * Hook for typing animation effect on terminal screen content.
277
+ * Reveals characters progressively when screen content changes.
278
+ * Also provides animated cursor position that follows the typing.
279
+ *
280
+ * Uses a queue-based model: incoming content updates are queued when an
281
+ * animation is in progress, then played sequentially. This prevents
282
+ * blinks (no mid-animation cancellation) and skips (every field entry
283
+ * gets its own animation). Queue depth is capped to avoid falling
284
+ * behind real-time.
285
+ *
286
+ * Screen transitions (large changes) always display SYNCHRONOUSLY.
287
+ */
288
+ declare function useTypingAnimation(content: string | null | undefined, enabled?: boolean, typingBudgetMs?: number): {
289
+ displayedContent: string;
290
+ isAnimating: boolean;
291
+ animatedCursorPos: {
292
+ row: number;
293
+ col: number;
294
+ } | null;
295
+ };
296
+
297
+ /**
298
+ * Hook for terminal connection management via adapter.
299
+ */
300
+ declare function useTerminalConnection(adapter: TerminalAdapter): {
301
+ status: ConnectionStatus | null;
302
+ loading: boolean;
303
+ error: string | null;
304
+ fetchStatus: () => Promise<ConnectionStatus | null>;
305
+ connect: (config?: ConnectConfig) => Promise<{
306
+ success: boolean;
307
+ cursor_row?: number;
308
+ cursor_col?: number;
309
+ content?: string;
310
+ screen_signature?: string;
311
+ error?: string;
312
+ }>;
313
+ disconnect: () => Promise<{
314
+ success: boolean;
315
+ error?: undefined;
316
+ } | {
317
+ success: boolean;
318
+ error: string;
319
+ }>;
320
+ reconnect: () => Promise<{
321
+ success: boolean;
322
+ cursor_row?: number;
323
+ cursor_col?: number;
324
+ content?: string;
325
+ screen_signature?: string;
326
+ error?: string;
327
+ }>;
328
+ };
329
+ /**
330
+ * Hook for terminal screen content with polling.
331
+ */
332
+ declare function useTerminalScreen(adapter: TerminalAdapter, interval?: number, enabled?: boolean): {
333
+ data: ScreenData | null;
334
+ error: unknown;
335
+ };
336
+ /**
337
+ * Hook for terminal operations (sendText, sendKey).
338
+ */
339
+ declare function useTerminalInput(adapter: TerminalAdapter): {
340
+ loading: boolean;
341
+ error: string | null;
342
+ sendText: (text: string) => Promise<SendResult>;
343
+ sendKey: (key: string) => Promise<SendResult>;
344
+ };
345
+ /** @deprecated Use `useTerminalConnection` instead */
346
+ declare const useTN5250Connection: typeof useTerminalConnection;
347
+ /** @deprecated Use `useTerminalScreen` instead */
348
+ declare const useTN5250Screen: typeof useTerminalScreen;
349
+ /** @deprecated Use `useTerminalInput` instead */
350
+ declare const useTN5250Terminal: typeof useTerminalInput;
351
+
352
+ /**
353
+ * Get a protocol profile by type. Defaults to TN5250 for backward compatibility.
354
+ */
355
+ declare function getProtocolProfile(protocol?: TerminalProtocol): ProtocolProfile;
356
+
357
+ declare const tn5250Profile: ProtocolProfile;
358
+
359
+ declare const tn3270Profile: ProtocolProfile;
360
+
361
+ declare const vtProfile: ProtocolProfile;
362
+
363
+ declare const hp6530Profile: ProtocolProfile;
364
+
365
+ /**
366
+ * Convert a linear position in screen content to row/col coordinates.
367
+ * Content is lines of characters separated by newlines.
368
+ */
369
+ declare function positionToRowCol(content: string, position: number): {
370
+ row: number;
371
+ col: number;
372
+ };
373
+ /**
374
+ * Detect if a content change is a field entry (small, localized change)
375
+ * vs a screen transition (large, distributed change).
376
+ *
377
+ * Field entries: < 50 changed characters within a span of < 100 positions.
378
+ * Screen transitions: everything else.
379
+ */
380
+ declare function isFieldEntry(previousContent: string | null | undefined, content: string | null | undefined): boolean;
381
+
382
+ /**
383
+ * Get the appropriate CSS class name for a row.
384
+ * Delegates to the TN5250 protocol profile for backward compatibility.
385
+ *
386
+ * For protocol-aware rendering, use `getProtocolProfile(protocol).colors.getRowColorClass()`.
387
+ */
388
+ declare function getRowColorClass(rowIndex: number, rowContent: string): string;
389
+ /**
390
+ * Parse the header row into colored segments.
391
+ * Delegates to the TN5250 protocol profile for backward compatibility.
392
+ *
393
+ * For protocol-aware rendering, use `getProtocolProfile(protocol).colors.parseHeaderRow()`.
394
+ */
395
+ declare function parseHeaderRow(line: string): {
396
+ text: string;
397
+ colorClass: string;
398
+ }[] | null;
399
+
400
+ export { type ConnectConfig, type ConnectionStatus, type Field, GreenScreenTerminal, type GreenScreenTerminalProps, type ProtocolColorProfile, type ProtocolProfile, RestAdapter, type RestAdapterOptions, type ScreenData, type SendResult, type TN5250Adapter, TN5250Terminal, type TN5250TerminalProps, type TerminalAdapter, TerminalBootLoader, type TerminalBootLoaderProps, type TerminalProtocol, getProtocolProfile, getRowColorClass, hp6530Profile, isFieldEntry, parseHeaderRow, positionToRowCol, tn3270Profile, tn5250Profile, useTN5250Connection, useTN5250Screen, useTN5250Terminal, useTerminalConnection, useTerminalInput, useTerminalScreen, useTypingAnimation, vtProfile };