Skip to content

Commit 5efff43

Browse files
committed
Convert JSDoc to line comments
1 parent ee85a1d commit 5efff43

File tree

3 files changed

+36
-62
lines changed

3 files changed

+36
-62
lines changed

addons/addon-image/src/kitty/KittyGraphicsHandler.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ const MAX_CONTROL_DATA_SIZE = 512;
3535
// Semicolon codepoint
3636
const SEMICOLON = 0x3B;
3737

38-
/**
39-
* Kitty graphics protocol handler with streaming base64 decoding.
40-
*/
38+
// Kitty graphics protocol handler with streaming base64 decoding.
4139
export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDisposable {
4240
private _aborted = false;
4341
private _decodeError = false;
@@ -48,28 +46,26 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos
4846

4947
// Streaming related states
5048

51-
/** True while receiving control data (before semicolon). */
49+
// True while receiving control data (before semicolon).
5250
private _inControlData = true;
5351

54-
/** Buffer for control data. */
52+
// Buffer for control data.
5553
private _controlData = new Uint32Array(MAX_CONTROL_DATA_SIZE);
5654
private _controlLength = 0;
5755

58-
/** Pre-calculated encoded size limit */
56+
// Pre-calculated encoded size limit
5957
private _encodedSizeLimit = 0;
6058
private _totalEncodedSize = 0;
6159

62-
/** Parsed command. These are the control data before semicolon. */
60+
// Parsed command. These are the control data before semicolon.
6361
private _parsedCommand: IKittyCommand | null = null;
6462

6563
// Storage related states
6664

6765
private _pendingTransmissions: Map<number, IPendingTransmission> = new Map();
68-
/**
69-
* Tracks the pending key of the most recently started chunked upload.
70-
* Per spec, subsequent chunks only need m= (and optionally q=), without i=.
71-
* When a chunk arrives with no i=, this key is used to find the pending upload.
72-
*/
66+
// Tracks the pending key of the most recently started chunked upload.
67+
// Per spec, subsequent chunks only need m= (and optionally q=), without i=.
68+
// When a chunk arrives with no i=, this key is used to find the pending upload.
7369
private _lastPendingKey: number | undefined;
7470

7571
constructor(
@@ -163,9 +159,7 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos
163159
}
164160
}
165161

166-
/**
167-
* Stream payload bytes into the base64 decoder.
168-
*/
162+
// Stream payload bytes into the base64 decoder.
169163
private _streamPayload(data: Uint32Array, start: number, end: number): void {
170164
if (this._aborted) return;
171165

@@ -601,9 +595,7 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos
601595
}
602596
}
603597

604-
/**
605-
* Create ImageBitmap from already-decoded image data.
606-
*/
598+
// Create ImageBitmap from already-decoded image data.
607599
private async _createBitmap(image: IKittyImageData): Promise<ImageBitmap> {
608600
let bytes: Uint8Array = new Uint8Array(await image.data.arrayBuffer());
609601

addons/addon-image/src/kitty/KittyGraphicsTypes.ts

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
import type Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';
99

10-
/**
11-
* Kitty graphics protocol action types.
12-
* See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'a'.
13-
*/
10+
// Kitty graphics protocol action types.
11+
// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'a'.
1412
export const enum KittyAction {
1513
TRANSMIT = 't',
1614
TRANSMIT_DISPLAY = 'T',
@@ -19,29 +17,23 @@ export const enum KittyAction {
1917
DELETE = 'd'
2018
}
2119

22-
/**
23-
* Kitty graphics protocol format types.
24-
* See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference
25-
*/
20+
// Kitty graphics protocol format types.
21+
// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference
2622
export const enum KittyFormat {
2723
RGB = 24,
2824
RGBA = 32,
2925
PNG = 100
3026
}
3127

32-
/**
33-
* Kitty graphics protocol compression types.
34-
* See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'o'.
35-
*/
28+
// Kitty graphics protocol compression types.
29+
// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'o'.
3630
export const enum KittyCompression {
3731
NONE = '',
3832
ZLIB = 'z'
3933
}
4034

41-
/**
42-
* Kitty graphics protocol control data keys.
43-
* See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference
44-
*/
35+
// Kitty graphics protocol control data keys.
36+
// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference
4537
export const enum KittyKey {
4638
// Action to perform (t=transmit, T=transmit+display, q=query, p=placement, d=delete)
4739
ACTION = 'a',
@@ -86,9 +78,7 @@ export const BYTES_PER_PIXEL_RGB = 3;
8678
export const BYTES_PER_PIXEL_RGBA = 4;
8779
export const ALPHA_OPAQUE = 255;
8880

89-
/**
90-
* Parsed Kitty graphics command.
91-
*/
81+
// Parsed Kitty graphics command.
9282
export interface IKittyCommand {
9383
action?: string;
9484
format?: number;
@@ -111,37 +101,31 @@ export interface IKittyCommand {
111101
payload?: string;
112102
}
113103

114-
/**
115-
* Pending chunked transmission state.
116-
* Stores metadata from the first chunk while accumulating decoded payload data.
117-
*/
104+
// Pending chunked transmission state.
105+
// Stores metadata from the first chunk while accumulating decoded payload data.
118106
export interface IPendingTransmission {
119-
/** The parsed command from the first chunk (contains action, format, dimensions, etc.) */
107+
// The parsed command from the first chunk (contains action, format, dimensions, etc.)
120108
cmd: IKittyCommand;
121-
/** Decoder used across chunked payloads */
109+
// Decoder used across chunked payloads
122110
decoder: Base64Decoder;
123-
/** Total encoded (base64) bytes received across all chunks - for size limit enforcement */
111+
// Total encoded (base64) bytes received across all chunks - for size limit enforcement
124112
totalEncodedSize: number;
125-
/** Whether any chunk has failed to decode */
113+
// Whether any chunk has failed to decode
126114
decodeError: boolean;
127115
}
128116

129-
/**
130-
* Stored Kitty image data.
131-
*/
117+
// Stored Kitty image data.
132118
export interface IKittyImageData {
133119
id: number;
134-
/** Decoded image data stored as Blob (off JS heap) to avoid 2GB heap limit */
120+
// Decoded image data stored as Blob (off JS heap) to avoid 2GB heap limit
135121
data: Blob;
136122
width: number;
137123
height: number;
138124
format: 24 | 32 | 100;
139125
compression?: string;
140126
}
141127

142-
/**
143-
* Parses Kitty graphics control data into a command object.
144-
*/
128+
// Parses Kitty graphics control data into a command object.
145129
export function parseKittyCommand(data: string): IKittyCommand {
146130
const cmd: IKittyCommand = {};
147131
const parts = data.split(',');

addons/addon-image/src/kitty/KittyImageStorage.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ import { ImageStorage } from '../ImageStorage';
88
import { ImageLayer } from '../Types';
99
import { IKittyImageData } from './KittyGraphicsTypes';
1010

11-
/**
12-
* Kitty-specific image storage controller.
13-
*
14-
* Wraps shared ImageStorage with kitty protocol semantics:
15-
* - tracks transmitted image payloads by kitty image id
16-
* - tracks kitty image id -> shared ImageStorage id mapping for displayed images
17-
* - mirrors shared-storage evictions into kitty maps
18-
* - applies protocol-level undisplayed-image eviction policy
19-
*/
11+
// Kitty-specific image storage controller.
12+
//
13+
// Wraps shared ImageStorage with kitty protocol semantics:
14+
// - tracks transmitted image payloads by kitty image id
15+
// - tracks kitty image id -> shared ImageStorage id mapping for displayed images
16+
// - mirrors shared-storage evictions into kitty maps
17+
// - applies protocol-level undisplayed-image eviction policy
2018
export class KittyImageStorage implements IDisposable {
2119
private static readonly _maxStoredImages = 256;
2220

@@ -128,4 +126,4 @@ export class KittyImageStorage implements IDisposable {
128126
}
129127
}
130128
}
131-
}
129+
}

0 commit comments

Comments
 (0)