From 0731f286150b1d319a0ff3f78af5d1bf2230f5e7 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 6 Aug 2017 10:25:25 -0700 Subject: [PATCH] jsdoc --- src/Buffer.ts | 11 +++++++++++ src/BufferSet.ts | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/Buffer.ts b/src/Buffer.ts index 714151d..ba47d0c 100644 --- a/src/Buffer.ts +++ b/src/Buffer.ts @@ -43,6 +43,9 @@ export class Buffer implements IBuffer { return this._lines; } + /** + * Fills the buffer's viewport with blank lines. + */ public fillViewportRows(): void { if (this._lines.length === 0) { let i = this._terminal.rows; @@ -52,6 +55,9 @@ export class Buffer implements IBuffer { } } + /** + * Clears the buffer to it's initial state, discarding all previous data. + */ public clear(): void { this.ydisp = 0; this.ybase = 0; @@ -64,6 +70,11 @@ export class Buffer implements IBuffer { this.scrollBottom = this._terminal.rows - 1; } + /** + * Resizes the buffer, adjusting its data accordingly. + * @param newCols The new number of columns. + * @param newRows The new number of rows. + */ public resize(newCols: number, newRows: number): void { // Don't resize the buffer if it's empty and hasn't been used yet. if (this._lines.length === 0) { diff --git a/src/BufferSet.ts b/src/BufferSet.ts index 345191c..24d6c31 100644 --- a/src/BufferSet.ts +++ b/src/BufferSet.ts @@ -76,6 +76,11 @@ export class BufferSet extends EventEmitter implements IBufferSet { this.emit('activate', this._alt); } + /** + * Resizes both normal and alt buffers, adjusting their data accordingly. + * @param newCols The new number of columns. + * @param newRows The new number of rows. + */ public resize(newCols: number, newRows: number): void { this._normal.resize(newCols, newRows); this._alt.resize(newCols, newRows);