Skip to content

Commit 167765f

Browse files
committed
Improve IAttributeData jsdoc
Fixes #2603
1 parent 880b726 commit 167765f

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

src/common/Types.d.ts

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IDeleteEvent, IInsertEvent } from 'common/CircularList';
99
import { IParams } from 'common/parser/Types';
1010
import { ICoreMouseService, ICoreService, IOptionsService, IUnicodeService } from 'common/services/Services';
1111
import { IBufferSet } from 'common/buffer/Types';
12-
import { UnderlineStyle } from 'common/buffer/Constants';
12+
import { Attributes, UnderlineStyle } from 'common/buffer/Constants';
1313

1414
export interface ICoreTerminal {
1515
coreMouseService: ICoreMouseService;
@@ -133,10 +133,24 @@ export interface IOscLinkData {
133133
uri: string;
134134
}
135135

136-
/** Attribute data */
136+
/**
137+
* An object that represents all attributes of a cell.
138+
*/
137139
export interface IAttributeData {
140+
/**
141+
* "fg" is a 32-bit unsigned integer that stores the foreground color of the cell in the 24 least
142+
* significant bits and additional flags in the remaining 8 bits.
143+
*/
138144
fg: number;
145+
/**
146+
* "bg" is a 32-bit unsigned integer that stores the background color of the cell in the 24 least
147+
* significant bits and additional flags in the remaining 8 bits.
148+
*/
139149
bg: number;
150+
/**
151+
* "extended", aka "ext", stores extended attributes beyond those available in fg and bg. This
152+
* data is optional on a cell and encodes less common data.
153+
*/
140154
extended: IExtendedAttrs;
141155

142156
clone(): IAttributeData;
@@ -152,8 +166,17 @@ export interface IAttributeData {
152166
isStrikethrough(): number;
153167
isProtected(): number;
154168

155-
// color modes
169+
/**
170+
* The color mode of the foreground color which determines how to decode {@link getFgColor},
171+
* possible values include {@link Attributes.CM_DEFAULT}, {@link Attributes.CM_P16},
172+
* {@link Attributes.CM_P256} and {@link Attributes.CM_RGB}.
173+
*/
156174
getFgColorMode(): number;
175+
/**
176+
* The color mode of the background color which determines how to decode {@link getBgColor},
177+
* possible values include {@link Attributes.CM_DEFAULT}, {@link Attributes.CM_P16},
178+
* {@link Attributes.CM_P256} and {@link Attributes.CM_RGB}.
179+
*/
157180
getBgColorMode(): number;
158181
isFgRGB(): boolean;
159182
isBgRGB(): boolean;
@@ -163,8 +186,15 @@ export interface IAttributeData {
163186
isBgDefault(): boolean;
164187
isAttributeDefault(): boolean;
165188

166-
// colors
189+
/**
190+
* Gets an integer representation of the foreground color, how to decode the color depends on the
191+
* color mode {@link getFgColorMode}.
192+
*/
167193
getFgColor(): number;
194+
/**
195+
* Gets an integer representation of the background color, how to decode the color depends on the
196+
* color mode {@link getBgColorMode}.
197+
*/
168198
getBgColor(): number;
169199

170200
// extended attrs

0 commit comments

Comments
 (0)