Update LKG (#17993)

This commit is contained in:
Andy 2017-08-23 17:48:01 -07:00 committed by GitHub
parent 40f9ee4b02
commit cd2ea9a12f
17 changed files with 22392 additions and 7357 deletions

View file

@ -69,3 +69,5 @@ function createCancellationToken(args) {
}
}
module.exports = createCancellationToken;
//# sourceMappingURL=cancellationToken.js.map

10
lib/lib.d.ts vendored
View file

@ -236,7 +236,7 @@ interface ObjectConstructor {
* Returns the names of the enumerable properties and methods of an object.
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
keys(o: any): string[];
keys(o: {}): string[];
}
/**
@ -1000,12 +1000,12 @@ interface ReadonlyArray<T> {
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: T[][]): T[];
concat(...items: ReadonlyArray<T>[]): T[];
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: (T | T[])[]): T[];
concat(...items: (T | ReadonlyArray<T>)[]): T[];
/**
* Adds all the elements of an array separated by the specified separator string.
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@ -1119,12 +1119,12 @@ interface Array<T> {
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: T[][]): T[];
concat(...items: ReadonlyArray<T>[]): T[];
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: (T | T[])[]): T[];
concat(...items: (T | ReadonlyArray<T>)[]): T[];
/**
* Adds all the elements of an array separated by the specified separator string.
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

View file

@ -130,7 +130,7 @@ interface Map<K, V> {
readonly [Symbol.toStringTag]: "Map";
}
interface WeakMap<K extends object, V>{
interface WeakMap<K extends object, V> {
readonly [Symbol.toStringTag]: "WeakMap";
}

1824
lib/lib.es2016.full.d.ts vendored

File diff suppressed because it is too large Load diff

1824
lib/lib.es2017.full.d.ts vendored

File diff suppressed because it is too large Load diff

10
lib/lib.es5.d.ts vendored
View file

@ -236,7 +236,7 @@ interface ObjectConstructor {
* Returns the names of the enumerable properties and methods of an object.
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
keys(o: any): string[];
keys(o: {}): string[];
}
/**
@ -1000,12 +1000,12 @@ interface ReadonlyArray<T> {
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: T[][]): T[];
concat(...items: ReadonlyArray<T>[]): T[];
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: (T | T[])[]): T[];
concat(...items: (T | ReadonlyArray<T>)[]): T[];
/**
* Adds all the elements of an array separated by the specified separator string.
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@ -1119,12 +1119,12 @@ interface Array<T> {
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: T[][]): T[];
concat(...items: ReadonlyArray<T>[]): T[];
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: (T | T[])[]): T[];
concat(...items: (T | ReadonlyArray<T>)[]): T[];
/**
* Adds all the elements of an array separated by the specified separator string.
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

12
lib/lib.es6.d.ts vendored
View file

@ -236,7 +236,7 @@ interface ObjectConstructor {
* Returns the names of the enumerable properties and methods of an object.
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
keys(o: any): string[];
keys(o: {}): string[];
}
/**
@ -1000,12 +1000,12 @@ interface ReadonlyArray<T> {
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: T[][]): T[];
concat(...items: ReadonlyArray<T>[]): T[];
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: (T | T[])[]): T[];
concat(...items: (T | ReadonlyArray<T>)[]): T[];
/**
* Adds all the elements of an array separated by the specified separator string.
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@ -1119,12 +1119,12 @@ interface Array<T> {
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: T[][]): T[];
concat(...items: ReadonlyArray<T>[]): T[];
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: (T | T[])[]): T[];
concat(...items: (T | ReadonlyArray<T>)[]): T[];
/**
* Adds all the elements of an array separated by the specified separator string.
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@ -5689,7 +5689,7 @@ interface Map<K, V> {
readonly [Symbol.toStringTag]: "Map";
}
interface WeakMap<K extends object, V>{
interface WeakMap<K extends object, V> {
readonly [Symbol.toStringTag]: "WeakMap";
}

1824
lib/lib.esnext.full.d.ts vendored

File diff suppressed because it is too large Load diff

3403
lib/tsc.js

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -50,7 +50,7 @@ declare namespace ts {
pos: number;
end: number;
}
enum SyntaxKind {
const enum SyntaxKind {
Unknown = 0,
EndOfFileToken = 1,
SingleLineCommentTrivia = 2,
@ -374,7 +374,7 @@ declare namespace ts {
FirstJSDocTagNode = 276,
LastJSDocTagNode = 285,
}
enum NodeFlags {
const enum NodeFlags {
None = 0,
Let = 1,
Const = 2,
@ -402,7 +402,7 @@ declare namespace ts {
ContextFlags = 96256,
TypeExcludesFlags = 20480,
}
enum ModifierFlags {
const enum ModifierFlags {
None = 0,
Export = 1,
Ambient = 2,
@ -422,7 +422,7 @@ declare namespace ts {
TypeScriptModifier = 2270,
ExportDefault = 513,
}
enum JsxFlags {
const enum JsxFlags {
None = 0,
IntrinsicNamedElement = 1,
IntrinsicIndexedElement = 2,
@ -1175,7 +1175,7 @@ declare namespace ts {
interface CatchClause extends Node {
kind: SyntaxKind.CatchClause;
parent?: TryStatement;
variableDeclaration: VariableDeclaration;
variableDeclaration?: VariableDeclaration;
block: Block;
}
type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
@ -1432,7 +1432,7 @@ declare namespace ts {
jsDocTypeTag?: JSDocTypeTag;
isArrayType?: boolean;
}
enum FlowFlags {
const enum FlowFlags {
Unreachable = 1,
Start = 2,
BranchLabel = 4,
@ -1452,38 +1452,39 @@ declare namespace ts {
interface FlowLock {
locked?: boolean;
}
interface AfterFinallyFlow extends FlowNode, FlowLock {
interface AfterFinallyFlow extends FlowNodeBase, FlowLock {
antecedent: FlowNode;
}
interface PreFinallyFlow extends FlowNode {
interface PreFinallyFlow extends FlowNodeBase {
antecedent: FlowNode;
lock: FlowLock;
}
interface FlowNode {
type FlowNode = AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation;
interface FlowNodeBase {
flags: FlowFlags;
id?: number;
}
interface FlowStart extends FlowNode {
interface FlowStart extends FlowNodeBase {
container?: FunctionExpression | ArrowFunction | MethodDeclaration;
}
interface FlowLabel extends FlowNode {
interface FlowLabel extends FlowNodeBase {
antecedents: FlowNode[];
}
interface FlowAssignment extends FlowNode {
interface FlowAssignment extends FlowNodeBase {
node: Expression | VariableDeclaration | BindingElement;
antecedent: FlowNode;
}
interface FlowCondition extends FlowNode {
interface FlowCondition extends FlowNodeBase {
expression: Expression;
antecedent: FlowNode;
}
interface FlowSwitchClause extends FlowNode {
interface FlowSwitchClause extends FlowNodeBase {
switchStatement: SwitchStatement;
clauseStart: number;
clauseEnd: number;
antecedent: FlowNode;
}
interface FlowArrayMutation extends FlowNode {
interface FlowArrayMutation extends FlowNodeBase {
node: CallExpression | BinaryExpression;
antecedent: FlowNode;
}
@ -1607,6 +1608,7 @@ declare namespace ts {
getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined;
getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined;
getExportSymbolOfSymbol(symbol: Symbol): Symbol;
getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined;
getTypeAtLocation(node: Node): Type;
getTypeFromTypeNode(node: TypeNode): Type;
@ -1684,7 +1686,7 @@ declare namespace ts {
reportInaccessibleThisError(): void;
reportPrivateInBaseOfClassExpression(propertyName: string): void;
}
enum TypeFormatFlags {
const enum TypeFormatFlags {
None = 0,
WriteArrayAsGenericType = 1,
UseTypeOfFunction = 4,
@ -1696,18 +1698,18 @@ declare namespace ts {
UseFullyQualifiedType = 256,
InFirstTypeArgument = 512,
InTypeAlias = 1024,
UseTypeAliasValue = 2048,
SuppressAnyReturnType = 4096,
AddUndefined = 8192,
WriteClassExpressionAsTypeLiteral = 16384,
InArrayType = 32768,
UseAliasDefinedOutsideCurrentScope = 65536,
}
enum SymbolFormatFlags {
const enum SymbolFormatFlags {
None = 0,
WriteTypeParametersOrArguments = 1,
UseOnlyExternalAliasing = 2,
}
enum TypePredicateKind {
const enum TypePredicateKind {
This = 0,
Identifier = 1,
}
@ -1724,7 +1726,7 @@ declare namespace ts {
parameterIndex: number;
}
type TypePredicate = IdentifierTypePredicate | ThisTypePredicate;
enum SymbolFlags {
const enum SymbolFlags {
None = 0,
FunctionScopedVariable = 1,
BlockScopedVariable = 2,
@ -1794,7 +1796,7 @@ declare namespace ts {
exports?: SymbolTable;
globalExports?: SymbolTable;
}
enum InternalSymbolName {
const enum InternalSymbolName {
Call = "__call",
Constructor = "__constructor",
New = "__new",
@ -1832,7 +1834,7 @@ declare namespace ts {
clear(): void;
}
type SymbolTable = UnderscoreEscapedMap<Symbol>;
enum TypeFlags {
const enum TypeFlags {
Any = 1,
String = 2,
Number = 4,
@ -1889,7 +1891,7 @@ declare namespace ts {
}
interface EnumType extends Type {
}
enum ObjectFlags {
const enum ObjectFlags {
Class = 1,
Interface = 2,
Reference = 4,
@ -1951,7 +1953,7 @@ declare namespace ts {
interface IndexType extends Type {
type: TypeVariable | UnionOrIntersectionType;
}
enum SignatureKind {
const enum SignatureKind {
Call = 0,
Construct = 1,
}
@ -1960,7 +1962,7 @@ declare namespace ts {
typeParameters?: TypeParameter[];
parameters: Symbol[];
}
enum IndexKind {
const enum IndexKind {
String = 0,
Number = 1,
}
@ -1969,7 +1971,7 @@ declare namespace ts {
isReadonly: boolean;
declaration?: SignatureDeclaration;
}
enum InferencePriority {
const enum InferencePriority {
NakedTypeVariable = 1,
MappedType = 2,
ReturnType = 4,
@ -1982,11 +1984,17 @@ declare namespace ts {
topLevel: boolean;
isFixed: boolean;
}
enum InferenceFlags {
const enum InferenceFlags {
InferUnionTypes = 1,
NoDefault = 2,
AnyDefault = 4,
}
const enum Ternary {
False = 0,
Maybe = 1,
True = -1,
}
type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary;
interface JsFileExtensionInfo {
extension: string;
isMixedContent: boolean;
@ -2073,6 +2081,7 @@ declare namespace ts {
outFile?: string;
paths?: MapLike<string[]>;
preserveConstEnums?: boolean;
preserveSymlinks?: boolean;
project?: string;
reactNamespace?: string;
jsxFactory?: string;
@ -2118,13 +2127,13 @@ declare namespace ts {
ES2015 = 5,
ESNext = 6,
}
enum JsxEmit {
const enum JsxEmit {
None = 0,
Preserve = 1,
React = 2,
ReactNative = 3,
}
enum NewLineKind {
const enum NewLineKind {
CarriageReturnLineFeed = 0,
LineFeed = 1,
}
@ -2132,7 +2141,7 @@ declare namespace ts {
line: number;
character: number;
}
enum ScriptKind {
const enum ScriptKind {
Unknown = 0,
JS = 1,
JSX = 2,
@ -2141,7 +2150,7 @@ declare namespace ts {
External = 5,
JSON = 6,
}
enum ScriptTarget {
const enum ScriptTarget {
ES3 = 0,
ES5 = 1,
ES2015 = 2,
@ -2150,7 +2159,7 @@ declare namespace ts {
ESNext = 5,
Latest = 5,
}
enum LanguageVariant {
const enum LanguageVariant {
Standard = 0,
JSX = 1,
}
@ -2163,7 +2172,7 @@ declare namespace ts {
wildcardDirectories?: MapLike<WatchDirectoryFlags>;
compileOnSave?: boolean;
}
enum WatchDirectoryFlags {
const enum WatchDirectoryFlags {
None = 0,
Recursive = 1,
}
@ -2186,8 +2195,13 @@ declare namespace ts {
}
interface ResolvedModuleFull extends ResolvedModule {
extension: Extension;
packageId?: PackageId;
}
enum Extension {
interface PackageId {
name: string;
version: string;
}
const enum Extension {
Ts = ".ts",
Tsx = ".tsx",
Dts = ".d.ts",
@ -2229,7 +2243,7 @@ declare namespace ts {
text: string;
skipTrivia?: (pos: number) => number;
}
enum EmitFlags {
const enum EmitFlags {
SingleLine = 1,
AdviseOnEmitNode = 2,
NoSubstitution = 4,
@ -2265,7 +2279,7 @@ declare namespace ts {
readonly text: string;
readonly priority?: number;
}
enum EmitHint {
const enum EmitHint {
SourceFile = 0,
Expression = 1,
IdentifierName = 2,
@ -2326,7 +2340,7 @@ declare namespace ts {
}
}
declare namespace ts {
const versionMajorMinor = "2.5";
const versionMajorMinor = "2.6";
const version: string;
}
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
@ -2402,6 +2416,8 @@ declare namespace ts {
function collapseTextChangeRangesAcrossMultipleVersions(changes: ReadonlyArray<TextChangeRange>): TextChangeRange;
function getTypeParameterOwner(d: Declaration): Declaration;
function isParameterPropertyDeclaration(node: Node): boolean;
function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
function isEmptyBindingElement(node: BindingElement): boolean;
function getCombinedModifierFlags(node: Node): ModifierFlags;
function getCombinedNodeFlags(node: Node): NodeFlags;
function validateLocaleAndSetLanguage(locale: string, sys: {
@ -2959,8 +2975,8 @@ declare namespace ts {
function updateDefaultClause(node: DefaultClause, statements: ReadonlyArray<Statement>): DefaultClause;
function createHeritageClause(token: HeritageClause["token"], types: ReadonlyArray<ExpressionWithTypeArguments>): HeritageClause;
function updateHeritageClause(node: HeritageClause, types: ReadonlyArray<ExpressionWithTypeArguments>): HeritageClause;
function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause;
function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause;
function createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause;
function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause;
function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment;
function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment;
function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment;
@ -3197,6 +3213,7 @@ declare namespace ts {
getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion;
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan;
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[];
getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[];
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined;
@ -3288,7 +3305,7 @@ declare namespace ts {
fileName: string;
highlightSpans: HighlightSpan[];
}
enum HighlightSpanKind {
const enum HighlightSpanKind {
none = "none",
definition = "definition",
reference = "reference",
@ -3483,7 +3500,7 @@ declare namespace ts {
outputFiles: OutputFile[];
emitSkipped: boolean;
}
enum OutputFileType {
const enum OutputFileType {
JavaScript = 0,
SourceMap = 1,
Declaration = 2,
@ -3493,7 +3510,7 @@ declare namespace ts {
writeByteOrderMark: boolean;
text: string;
}
enum EndOfLineState {
const enum EndOfLineState {
None = 0,
InMultiLineCommentTrivia = 1,
InSingleQuoteStringLiteral = 2,
@ -3525,7 +3542,7 @@ declare namespace ts {
getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult;
getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
}
enum ScriptElementKind {
const enum ScriptElementKind {
unknown = "",
warning = "warning",
keyword = "keyword",
@ -3560,7 +3577,7 @@ declare namespace ts {
externalModuleName = "external module name",
jsxAttribute = "JSX attribute",
}
enum ScriptElementKindModifier {
const enum ScriptElementKindModifier {
none = "",
publicMemberModifier = "public",
privateMemberModifier = "private",
@ -3570,7 +3587,7 @@ declare namespace ts {
staticModifier = "static",
abstractModifier = "abstract",
}
enum ClassificationTypeNames {
const enum ClassificationTypeNames {
comment = "comment",
identifier = "identifier",
keyword = "keyword",
@ -3595,7 +3612,7 @@ declare namespace ts {
jsxText = "jsx text",
jsxAttributeStringLiteralValue = "jsx attribute string literal value",
}
enum ClassificationType {
const enum ClassificationType {
comment = 1,
identifier = 2,
keyword = 3,
@ -3687,7 +3704,10 @@ declare namespace ts.server {
error: undefined;
} | {
module: undefined;
error: {};
error: {
stack?: string;
message?: string;
};
};
interface ServerHost extends System {
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
@ -3770,6 +3790,7 @@ declare namespace ts.server {
const LogFile = "--logFile";
const EnableTelemetry = "--enableTelemetry";
const TypingSafeListLocation = "--typingSafeListLocation";
const TypesMapLocation = "--typesMapLocation";
const NpmLocation = "--npmLocation";
}
function hasArgument(argumentName: string): boolean;
@ -3838,9 +3859,6 @@ declare namespace ts.server {
function isInferredProjectName(name: string): boolean;
function makeInferredProjectName(counter: number): string;
function createSortedArray<T>(): SortedArray<T>;
function toSortedArray(arr: string[]): SortedArray<string>;
function toSortedArray<T>(arr: T[], comparer: Comparer<T>): SortedArray<T>;
function enumerateInsertsAndDeletes<T>(newItems: SortedReadonlyArray<T>, oldItems: SortedReadonlyArray<T>, inserted: (newItem: T) => void, deleted: (oldItem: T) => void, compare?: Comparer<T>): void;
class ThrottledOperations {
private readonly host;
private pendingTimeouts;
@ -3857,13 +3875,12 @@ declare namespace ts.server {
scheduleCollect(): void;
private static run(self);
}
function insertSorted<T>(array: SortedArray<T>, insert: T, compare: Comparer<T>): void;
function removeSorted<T>(array: SortedArray<T>, remove: T, compare: Comparer<T>): void;
}
declare namespace ts.server.protocol {
enum CommandTypes {
const enum CommandTypes {
Brace = "brace",
BraceCompletion = "braceCompletion",
GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
Change = "change",
Close = "close",
Completions = "completions",
@ -3951,6 +3968,13 @@ declare namespace ts.server.protocol {
interface TodoCommentsResponse extends Response {
body?: TodoComment[];
}
interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
command: CommandTypes.GetSpanOfEnclosingComment;
arguments: SpanOfEnclosingCommentRequestArgs;
}
interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
onlyMultiLine: boolean;
}
interface IndentationRequest extends FileLocationRequest {
command: CommandTypes.Indentation;
arguments: IndentationRequestArgs;
@ -4168,7 +4192,7 @@ declare namespace ts.server.protocol {
}
interface RenameResponseBody {
info: RenameInfo;
locs: SpanGroup[];
locs: ReadonlyArray<SpanGroup>;
}
interface RenameResponse extends Response {
body?: RenameResponseBody;
@ -4248,6 +4272,7 @@ declare namespace ts.server.protocol {
}
interface SetCompilerOptionsForInferredProjectsArgs {
options: ExternalProjectCompilerOptions;
projectRootPath?: string;
}
interface SetCompilerOptionsForInferredProjectsResponse extends Response {
}
@ -4603,7 +4628,7 @@ declare namespace ts.server.protocol {
interface NavTreeResponse extends Response {
body?: NavigationTree;
}
enum IndentStyle {
const enum IndentStyle {
None = "None",
Block = "Block",
Smart = "Smart",
@ -4681,6 +4706,7 @@ declare namespace ts.server.protocol {
paths?: MapLike<string[]>;
plugins?: PluginImport[];
preserveConstEnums?: boolean;
preserveSymlinks?: boolean;
project?: string;
reactNamespace?: string;
removeComments?: boolean;
@ -4700,13 +4726,13 @@ declare namespace ts.server.protocol {
typeRoots?: string[];
[option: string]: CompilerOptionsValue | undefined;
}
enum JsxEmit {
const enum JsxEmit {
None = "None",
Preserve = "Preserve",
ReactNative = "ReactNative",
React = "React",
}
enum ModuleKind {
const enum ModuleKind {
None = "None",
CommonJS = "CommonJS",
AMD = "AMD",
@ -4714,20 +4740,24 @@ declare namespace ts.server.protocol {
System = "System",
ES6 = "ES6",
ES2015 = "ES2015",
ESNext = "ESNext",
}
enum ModuleResolutionKind {
const enum ModuleResolutionKind {
Classic = "Classic",
Node = "Node",
}
enum NewLineKind {
const enum NewLineKind {
Crlf = "Crlf",
Lf = "Lf",
}
enum ScriptTarget {
const enum ScriptTarget {
ES3 = "ES3",
ES5 = "ES5",
ES6 = "ES6",
ES2015 = "ES2015",
ES2016 = "ES2016",
ES2017 = "ES2017",
ESNext = "ESNext",
}
}
declare namespace ts.server {
@ -4750,6 +4780,7 @@ declare namespace ts.server {
host: ServerHost;
cancellationToken: ServerCancellationToken;
useSingleInferredProject: boolean;
useInferredProjectPerProjectRoot: boolean;
typingsInstaller: ITypingsInstaller;
byteLength: (buf: string, encoding?: string) => number;
hrtime: (start?: number[]) => number[];
@ -4757,8 +4788,8 @@ declare namespace ts.server {
canUseEvents: boolean;
eventHandler?: ProjectServiceEventHandler;
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
globalPlugins?: ReadonlyArray<string>;
pluginProbeLocations?: ReadonlyArray<string>;
allowLocalPluginLoads?: boolean;
}
class Session implements EventSender {
@ -4780,13 +4811,13 @@ declare namespace ts.server {
private defaultEventHandler(event);
logError(err: Error, cmd: string): void;
send(msg: protocol.Message): void;
configFileDiagnosticEvent(triggerFile: string, configFile: string, diagnostics: Diagnostic[]): void;
configFileDiagnosticEvent(triggerFile: string, configFile: string, diagnostics: ReadonlyArray<Diagnostic>): void;
event<T>(info: T, eventName: string): void;
output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
private semanticCheck(file, project);
private syntacticCheck(file, project);
private updateProjectStructure(seq, matchSeq, ms?);
private updateErrorCheck(next, checkList, seq, matchSeq, ms?, followMs?, requireOpen?);
private updateProjectStructure();
private updateErrorCheck(next, checkList, ms, requireOpen?);
private cleanProjects(caption, projects);
private cleanup();
private getEncodedSemanticClassifications(args);
@ -4820,6 +4851,7 @@ declare namespace ts.server {
private getOutliningSpans(args);
private getTodoComments(args);
private getDocCommentTemplate(args);
private getSpanOfEnclosingComment(args);
private getIndentation(args);
private getBreakpointStatement(args);
private getNameOrDottedNameSpan(args);
@ -4878,38 +4910,10 @@ declare namespace ts.server {
}
}
declare namespace ts.server {
interface LineCollection {
charCount(): number;
lineCount(): number;
isLeaf(): this is LineLeaf;
walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void;
}
interface AbsolutePositionAndLineText {
absolutePosition: number;
lineText: string | undefined;
}
enum CharRangeSection {
PreStart = 0,
Start = 1,
Entire = 2,
Mid = 3,
End = 4,
PostEnd = 5,
}
interface ILineIndexWalker {
goSubtree: boolean;
done: boolean;
leaf(relativeStart: number, relativeLength: number, lineCollection: LineLeaf): void;
pre?(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineNode, nodeType: CharRangeSection): void;
post?(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineNode, nodeType: CharRangeSection): void;
}
class TextChange {
pos: number;
deleteLen: number;
insertedText: string;
constructor(pos: number, deleteLen: number, insertedText?: string);
getTextChangeRange(): TextChangeRange;
}
class ScriptVersionCache {
private changes;
private readonly versions;
@ -4921,79 +4925,17 @@ declare namespace ts.server {
private versionToIndex(version);
private currentVersionToIndex();
edit(pos: number, deleteLen: number, insertedText?: string): void;
latest(): LineIndexSnapshot;
latestVersion(): number;
reload(script: string): void;
getSnapshot(): LineIndexSnapshot;
getSnapshot(): IScriptSnapshot;
private _getSnapshot();
getSnapshotVersion(): number;
getLineInfo(line: number): AbsolutePositionAndLineText;
lineOffsetToPosition(line: number, column: number): number;
positionToLineOffset(position: number): protocol.Location;
lineToTextSpan(line: number): TextSpan;
getTextChangesBetweenVersions(oldVersion: number, newVersion: number): TextChangeRange;
static fromString(script: string): ScriptVersionCache;
}
class LineIndexSnapshot implements IScriptSnapshot {
readonly version: number;
readonly cache: ScriptVersionCache;
readonly index: LineIndex;
readonly changesSincePreviousVersion: ReadonlyArray<TextChange>;
constructor(version: number, cache: ScriptVersionCache, index: LineIndex, changesSincePreviousVersion?: ReadonlyArray<TextChange>);
getText(rangeStart: number, rangeEnd: number): string;
getLength(): number;
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
}
class LineIndex {
root: LineNode;
checkEdits: boolean;
absolutePositionOfStartOfLine(oneBasedLine: number): number;
positionToLineOffset(position: number): protocol.Location;
private positionToColumnAndLineText(position);
lineNumberToInfo(oneBasedLine: number): AbsolutePositionAndLineText;
load(lines: string[]): void;
walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void;
getText(rangeStart: number, rangeLength: number): string;
getLength(): number;
every(f: (ll: LineLeaf, s: number, len: number) => boolean, rangeStart: number, rangeEnd?: number): boolean;
edit(pos: number, deleteLength: number, newText?: string): LineIndex;
private static buildTreeFromBottom(nodes);
static linesFromText(text: string): {
lines: string[];
lineMap: number[];
};
}
class LineNode implements LineCollection {
private readonly children;
totalChars: number;
totalLines: number;
constructor(children?: LineCollection[]);
isLeaf(): boolean;
updateCounts(): void;
private execWalk(rangeStart, rangeLength, walkFns, childIndex, nodeType);
private skipChild(relativeStart, relativeLength, childIndex, walkFns, nodeType);
walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void;
charOffsetToLineInfo(lineNumberAccumulator: number, relativePosition: number): {
oneBasedLine: number;
zeroBasedColumn: number;
lineText: string | undefined;
};
lineNumberToInfo(relativeOneBasedLine: number, positionAccumulator: number): {
position: number;
leaf: LineLeaf | undefined;
};
private childFromLineNumber(relativeOneBasedLine, positionAccumulator);
private childFromCharOffset(lineNumberAccumulator, relativePosition);
private splitAfter(childIndex);
remove(child: LineCollection): void;
private findChildIndex(child);
insertAt(child: LineCollection, nodes: LineCollection[]): LineNode[];
add(collection: LineCollection): void;
charCount(): number;
lineCount(): number;
}
class LineLeaf implements LineCollection {
text: string;
constructor(text: string);
isLeaf(): boolean;
walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void;
charCount(): number;
lineCount(): number;
}
}
declare namespace ts.server {
class ScriptInfo {
@ -5174,7 +5116,7 @@ declare namespace ts.server {
private projectStructureVersion;
private projectStateVersion;
private typingFiles;
protected projectErrors: Diagnostic[];
protected projectErrors: ReadonlyArray<Diagnostic>;
typesVersion: number;
isNonTsProject(): boolean;
isJsOnlyProject(): boolean;
@ -5182,8 +5124,8 @@ declare namespace ts.server {
static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {};
constructor(projectName: string, projectKind: ProjectKind, projectService: ProjectService, documentRegistry: DocumentRegistry, hasExplicitListOfFiles: boolean, languageServiceEnabled: boolean, compilerOptions: CompilerOptions, compileOnSaveEnabled: boolean);
private setInternalCompilerOptionsForEmittingJsFiles();
getGlobalProjectErrors(): Diagnostic[];
getAllProjectErrors(): Diagnostic[];
getGlobalProjectErrors(): ReadonlyArray<Diagnostic>;
getAllProjectErrors(): ReadonlyArray<Diagnostic>;
getLanguageService(ensureSynchronized?: boolean): LanguageService;
getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[];
getProjectVersion(): string;
@ -5203,6 +5145,7 @@ declare namespace ts.server {
getRootScriptInfos(): ScriptInfo[];
getScriptInfos(): ScriptInfo[];
getFileEmitOutput(info: ScriptInfo, emitOnlyDtsFiles: boolean): EmitOutput;
getExcludedFiles(): ReadonlyArray<NormalizedPath>;
getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): NormalizedPath[];
hasConfigFile(configFilePath: NormalizedPath): boolean;
getAllEmittableFiles(): string[];
@ -5228,12 +5171,13 @@ declare namespace ts.server {
protected removeRoot(info: ScriptInfo): void;
}
class InferredProject extends Project {
readonly projectRootPath: string | undefined;
private static readonly newName;
private _isJsInferredProject;
toggleJsInferredProject(isJsInferredProject: boolean): void;
setCompilerOptions(options?: CompilerOptions): void;
directoriesWatchedForTsconfig: string[];
constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions);
constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, projectRootPath?: string);
addRoot(info: ScriptInfo): void;
removeRoot(info: ScriptInfo): void;
getProjectRootPath(): string;
@ -5257,7 +5201,7 @@ declare namespace ts.server {
private enablePlugin(pluginConfigEntry, searchPaths);
private enableProxy(pluginModuleFactory, configEntry);
getProjectRootPath(): string;
setProjectErrors(projectErrors: Diagnostic[]): void;
setProjectErrors(projectErrors: ReadonlyArray<Diagnostic>): void;
setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void;
getTypeAcquisition(): TypeAcquisition;
getExternalFiles(): SortedReadonlyArray<string>;
@ -5275,11 +5219,13 @@ declare namespace ts.server {
externalProjectName: string;
compileOnSaveEnabled: boolean;
private readonly projectFilePath;
excludedFiles: ReadonlyArray<NormalizedPath>;
private typeAcquisition;
constructor(externalProjectName: string, projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, languageServiceEnabled: boolean, compileOnSaveEnabled: boolean, projectFilePath?: string);
getExcludedFiles(): ReadonlyArray<NormalizedPath>;
getProjectRootPath(): string;
getTypeAcquisition(): TypeAcquisition;
setProjectErrors(projectErrors: Diagnostic[]): void;
setProjectErrors(projectErrors: ReadonlyArray<Diagnostic>): void;
setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void;
}
}
@ -5301,7 +5247,7 @@ declare namespace ts.server {
data: {
triggerFile: string;
configFileName: string;
diagnostics: Diagnostic[];
diagnostics: ReadonlyArray<Diagnostic>;
};
}
interface ProjectLanguageServiceStateEvent {
@ -5353,11 +5299,15 @@ declare namespace ts.server {
types?: string[];
};
}
interface TypesMapFile {
typesMap: SafeList;
simpleMap: string[];
}
function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings;
function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin;
function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind;
function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX;
function combineProjectOutput<T>(projects: Project[], action: (project: Project) => T[], comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean): T[];
function combineProjectOutput<T>(projects: ReadonlyArray<Project>, action: (project: Project) => ReadonlyArray<T>, comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean): T[];
interface HostConfiguration {
formatCodeOptions: FormatCodeSettings;
hostInfo: string;
@ -5365,19 +5315,21 @@ declare namespace ts.server {
}
interface OpenConfiguredProjectResult {
configFileName?: NormalizedPath;
configFileErrors?: Diagnostic[];
configFileErrors?: ReadonlyArray<Diagnostic>;
}
interface ProjectServiceOptions {
host: ServerHost;
logger: Logger;
cancellationToken: HostCancellationToken;
useSingleInferredProject: boolean;
useInferredProjectPerProjectRoot: boolean;
typingsInstaller: ITypingsInstaller;
eventHandler?: ProjectServiceEventHandler;
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
globalPlugins?: ReadonlyArray<string>;
pluginProbeLocations?: ReadonlyArray<string>;
allowLocalPluginLoads?: boolean;
typesMapLocation?: string;
}
class ProjectService {
readonly typingsCache: TypingsCache;
@ -5389,7 +5341,7 @@ declare namespace ts.server {
readonly configuredProjects: ConfiguredProject[];
readonly openFiles: ScriptInfo[];
private compilerOptionsForInferredProjects;
private compileOnSaveForInferredProjects;
private compilerOptionsForInferredProjectsPerProjectRoot;
private readonly projectToSizeMap;
private readonly directoryWatchers;
private readonly throttledOperations;
@ -5402,19 +5354,22 @@ declare namespace ts.server {
readonly logger: Logger;
readonly cancellationToken: HostCancellationToken;
readonly useSingleInferredProject: boolean;
readonly useInferredProjectPerProjectRoot: boolean;
readonly typingsInstaller: ITypingsInstaller;
readonly throttleWaitMilliseconds?: number;
private readonly eventHandler?;
readonly globalPlugins: ReadonlyArray<string>;
readonly pluginProbeLocations: ReadonlyArray<string>;
readonly allowLocalPluginLoads: boolean;
readonly typesMapLocation: string | undefined;
private readonly seenProjects;
constructor(opts: ProjectServiceOptions);
ensureInferredProjectsUpToDate_TestOnly(): void;
getCompilerOptionsForInferredProjects(): CompilerOptions;
onUpdateLanguageServiceStateForProject(project: Project, languageServiceEnabled: boolean): void;
private loadTypesMap();
updateTypingsForProject(response: SetTypings | InvalidateCachedTypings): void;
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions): void;
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions, projectRootPath?: string): void;
stopWatchingDirectory(directory: string): void;
findProject(projectName: string): Project;
getDefaultProjectForFile(fileName: NormalizedPath, refreshInferredProjects: boolean): Project;
@ -5431,7 +5386,7 @@ declare namespace ts.server {
private onConfigFileAddedForInferredProject(fileName);
private getCanonicalFileName(fileName);
private removeProject(project);
private assignScriptInfoToInferredProjectIfNecessary(info, addToListOfOpenFiles);
private assignScriptInfoToInferredProjectIfNecessary(info, addToListOfOpenFiles, projectRootPath?);
private closeOpenFile(info);
private deleteOrphanScriptInfoNotInAnyProject();
private openOrUpdateConfiguredProjectForFile(fileName, projectRootPath?);
@ -5450,7 +5405,10 @@ declare namespace ts.server {
private openConfigFile(configFileName, clientFileName?);
private updateNonInferredProject<T>(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, configFileErrors);
private updateConfiguredProject(project);
createInferredProjectWithRootFileIfNecessary(root: ScriptInfo): InferredProject;
private getOrCreateInferredProjectForProjectRootPathIfEnabled(root, projectRootPath);
private getOrCreateSingleInferredProjectIfEnabled();
private createInferredProject(isSingleInferredProject?, projectRootPath?);
createInferredProjectWithRootFileIfNecessary(root: ScriptInfo, projectRootPath?: string): InferredProject;
getOrCreateScriptInfo(uncheckedFileName: string, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind): ScriptInfo;
getScriptInfo(uncheckedFileName: string): ScriptInfo;
watchClosedScriptInfo(info: ScriptInfo): void;
@ -5471,8 +5429,7 @@ declare namespace ts.server {
private static readonly filenameEscapeRegexp;
private static escapeFilenameForRegex(filename);
resetSafeList(): void;
loadSafeList(fileName: string): void;
applySafeList(proj: protocol.ExternalProject): void;
applySafeList(proj: protocol.ExternalProject): NormalizedPath[];
openExternalProject(proj: protocol.ExternalProject, suppressRefreshOfInferredProjects?: boolean): void;
}
}

File diff suppressed because it is too large Load diff

85
lib/typescript.d.ts vendored
View file

@ -1210,7 +1210,7 @@ declare namespace ts {
interface CatchClause extends Node {
kind: SyntaxKind.CatchClause;
parent?: TryStatement;
variableDeclaration: VariableDeclaration;
variableDeclaration?: VariableDeclaration;
block: Block;
}
type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
@ -1496,38 +1496,39 @@ declare namespace ts {
interface FlowLock {
locked?: boolean;
}
interface AfterFinallyFlow extends FlowNode, FlowLock {
interface AfterFinallyFlow extends FlowNodeBase, FlowLock {
antecedent: FlowNode;
}
interface PreFinallyFlow extends FlowNode {
interface PreFinallyFlow extends FlowNodeBase {
antecedent: FlowNode;
lock: FlowLock;
}
interface FlowNode {
type FlowNode = AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation;
interface FlowNodeBase {
flags: FlowFlags;
id?: number;
}
interface FlowStart extends FlowNode {
interface FlowStart extends FlowNodeBase {
container?: FunctionExpression | ArrowFunction | MethodDeclaration;
}
interface FlowLabel extends FlowNode {
interface FlowLabel extends FlowNodeBase {
antecedents: FlowNode[];
}
interface FlowAssignment extends FlowNode {
interface FlowAssignment extends FlowNodeBase {
node: Expression | VariableDeclaration | BindingElement;
antecedent: FlowNode;
}
interface FlowCondition extends FlowNode {
interface FlowCondition extends FlowNodeBase {
expression: Expression;
antecedent: FlowNode;
}
interface FlowSwitchClause extends FlowNode {
interface FlowSwitchClause extends FlowNodeBase {
switchStatement: SwitchStatement;
clauseStart: number;
clauseEnd: number;
antecedent: FlowNode;
}
interface FlowArrayMutation extends FlowNode {
interface FlowArrayMutation extends FlowNodeBase {
node: CallExpression | BinaryExpression;
antecedent: FlowNode;
}
@ -1696,6 +1697,15 @@ declare namespace ts {
getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined;
getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined;
/**
* If a symbol is a local symbol with an associated exported symbol, returns the exported symbol.
* Otherwise returns its input.
* For example, at `export type T = number;`:
* - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`.
* - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol.
* - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol.
*/
getExportSymbolOfSymbol(symbol: Symbol): Symbol;
getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined;
getTypeAtLocation(node: Node): Type;
getTypeFromTypeNode(node: TypeNode): Type;
@ -1790,11 +1800,11 @@ declare namespace ts {
UseFullyQualifiedType = 256,
InFirstTypeArgument = 512,
InTypeAlias = 1024,
UseTypeAliasValue = 2048,
SuppressAnyReturnType = 4096,
AddUndefined = 8192,
WriteClassExpressionAsTypeLiteral = 16384,
InArrayType = 32768,
UseAliasDefinedOutsideCurrentScope = 65536,
}
enum SymbolFormatFlags {
None = 0,
@ -2056,6 +2066,7 @@ declare namespace ts {
interface TypeVariable extends Type {
}
interface TypeParameter extends TypeVariable {
/** Retrieve using getConstraintFromTypeParameter */
constraint: Type;
default?: Type;
}
@ -2103,6 +2114,21 @@ declare namespace ts {
NoDefault = 2,
AnyDefault = 4,
}
/**
* Ternary values are defined such that
* x & y is False if either x or y is False.
* x & y is Maybe if either x or y is Maybe, but neither x or y is False.
* x & y is True if both x and y are True.
* x | y is False if both x and y are False.
* x | y is Maybe if either x or y is Maybe, but neither x or y is True.
* x | y is True if either x or y is True.
*/
enum Ternary {
False = 0,
Maybe = 1,
True = -1,
}
type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary;
interface JsFileExtensionInfo {
extension: string;
isMixedContent: boolean;
@ -2195,6 +2221,7 @@ declare namespace ts {
outFile?: string;
paths?: MapLike<string[]>;
preserveConstEnums?: boolean;
preserveSymlinks?: boolean;
project?: string;
reactNamespace?: string;
jsxFactory?: string;
@ -2300,6 +2327,10 @@ declare namespace ts {
readFile(fileName: string): string | undefined;
trace?(s: string): void;
directoryExists?(directoryName: string): boolean;
/**
* Resolve a symbolic link.
* @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options
*/
realpath?(path: string): string;
getCurrentDirectory?(): string;
getDirectories?(path: string): string[];
@ -2314,17 +2345,13 @@ declare namespace ts {
interface ResolvedModule {
/** Path of the file the module was resolved to. */
resolvedFileName: string;
/**
* Denotes if 'resolvedFileName' is isExternalLibraryImport and thus should be a proper external module:
* - be a .d.ts file
* - use top level imports\exports
* - don't use tripleslash references
*/
/** True if `resolvedFileName` comes from `node_modules`. */
isExternalLibraryImport?: boolean;
}
/**
* ResolvedModule with an explicitly provided `extension` property.
* Prefer this over `ResolvedModule`.
* If changing this, remember to change `moduleResolutionIsEqualTo`.
*/
interface ResolvedModuleFull extends ResolvedModule {
/**
@ -2332,6 +2359,21 @@ declare namespace ts {
* This is optional for backwards-compatibility, but will be added if not provided.
*/
extension: Extension;
packageId?: PackageId;
}
/**
* Unique identifier with a package name and version.
* If changing this, remember to change `packageIdIsEqual`.
*/
interface PackageId {
/**
* Name of the package.
* Should not include `@types`.
* If accessing a non-index file, this should include its name e.g. "foo/bar".
*/
name: string;
/** Version of the package, e.g. "1.2.3" */
version: string;
}
enum Extension {
Ts = ".ts",
@ -2593,7 +2635,7 @@ declare namespace ts {
}
}
declare namespace ts {
const versionMajorMinor = "2.5";
const versionMajorMinor = "2.6";
/** The version of the TypeScript compiler release */
const version: string;
}
@ -2741,6 +2783,8 @@ declare namespace ts {
function collapseTextChangeRangesAcrossMultipleVersions(changes: ReadonlyArray<TextChangeRange>): TextChangeRange;
function getTypeParameterOwner(d: Declaration): Declaration;
function isParameterPropertyDeclaration(node: Node): boolean;
function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
function isEmptyBindingElement(node: BindingElement): boolean;
function getCombinedModifierFlags(node: Node): ModifierFlags;
function getCombinedNodeFlags(node: Node): NodeFlags;
/**
@ -3310,8 +3354,8 @@ declare namespace ts {
function updateDefaultClause(node: DefaultClause, statements: ReadonlyArray<Statement>): DefaultClause;
function createHeritageClause(token: HeritageClause["token"], types: ReadonlyArray<ExpressionWithTypeArguments>): HeritageClause;
function updateHeritageClause(node: HeritageClause, types: ReadonlyArray<ExpressionWithTypeArguments>): HeritageClause;
function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause;
function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause;
function createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause;
function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause;
function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment;
function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment;
function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment;
@ -3773,6 +3817,7 @@ declare namespace ts {
getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion;
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan;
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[];
getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[];
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined;

File diff suppressed because it is too large Load diff

View file

@ -1210,7 +1210,7 @@ declare namespace ts {
interface CatchClause extends Node {
kind: SyntaxKind.CatchClause;
parent?: TryStatement;
variableDeclaration: VariableDeclaration;
variableDeclaration?: VariableDeclaration;
block: Block;
}
type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
@ -1496,38 +1496,39 @@ declare namespace ts {
interface FlowLock {
locked?: boolean;
}
interface AfterFinallyFlow extends FlowNode, FlowLock {
interface AfterFinallyFlow extends FlowNodeBase, FlowLock {
antecedent: FlowNode;
}
interface PreFinallyFlow extends FlowNode {
interface PreFinallyFlow extends FlowNodeBase {
antecedent: FlowNode;
lock: FlowLock;
}
interface FlowNode {
type FlowNode = AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation;
interface FlowNodeBase {
flags: FlowFlags;
id?: number;
}
interface FlowStart extends FlowNode {
interface FlowStart extends FlowNodeBase {
container?: FunctionExpression | ArrowFunction | MethodDeclaration;
}
interface FlowLabel extends FlowNode {
interface FlowLabel extends FlowNodeBase {
antecedents: FlowNode[];
}
interface FlowAssignment extends FlowNode {
interface FlowAssignment extends FlowNodeBase {
node: Expression | VariableDeclaration | BindingElement;
antecedent: FlowNode;
}
interface FlowCondition extends FlowNode {
interface FlowCondition extends FlowNodeBase {
expression: Expression;
antecedent: FlowNode;
}
interface FlowSwitchClause extends FlowNode {
interface FlowSwitchClause extends FlowNodeBase {
switchStatement: SwitchStatement;
clauseStart: number;
clauseEnd: number;
antecedent: FlowNode;
}
interface FlowArrayMutation extends FlowNode {
interface FlowArrayMutation extends FlowNodeBase {
node: CallExpression | BinaryExpression;
antecedent: FlowNode;
}
@ -1696,6 +1697,15 @@ declare namespace ts {
getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined;
getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined;
/**
* If a symbol is a local symbol with an associated exported symbol, returns the exported symbol.
* Otherwise returns its input.
* For example, at `export type T = number;`:
* - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`.
* - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol.
* - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol.
*/
getExportSymbolOfSymbol(symbol: Symbol): Symbol;
getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined;
getTypeAtLocation(node: Node): Type;
getTypeFromTypeNode(node: TypeNode): Type;
@ -1790,11 +1800,11 @@ declare namespace ts {
UseFullyQualifiedType = 256,
InFirstTypeArgument = 512,
InTypeAlias = 1024,
UseTypeAliasValue = 2048,
SuppressAnyReturnType = 4096,
AddUndefined = 8192,
WriteClassExpressionAsTypeLiteral = 16384,
InArrayType = 32768,
UseAliasDefinedOutsideCurrentScope = 65536,
}
enum SymbolFormatFlags {
None = 0,
@ -2056,6 +2066,7 @@ declare namespace ts {
interface TypeVariable extends Type {
}
interface TypeParameter extends TypeVariable {
/** Retrieve using getConstraintFromTypeParameter */
constraint: Type;
default?: Type;
}
@ -2103,6 +2114,21 @@ declare namespace ts {
NoDefault = 2,
AnyDefault = 4,
}
/**
* Ternary values are defined such that
* x & y is False if either x or y is False.
* x & y is Maybe if either x or y is Maybe, but neither x or y is False.
* x & y is True if both x and y are True.
* x | y is False if both x and y are False.
* x | y is Maybe if either x or y is Maybe, but neither x or y is True.
* x | y is True if either x or y is True.
*/
enum Ternary {
False = 0,
Maybe = 1,
True = -1,
}
type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary;
interface JsFileExtensionInfo {
extension: string;
isMixedContent: boolean;
@ -2195,6 +2221,7 @@ declare namespace ts {
outFile?: string;
paths?: MapLike<string[]>;
preserveConstEnums?: boolean;
preserveSymlinks?: boolean;
project?: string;
reactNamespace?: string;
jsxFactory?: string;
@ -2300,6 +2327,10 @@ declare namespace ts {
readFile(fileName: string): string | undefined;
trace?(s: string): void;
directoryExists?(directoryName: string): boolean;
/**
* Resolve a symbolic link.
* @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options
*/
realpath?(path: string): string;
getCurrentDirectory?(): string;
getDirectories?(path: string): string[];
@ -2314,17 +2345,13 @@ declare namespace ts {
interface ResolvedModule {
/** Path of the file the module was resolved to. */
resolvedFileName: string;
/**
* Denotes if 'resolvedFileName' is isExternalLibraryImport and thus should be a proper external module:
* - be a .d.ts file
* - use top level imports\exports
* - don't use tripleslash references
*/
/** True if `resolvedFileName` comes from `node_modules`. */
isExternalLibraryImport?: boolean;
}
/**
* ResolvedModule with an explicitly provided `extension` property.
* Prefer this over `ResolvedModule`.
* If changing this, remember to change `moduleResolutionIsEqualTo`.
*/
interface ResolvedModuleFull extends ResolvedModule {
/**
@ -2332,6 +2359,21 @@ declare namespace ts {
* This is optional for backwards-compatibility, but will be added if not provided.
*/
extension: Extension;
packageId?: PackageId;
}
/**
* Unique identifier with a package name and version.
* If changing this, remember to change `packageIdIsEqual`.
*/
interface PackageId {
/**
* Name of the package.
* Should not include `@types`.
* If accessing a non-index file, this should include its name e.g. "foo/bar".
*/
name: string;
/** Version of the package, e.g. "1.2.3" */
version: string;
}
enum Extension {
Ts = ".ts",
@ -2593,7 +2635,7 @@ declare namespace ts {
}
}
declare namespace ts {
const versionMajorMinor = "2.5";
const versionMajorMinor = "2.6";
/** The version of the TypeScript compiler release */
const version: string;
}
@ -2741,6 +2783,8 @@ declare namespace ts {
function collapseTextChangeRangesAcrossMultipleVersions(changes: ReadonlyArray<TextChangeRange>): TextChangeRange;
function getTypeParameterOwner(d: Declaration): Declaration;
function isParameterPropertyDeclaration(node: Node): boolean;
function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
function isEmptyBindingElement(node: BindingElement): boolean;
function getCombinedModifierFlags(node: Node): ModifierFlags;
function getCombinedNodeFlags(node: Node): NodeFlags;
/**
@ -3310,8 +3354,8 @@ declare namespace ts {
function updateDefaultClause(node: DefaultClause, statements: ReadonlyArray<Statement>): DefaultClause;
function createHeritageClause(token: HeritageClause["token"], types: ReadonlyArray<ExpressionWithTypeArguments>): HeritageClause;
function updateHeritageClause(node: HeritageClause, types: ReadonlyArray<ExpressionWithTypeArguments>): HeritageClause;
function createCatchClause(variableDeclaration: string | VariableDeclaration, block: Block): CatchClause;
function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration, block: Block): CatchClause;
function createCatchClause(variableDeclaration: string | VariableDeclaration | undefined, block: Block): CatchClause;
function updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause;
function createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment;
function updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment;
function createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment;
@ -3773,6 +3817,7 @@ declare namespace ts {
getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion;
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan;
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[];
getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[];
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff