add public api

This commit is contained in:
tisilent
2023-10-18 00:29:56 +08:00
parent 4245283e05
commit 7dab4601d2
19 changed files with 56 additions and 17 deletions
+1 -2
View File
@@ -15,8 +15,7 @@
"xterm.js"
],
"scripts": {
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"prepackage": "../../node_modules/.bin/tsc -p .",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
},
+2 -1
View File
@@ -6,6 +6,7 @@
import { Terminal, IDisposable, ITerminalAddon, IDecoration } from 'xterm';
import { EventEmitter } from 'common/EventEmitter';
import { Disposable, toDisposable, disposeArray, MutableDisposable } from 'common/Lifecycle';
import { SearchAddon as ISearchApi } from 'xterm-addon-search';
export interface ISearchOptions {
regex?: boolean;
@@ -61,7 +62,7 @@ const NON_WORD_CHARACTERS = ' ~!@#$%^&*()+`-=[]{}|\\;:"\',./<>?';
const LINES_CACHE_TIME_TO_LIVE = 15 * 1000; // 15 secs
const DEFAULT_HIGHLIGHT_LIMIT = 1000;
export class SearchAddon extends Disposable implements ITerminalAddon {
export class SearchAddon extends Disposable implements ITerminalAddon , ISearchApi {
private _terminal: Terminal | undefined;
private _cachedSearchTerm: string | undefined;
private _highlightedLines: Set<number> = new Set();
@@ -17,6 +17,9 @@
"paths": {
"common/*": [
"../../../src/common/*"
],
"xterm-addon-search" : [
"../typings/xterm-addon-search.d.ts"
]
}
},