Comparing version 3.14.0-beta10 to 3.14.0-beta11
@@ -21,3 +21,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.search = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
var startCol = 0; | ||
var startRow = this._terminal._core.buffer.ydisp; | ||
var startRow = this._terminal.buffer.viewportY; | ||
if (this._terminal.hasSelection()) { | ||
@@ -31,3 +31,3 @@ var currentSelection = this._terminal.getSelectionPosition(); | ||
var cumulativeCols = startCol; | ||
while (this._terminal._core.buffer.lines.get(findingRow).isWrapped) { | ||
while (this._terminal.buffer.getLine(findingRow).isWrapped) { | ||
findingRow--; | ||
@@ -38,3 +38,3 @@ cumulativeCols += this._terminal.cols; | ||
if (!result) { | ||
for (var y = startRow + 1; y < this._terminal._core.buffer.ybase + this._terminal.rows; y++) { | ||
for (var y = startRow + 1; y < this._terminal.buffer.baseY + this._terminal.rows; y++) { | ||
result = this._findInLine(term, y, 0, searchOptions); | ||
@@ -63,3 +63,3 @@ if (result) { | ||
var isReverseSearch = true; | ||
var startRow = this._terminal._core.buffer.ydisp + this._terminal.rows - 1; | ||
var startRow = this._terminal.buffer.viewportY + this._terminal.rows - 1; | ||
var startCol = this._terminal.cols; | ||
@@ -75,3 +75,3 @@ if (this._terminal.hasSelection()) { | ||
var cumulativeCols = this._terminal.cols; | ||
if (this._terminal._core.buffer.lines.get(startRow).isWrapped) { | ||
if (this._terminal.buffer.getLine(startRow).isWrapped) { | ||
cumulativeCols += startCol; | ||
@@ -84,3 +84,3 @@ } | ||
} | ||
if (this._terminal._core.buffer.lines.get(y).isWrapped) { | ||
if (this._terminal.buffer.getLine(y).isWrapped) { | ||
cumulativeCols += this._terminal.cols; | ||
@@ -94,3 +94,3 @@ } | ||
if (!result) { | ||
var searchFrom = this._terminal._core.buffer.ybase + this._terminal.rows - 1; | ||
var searchFrom = this._terminal.buffer.baseY + this._terminal.rows - 1; | ||
var cumulativeCols = this._terminal.cols; | ||
@@ -102,3 +102,3 @@ for (var y = searchFrom; y >= startRow; y--) { | ||
} | ||
if (this._terminal._core.buffer.lines.get(y).isWrapped) { | ||
if (this._terminal.buffer.getLine(y).isWrapped) { | ||
cumulativeCols += this._terminal.cols; | ||
@@ -116,3 +116,3 @@ } | ||
if (!this._linesCache) { | ||
this._linesCache = new Array(this._terminal._core.buffer.length); | ||
this._linesCache = new Array(this._terminal.buffer.length); | ||
this._cursorMoveListener = this._terminal.onCursorMove(function () { return _this._destroyLinesCache(); }); | ||
@@ -146,3 +146,3 @@ this._resizeListener = this._terminal.onResize(function () { return _this._destroyLinesCache(); }); | ||
if (isReverseSearch === void 0) { isReverseSearch = false; } | ||
if (this._terminal._core.buffer.lines.get(row).isWrapped) { | ||
if (this._terminal.buffer.getLine(row).isWrapped) { | ||
return; | ||
@@ -196,10 +196,10 @@ } | ||
} | ||
var line = this._terminal._core.buffer.lines.get(row); | ||
var line = this._terminal.buffer.getLine(row); | ||
for (var i = 0; i < resultIndex; i++) { | ||
var charData = line.get(i); | ||
var char = charData[1]; | ||
var cell = line.getCell(i); | ||
var char = cell.char; | ||
if (char.length > 1) { | ||
resultIndex -= char.length - 1; | ||
} | ||
var charWidth = charData[2]; | ||
var charWidth = cell.width; | ||
if (charWidth === 0) { | ||
@@ -220,5 +220,5 @@ resultIndex++; | ||
do { | ||
var nextLine = this._terminal._core.buffer.lines.get(lineIndex + 1); | ||
var nextLine = this._terminal.buffer.getLine(lineIndex + 1); | ||
lineWrapsToNext = nextLine ? nextLine.isWrapped : false; | ||
lineString += this._terminal._core.buffer.translateBufferLineToString(lineIndex, !lineWrapsToNext && trimRight).substring(0, this._terminal.cols); | ||
lineString += this._terminal.buffer.getLine(lineIndex).translateToString(!lineWrapsToNext && trimRight).substring(0, this._terminal.cols); | ||
lineIndex++; | ||
@@ -234,3 +234,3 @@ } while (lineWrapsToNext); | ||
this._terminal.select(result.col, result.row, result.term.length); | ||
this._terminal.scrollLines(result.row - this._terminal._core.buffer.ydisp); | ||
this._terminal.scrollLines(result.row - this._terminal.buffer.viewportY); | ||
return true; | ||
@@ -237,0 +237,0 @@ }; |
import { Terminal } from 'xterm'; | ||
export interface ITerminalCore { | ||
buffer: any; | ||
} | ||
export interface ISearchAddonTerminal extends Terminal { | ||
__searchHelper?: ISearchHelper; | ||
_core: ITerminalCore; | ||
} | ||
@@ -9,0 +5,0 @@ export interface ISearchHelper { |
@@ -20,3 +20,3 @@ "use strict"; | ||
var startCol = 0; | ||
var startRow = this._terminal._core.buffer.ydisp; | ||
var startRow = this._terminal.buffer.viewportY; | ||
if (this._terminal.hasSelection()) { | ||
@@ -30,3 +30,3 @@ var currentSelection = this._terminal.getSelectionPosition(); | ||
var cumulativeCols = startCol; | ||
while (this._terminal._core.buffer.lines.get(findingRow).isWrapped) { | ||
while (this._terminal.buffer.getLine(findingRow).isWrapped) { | ||
findingRow--; | ||
@@ -37,3 +37,3 @@ cumulativeCols += this._terminal.cols; | ||
if (!result) { | ||
for (var y = startRow + 1; y < this._terminal._core.buffer.ybase + this._terminal.rows; y++) { | ||
for (var y = startRow + 1; y < this._terminal.buffer.baseY + this._terminal.rows; y++) { | ||
result = this._findInLine(term, y, 0, searchOptions); | ||
@@ -62,3 +62,3 @@ if (result) { | ||
var isReverseSearch = true; | ||
var startRow = this._terminal._core.buffer.ydisp + this._terminal.rows - 1; | ||
var startRow = this._terminal.buffer.viewportY + this._terminal.rows - 1; | ||
var startCol = this._terminal.cols; | ||
@@ -74,3 +74,3 @@ if (this._terminal.hasSelection()) { | ||
var cumulativeCols = this._terminal.cols; | ||
if (this._terminal._core.buffer.lines.get(startRow).isWrapped) { | ||
if (this._terminal.buffer.getLine(startRow).isWrapped) { | ||
cumulativeCols += startCol; | ||
@@ -83,3 +83,3 @@ } | ||
} | ||
if (this._terminal._core.buffer.lines.get(y).isWrapped) { | ||
if (this._terminal.buffer.getLine(y).isWrapped) { | ||
cumulativeCols += this._terminal.cols; | ||
@@ -93,3 +93,3 @@ } | ||
if (!result) { | ||
var searchFrom = this._terminal._core.buffer.ybase + this._terminal.rows - 1; | ||
var searchFrom = this._terminal.buffer.baseY + this._terminal.rows - 1; | ||
var cumulativeCols = this._terminal.cols; | ||
@@ -101,3 +101,3 @@ for (var y = searchFrom; y >= startRow; y--) { | ||
} | ||
if (this._terminal._core.buffer.lines.get(y).isWrapped) { | ||
if (this._terminal.buffer.getLine(y).isWrapped) { | ||
cumulativeCols += this._terminal.cols; | ||
@@ -115,3 +115,3 @@ } | ||
if (!this._linesCache) { | ||
this._linesCache = new Array(this._terminal._core.buffer.length); | ||
this._linesCache = new Array(this._terminal.buffer.length); | ||
this._cursorMoveListener = this._terminal.onCursorMove(function () { return _this._destroyLinesCache(); }); | ||
@@ -145,3 +145,3 @@ this._resizeListener = this._terminal.onResize(function () { return _this._destroyLinesCache(); }); | ||
if (isReverseSearch === void 0) { isReverseSearch = false; } | ||
if (this._terminal._core.buffer.lines.get(row).isWrapped) { | ||
if (this._terminal.buffer.getLine(row).isWrapped) { | ||
return; | ||
@@ -195,10 +195,10 @@ } | ||
} | ||
var line = this._terminal._core.buffer.lines.get(row); | ||
var line = this._terminal.buffer.getLine(row); | ||
for (var i = 0; i < resultIndex; i++) { | ||
var charData = line.get(i); | ||
var char = charData[1]; | ||
var cell = line.getCell(i); | ||
var char = cell.char; | ||
if (char.length > 1) { | ||
resultIndex -= char.length - 1; | ||
} | ||
var charWidth = charData[2]; | ||
var charWidth = cell.width; | ||
if (charWidth === 0) { | ||
@@ -219,5 +219,5 @@ resultIndex++; | ||
do { | ||
var nextLine = this._terminal._core.buffer.lines.get(lineIndex + 1); | ||
var nextLine = this._terminal.buffer.getLine(lineIndex + 1); | ||
lineWrapsToNext = nextLine ? nextLine.isWrapped : false; | ||
lineString += this._terminal._core.buffer.translateBufferLineToString(lineIndex, !lineWrapsToNext && trimRight).substring(0, this._terminal.cols); | ||
lineString += this._terminal.buffer.getLine(lineIndex).translateToString(!lineWrapsToNext && trimRight).substring(0, this._terminal.cols); | ||
lineIndex++; | ||
@@ -233,3 +233,3 @@ } while (lineWrapsToNext); | ||
this._terminal.select(result.col, result.row, result.term.length); | ||
this._terminal.scrollLines(result.row - this._terminal._core.buffer.ydisp); | ||
this._terminal.scrollLines(result.row - this._terminal.buffer.viewportY); | ||
return true; | ||
@@ -236,0 +236,0 @@ }; |
@@ -330,2 +330,84 @@ "use strict"; | ||
}); | ||
describe('loadAddon', function () { | ||
it('constructor', function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
this.timeout(10000); | ||
return [4, openTerminal({ cols: 5 })]; | ||
case 1: | ||
_c.sent(); | ||
return [4, page.evaluate("\n window.cols = 0;\n window.term.loadAddon({\n activate: (t) => window.cols = t.cols,\n dispose: () => {}\n });\n ")]; | ||
case 2: | ||
_c.sent(); | ||
_b = (_a = chai_1.assert).equal; | ||
return [4, page.evaluate("window.cols")]; | ||
case 3: | ||
_b.apply(_a, [_c.sent(), 5]); | ||
return [2]; | ||
} | ||
}); | ||
}); | ||
}); | ||
it('dispose (addon)', function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, _b, _c, _d; | ||
return __generator(this, function (_e) { | ||
switch (_e.label) { | ||
case 0: | ||
this.timeout(10000); | ||
return [4, openTerminal()]; | ||
case 1: | ||
_e.sent(); | ||
return [4, page.evaluate("\n window.disposeCalled = false\n window.addon = {\n activate: () => {},\n dispose: () => window.disposeCalled = true\n };\n window.term.loadAddon(window.addon);\n ")]; | ||
case 2: | ||
_e.sent(); | ||
_b = (_a = chai_1.assert).equal; | ||
return [4, page.evaluate("window.disposeCalled")]; | ||
case 3: | ||
_b.apply(_a, [_e.sent(), false]); | ||
return [4, page.evaluate("window.addon.dispose()")]; | ||
case 4: | ||
_e.sent(); | ||
_d = (_c = chai_1.assert).equal; | ||
return [4, page.evaluate("window.disposeCalled")]; | ||
case 5: | ||
_d.apply(_c, [_e.sent(), true]); | ||
return [2]; | ||
} | ||
}); | ||
}); | ||
}); | ||
it('dispose (terminal)', function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, _b, _c, _d; | ||
return __generator(this, function (_e) { | ||
switch (_e.label) { | ||
case 0: | ||
this.timeout(10000); | ||
return [4, openTerminal()]; | ||
case 1: | ||
_e.sent(); | ||
return [4, page.evaluate("\n window.disposeCalled = false\n window.term.loadAddon({\n activate: () => {},\n dispose: () => window.disposeCalled = true\n });\n ")]; | ||
case 2: | ||
_e.sent(); | ||
_b = (_a = chai_1.assert).equal; | ||
return [4, page.evaluate("window.disposeCalled")]; | ||
case 3: | ||
_b.apply(_a, [_e.sent(), false]); | ||
return [4, page.evaluate("window.term.dispose()")]; | ||
case 4: | ||
_e.sent(); | ||
_d = (_c = chai_1.assert).equal; | ||
return [4, page.evaluate("window.disposeCalled")]; | ||
case 5: | ||
_d.apply(_c, [_e.sent(), true]); | ||
return [2]; | ||
} | ||
}); | ||
}); | ||
}); | ||
}); | ||
describe('Events', function () { | ||
@@ -332,0 +414,0 @@ it('onCursorMove', function () { |
@@ -5,5 +5,7 @@ "use strict"; | ||
var Strings = require("../Strings"); | ||
var AddonManager_1 = require("./AddonManager"); | ||
var Terminal = (function () { | ||
function Terminal(options) { | ||
this._core = new Terminal_1.Terminal(options); | ||
this._addonManager = new AddonManager_1.AddonManager(); | ||
} | ||
@@ -158,2 +160,3 @@ Object.defineProperty(Terminal.prototype, "onCursorMove", { | ||
Terminal.prototype.dispose = function () { | ||
this._addonManager.dispose(); | ||
this._core.dispose(); | ||
@@ -200,2 +203,5 @@ }; | ||
}; | ||
Terminal.prototype.loadAddon = function (addon) { | ||
return this._addonManager.loadAddon(this, addon); | ||
}; | ||
Object.defineProperty(Terminal, "strings", { | ||
@@ -202,0 +208,0 @@ get: function () { |
{ | ||
"name": "xterm", | ||
"description": "Full xterm terminal, in your browser", | ||
"version": "3.14.0-beta10", | ||
"version": "3.14.0-beta11", | ||
"main": "lib/public/Terminal.js", | ||
@@ -47,2 +47,5 @@ "types": "typings/xterm.d.ts", | ||
"webpack-cli": "^3.1.0", | ||
"xterm-addon-attach": "0.1.0-beta7", | ||
"xterm-addon-search": "0.1.0-beta4", | ||
"xterm-addon-web-links": "0.1.0-beta6", | ||
"zmodem.js": "^0.1.5" | ||
@@ -49,0 +52,0 @@ }, |
@@ -8,10 +8,4 @@ /** | ||
// TODO: Don't rely on this private API | ||
export interface ITerminalCore { | ||
buffer: any; | ||
} | ||
export interface ISearchAddonTerminal extends Terminal { | ||
__searchHelper?: ISearchHelper; | ||
_core: ITerminalCore; | ||
} | ||
@@ -18,0 +12,0 @@ |
@@ -47,3 +47,3 @@ /** | ||
let startCol: number = 0; | ||
let startRow = this._terminal._core.buffer.ydisp; | ||
let startRow = this._terminal.buffer.viewportY; | ||
@@ -66,3 +66,3 @@ if (this._terminal.hasSelection()) { | ||
// So we can start matching on wrapped line from long unwrapped line. | ||
while (this._terminal._core.buffer.lines.get(findingRow).isWrapped) { | ||
while (this._terminal.buffer.getLine(findingRow).isWrapped) { | ||
findingRow--; | ||
@@ -78,3 +78,3 @@ cumulativeCols += this._terminal.cols; | ||
for (let y = startRow + 1; y < this._terminal._core.buffer.ybase + this._terminal.rows; y++) { | ||
for (let y = startRow + 1; y < this._terminal.buffer.baseY + this._terminal.rows; y++) { | ||
@@ -121,3 +121,3 @@ // If the current line is wrapped line, increase index of column to ignore the previous scan | ||
const isReverseSearch = true; | ||
let startRow = this._terminal._core.buffer.ydisp + this._terminal.rows - 1; | ||
let startRow = this._terminal.buffer.viewportY + this._terminal.rows - 1; | ||
let startCol = this._terminal.cols; | ||
@@ -142,3 +142,3 @@ | ||
let cumulativeCols = this._terminal.cols; | ||
if (this._terminal._core.buffer.lines.get(startRow).isWrapped) { | ||
if (this._terminal.buffer.getLine(startRow).isWrapped) { | ||
cumulativeCols += startCol; | ||
@@ -153,3 +153,3 @@ } | ||
// preparing for scanning on unwrapped line | ||
if (this._terminal._core.buffer.lines.get(y).isWrapped) { | ||
if (this._terminal.buffer.getLine(y).isWrapped) { | ||
cumulativeCols += this._terminal.cols; | ||
@@ -165,3 +165,3 @@ } else { | ||
if (!result) { | ||
const searchFrom = this._terminal._core.buffer.ybase + this._terminal.rows - 1; | ||
const searchFrom = this._terminal.buffer.baseY + this._terminal.rows - 1; | ||
let cumulativeCols = this._terminal.cols; | ||
@@ -173,3 +173,3 @@ for (let y = searchFrom; y >= startRow; y--) { | ||
} | ||
if (this._terminal._core.buffer.lines.get(y).isWrapped) { | ||
if (this._terminal.buffer.getLine(y).isWrapped) { | ||
cumulativeCols += this._terminal.cols; | ||
@@ -191,3 +191,3 @@ } else { | ||
if (!this._linesCache) { | ||
this._linesCache = new Array(this._terminal._core.buffer.length); | ||
this._linesCache = new Array(this._terminal.buffer.length); | ||
this._cursorMoveListener = this._terminal.onCursorMove(() => this._destroyLinesCache()); | ||
@@ -242,3 +242,3 @@ this._resizeListener = this._terminal.onResize(() => this._destroyLinesCache()); | ||
// Ignore wrapped lines, only consider on unwrapped line (first row of command string). | ||
if (this._terminal._core.buffer.lines.get(row).isWrapped) { | ||
if (this._terminal.buffer.getLine(row).isWrapped) { | ||
return; | ||
@@ -295,8 +295,8 @@ } | ||
const line = this._terminal._core.buffer.lines.get(row); | ||
const line = this._terminal.buffer.getLine(row); | ||
for (let i = 0; i < resultIndex; i++) { | ||
const charData = line.get(i); | ||
const cell = line.getCell(i); | ||
// Adjust the searchIndex to normalize emoji into single chars | ||
const char = charData[1/*CHAR_DATA_CHAR_INDEX*/]; | ||
const char = cell.char; | ||
if (char.length > 1) { | ||
@@ -307,3 +307,3 @@ resultIndex -= char.length - 1; | ||
// chars (eg. CJK) | ||
const charWidth = charData[2/*CHAR_DATA_WIDTH_INDEX*/]; | ||
const charWidth = cell.width; | ||
if (charWidth === 0) { | ||
@@ -333,5 +333,5 @@ resultIndex++; | ||
do { | ||
const nextLine = this._terminal._core.buffer.lines.get(lineIndex + 1); | ||
const nextLine = this._terminal.buffer.getLine(lineIndex + 1); | ||
lineWrapsToNext = nextLine ? nextLine.isWrapped : false; | ||
lineString += this._terminal._core.buffer.translateBufferLineToString(lineIndex, !lineWrapsToNext && trimRight).substring(0, this._terminal.cols); | ||
lineString += this._terminal.buffer.getLine(lineIndex).translateToString(!lineWrapsToNext && trimRight).substring(0, this._terminal.cols); | ||
lineIndex++; | ||
@@ -354,5 +354,5 @@ } while (lineWrapsToNext); | ||
this._terminal.select(result.col, result.row, result.term.length); | ||
this._terminal.scrollLines(result.row - this._terminal._core.buffer.ydisp); | ||
this._terminal.scrollLines(result.row - this._terminal.buffer.viewportY); | ||
return true; | ||
} | ||
} |
@@ -121,2 +121,48 @@ /** | ||
describe('loadAddon', () => { | ||
it('constructor', async function(): Promise<any> { | ||
this.timeout(10000); | ||
await openTerminal({ cols: 5 }); | ||
await page.evaluate(` | ||
window.cols = 0; | ||
window.term.loadAddon({ | ||
activate: (t) => window.cols = t.cols, | ||
dispose: () => {} | ||
}); | ||
`); | ||
assert.equal(await page.evaluate(`window.cols`), 5); | ||
}); | ||
it('dispose (addon)', async function(): Promise<any> { | ||
this.timeout(10000); | ||
await openTerminal(); | ||
await page.evaluate(` | ||
window.disposeCalled = false | ||
window.addon = { | ||
activate: () => {}, | ||
dispose: () => window.disposeCalled = true | ||
}; | ||
window.term.loadAddon(window.addon); | ||
`); | ||
assert.equal(await page.evaluate(`window.disposeCalled`), false); | ||
await page.evaluate(`window.addon.dispose()`); | ||
assert.equal(await page.evaluate(`window.disposeCalled`), true); | ||
}); | ||
it('dispose (terminal)', async function(): Promise<any> { | ||
this.timeout(10000); | ||
await openTerminal(); | ||
await page.evaluate(` | ||
window.disposeCalled = false | ||
window.term.loadAddon({ | ||
activate: () => {}, | ||
dispose: () => window.disposeCalled = true | ||
}); | ||
`); | ||
assert.equal(await page.evaluate(`window.disposeCalled`), false); | ||
await page.evaluate(`window.term.dispose()`); | ||
assert.equal(await page.evaluate(`window.disposeCalled`), true); | ||
}); | ||
}); | ||
describe('Events', () => { | ||
@@ -123,0 +169,0 @@ it('onCursorMove', async function(): Promise<any> { |
@@ -6,3 +6,3 @@ /** | ||
import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi, ISelectionPosition } from 'xterm'; | ||
import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from 'xterm'; | ||
import { ITerminal, IBuffer } from '../Types'; | ||
@@ -13,8 +13,11 @@ import { IBufferLine } from '../core/Types'; | ||
import { IEvent } from '../common/EventEmitter2'; | ||
import { AddonManager } from './AddonManager'; | ||
export class Terminal implements ITerminalApi { | ||
private _core: ITerminal; | ||
private _addonManager: AddonManager; | ||
constructor(options?: ITerminalOptions) { | ||
this._core = new TerminalCore(options); | ||
this._addonManager = new AddonManager(); | ||
} | ||
@@ -120,2 +123,3 @@ | ||
public dispose(): void { | ||
this._addonManager.dispose(); | ||
this._core.dispose(); | ||
@@ -179,2 +183,5 @@ } | ||
} | ||
public loadAddon(addon: ITerminalAddon): void { | ||
return this._addonManager.loadAddon(this, addon); | ||
} | ||
public static get strings(): ILocalizableStrings { | ||
@@ -181,0 +188,0 @@ return Strings; |
@@ -223,50 +223,51 @@ /** | ||
// Portions of the public API that are required by the internal Terminal | ||
export interface IPublicTerminal extends IDisposable, IEventEmitter { | ||
textarea: HTMLTextAreaElement; | ||
rows: number; | ||
cols: number; | ||
buffer: IBuffer; | ||
markers: IMarker[]; | ||
onCursorMove: IEvent<void>; | ||
onData: IEvent<string>; | ||
onKey: IEvent<{ key: string, domEvent: KeyboardEvent }>; | ||
onLineFeed: IEvent<void>; | ||
onScroll: IEvent<number>; | ||
onSelectionChange: IEvent<void>; | ||
onRender: IEvent<{ start: number, end: number }>; | ||
onResize: IEvent<{ cols: number, rows: number }>; | ||
onTitleChange: IEvent<string>; | ||
blur(): void; | ||
focus(): void; | ||
resize(columns: number, rows: number): void; | ||
writeln(data: string): void; | ||
open(parent: HTMLElement): void; | ||
attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void; | ||
addCsiHandler(flag: string, callback: (params: number[], collect: string) => boolean): IDisposable; | ||
addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; | ||
registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): number; | ||
deregisterLinkMatcher(matcherId: number): void; | ||
registerCharacterJoiner(handler: (text: string) => [number, number][]): number; | ||
deregisterCharacterJoiner(joinerId: number): void; | ||
addMarker(cursorYOffset: number): IMarker; | ||
hasSelection(): boolean; | ||
getSelection(): string; | ||
getSelectionPosition(): ISelectionPosition | undefined; | ||
clearSelection(): void; | ||
select(column: number, row: number, length: number): void; | ||
selectAll(): void; | ||
selectLines(start: number, end: number): void; | ||
dispose(): void; | ||
destroy(): void; | ||
scrollLines(amount: number): void; | ||
scrollPages(pageCount: number): void; | ||
scrollToTop(): void; | ||
scrollToBottom(): void; | ||
scrollToLine(line: number): void; | ||
clear(): void; | ||
write(data: string): void; | ||
getOption(key: string): any; | ||
setOption(key: string, value: any): void; | ||
refresh(start: number, end: number): void; | ||
reset(): void; | ||
textarea: HTMLTextAreaElement; | ||
rows: number; | ||
cols: number; | ||
buffer: IBuffer; | ||
markers: IMarker[]; | ||
onCursorMove: IEvent<void>; | ||
onData: IEvent<string>; | ||
onKey: IEvent<{ key: string, domEvent: KeyboardEvent }>; | ||
onLineFeed: IEvent<void>; | ||
onScroll: IEvent<number>; | ||
onSelectionChange: IEvent<void>; | ||
onRender: IEvent<{ start: number, end: number }>; | ||
onResize: IEvent<{ cols: number, rows: number }>; | ||
onTitleChange: IEvent<string>; | ||
blur(): void; | ||
focus(): void; | ||
resize(columns: number, rows: number): void; | ||
writeln(data: string): void; | ||
open(parent: HTMLElement): void; | ||
attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void; | ||
addCsiHandler(flag: string, callback: (params: number[], collect: string) => boolean): IDisposable; | ||
addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; | ||
registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): number; | ||
deregisterLinkMatcher(matcherId: number): void; | ||
registerCharacterJoiner(handler: (text: string) => [number, number][]): number; | ||
deregisterCharacterJoiner(joinerId: number): void; | ||
addMarker(cursorYOffset: number): IMarker; | ||
hasSelection(): boolean; | ||
getSelection(): string; | ||
getSelectionPosition(): ISelectionPosition | undefined; | ||
clearSelection(): void; | ||
select(column: number, row: number, length: number): void; | ||
selectAll(): void; | ||
selectLines(start: number, end: number): void; | ||
dispose(): void; | ||
destroy(): void; | ||
scrollLines(amount: number): void; | ||
scrollPages(pageCount: number): void; | ||
scrollToTop(): void; | ||
scrollToBottom(): void; | ||
scrollToLine(line: number): void; | ||
clear(): void; | ||
write(data: string): void; | ||
getOption(key: string): any; | ||
setOption(key: string, value: any): void; | ||
refresh(start: number, end: number): void; | ||
reset(): void; | ||
} | ||
@@ -273,0 +274,0 @@ |
@@ -876,7 +876,24 @@ /** | ||
* @param addon The addon to apply. | ||
* @deprecated Use the new loadAddon API/addon format. | ||
*/ | ||
static applyAddon(addon: any): void; | ||
/** | ||
* (EXPERIMENTAL) Loads an addon into this instance of xterm.js. | ||
* @param addon The addon to load. | ||
*/ | ||
loadAddon(addon: ITerminalAddon): void; | ||
} | ||
/** | ||
* An addon that can provide additional functionality to the terminal. | ||
*/ | ||
export interface ITerminalAddon extends IDisposable { | ||
/** | ||
* (EXPERIMENTAL) This is called when the addon is activated within xterm.js. | ||
*/ | ||
activate(terminal: Terminal): void; | ||
} | ||
/** | ||
* An object representing a selecrtion within the terminal. | ||
@@ -883,0 +900,0 @@ */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2699972
305
40845
41