Add addon typings

This commit is contained in:
Daniel Imms
2019-06-15 00:11:34 -07:00
parent d272422c0b
commit 765297e67c
+5 -47
View File
@@ -3,41 +3,15 @@
* @license MIT
*/
import { Terminal, ILinkMatcherOptions, IDisposable, ITerminalAddon } from 'xterm';
declare module 'xterm-addon-search' {
/**
* Options for a search.
*/
export interface ISearchOptions {
/**
* Whether the search term is a regex.
*/
regex?: boolean;
/**
* Whether to search for a whole word, the result is only valid if it's
* suppounded in "non-word" characters such as `_`, `(`, `)` or space.
*/
wholeWord?: boolean;
/**
* Whether the search is case sensitive.
*/
caseSensitive?: boolean;
/**
* Whether to do an indcremental search, this will expand the selection if it
* still matches the term the user typed. Note that this only affects
* `findNext`, not `findPrevious`.
*/
incremental?: boolean;
}
import { Terminal, IDisposable, ITerminalAddon } from 'xterm';
declare module 'xterm-addon-webgl' {
/**
* An xterm.js addon that provides search functionality.
*/
export class SearchAddon implements ITerminalAddon {
export class WebglAddon implements ITerminalAddon {
constructor(preserveDrawingBuffer?: boolean);
/**
* Activates the addon
* @param terminal The terminal the addon is being loaded in.
@@ -48,21 +22,5 @@ declare module 'xterm-addon-search' {
* Disposes the addon.
*/
public dispose(): void;
/**
* Search forwards for the next result that matches the search term and
* options.
* @param term The search term.
* @param searchOptions The options for the search.
*/
public findNext(term: string, searchOptions?: ISearchOptions): boolean;
/**
* Search backwards for the previous result that matches the search term and
* options.
* @param term The search term.
* @param searchOptions The options for the search.
*/
public findPrevious(term: string, searchOptions?: ISearchOptions): boolean;
}
}