chen-typescript
Version:
TypeScript is a language for application scale JavaScript development
1,511 lines • 395 kB
TypeScript
/// <reference path="../../src/server/types.d.ts" />
/// <reference types="node" />
declare namespace ts.server.protocol {
namespace CommandTypes {
type Brace = "brace";
type BraceFull = "brace-full";
type BraceCompletion = "braceCompletion";
type Change = "change";
type Close = "close";
type Completions = "completions";
type CompletionsFull = "completions-full";
type CompletionDetails = "completionEntryDetails";
type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList";
type CompileOnSaveEmitFile = "compileOnSaveEmitFile";
type Configure = "configure";
type Definition = "definition";
type DefinitionFull = "definition-full";
type Exit = "exit";
type Format = "format";
type Formatonkey = "formatonkey";
type FormatFull = "format-full";
type FormatonkeyFull = "formatonkey-full";
type FormatRangeFull = "formatRange-full";
type Geterr = "geterr";
type GeterrForProject = "geterrForProject";
type SemanticDiagnosticsSync = "semanticDiagnosticsSync";
type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync";
type NavBar = "navbar";
type NavBarFull = "navbar-full";
type Navto = "navto";
type NavtoFull = "navto-full";
type NavTree = "navtree";
type NavTreeFull = "navtree-full";
type Occurrences = "occurrences";
type DocumentHighlights = "documentHighlights";
type DocumentHighlightsFull = "documentHighlights-full";
type Open = "open";
type Quickinfo = "quickinfo";
type QuickinfoFull = "quickinfo-full";
type References = "references";
type ReferencesFull = "references-full";
type Reload = "reload";
type Rename = "rename";
type RenameInfoFull = "rename-full";
type RenameLocationsFull = "renameLocations-full";
type Saveto = "saveto";
type SignatureHelp = "signatureHelp";
type SignatureHelpFull = "signatureHelp-full";
type TypeDefinition = "typeDefinition";
type ProjectInfo = "projectInfo";
type ReloadProjects = "reloadProjects";
type Unknown = "unknown";
type OpenExternalProject = "openExternalProject";
type OpenExternalProjects = "openExternalProjects";
type CloseExternalProject = "closeExternalProject";
type SynchronizeProjectList = "synchronizeProjectList";
type ApplyChangedToOpenFiles = "applyChangedToOpenFiles";
type EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full";
type Cleanup = "cleanup";
type OutliningSpans = "outliningSpans";
type TodoComments = "todoComments";
type Indentation = "indentation";
type DocCommentTemplate = "docCommentTemplate";
type CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full";
type NameOrDottedNameSpan = "nameOrDottedNameSpan";
type BreakpointStatement = "breakpointStatement";
type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects";
}
interface Message {
seq: number;
type: "request" | "response" | "event";
}
interface Request extends Message {
command: string;
arguments?: any;
}
interface ReloadProjectsRequest extends Message {
command: CommandTypes.ReloadProjects;
}
interface Event extends Message {
event: string;
body?: any;
}
interface Response extends Message {
request_seq: number;
success: boolean;
command: string;
message?: string;
body?: any;
}
interface FileRequestArgs {
file: string;
projectFileName?: string;
}
interface DocCommentTemplateRequest extends FileLocationRequest {
command: CommandTypes.DocCommentTemplate;
}
interface DocCommandTemplateResponse extends Response {
body?: TextInsertion;
}
interface TodoCommentRequest extends FileRequest {
command: CommandTypes.TodoComments;
arguments: TodoCommentRequestArgs;
}
interface TodoCommentRequestArgs extends FileRequestArgs {
descriptors: TodoCommentDescriptor[];
}
interface TodoCommentsResponse extends Response {
body?: TodoComment[];
}
interface OutliningSpansRequest extends FileRequest {
command: CommandTypes.OutliningSpans;
}
interface OutliningSpansResponse extends Response {
body?: OutliningSpan[];
}
interface IndentationRequest extends FileLocationRequest {
command: CommandTypes.Indentation;
arguments: IndentationRequestArgs;
}
interface IndentationResponse extends Response {
body?: IndentationResult;
}
interface IndentationResult {
position: number;
indentation: number;
}
interface IndentationRequestArgs extends FileLocationRequestArgs {
options?: EditorSettings;
}
interface ProjectInfoRequestArgs extends FileRequestArgs {
needFileNameList: boolean;
}
interface ProjectInfoRequest extends Request {
command: CommandTypes.ProjectInfo;
arguments: ProjectInfoRequestArgs;
}
interface CompilerOptionsDiagnosticsRequest extends Request {
arguments: CompilerOptionsDiagnosticsRequestArgs;
}
interface CompilerOptionsDiagnosticsRequestArgs {
projectFileName: string;
}
interface ProjectInfo {
configFileName: string;
fileNames?: string[];
languageServiceDisabled?: boolean;
}
interface DiagnosticWithLinePosition {
message: string;
start: number;
length: number;
startLocation: Location;
endLocation: Location;
category: string;
code: number;
}
interface ProjectInfoResponse extends Response {
body?: ProjectInfo;
}
interface FileRequest extends Request {
arguments: FileRequestArgs;
}
interface FileLocationRequestArgs extends FileRequestArgs {
line: number;
offset: number;
position?: number;
}
interface FileLocationRequest extends FileRequest {
arguments: FileLocationRequestArgs;
}
interface EncodedSemanticClassificationsRequest extends FileRequest {
arguments: EncodedSemanticClassificationsRequestArgs;
}
interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
start: number;
length: number;
}
interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
filesToSearch: string[];
}
interface DefinitionRequest extends FileLocationRequest {
command: CommandTypes.Definition;
}
interface TypeDefinitionRequest extends FileLocationRequest {
command: CommandTypes.TypeDefinition;
}
interface Location {
line: number;
offset: number;
}
interface TextSpan {
start: Location;
end: Location;
}
interface FileSpan extends TextSpan {
file: string;
}
interface DefinitionResponse extends Response {
body?: FileSpan[];
}
interface TypeDefinitionResponse extends Response {
body?: FileSpan[];
}
interface ImplementationResponse extends Response {
body?: FileSpan[];
}
interface BraceCompletionRequest extends FileLocationRequest {
command: CommandTypes.BraceCompletion;
arguments: BraceCompletionRequestArgs;
}
interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
openingBrace: string;
}
interface OccurrencesRequest extends FileLocationRequest {
command: CommandTypes.Occurrences;
}
interface OccurrencesResponseItem extends FileSpan {
isWriteAccess: boolean;
}
interface OccurrencesResponse extends Response {
body?: OccurrencesResponseItem[];
}
interface DocumentHighlightsRequest extends FileLocationRequest {
command: CommandTypes.DocumentHighlights;
arguments: DocumentHighlightsRequestArgs;
}
interface HighlightSpan extends TextSpan {
kind: string;
}
interface DocumentHighlightsItem {
file: string;
highlightSpans: HighlightSpan[];
}
interface DocumentHighlightsResponse extends Response {
body?: DocumentHighlightsItem[];
}
interface ReferencesRequest extends FileLocationRequest {
command: CommandTypes.References;
}
interface ReferencesResponseItem extends FileSpan {
lineText: string;
isWriteAccess: boolean;
isDefinition: boolean;
}
interface ReferencesResponseBody {
refs: ReferencesResponseItem[];
symbolName: string;
symbolStartOffset: number;
symbolDisplayString: string;
}
interface ReferencesResponse extends Response {
body?: ReferencesResponseBody;
}
interface RenameRequestArgs extends FileLocationRequestArgs {
findInComments?: boolean;
findInStrings?: boolean;
}
interface RenameRequest extends FileLocationRequest {
command: CommandTypes.Rename;
arguments: RenameRequestArgs;
}
interface RenameInfo {
canRename: boolean;
localizedErrorMessage?: string;
displayName: string;
fullDisplayName: string;
kind: string;
kindModifiers: string;
}
interface SpanGroup {
file: string;
locs: TextSpan[];
}
interface RenameResponseBody {
info: RenameInfo;
locs: SpanGroup[];
}
interface RenameResponse extends Response {
body?: RenameResponseBody;
}
interface ExternalFile {
fileName: string;
scriptKind?: ScriptKindName | ts.ScriptKind;
hasMixedContent?: boolean;
content?: string;
}
interface ExternalProject {
projectFileName: string;
rootFiles: ExternalFile[];
options: ExternalProjectCompilerOptions;
typingOptions?: TypingOptions;
}
interface CompileOnSaveMixin {
compileOnSave?: boolean;
}
type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin;
interface ProjectVersionInfo {
projectName: string;
isInferred: boolean;
version: number;
options: ts.CompilerOptions;
}
interface ProjectChanges {
added: string[];
removed: string[];
}
interface ProjectFiles {
info?: ProjectVersionInfo;
files?: string[];
changes?: ProjectChanges;
}
interface ProjectFilesWithDiagnostics extends ProjectFiles {
projectErrors: DiagnosticWithLinePosition[];
}
interface ChangedOpenFile {
fileName: string;
changes: ts.TextChange[];
}
interface ConfigureRequestArguments {
hostInfo?: string;
file?: string;
formatOptions?: FormatCodeSettings;
}
interface ConfigureRequest extends Request {
command: CommandTypes.Configure;
arguments: ConfigureRequestArguments;
}
interface ConfigureResponse extends Response {
}
interface OpenRequestArgs extends FileRequestArgs {
fileContent?: string;
scriptKindName?: ScriptKindName;
}
type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
interface OpenRequest extends Request {
command: CommandTypes.Open;
arguments: OpenRequestArgs;
}
interface OpenExternalProjectRequest extends Request {
command: CommandTypes.OpenExternalProject;
arguments: OpenExternalProjectArgs;
}
type OpenExternalProjectArgs = ExternalProject;
interface OpenExternalProjectsRequest extends Request {
command: CommandTypes.OpenExternalProjects;
arguments: OpenExternalProjectsArgs;
}
interface OpenExternalProjectsArgs {
projects: ExternalProject[];
}
interface OpenExternalProjectResponse extends Response {
}
interface OpenExternalProjectsResponse extends Response {
}
interface CloseExternalProjectRequest extends Request {
command: CommandTypes.CloseExternalProject;
arguments: CloseExternalProjectRequestArgs;
}
interface CloseExternalProjectRequestArgs {
projectFileName: string;
}
interface CloseExternalProjectResponse extends Response {
}
interface SynchronizeProjectListRequest extends Request {
arguments: SynchronizeProjectListRequestArgs;
}
interface SynchronizeProjectListRequestArgs {
knownProjects: protocol.ProjectVersionInfo[];
}
interface ApplyChangedToOpenFilesRequest extends Request {
arguments: ApplyChangedToOpenFilesRequestArgs;
}
interface ApplyChangedToOpenFilesRequestArgs {
openFiles?: ExternalFile[];
changedFiles?: ChangedOpenFile[];
closedFiles?: string[];
}
interface SetCompilerOptionsForInferredProjectsRequest extends Request {
command: CommandTypes.CompilerOptionsForInferredProjects;
arguments: SetCompilerOptionsForInferredProjectsArgs;
}
interface SetCompilerOptionsForInferredProjectsArgs {
options: ExternalProjectCompilerOptions;
}
interface SetCompilerOptionsForInferredProjectsResponse extends Response {
}
interface ExitRequest extends Request {
command: CommandTypes.Exit;
}
interface CloseRequest extends FileRequest {
command: CommandTypes.Close;
}
interface CompileOnSaveAffectedFileListRequest extends FileRequest {
command: CommandTypes.CompileOnSaveAffectedFileList;
}
interface CompileOnSaveAffectedFileListSingleProject {
projectFileName: string;
fileNames: string[];
}
interface CompileOnSaveAffectedFileListResponse extends Response {
body: CompileOnSaveAffectedFileListSingleProject[];
}
interface CompileOnSaveEmitFileRequest extends FileRequest {
command: CommandTypes.CompileOnSaveEmitFile;
arguments: CompileOnSaveEmitFileRequestArgs;
}
interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
forced?: boolean;
}
interface QuickInfoRequest extends FileLocationRequest {
command: CommandTypes.Quickinfo;
}
interface QuickInfoResponseBody {
kind: string;
kindModifiers: string;
start: Location;
end: Location;
displayString: string;
documentation: string;
}
interface QuickInfoResponse extends Response {
body?: QuickInfoResponseBody;
}
interface FormatRequestArgs extends FileLocationRequestArgs {
endLine: number;
endOffset: number;
endPosition?: number;
options?: FormatCodeSettings;
}
interface FormatRequest extends FileLocationRequest {
command: CommandTypes.Format;
arguments: FormatRequestArgs;
}
interface CodeEdit {
start: Location;
end: Location;
newText: string;
}
interface FormatResponse extends Response {
body?: CodeEdit[];
}
interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
key: string;
options?: FormatCodeSettings;
}
interface FormatOnKeyRequest extends FileLocationRequest {
command: CommandTypes.Formatonkey;
arguments: FormatOnKeyRequestArgs;
}
interface CompletionsRequestArgs extends FileLocationRequestArgs {
prefix?: string;
}
interface CompletionsRequest extends FileLocationRequest {
command: CommandTypes.Completions;
arguments: CompletionsRequestArgs;
}
interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
entryNames: string[];
}
interface CompletionDetailsRequest extends FileLocationRequest {
command: CommandTypes.CompletionDetails;
arguments: CompletionDetailsRequestArgs;
}
interface SymbolDisplayPart {
text: string;
kind: string;
}
interface CompletionEntry {
name: string;
kind: string;
kindModifiers: string;
sortText: string;
replacementSpan?: TextSpan;
}
interface CompletionEntryDetails {
name: string;
kind: string;
kindModifiers: string;
displayParts: SymbolDisplayPart[];
documentation: SymbolDisplayPart[];
}
interface CompletionsResponse extends Response {
body?: CompletionEntry[];
}
interface CompletionDetailsResponse extends Response {
body?: CompletionEntryDetails[];
}
interface SignatureHelpParameter {
name: string;
documentation: SymbolDisplayPart[];
displayParts: SymbolDisplayPart[];
isOptional: boolean;
}
interface SignatureHelpItem {
isVariadic: boolean;
prefixDisplayParts: SymbolDisplayPart[];
suffixDisplayParts: SymbolDisplayPart[];
separatorDisplayParts: SymbolDisplayPart[];
parameters: SignatureHelpParameter[];
documentation: SymbolDisplayPart[];
}
interface SignatureHelpItems {
items: SignatureHelpItem[];
applicableSpan: TextSpan;
selectedItemIndex: number;
argumentIndex: number;
argumentCount: number;
}
interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
}
interface SignatureHelpRequest extends FileLocationRequest {
command: CommandTypes.SignatureHelp;
arguments: SignatureHelpRequestArgs;
}
interface SignatureHelpResponse extends Response {
body?: SignatureHelpItems;
}
interface SemanticDiagnosticsSyncRequest extends FileRequest {
command: CommandTypes.SemanticDiagnosticsSync;
arguments: SemanticDiagnosticsSyncRequestArgs;
}
interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
includeLinePosition?: boolean;
}
interface SemanticDiagnosticsSyncResponse extends Response {
body?: Diagnostic[] | DiagnosticWithLinePosition[];
}
interface SyntacticDiagnosticsSyncRequest extends FileRequest {
command: CommandTypes.SyntacticDiagnosticsSync;
arguments: SyntacticDiagnosticsSyncRequestArgs;
}
interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
includeLinePosition?: boolean;
}
interface SyntacticDiagnosticsSyncResponse extends Response {
body?: Diagnostic[] | DiagnosticWithLinePosition[];
}
interface GeterrForProjectRequestArgs {
file: string;
delay: number;
}
interface GeterrForProjectRequest extends Request {
command: CommandTypes.GeterrForProject;
arguments: GeterrForProjectRequestArgs;
}
interface GeterrRequestArgs {
files: string[];
delay: number;
}
interface GeterrRequest extends Request {
command: CommandTypes.Geterr;
arguments: GeterrRequestArgs;
}
interface Diagnostic {
start: Location;
end: Location;
text: string;
}
interface DiagnosticEventBody {
file: string;
diagnostics: Diagnostic[];
}
interface DiagnosticEvent extends Event {
body?: DiagnosticEventBody;
}
interface ConfigFileDiagnosticEventBody {
triggerFile: string;
configFile: string;
diagnostics: Diagnostic[];
}
interface ConfigFileDiagnosticEvent extends Event {
body?: ConfigFileDiagnosticEventBody;
event: "configFileDiag";
}
interface ReloadRequestArgs extends FileRequestArgs {
tmpfile: string;
}
interface ReloadRequest extends FileRequest {
command: CommandTypes.Reload;
arguments: ReloadRequestArgs;
}
interface ReloadResponse extends Response {
}
interface SavetoRequestArgs extends FileRequestArgs {
tmpfile: string;
}
interface SavetoRequest extends FileRequest {
command: CommandTypes.Saveto;
arguments: SavetoRequestArgs;
}
interface NavtoRequestArgs extends FileRequestArgs {
searchValue: string;
maxResultCount?: number;
projectFileName?: string;
}
interface NavtoRequest extends FileRequest {
command: CommandTypes.Navto;
arguments: NavtoRequestArgs;
}
interface NavtoItem {
name: string;
kind: string;
matchKind?: string;
isCaseSensitive?: boolean;
kindModifiers?: string;
file: string;
start: Location;
end: Location;
containerName?: string;
containerKind?: string;
}
interface NavtoResponse extends Response {
body?: NavtoItem[];
}
interface ChangeRequestArgs extends FormatRequestArgs {
insertString?: string;
}
interface ChangeRequest extends FileLocationRequest {
command: CommandTypes.Change;
arguments: ChangeRequestArgs;
}
interface BraceResponse extends Response {
body?: TextSpan[];
}
interface BraceRequest extends FileLocationRequest {
command: CommandTypes.Brace;
}
interface NavBarRequest extends FileRequest {
command: CommandTypes.NavBar;
}
interface NavTreeRequest extends FileRequest {
command: CommandTypes.NavTree;
}
interface NavigationBarItem {
text: string;
kind: string;
kindModifiers?: string;
spans: TextSpan[];
childItems?: NavigationBarItem[];
indent: number;
}
interface NavigationTree {
text: string;
kind: string;
kindModifiers: string;
spans: TextSpan[];
childItems?: NavigationTree[];
}
type TelemetryEventName = "telemetry";
interface TelemetryEvent extends Event {
event: TelemetryEventName;
body: TelemetryEventBody;
}
interface TelemetryEventBody {
telemetryEventName: string;
payload: any;
}
type TypingsInstalledTelemetryEventName = "typingsInstalled";
interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
telemetryEventName: TypingsInstalledTelemetryEventName;
payload: TypingsInstalledTelemetryEventPayload;
}
interface TypingsInstalledTelemetryEventPayload {
installedPackages: string;
installSuccess: boolean;
}
interface NavBarResponse extends Response {
body?: NavigationBarItem[];
}
interface NavTreeResponse extends Response {
body?: NavigationTree;
}
namespace IndentStyle {
type None = "None";
type Block = "Block";
type Smart = "Smart";
}
type IndentStyle = IndentStyle.None | IndentStyle.Block | IndentStyle.Smart;
interface EditorSettings {
baseIndentSize?: number;
indentSize?: number;
tabSize?: number;
newLineCharacter?: string;
convertTabsToSpaces?: boolean;
indentStyle?: IndentStyle | ts.IndentStyle;
}
interface FormatCodeSettings extends EditorSettings {
insertSpaceAfterCommaDelimiter?: boolean;
insertSpaceAfterSemicolonInForStatements?: boolean;
insertSpaceBeforeAndAfterBinaryOperators?: boolean;
insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
placeOpenBraceOnNewLineForFunctions?: boolean;
placeOpenBraceOnNewLineForControlBlocks?: boolean;
}
interface CompilerOptions {
allowJs?: boolean;
allowSyntheticDefaultImports?: boolean;
allowUnreachableCode?: boolean;
allowUnusedLabels?: boolean;
baseUrl?: string;
charset?: string;
declaration?: boolean;
declarationDir?: string;
disableSizeLimit?: boolean;
emitBOM?: boolean;
emitDecoratorMetadata?: boolean;
experimentalDecorators?: boolean;
forceConsistentCasingInFileNames?: boolean;
inlineSourceMap?: boolean;
inlineSources?: boolean;
isolatedModules?: boolean;
jsx?: JsxEmit | ts.JsxEmit;
lib?: string[];
locale?: string;
mapRoot?: string;
maxNodeModuleJsDepth?: number;
module?: ModuleKind | ts.ModuleKind;
moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
newLine?: NewLineKind | ts.NewLineKind;
noEmit?: boolean;
noEmitHelpers?: boolean;
noEmitOnError?: boolean;
noErrorTruncation?: boolean;
noFallthroughCasesInSwitch?: boolean;
noImplicitAny?: boolean;
noImplicitReturns?: boolean;
noImplicitThis?: boolean;
noUnusedLocals?: boolean;
noUnusedParameters?: boolean;
noImplicitUseStrict?: boolean;
noLib?: boolean;
noResolve?: boolean;
out?: string;
outDir?: string;
outFile?: string;
paths?: MapLike<string[]>;
preserveConstEnums?: boolean;
project?: string;
reactNamespace?: string;
removeComments?: boolean;
rootDir?: string;
rootDirs?: string[];
skipLibCheck?: boolean;
skipDefaultLibCheck?: boolean;
sourceMap?: boolean;
sourceRoot?: string;
strictNullChecks?: boolean;
suppressExcessPropertyErrors?: boolean;
suppressImplicitAnyIndexErrors?: boolean;
target?: ScriptTarget | ts.ScriptTarget;
traceResolution?: boolean;
types?: string[];
typeRoots?: string[];
[option: string]: CompilerOptionsValue | undefined;
}
namespace JsxEmit {
type None = "None";
type Preserve = "Preserve";
type React = "React";
}
type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React;
namespace ModuleKind {
type None = "None";
type CommonJS = "CommonJS";
type AMD = "AMD";
type UMD = "UMD";
type System = "System";
type ES6 = "ES6";
type ES2015 = "ES2015";
}
type ModuleKind = ModuleKind.None | ModuleKind.CommonJS | ModuleKind.AMD | ModuleKind.UMD | ModuleKind.System | ModuleKind.ES6 | ModuleKind.ES2015;
namespace ModuleResolutionKind {
type Classic = "Classic";
type Node = "Node";
}
type ModuleResolutionKind = ModuleResolutionKind.Classic | ModuleResolutionKind.Node;
namespace NewLineKind {
type Crlf = "Crlf";
type Lf = "Lf";
}
type NewLineKind = NewLineKind.Crlf | NewLineKind.Lf;
namespace ScriptTarget {
type ES3 = "ES3";
type ES5 = "ES5";
type ES6 = "ES6";
type ES2015 = "ES2015";
}
type ScriptTarget = ScriptTarget.ES3 | ScriptTarget.ES5 | ScriptTarget.ES6 | ScriptTarget.ES2015;
}
declare namespace ts {
interface MapLike<T> {
[index: string]: T;
}
interface Map<T> extends MapLike<T> {
__mapBrand: any;
}
type Path = string & {
__pathBrand: any;
};
interface FileMap<T> {
get(fileName: Path): T;
set(fileName: Path, value: T): void;
contains(fileName: Path): boolean;
remove(fileName: Path): void;
forEachValue(f: (key: Path, v: T) => void): void;
getKeys(): Path[];
clear(): void;
}
interface TextRange {
pos: number;
end: number;
}
const enum SyntaxKind {
Unknown = 0,
EndOfFileToken = 1,
SingleLineCommentTrivia = 2,
MultiLineCommentTrivia = 3,
NewLineTrivia = 4,
WhitespaceTrivia = 5,
ShebangTrivia = 6,
ConflictMarkerTrivia = 7,
NumericLiteral = 8,
StringLiteral = 9,
RegularExpressionLiteral = 10,
NoSubstitutionTemplateLiteral = 11,
TemplateHead = 12,
TemplateMiddle = 13,
TemplateTail = 14,
OpenBraceToken = 15,
CloseBraceToken = 16,
OpenParenToken = 17,
CloseParenToken = 18,
OpenBracketToken = 19,
CloseBracketToken = 20,
DotToken = 21,
DotDotDotToken = 22,
SemicolonToken = 23,
CommaToken = 24,
LessThanToken = 25,
LessThanSlashToken = 26,
GreaterThanToken = 27,
LessThanEqualsToken = 28,
GreaterThanEqualsToken = 29,
EqualsEqualsToken = 30,
ExclamationEqualsToken = 31,
EqualsEqualsEqualsToken = 32,
ExclamationEqualsEqualsToken = 33,
EqualsGreaterThanToken = 34,
PlusToken = 35,
MinusToken = 36,
AsteriskToken = 37,
AsteriskAsteriskToken = 38,
SlashToken = 39,
PercentToken = 40,
PlusPlusToken = 41,
MinusMinusToken = 42,
LessThanLessThanToken = 43,
GreaterThanGreaterThanToken = 44,
GreaterThanGreaterThanGreaterThanToken = 45,
AmpersandToken = 46,
BarToken = 47,
CaretToken = 48,
ExclamationToken = 49,
TildeToken = 50,
AmpersandAmpersandToken = 51,
BarBarToken = 52,
QuestionToken = 53,
ColonToken = 54,
AtToken = 55,
EqualsToken = 56,
PlusEqualsToken = 57,
MinusEqualsToken = 58,
AsteriskEqualsToken = 59,
AsteriskAsteriskEqualsToken = 60,
SlashEqualsToken = 61,
PercentEqualsToken = 62,
LessThanLessThanEqualsToken = 63,
GreaterThanGreaterThanEqualsToken = 64,
GreaterThanGreaterThanGreaterThanEqualsToken = 65,
AmpersandEqualsToken = 66,
BarEqualsToken = 67,
CaretEqualsToken = 68,
Identifier = 69,
BreakKeyword = 70,
CaseKeyword = 71,
CatchKeyword = 72,
ClassKeyword = 73,
ConstKeyword = 74,
ContinueKeyword = 75,
DebuggerKeyword = 76,
DefaultKeyword = 77,
DeleteKeyword = 78,
DoKeyword = 79,
ElseKeyword = 80,
EnumKeyword = 81,
ExportKeyword = 82,
ExtendsKeyword = 83,
FalseKeyword = 84,
FinallyKeyword = 85,
ForKeyword = 86,
FunctionKeyword = 87,
IfKeyword = 88,
ImportKeyword = 89,
InKeyword = 90,
InstanceOfKeyword = 91,
NewKeyword = 92,
NullKeyword = 93,
ReturnKeyword = 94,
SuperKeyword = 95,
SwitchKeyword = 96,
ThisKeyword = 97,
ThrowKeyword = 98,
TrueKeyword = 99,
TryKeyword = 100,
TypeOfKeyword = 101,
VarKeyword = 102,
VoidKeyword = 103,
WhileKeyword = 104,
WithKeyword = 105,
ImplementsKeyword = 106,
InterfaceKeyword = 107,
LetKeyword = 108,
PackageKeyword = 109,
PrivateKeyword = 110,
ProtectedKeyword = 111,
PublicKeyword = 112,
StaticKeyword = 113,
YieldKeyword = 114,
AbstractKeyword = 115,
AsKeyword = 116,
AnyKeyword = 117,
AsyncKeyword = 118,
AwaitKeyword = 119,
BooleanKeyword = 120,
ConstructorKeyword = 121,
DeclareKeyword = 122,
GetKeyword = 123,
IsKeyword = 124,
ModuleKeyword = 125,
NamespaceKeyword = 126,
NeverKeyword = 127,
ReadonlyKeyword = 128,
RequireKeyword = 129,
NumberKeyword = 130,
SetKeyword = 131,
StringKeyword = 132,
SymbolKeyword = 133,
TypeKeyword = 134,
UndefinedKeyword = 135,
FromKeyword = 136,
GlobalKeyword = 137,
OfKeyword = 138,
QualifiedName = 139,
ComputedPropertyName = 140,
TypeParameter = 141,
Parameter = 142,
Decorator = 143,
PropertySignature = 144,
PropertyDeclaration = 145,
MethodSignature = 146,
MethodDeclaration = 147,
Constructor = 148,
GetAccessor = 149,
SetAccessor = 150,
CallSignature = 151,
ConstructSignature = 152,
IndexSignature = 153,
TypePredicate = 154,
TypeReference = 155,
FunctionType = 156,
ConstructorType = 157,
TypeQuery = 158,
TypeLiteral = 159,
ArrayType = 160,
TupleType = 161,
UnionType = 162,
IntersectionType = 163,
ParenthesizedType = 164,
ThisType = 165,
LiteralType = 166,
ObjectBindingPattern = 167,
ArrayBindingPattern = 168,
BindingElement = 169,
ArrayLiteralExpression = 170,
ObjectLiteralExpression = 171,
PropertyAccessExpression = 172,
ElementAccessExpression = 173,
CallExpression = 174,
NewExpression = 175,
TaggedTemplateExpression = 176,
TypeAssertionExpression = 177,
ParenthesizedExpression = 178,
FunctionExpression = 179,
ArrowFunction = 180,
DeleteExpression = 181,
TypeOfExpression = 182,
VoidExpression = 183,
AwaitExpression = 184,
PrefixUnaryExpression = 185,
PostfixUnaryExpression = 186,
BinaryExpression = 187,
ConditionalExpression = 188,
TemplateExpression = 189,
YieldExpression = 190,
SpreadElementExpression = 191,
ClassExpression = 192,
OmittedExpression = 193,
ExpressionWithTypeArguments = 194,
AsExpression = 195,
NonNullExpression = 196,
TemplateSpan = 197,
SemicolonClassElement = 198,
Block = 199,
VariableStatement = 200,
EmptyStatement = 201,
ExpressionStatement = 202,
IfStatement = 203,
DoStatement = 204,
WhileStatement = 205,
ForStatement = 206,
ForInStatement = 207,
ForOfStatement = 208,
ContinueStatement = 209,
BreakStatement = 210,
ReturnStatement = 211,
WithStatement = 212,
SwitchStatement = 213,
LabeledStatement = 214,
ThrowStatement = 215,
TryStatement = 216,
DebuggerStatement = 217,
VariableDeclaration = 218,
VariableDeclarationList = 219,
FunctionDeclaration = 220,
ClassDeclaration = 221,
InterfaceDeclaration = 222,
TypeAliasDeclaration = 223,
EnumDeclaration = 224,
ModuleDeclaration = 225,
ModuleBlock = 226,
CaseBlock = 227,
NamespaceExportDeclaration = 228,
ImportEqualsDeclaration = 229,
ImportDeclaration = 230,
ImportClause = 231,
NamespaceImport = 232,
NamedImports = 233,
ImportSpecifier = 234,
ExportAssignment = 235,
ExportDeclaration = 236,
NamedExports = 237,
ExportSpecifier = 238,
MissingDeclaration = 239,
ExternalModuleReference = 240,
JsxElement = 241,
JsxSelfClosingElement = 242,
JsxOpeningElement = 243,
JsxText = 244,
JsxClosingElement = 245,
JsxAttribute = 246,
JsxSpreadAttribute = 247,
JsxExpression = 248,
CaseClause = 249,
DefaultClause = 250,
HeritageClause = 251,
CatchClause = 252,
PropertyAssignment = 253,
ShorthandPropertyAssignment = 254,
EnumMember = 255,
SourceFile = 256,
JSDocTypeExpression = 257,
JSDocAllType = 258,
JSDocUnknownType = 259,
JSDocArrayType = 260,
JSDocUnionType = 261,
JSDocTupleType = 262,
JSDocNullableType = 263,
JSDocNonNullableType = 264,
JSDocRecordType = 265,
JSDocRecordMember = 266,
JSDocTypeReference = 267,
JSDocOptionalType = 268,
JSDocFunctionType = 269,
JSDocVariadicType = 270,
JSDocConstructorType = 271,
JSDocThisType = 272,
JSDocComment = 273,
JSDocTag = 274,
JSDocParameterTag = 275,
JSDocReturnTag = 276,
JSDocTypeTag = 277,
JSDocTemplateTag = 278,
JSDocTypedefTag = 279,
JSDocPropertyTag = 280,
JSDocTypeLiteral = 281,
JSDocLiteralType = 282,
JSDocNullKeyword = 283,
JSDocUndefinedKeyword = 284,
JSDocNeverKeyword = 285,
SyntaxList = 286,
Count = 287,
FirstAssignment = 56,
LastAssignment = 68,
FirstReservedWord = 70,
LastReservedWord = 105,
FirstKeyword = 70,
LastKeyword = 138,
FirstFutureReservedWord = 106,
LastFutureReservedWord = 114,
FirstTypeNode = 154,
LastTypeNode = 166,
FirstPunctuation = 15,
LastPunctuation = 68,
FirstToken = 0,
LastToken = 138,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
LastLiteralToken = 11,
FirstTemplateToken = 11,
LastTemplateToken = 14,
FirstBinaryOperator = 25,
LastBinaryOperator = 68,
FirstNode = 139,
FirstJSDocNode = 257,
LastJSDocNode = 282,
FirstJSDocTagNode = 273,
LastJSDocTagNode = 285,
}
const enum NodeFlags {
None = 0,
Export = 1,
Ambient = 2,
Public = 4,
Private = 8,
Protected = 16,
Static = 32,
Readonly = 64,
Abstract = 128,
Async = 256,
Default = 512,
Let = 1024,
Const = 2048,
Namespace = 4096,
ExportContext = 8192,
ContainsThis = 16384,
HasImplicitReturn = 32768,
HasExplicitReturn = 65536,
GlobalAugmentation = 131072,
HasClassExtends = 262144,
HasDecorators = 524288,
HasParamDecorators = 1048576,
HasAsyncFunctions = 2097152,
DisallowInContext = 4194304,
YieldContext = 8388608,
DecoratorContext = 16777216,
AwaitContext = 33554432,
ThisNodeHasError = 67108864,
JavaScriptFile = 134217728,
ThisNodeOrAnySubNodesHasError = 268435456,
HasAggregatedChildData = 536870912,
HasJsxSpreadAttribute = 1073741824,
Modifier = 1023,
AccessibilityModifier = 28,
ParameterPropertyModifier = 92,
BlockScoped = 3072,
ReachabilityCheckFlags = 98304,
EmitHelperFlags = 3932160,
ReachabilityAndEmitFlags = 4030464,
ContextFlags = 197132288,
TypeExcludesFlags = 41943040,
}
const enum JsxFlags {
None = 0,
IntrinsicNamedElement = 1,
IntrinsicIndexedElement = 2,
IntrinsicElement = 3,
}
const enum RelationComparisonResult {
Succeeded = 1,
Failed = 2,
FailedAndReported = 3,
}
interface Node extends TextRange {
kind: SyntaxKind;
flags: NodeFlags;
decorators?: NodeArray<Decorator>;
modifiers?: ModifiersArray;
id?: number;
parent?: Node;
jsDocComments?: JSDocComment[];
symbol?: Symbol;
locals?: SymbolTable;
nextContainer?: Node;
localSymbol?: Symbol;
flowNode?: FlowNode;
}
interface NodeArray<T> extends Array<T>, TextRange {
hasTrailingComma?: boolean;
}
interface ModifiersArray extends NodeArray<Modifier> {
flags: NodeFlags;
}
interface Token extends Node {
__tokenTag: any;
}
interface Modifier extends Token {
}
interface Identifier extends PrimaryExpression {
text: string;
originalKeywordKind?: SyntaxKind;
}
interface QualifiedName extends Node {
left: EntityName;
right: Identifier;
}
type EntityName = Identifier | QualifiedName;
type PropertyName = Identifier | LiteralExpression | ComputedPropertyName;
type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern;
interface Declaration extends Node {
_declarationBrand: any;
name?: DeclarationName;
}
interface DeclarationStatement extends Declaration, Statement {
name?: Identifier;
}
interface ComputedPropertyName extends Node {
expression: Expression;
}
interface Decorator extends Node {
expression: LeftHandSideExpression;
}
interface TypeParameterDeclaration extends Declaration {
name: Identifier;
constraint?: TypeNode;
expression?: Expression;
}
interface SignatureDeclaration extends Declaration {
name?: PropertyName;
typeParameters?: NodeArray<TypeParameterDeclaration>;
parameters: NodeArray<ParameterDeclaration>;
type?: TypeNode;
}
interface CallSignatureDeclaration extends SignatureDeclaration, TypeElement {
}
interface ConstructSignatureDeclaration extends SignatureDeclaration, TypeElement {
}
interface VariableDeclaration extends Declaration {
parent?: VariableDeclarationList;
name: Identifier | BindingPattern;
type?: TypeNode;
initializer?: Expression;
}
interface VariableDeclarationList extends Node {
declarations: NodeArray<VariableDeclaration>;
}
interface ParameterDeclaration extends Declaration {
dotDotDotToken?: Node;
name: Identifier | BindingPattern;
questionToken?: Node;
type?: TypeNode;
initializer?: Expression;
}
interface BindingElement extends Declaration {
propertyName?: PropertyName;
dotDotDotToken?: Node;
name: Identifier | BindingPattern;
initializer?: Expression;
}
interface PropertySignature extends TypeElement {
name: PropertyName;
questionToken?: Node;
type?: TypeNode;
initializer?: Expression;
}
interface PropertyDeclaration extends ClassElement {
questionToken?: Node;
name: PropertyName;
type?: TypeNode;
initializer?: Expression;
}
interface ObjectLiteralElement extends Declaration {
_objectLiteralBrandBrand: any;
name?: PropertyName;
}
interface PropertyAssignment extends ObjectLiteralElement {
_propertyAssignmentBrand: any;
name: PropertyName;
questionToken?: Node;
initializer: Expression;
}
interface ShorthandPropertyAssignment extends ObjectLiteralElement {
name: Identifier;
questionToken?: Node;
equalsToken?: Node;
objectAssignmentInitializer?: Expression;
}
interface VariableLikeDeclaration extends Declaration {
propertyName?: PropertyName;
dotDotDotToken?: Node;
name: DeclarationName;
questionToken?: Node;
type?: TypeNode;
initializer?: Expression;
}
interface PropertyLikeDeclaration extends Declaration {
name: PropertyName;
}
interface BindingPattern extends Node {
elements: NodeArray<BindingElement>;
}
interface ObjectBindingPattern extends BindingPattern {
}
interface ArrayBindingPattern extends BindingPattern {
}
interface FunctionLikeDeclaration extends SignatureDeclaration {
_functionLikeDeclarationBrand: any;
asteriskToken?: Node;
questionToken?: Node;
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, DeclarationStatement {
name?: Identifier;
body?: FunctionBody;
}
interface MethodSignature extends SignatureDeclaration, TypeElement {
name: PropertyName;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
name: PropertyName;
body?: FunctionBody;
}
interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement {
body?: FunctionBody;
}
interface SemicolonClassElement extends ClassElement {
_semicolonClassElementBrand: any;
}
interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
_accessorDeclarationBrand: any;
name: PropertyName;
body: FunctionBody;
}
interface GetAccessorDeclaration extends AccessorDeclaration {
}
interface SetAccessorDeclaration extends AccessorDeclaration {
}
interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement {
_indexSignatureDeclarationBrand: any;
}
interface TypeNode extends Node {
_typeNodeBrand: any;
}
interface ThisTypeNode extends TypeNode {
_thisTypeNodeBrand: any;
}
interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration {
_functionOrConstructorTypeNodeBrand: any;
}
interface FunctionTypeNode extends FunctionOrConstructorTypeNode {
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNode {
}
interface TypeReferenceNode extends TypeNode {
typeName: EntityName;
typeArguments?: NodeArray<TypeNode>;
}
interface TypePredicateNode extends TypeNode {
parameterName: Identifier | ThisTypeNode;
type: TypeNode;
}
interface TypeQueryNode extends TypeNode {
exprName: EntityName;
}
interface TypeLiteralNode extends TypeNode, Declaration {
members: NodeArray<TypeElement>;
}
interface ArrayTypeNode extends TypeNode {
elementType: TypeNode;
}
interface TupleTypeNode extends TypeNode {
elementTypes: NodeArray<TypeNode>;
}
interface UnionOrIntersectionTypeNode extends TypeNode {
types: NodeArray<TypeNode>;
}
interface UnionTypeNode extends UnionOrIntersectionTypeNode {
}
interface IntersectionTypeNode extends UnionOrIntersectionTypeNode {
}
interface ParenthesizedTypeNode extends TypeNode {
type: TypeNode;
}
interface LiteralTypeNode extends TypeNode {
_stringLiteralTypeBrand: any;
literal: Expression;
}
interface StringLiteral extends LiteralExpression {
_stringLiteralBrand: any;
}
interface Expression extends Node {
_expressionBrand: any;
contextualType?: Type;
}
interface OmittedExpression extends Expression {
}
interface UnaryExpression extends Expression {
_unaryExpressionBrand: any;
}
interface IncrementExpression extends UnaryExpression {
_incrementExpressionBrand: any;
}
interface PrefixUnaryExpression extends IncrementExpression {
operator: SyntaxKind;
operand: UnaryExpression;
}
interface PostfixUnaryExpression extends IncrementExpression {
operand: LeftHandSideExpression;
operator: SyntaxKind;
}
interface PostfixExpression extends UnaryExpression {
_postfixExpressionBrand: any;
}
interface LeftHandSideExpression extends IncrementExpression {
_leftHandSideExpressionBrand: any;
}
interface MemberExpression extends LeftHandSideExpression {
_memberExpressionBrand: any;
}
interface PrimaryExpression extends MemberExpression {
_primaryExpressionBrand: any;
}
interface DeleteExpression extends UnaryExpression {
expression: UnaryExpression;
}
interface TypeOfExpression extends UnaryExpression {
expression: UnaryExpression;
}
interface VoidExpression extends UnaryExpression {
expression: UnaryExpression;
}
interface AwaitExpression extends UnaryExpression {
expression: UnaryExpression;
}
interface YieldExpression extends Expression {
asteriskToken?: Node;
expression?: Expression;
}
interface BinaryExpression extends Expression, Declaration {
left: Expression;
operatorToken: Node;
right: Expression;
}
interface ConditionalExpression extends Expression {
condition: Expression;
questionToken: Node;
whenTrue: Expression;
colonToken: Node;
whenFalse: Expression;
}
type FunctionBody = Block;
type ConciseBody = FunctionBody | Expression;
interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
name?: Identifier;
body: FunctionBody;
}
interface ArrowFunction extends Expression, FunctionLikeDeclaration {
equalsGreaterThanToken: Node;
body: ConciseBody;
}
interface LiteralLikeNode extends Node {
text: string;
isUnterminated?: boolean;
hasExtendedUnicodeEscape?: boolean;
isOctalLiteral?: boolean;
}
interface LiteralExpression extends LiteralLikeNode, PrimaryExpression {
_literalExpressionBrand: any;
}
interface TemplateLiteralFragment extends LiteralLikeNode {
_templateLiteralFragmentBrand: any;
}
interface TemplateExpression extends PrimaryExpression {
head: TemplateLiteralFragment;
templateSpans: NodeArray<TemplateSpan>;
}
interface TemplateSpan extends Node {
expression: Expression;
literal: TemplateLiteralFragment;
}
interface ParenthesizedExpression extends PrimaryExpression {
expression: Expression;
}
interface ArrayLiteralExpression extends PrimaryExpression {
elements: NodeArray<Expression>;
multiLine?: boolean;
}
interface SpreadElementExpression extends Expression {
expression: Expression;
}
interface ObjectLiteralExpression extends PrimaryExpression, Declaration {
properties: NodeArray<ObjectLiteralElement>;
multiLine?: boolean;
}
type E