Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)

* Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d

* Fix vs unit tests and hygiene issue

* Fix strict null check issue
This commit is contained in:
Chris LaFreniere
2019-06-10 18:27:09 -07:00
committed by GitHub
parent ff38bc8143
commit d15a3fcc98
926 changed files with 19529 additions and 11383 deletions

File diff suppressed because it is too large Load Diff

33
src/typings/onigasm-umd.d.ts vendored Normal file
View File

@@ -0,0 +1,33 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module "onigasm-umd" {
function loadWASM(data: string | ArrayBuffer): Promise<void>;
class OnigString {
constructor(content: string);
readonly content: string;
readonly dispose?: () => void;
}
class OnigScanner {
constructor(patterns: string[]);
findNextMatchSync(string: string | OnigString, startPosition: number): IOnigMatch;
}
export interface IOnigCaptureIndex {
index: number
start: number
end: number
length: number
}
export interface IOnigMatch {
index: number
captureIndices: IOnigCaptureIndex[]
scanner: OnigScanner
}
}

View File

@@ -17,7 +17,12 @@ declare const enum LoaderEventType {
NodeEndEvaluatingScript = 32,
NodeBeginNativeRequire = 33,
NodeEndNativeRequire = 34
NodeEndNativeRequire = 34,
CachedDataFound = 60,
CachedDataMissed = 61,
CachedDataRejected = 62,
CachedDataCreated = 63,
}
declare class LoaderEvent {

View File

@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode-windows-ca-certs';

10
src/typings/vsda.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vsda' {
export class signer {
sign(arg: any): any;
}
}

69
src/typings/xterm-addon-search.d.ts vendored Normal file
View File

@@ -0,0 +1,69 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
// HACK: gulp-tsb doesn't play nice with importing from typings
// import { Terminal, 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;
}
/**
* An xterm.js addon that provides search functionality.
*/
export class SearchAddon {
/**
* Activates the addon
* @param terminal The terminal the addon is being loaded in.
*/
public activate(terminal: any): void;
/**
* 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;
}
}

71
src/typings/xterm-addon-web-links.d.ts vendored Normal file
View File

@@ -0,0 +1,71 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
// HACK: gulp-tsb doesn't play nice with importing from typings
// import { Terminal, ITerminalAddon } from 'xterm';
interface ILinkMatcherOptions {
/**
* The index of the link from the regex.match(text) call. This defaults to 0
* (for regular expressions without capture groups).
*/
matchIndex?: number;
/**
* A callback that validates whether to create an individual link, pass
* whether the link is valid to the callback.
*/
validationCallback?: (uri: string, callback: (isValid: boolean) => void) => void;
/**
* A callback that fires when the mouse hovers over a link for a moment.
*/
tooltipCallback?: (event: MouseEvent, uri: string) => boolean | void;
/**
* A callback that fires when the mouse leaves a link. Note that this can
* happen even when tooltipCallback hasn't fired for the link yet.
*/
leaveCallback?: () => void;
/**
* The priority of the link matcher, this defines the order in which the link
* matcher is evaluated relative to others, from highest to lowest. The
* default value is 0.
*/
priority?: number;
/**
* A callback that fires when the mousedown and click events occur that
* determines whether a link will be activated upon click. This enables
* only activating a link when a certain modifier is held down, if not the
* mouse event will continue propagation (eg. double click to select word).
*/
willLinkActivate?: (event: MouseEvent, uri: string) => boolean;
}
declare module 'xterm-addon-web-links' {
/**
* An xterm.js addon that enables web links.
*/
export class WebLinksAddon {
/**
* Creates a new web links addon.
* @param handler The callback when the link is called.
* @param options Options for the link matcher.
*/
constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions);
/**
* Activates the addon
* @param terminal The terminal the addon is being loaded in.
*/
public activate(terminal: any): void;
/**
* Disposes the addon.
*/
public dispose(): void;
}
}

View File

@@ -9,7 +9,7 @@
/// <reference lib="dom"/>
declare module 'vscode-xterm' {
declare module 'xterm' {
/**
* A string representing text font weight.
*/
@@ -76,31 +76,6 @@ declare module 'vscode-xterm' {
*/
drawBoldTextInBrightColors?: boolean;
/**
* Whether to enable the rendering of bold text.
*
* @deprecated Use fontWeight and fontWeightBold instead.
*/
enableBold?: boolean;
/**
* What character atlas implementation to use. The character atlas caches drawn characters,
* speeding up rendering significantly. However, it can introduce some minor rendering
* artifacts.
*
* - 'none': Don't use an atlas.
* - 'static': Generate an atlas when the terminal starts or is reconfigured. This atlas will
* only contain ASCII characters in 16 colors.
* - 'dynamic': Generate an atlas using a LRU cache as characters are requested. Limited to
* ASCII characters (for now), but supports 256 colors. For characters covered by the static
* cache, it's slightly slower in comparison, since there's more overhead involved in
* managing the cache.
*
* Currently defaults to 'static'. This option may be removed in the future. If it is, passed
* parameters will be ignored.
*/
experimentalCharAtlas?: 'none' | 'static' | 'dynamic';
/**
* The font size used to render text.
*/
@@ -706,13 +681,6 @@ declare module 'vscode-xterm' {
*/
dispose(): void;
/**
* Destroys the terminal and detaches it from the DOM.
*
* @deprecated Use dispose() instead.
*/
destroy(): void;
/**
* Scroll the display of the terminal
* @param amount The number of lines to scroll down (negative scroll up).
@@ -775,7 +743,7 @@ declare module 'vscode-xterm' {
* Retrieves an option's value from the terminal.
* @param key The option key.
*/
getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode'): boolean;
getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode'): boolean;
/**
* Retrieves an option's value from the terminal.
* @param key The option key.
@@ -826,7 +794,7 @@ declare module 'vscode-xterm' {
* @param key The option key.
* @param value The option value.
*/
setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'popOnBell' | 'rightClickSelectsWord' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode', value: boolean): void;
setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'macOptionIsMeta' | 'popOnBell' | 'rightClickSelectsWord' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode', value: boolean): void;
/**
* Sets an option on the terminal.
* @param key The option key.
@@ -982,7 +950,7 @@ declare module 'vscode-xterm' {
*
* @param x The character index to get.
*/
getCell(x: number): IBufferCell;
getCell(x: number): IBufferCell | undefined;
/**
* Gets the line as a string. Note that this is gets only the string for the line, not taking
@@ -1013,8 +981,10 @@ declare module 'vscode-xterm' {
}
// Modifications to official .d.ts below
declare module 'vscode-xterm' {
declare module 'xterm' {
interface TerminalCore {
debug: boolean;
@@ -1037,42 +1007,7 @@ declare module 'vscode-xterm' {
fire(e: T): void;
}
interface ISearchOptions {
/**
* Whether the find should be done as a regex.
*/
regex?: boolean;
/**
* Whether only whole words should match.
*/
wholeWord?: boolean;
/**
* Whether find should pay attention to case.
*/
caseSensitive?: boolean;
}
interface Terminal {
_core: TerminalCore;
webLinksInit(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): void;
/**
* Find the next instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing.
* @param term The search term.
* @param findOptions Regex, whole word, and case sensitive options.
* @return Whether a result was found.
*/
findNext(term: string, findOptions: ISearchOptions): boolean;
/**
* Find the previous instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing.
* @param term The search term.
* @param findOptions Regex, whole word, and case sensitive options.
* @return Whether a result was found.
*/
findPrevious(term: string, findOptions: ISearchOptions): boolean;
}
}
}