diff --git a/src/browser/services/DecorationService.ts b/src/browser/services/DecorationService.ts index 8cbaaa32..cd32743b 100644 --- a/src/browser/services/DecorationService.ts +++ b/src/browser/services/DecorationService.ts @@ -11,7 +11,7 @@ import { IDecorationOptions, IDecoration, IMarker } from 'xterm'; export class DecorationService extends Disposable implements IDecorationService { - private _decorations: Decoration[] = []; + private readonly _decorations: Decoration[] = []; private _screenElement: HTMLElement | undefined; constructor( @@ -61,11 +61,10 @@ export class DecorationService extends Disposable implements IDecorationService } class Decoration extends Disposable implements IDecoration { - public readonly id: number = Decoration._nextId++; - private static _nextId: number = 1; - - private _marker: IMarker; + private static _nextId = 1; + private readonly _marker: IMarker; private _element: HTMLElement | undefined; + private readonly _id: number = Decoration._nextId++; public isDisposed: boolean = false; public get element(): HTMLElement | undefined { return this._element; } diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 0a307f31..17bf8d50 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -942,7 +942,7 @@ declare module 'xterm' { * @param decorationOptions, which takes a marker and an optional anchor, * width, height, and x offset from the anchor. Returns the decoration or * undefined if the alt buffer is active or the marker has already been disposed of. - * @throws if the @param decorationOptions includes a negative x offset. + * @throws when options include a negative x offset. */ registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined;