@lpc-lang/core
Version:
LPC Language Compiler Library
960 lines • 160 kB
TypeScript
import { CreateSourceFileOptions, MapLike, ModuleResolutionCache, Mutable } from "./_namespaces/lpc.js";
export type NodeId = number;
export type SymbolId = number;
export type Path = string & {
__pathBrand: any;
};
/** SymbolTable based on ES6 Map interface. */
export type SymbolTable = Map<string, Symbol>;
export interface TextRange {
pos: number;
end: number;
}
export interface ReadonlyTextRange {
readonly pos: number;
readonly end: number;
}
export interface MacroIncludedFileRange {
posInOrigin?: number;
endInOrigin?: number;
originFilename?: string;
}
/** Base Node */
export interface Node extends ReadonlyTextRange {
readonly kind: SyntaxKind;
readonly flags: NodeFlags;
readonly parent: Node;
}
export interface EmitNode {
flags: EmitFlags;
internalFlags: InternalEmitFlags;
annotatedNodes?: Node[];
leadingComments?: SynthesizedComment[];
trailingComments?: SynthesizedComment[];
commentRange?: TextRange;
constantValue?: string | number;
externalHelpersModuleName?: Identifier;
externalHelpers?: boolean;
helpers?: EmitHelper[];
startsOnNewLine?: boolean;
snippetElement?: SnippetElement;
typeNode?: TypeNode;
classThis?: Identifier;
assignedName?: Expression;
identifierTypeArguments?: NodeArray<TypeNode | TypeParameterDeclaration>;
autoGenerate: AutoGenerateInfo | undefined;
}
export interface TypeChecker {
getTypeOfSymbol(symbol: Symbol): Type;
createSymbol(flags: SymbolFlags, name: string, checkFlags?: CheckFlags): TransientSymbol;
getDeclaredTypeOfSymbol(symbol: Symbol): Type;
getStringType(): Type;
signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string;
symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string;
getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined;
/** Follow all aliases to get the original symbol. */
getAliasedSymbol(symbol: Symbol): Symbol;
getSymbolAtLocation(node: Node): Symbol | undefined;
getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
getRootSymbols(symbol: Symbol): readonly Symbol[];
evaluate(expr: Expression, location?: Declaration): EvaluatorResult<string | number>;
/**
* True if this type is assignable to `ReadonlyArray<any>`.
*/
isArrayLikeType(type: Type): boolean;
/** Note that the resulting nodes cannot be checked. */
typeToTypeNode(type: Type, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeNode | undefined;
getReturnTypeOfSignature(signature: Signature): Type;
resolveName(name: string, location: Node | undefined, meaning: SymbolFlags, excludeGlobals: boolean): Symbol | undefined;
resolveBaseTypesOfClass(type: InterfaceType): Type[];
isArgumentsSymbol(symbol: Symbol): boolean;
/**
* returns unknownSignature in the case of an error.
* returns undefined if the node is not valid.
* @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`.
*/
getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined;
/**
* The function returns the value (local variable) symbol of an identifier in the short-hand property assignment.
* This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value.
*/
getShorthandAssignmentValueSymbol(location: Node | undefined): Symbol | undefined;
isUnknownSymbol(symbol: Symbol): boolean;
isUndefinedSymbol(symbol: Symbol): boolean;
getMergedSymbol(symbol: Symbol): Symbol;
getTypeAtLocation(node: Node): Type;
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
/**
* Depending on the operation performed, it may be appropriate to throw away the checker
* if the cancellation token is triggered. Typically, if it is used for error checking
* and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
*/
runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T;
/** Note that the resulting nodes cannot be checked. */
symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): NodeArray<TypeParameterDeclaration> | undefined;
getNullableType(type: Type, flags: TypeFlags): Type;
getNonNullableType(type: Type): Type;
getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[];
getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined;
getBaseConstraintOfType(type: Type): Type | undefined;
getDefaultFromTypeParameter(type: Type): Type | undefined;
getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
getTypeFromTypeNode(node: TypeNode): Type;
getFullyQualifiedName(symbol: Symbol): string;
getWidenedType(type: Type): Type;
getAugmentedPropertiesOfType(type: Type): Symbol[];
getPropertiesOfType(type: Type): Symbol[];
getExportsOfModule(moduleSymbol: Symbol): Symbol[];
getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined;
/** Note that the resulting nodes cannot be checked. */
typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeParameterDeclaration | undefined;
/** Note that the resulting nodes cannot be checked. */
symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): ParameterDeclaration | undefined;
isOptionalParameter(node: ParameterDeclaration): boolean;
}
export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string> | MapLike<string[]> | ProjectReference[] | null | undefined;
export interface TypeAcquisition {
enable?: boolean;
include?: string[];
exclude?: string[];
disableFilenameBasedTypeAcquisition?: boolean;
[option: string]: CompilerOptionsValue | undefined;
}
export interface ProjectReference {
/** A normalized path on disk */
path: string;
/** The path as the user originally wrote it */
originalPath?: string;
/** @deprecated */
prepend?: boolean;
/** True if it is intended that this reference form a circularity */
circular?: boolean;
}
/** Either a parsed command line or a parsed tsconfig.json */
export interface ParsedCommandLine {
options: CompilerOptions;
typeAcquisition?: TypeAcquisition;
fileNames: string[];
projectReferences?: readonly ProjectReference[];
watchOptions?: WatchOptions;
raw?: any;
errors: Diagnostic[];
wildcardDirectories?: MapLike<WatchDirectoryFlags>;
compileOnSave?: boolean;
}
export interface ResolvedProjectReference {
commandLine: ParsedCommandLine;
sourceFile: SourceFile;
references?: readonly (ResolvedProjectReference | undefined)[];
}
/**
* Represents the result of module resolution.
* Module resolution will pick up tsx/jsx/js files even if '--jsx' and '--allowJs' are turned off.
* The Program will then filter results based on these flags.
*
* Prefer to return a `ResolvedModuleFull` so that the file type does not have to be inferred.
*/
export interface ResolvedModule {
/** Path of the file the module was resolved to. */
resolvedFileName: string;
/** True if `resolvedFileName` comes from `node_modules`. */
isExternalLibraryImport?: boolean;
/**
* True if the original module reference used a .ts extension to refer directly to a .ts file,
* which should produce an error during checking if emit is enabled.
*/
resolvedUsingTsExtension?: boolean;
}
/**
* ResolvedModule with an explicitly provided `extension` property.
* Prefer this over `ResolvedModule`.
* If changing this, remember to change `moduleResolutionIsEqualTo`.
*/
export interface ResolvedModuleFull extends ResolvedModule {
/**
* Extension of resolvedFileName. This must match what's at the end of resolvedFileName.
* This is optional for backwards-compatibility, but will be added if not provided.
*/
extension: string;
packageId?: PackageId;
}
export interface ResolvedTypeReferenceDirective {
primary: boolean;
resolvedFileName: string | undefined;
packageId?: PackageId;
/** True if `resolvedFileName` comes from `node_modules`. */
isExternalLibraryImport?: boolean;
}
export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
}
export interface ResolvedModuleWithFailedLookupLocations {
readonly resolvedModule: ResolvedModuleFull | undefined;
}
export declare const enum SignatureKind {
Call = 0,
Construct = 1
}
export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
export interface Type {
flags: TypeFlags;
symbol: Symbol;
pattern?: DestructuringPattern;
aliasSymbol?: Symbol;
aliasTypeArguments?: readonly Type[];
}
export declare const enum SyntaxKind {
Unknown = 0,// fIrst token
EndOfFileToken = 1,
SingleLineCommentTrivia = 2,
MultiLineCommentTrivia = 3,
NewLineTrivia = 4,
WhitespaceTrivia = 5,
ConflictMarkerTrivia = 6,
MacroIdentifierTrivia = 7,
ShebangTrivia = 8,
NonTextFileMarkerTrivia = 9,
NumericLiteral = 10,
IntLiteral = 11,
CharLiteral = 12,
FloatLiteral = 13,
BytesLiteral = 14,
StringArrayLiteral = 15,
StringLiteral = 16,
OpenBraceToken = 17,
BacktickToken = 18,
CloseBraceToken = 19,
OpenParenToken = 20,
CloseParenToken = 21,
OpenBracketToken = 22,
CloseBracketToken = 23,
DotToken = 24,
DotDotDotToken = 25,
SemicolonToken = 26,
CommaToken = 27,
QuestionDotToken = 28,
LessThanToken = 29,
LessThanSlashToken = 30,
LessThanDotDotToken = 31,
GreaterThanToken = 32,
LessThanEqualsToken = 33,
GreaterThanEqualsToken = 34,
EqualsEqualsToken = 35,
ExclamationEqualsToken = 36,
EqualsEqualsEqualsToken = 37,
ExclamationEqualsEqualsToken = 38,
EqualsGreaterThanToken = 39,
MinusGreaterThanToken = 40,
PlusToken = 41,
MinusToken = 42,
AsteriskToken = 43,
AsteriskAsteriskToken = 44,
SlashToken = 45,
PercentToken = 46,
PlusPlusToken = 47,
MinusMinusToken = 48,
LessThanLessThanToken = 49,
GreaterThanGreaterThanToken = 50,
GreaterThanGreaterThanGreaterThanToken = 51,
AmpersandToken = 52,
BarToken = 53,
CaretToken = 54,
ExclamationToken = 55,
DoubleExclamationToken = 56,
TildeToken = 57,
AmpersandAmpersandToken = 58,
BarBarToken = 59,
QuestionToken = 60,
ColonToken = 61,
AtToken = 62,
AtAtToken = 63,
QuestionQuestionToken = 64,
HashToken = 65,
OpenParenColonToken = 66,// for inline closures
ColonCloseParenToken = 67,
OpenParenBracketToken = 68,// for mapping literal
OpenParenBraceToken = 69,// for array literal
OpenParenAsteriskToken = 70,// (*fn) shortcut for evaluate()
ColonColonToken = 71,
LambdaToken = 72,
DotDotToken = 73,
EqualsToken = 74,// first assignment
PlusEqualsToken = 75,
MinusEqualsToken = 76,
AsteriskEqualsToken = 77,
AsteriskAsteriskEqualsToken = 78,
SlashEqualsToken = 79,
PercentEqualsToken = 80,
LessThanLessThanEqualsToken = 81,
GreaterThanGreaterThanEqualsToken = 82,
GreaterThanGreaterThanGreaterThanEqualsToken = 83,
AmpersandEqualsToken = 84,
BarEqualsToken = 85,
BarBarEqualsToken = 86,
AmpersandAmpersandEqualsToken = 87,
QuestionQuestionEqualsToken = 88,
CaretEqualsToken = 89,// last assignment
Identifier = 90,
StringizedIdentifier = 91,
IntKeyword = 93,// FIrst Keyword, FirstReserved Word
FloatKeyword = 94,
StringKeyword = 95,
LwObjectKeyword = 96,
AnyKeyword = 97,
ClosureKeyword = 98,
StructKeyword = 99,
CatchKeyword = 100,
MixedKeyword = 101,
UnknownKeyword = 102,
MappingKeyword = 103,
VoidKeyword = 104,
BreakKeyword = 105,
BytesKeyword = 106,
DoKeyword = 107,
ElseKeyword = 108,
ForKeyword = 109,
ForEachKeyword = 110,
CaseKeyword = 111,
DefaultKeyword = 112,
IfKeyword = 113,
ReturnKeyword = 114,
SwitchKeyword = 115,
WhileKeyword = 116,
AsyncKeyword = 117,
InheritKeyword = 118,
ContinueKeyword = 119,
PrivateKeyword = 120,
ProtectedKeyword = 121,
PublicKeyword = 122,
StaticKeyword = 123,
VisibleKeyword = 124,
NoSaveKeyword = 125,
NoShadowKeyword = 126,
IntrinsicKeyword = 127,
NoMaskKeyword = 128,
VarArgsKeyword = 129,
DeprecatedKeyword = 130,// LastReservedWord
ClassKeyword = 131,
StatusKeyword = 132,
UndefinedKeyword = 133,
FalseKeyword = 134,// JSON-only
TrueKeyword = 135,// JSON-only
NullKeyword = 136,// JSON-only
NeverKeyword = 137,// typenode only
FunctionKeyword = 138,// can be used as a param name
SymbolKeyword = 139,// not reserved in fluffos
ObjectKeyword = 140,// can occur in a super expr i.e. object::fn()
RefKeyword = 141,// fluff only
BufferKeyword = 142,// fluff only
IsKeyword = 143,// use for type predicates only
FunctionsKeyword = 144,// inherit modifier
VirtualKeyword = 145,// inherit modifier
InKeyword = 146,// not a reserved word in LD (maybe fluff?)
NewKeyword = 147,// LastKeyword and LastToken - everything after this will be processed by the binder
QualifiedName = 148,// First Node
ComputedPropertyName = 149,
TypeParameter = 150,
Parameter = 151,
IndexSignature = 152,
CallSignature = 153,
PropertyDeclaration = 154,
PropertySignature = 155,
MethodDeclaration = 156,
InterfaceDeclaration = 157,
MethodSignature = 158,
UnionType = 159,// First Type Node
FunctionType = 160,
IntersectionType = 161,
RestType = 162,
ArrayType = 163,
MappingType = 164,
TupleType = 165,
TypeLiteral = 166,
TypeQuery = 167,
ParenthesizedType = 168,
TypeReference = 169,
TypePredicate = 170,
NamedObjectType = 171,
ConditionalType = 172,// Last TYpe Node
FunctionDeclaration = 173,
ClassDeclaration = 174,
ExportSpecifier = 175,
ExportDeclaration = 176,
MissingDeclaration = 177,
PropertyAssignment = 178,
ShorthandPropertyAssignment = 179,
SourceFile = 180,
Bundle = 181,
IncludeDirective = 182,
DefineDirective = 183,
UndefDirective = 184,
IfDirective = 185,
IfDefDirective = 186,
IfNDefDirective = 187,
ElseDirective = 188,
ElseIfDirective = 189,
EndIfDirective = 190,
PragmaDirective = 191,
JSDocTypeExpression = 192,// First JSDoc Node
JSDocNameReference = 193,
JSDocMemberName = 194,// C#p
JSDocAllType = 195,// The * type
JSDocUnknownType = 196,// The ? type
JSDocNullableType = 197,
JSDocNonNullableType = 198,
JSDocOptionalType = 199,
JSDocFunctionType = 200,
JSDocVariadicType = 201,
JSDocNamepathType = 202,// https://jsdoc.app/about-namepaths.html
JSDoc = 203,
/** @deprecated Use SyntaxKind.JSDoc */
JSDocComment = 203,
JSDocText = 204,
JSDocTypeLiteral = 205,
JSDocSignature = 206,
JSDocLink = 207,
JSDocLinkCode = 208,
JSDocLinkPlain = 209,
JSDocTag = 210,
JSDocAugmentsTag = 211,
JSDocImplementsTag = 212,
JSDocAuthorTag = 213,
JSDocDeprecatedTag = 214,
JSDocClassTag = 215,
JSDocPublicTag = 216,
JSDocPrivateTag = 217,
JSDocProtectedTag = 218,
JSDocReadonlyTag = 219,
JSDocOverrideTag = 220,
JSDocCallbackTag = 221,
JSDocOverloadTag = 222,
JSDocEnumTag = 223,
JSDocParameterTag = 224,
JSDocReturnTag = 225,
JSDocThisTag = 226,
JSDocTypeTag = 227,
JSDocTemplateTag = 228,
JSDocTypedefTag = 229,
JSDocSeeTag = 230,
JSDocPropertyTag = 231,
JSDocVariableTag = 232,
JSDocThrowsTag = 233,
JSDocSatisfiesTag = 234,
JSDocImportTag = 235,// Last JSDoc Node
SyntaxList = 236,
NotEmittedStatement = 237,
PartiallyEmittedExpression = 238,
CommaListExpression = 239,
Block = 240,
VariableDeclaration = 241,
VariableDeclarationList = 242,
TypeAliasDeclaration = 243,
CaseBlock = 244,
StructDeclaration = 245,// WAS: ClassDeclaration,
VariableStatement = 246,// FirstStatement
ForStatement = 247,
ForEachStatement = 248,
DoWhileStatement = 249,
WhileStatement = 250,
ExpressionStatement = 251,
ReturnStatement = 252,
LabeledStatement = 253,
BreakStatement = 254,
ContinueStatement = 255,
InheritDeclaration = 256,
IfStatement = 257,
EmptyStatement = 258,
CatchStatement = 259,
SwitchStatement = 260,// LastStatement
LiteralType = 261,
StructType = 262,
InferType = 263,
ThisType = 264,
IndexedAccessType = 265,
NamedTupleMember = 266,
TypeOperator = 267,
MappedType = 268,
ArrayBindingPattern = 269,
BindingElement = 270,
ConditionalExpression = 271,
CatchExpression = 272,
BinaryExpression = 273,
FunctionExpression = 274,
ArrowFunction = 275,
CallExpression = 276,
CloneObjectExpression = 277,
ClassExpression = 278,
SyntheticExpression = 279,
NewExpression = 280,
NewStructExpression = 281,
EvaluateExpression = 282,
TypeAssertionExpression = 283,
ExpressionWithTypeArguments = 284,
ElementAccessExpression = 285,
RangeExpression = 286,
InlineClosureExpression = 287,
LambdaIdentifierExpression = 288,
LambdaOperatorExpression = 289,
PropertyAccessExpression = 290,
SuperAccessExpression = 291,
PostfixUnaryExpression = 292,
ParenthesizedExpression = 293,
ArrayLiteralExpression = 294,
MappingLiteralExpression = 295,
MappingEntryExpression = 296,
ObjectLiteralExpression = 297,
SpreadElement = 298,
ByRefElement = 299,
CastExpression = 300,
OmittedExpression = 301,
PrefixUnaryExpression = 302,
CaseClause = 303,
HeritageClause = 304,
DefaultClause = 305,
Count = 306,
FirstReservedWord = 93,
LastReservedWord = 130,
FirstKeyword = 93,
LastKeyword = 147,
FirstToken = 0,
LastToken = 147,
FirstStatement = 246,
LastStatement = 260,
FirstAssignment = 74,
LastAssignment = 89,
SuperKeyword = 71,
FirstTypeNode = 159,
LastTypeNode = 172,
FirstNode = 148,
FirstFutureReservedWord = 93,
LastFutureReservedWord = 147,
FirstJSDocNode = 192,
LastJSDocNode = 235,
FirstLiteralToken = 11,
LastLiteralToken = 16,
FirstJSDocTagNode = 192,
LastJSDocTagNode = 235,
FirstTriviaToken = 2,
LastTriviaToken = 8,
FirstBinaryOperator = 29,
LastBinaryOperator = 89,
FirstPunctuation = 17,
LastPunctuation = 73
}
export declare const enum TypeFlags {
Any = 1,
Unknown = 2,
String = 4,
Number = 8,
Boolean = 16,
Enum = 32,// Numeric computed enum member value
Float = 64,
StringLiteral = 128,
IntLiteral = 256,
BooleanLiteral = 512,
EnumLiteral = 1024,// Always combined with StringLiteral, NumberLiteral, or Union
FloatLiteral = 2048,
Bytes = 4096,
BytesLiteral = 8192,// unique symbol
Void = 16384,
Undefined = 32768,
Null = 65536,
Never = 131072,// Never type
TypeParameter = 262144,// Type parameter
Object = 524288,// Object type
Union = 1048576,// Union (T | U)
Intersection = 2097152,// Intersection (T & U)
Index = 4194304,// keyof T
IndexedAccess = 8388608,// T[K]
Conditional = 16777216,// T extends U ? X : Y
Substitution = 33554432,// Type parameter substitution
NonPrimitive = 67108864,// intrinsic object type
TemplateLiteral = 134217728,// Template literal type
StringMapping = 268435456,// Used by union/intersection type construction
LpcDocVariable = -2147483648,
Literal = 2944,
Unit = 101280,
Freshable = 2976,
StringOrNumberLiteral = 384,
PossiblyFalsy = 121820,
StringLike = 402653316,
NumberLike = 2344,
BooleanLike = 528,
EnumLike = 1056,
VoidLike = 49152,
BytesLike = 12288,
UnionOrIntersection = 3145728,
StructuredType = 3670016,
TypeVariable = 8650752,
InstantiableNonPrimitive = 58982400,
InstantiablePrimitive = 406847488,
Instantiable = 465829888,
StructuredOrInstantiable = 469499904,
Narrowable = 536624063
}
export declare const enum TypeFormatFlags {
None = 0,
NoTruncation = 1,// Don't truncate typeToString result
WriteArrayAsGenericType = 2,// Write Array<T> instead T[]
GenerateNamesForShadowedTypeParams = 4,// When a type parameter T is shadowing another T, generate a name for it so it can still be referenced
UseStructuralFallback = 8,// When an alias cannot be named by its symbol, rather than report an error, fallback to a structural printout if possible
WriteTypeArgumentsOfSignature = 32,// Write the type arguments instead of type parameters of the signature
UseFullyQualifiedType = 64,// Write out the fully qualified type name (eg. Module.Type, instead of Type)
SuppressAnyReturnType = 256,// If the return type is any-like, don't offer a return type.
MultilineObjectLiterals = 1024,// Always print object literals across multiple lines (only used to map into node builder flags)
WriteClassExpressionAsTypeLiteral = 2048,// Write a type literal instead of (Anonymous class)
UseTypeOfFunction = 4096,// Write typeof instead of function type literal
OmitParameterModifiers = 8192,// Omit modifiers on parameters
UseAliasDefinedOutsideCurrentScope = 16384,// For a `type T = ... ` defined in a different file, write `T` instead of its value, even though `T` can't be accessed in the current scope.
UseSingleQuotesForStringLiteralType = 268435456,// Use single quotes for string literal type
NoTypeReduction = 536870912,// Don't call getReducedType
OmitThisParameter = 33554432,
AllowUniqueESSymbolType = 1048576,// This is bit 20 to align with the same bit in `NodeBuilderFlags`
AddUndefined = 131072,// Add undefined to types of initialized, non-optional parameters
WriteArrowStyleSignature = 262144,// Write arrow style signature
InArrayType = 524288,// Writing an array element type
InElementType = 2097152,// Writing an array or union element type
InFirstTypeArgument = 4194304,// Writing first type argument of the instantiated type
InTypeAlias = 8388608,// Writing type in type alias declaration
NodeBuilderFlagsMask = 848330095
}
export declare const enum NodeFlags {
None = 0,
Variable = 1,// Variable declaration
ExternalFile = 4,// Included from an external file
Synthesized = 16,// Node was synthesized during transformation
IncludeContext = 32,// Node was parsed from an include file
MacroContext = 64,// Node was parsed as a result of a macro expansion
ExportContext = 128,// Export context (initialized by binding)
HasImplicitReturn = 512,// If function implicitly returns on one of codepaths (initialized by binding)
HasExplicitReturn = 1024,// If function has explicit reachable return on one of codepaths (initialized by binding)
HasAsyncFunctions = 4096,// If the file has async (i.e. LD coroutine) functions (initialized by binding)
DisallowInContext = 8192,// If node was parsed in a context where 'in-expressions' are not allowed
YieldContext = 16384,// If node was parsed in the 'yield' context created when parsing a generator
DisallowTypes = 32768,// If node was parsed in a context where types are not allowed
AwaitContext = 65536,// If node was parsed in the 'await' context created when parsing an async function
DisallowCommaContext = 131072,// If node was parsed in a context where comma expr are not allow
ThisNodeHasError = 262144,// If the parser encountered an error when parsing the code that created this node
DisallowConditionalTypesContext = 524288,
ThisNodeOrAnySubNodesHasError = 1048576,// If this node or any of its children had an error
HasAggregatedChildData = 2097152,// If we've computed data from children and cached it in this node
OptionalChain = 4194304,// not used
DisallowPipeContext = 8388608,// If node was parsed in a context where '|' operators are not allowed
CatchContext = 16777216,// If node was parsed in the 'catch' context created when parsing a catch clause
JSDoc = 33554432,// If has '@deprecated' JSDoc tag
ReachabilityCheckFlags = 1536,
ReachabilityAndEmitFlags = 1536,
ContextFlags = 67887200,
BlockScoped = 1,// Indicates whether the identifier is part of a JSDoc namespace
IncludeOrMacro = 96
}
export declare const enum EmitFlags {
None = 0,
SingleLine = 1,// The contents of this node should be emitted on a single line.
MultiLine = 2,
AdviseOnEmitNode = 4,// The printer should invoke the onEmitNode callback when printing this node.
NoSubstitution = 8,// Disables further substitution of an expression.
CapturesThis = 16,// The function captures a lexical `this`
NoLeadingSourceMap = 32,// Do not emit a leading source map location for this node.
NoTrailingSourceMap = 64,// Do not emit a trailing source map location for this node.
NoSourceMap = 96,// Do not emit a source map location for this node.
NoNestedSourceMaps = 128,// Do not emit source map locations for children of this node.
NoTokenLeadingSourceMaps = 256,// Do not emit leading source map location for token nodes.
NoTokenTrailingSourceMaps = 512,// Do not emit trailing source map location for token nodes.
NoTokenSourceMaps = 768,// Do not emit source map locations for tokens of this node.
NoLeadingComments = 1024,// Do not emit leading comments for this node.
NoTrailingComments = 2048,// Do not emit trailing comments for this node.
NoComments = 3072,// Do not emit comments for this node.
NoNestedComments = 4096,
HelperName = 8192,// The Identifier refers to an *unscoped* emit helper (one that is emitted at the top of the file)
ExportName = 16384,// Ensure an export prefix is added for an identifier that points to an exported declaration with a local name (see SymbolFlags.ExportHasLocal).
LocalName = 32768,// Ensure an export prefix is not added for an identifier that points to an exported declaration.
InternalName = 65536,// The name is internal to an ES5 class body function.
Indented = 131072,// Adds an explicit extra indentation level for class and function bodies when printing (used to match old emitter).
NoIndentation = 262144,// Do not indent the node.
AsyncFunctionBody = 524288,
ReuseTempVariableScope = 1048576,// Reuse the existing temp variable scope during emit.
CustomPrologue = 2097152,// Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed).
NoHoisting = 4194304,// Do not hoist this declaration in --module system
Iterator = 8388608,// The expression to a `yield*` should be treated as an Iterator when down-leveling, not an Iterable.
NoAsciiEscaping = 16777216
}
export declare const enum ModifierFlags {
None = 0,
Public = 1,// Property/Method
Private = 2,// Property/Method
Protected = 4,// Property/Method
NoMask = 32,//
NoShadow = 64,//
NoSave = 128,//
Static = 256,// Property/Method
VarArgs = 512,
Visible = 1024,
Export = 2048,// Declarations
Ambient = 4096,
Readonly = 8192,
In = 16384,// Contravariance modifier
Out = 32768,// Covariance modifier
Deprecated = 65536,
HasComputedJSDocModifiers = 268435456,// Indicates the computed modifier flags include modifiers from JSDoc.
HasComputedFlags = 536870912,// Modifier flags have been computed
AccessibilityModifier = 7,
ParameterPropertyModifier = 167,
NonPublicAccessibilityModifier = 6,
All = 67559,
Modifier = 67559
}
export declare const enum ElementFlags {
Required = 1,// T
Optional = 2,// T?
Rest = 4,// ...T[]
Variadic = 8,// ...T
Fixed = 3,
Variable = 12,
NonRequired = 14,
NonRest = 11
}
export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.IntKeyword | SyntaxKind.FloatKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.BytesKeyword | SyntaxKind.MappingKeyword | SyntaxKind.StatusKeyword | SyntaxKind.LwObjectKeyword | SyntaxKind.ClosureKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.BufferKeyword | SyntaxKind.MixedKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.NeverKeyword | SyntaxKind.VoidKeyword;
export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
export type TypeNodeSyntaxKind = KeywordTypeSyntaxKind | SyntaxKind.TupleType | SyntaxKind.InferType | SyntaxKind.UnionType | SyntaxKind.NamedTupleMember | SyntaxKind.IndexedAccessType | SyntaxKind.StructType | SyntaxKind.ArrayType | SyntaxKind.MappingType | SyntaxKind.LiteralType | SyntaxKind.ThisType | SyntaxKind.TypePredicate | SyntaxKind.MappedType | SyntaxKind.TypeLiteral | SyntaxKind.ParenthesizedType | SyntaxKind.TypeReference | SyntaxKind.ExpressionWithTypeArguments | SyntaxKind.FunctionType | SyntaxKind.ConditionalType | SyntaxKind.IntersectionType | SyntaxKind.NamedObjectType | SyntaxKind.JSDocTypeExpression | SyntaxKind.JSDocAllType | SyntaxKind.JSDocUnknownType | SyntaxKind.JSDocNonNullableType | SyntaxKind.JSDocNullableType | SyntaxKind.JSDocOptionalType | SyntaxKind.JSDocFunctionType | SyntaxKind.JSDocVariadicType | SyntaxKind.JSDocNamepathType | SyntaxKind.JSDocSignature | SyntaxKind.JSDocTypeLiteral;
export type PropertyName = Identifier | StringLiteral | IntLiteral | ComputedPropertyName | ParenthesizedExpression;
export type MemberName = Identifier;
export type DeclarationName = PropertyName | StringLiteral | Expression | ElementAccessExpression | BindingPattern | EntityNameExpression;
export interface Symbol {
flags: SymbolFlags;
name: string;
declarations?: Declaration[];
valueDeclaration?: Declaration;
members?: SymbolTable;
exports?: SymbolTable;
inherits?: Map<string, Type>;
globalExports?: SymbolTable;
}
export interface TrueLiteral extends PrimaryExpression {
readonly kind: SyntaxKind.TrueKeyword;
}
export interface FalseLiteral extends PrimaryExpression {
readonly kind: SyntaxKind.FalseKeyword;
}
export interface NodeFactory {
createSourceFile(statements: readonly Statement[], endOfFileToken: EndOfFileToken, flags: NodeFlags): SourceFile;
createNodeArray<T extends Node>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>;
createIntLiteral(value: string | number, numericLiteralFlags?: TokenFlags): IntLiteral;
createFloatLiteral(value: string | number, numericLiteralFlags?: TokenFlags): FloatLiteral;
createStringLiteral(text: string): StringLiteral;
createBytesLiteral(text: string): BytesLiteral;
createStringLiteralFromNode(sourceNode: PropertyNameLiteral, isSingleQuote?: boolean): StringLiteral;
createTrue(): TrueLiteral;
createFalse(): FalseLiteral;
createToken(token: SyntaxKind.EndOfFileToken): EndOfFileToken;
createToken(token: SyntaxKind.Unknown): Token<SyntaxKind.Unknown>;
createIdentifier(text: string): Identifier;
createLiteralLikeNode(kind: LiteralToken["kind"], text: string): LiteralToken;
createEmptyStatement(): EmptyStatement;
createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[] | undefined;
createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
createComputedPropertyName(expression: Expression): ComputedPropertyName;
updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName;
createIndexSignature(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
createTypeParameterDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration;
updateTypeParameterDeclaration(node: TypeParameterDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration;
createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
createCallSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration;
createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement;
updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement;
createIncludeDirective(content: StringLiteral[], localFirst: boolean): IncludeDirective;
createPragmaDirective(expression: NodeArray<Identifier>): PragmaDirective;
createDefineDirective(name: string | Identifier | TypeNode, args: NodeArray<ParameterDeclaration>, range: TextRange): DefineDirective;
createUndefDirective(name: string | Identifier): UndefDirective;
createTypePredicateNode(assertsModifier: undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode;
updateTypePredicateNode(node: TypePredicateNode, assertsModifier: undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
createKeywordTypeNode<TKind extends KeywordTypeSyntaxKind>(kind: TKind): KeywordTypeNode<TKind>;
createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode;
createUnionTypeNode(types: readonly TypeNode[]): UnionTypeNode;
createIntersectionTypeNode(types: readonly TypeNode[]): IntersectionTypeNode;
createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
createMappingTypeNode(keyType: TypeNode, valueTypes: NodeArray<TypeNode>): MappingTypeNode;
createNamedObjectTypeNode(name: StringLiteral | BinaryExpression | ParenthesizedExpression, objectKeyword: TypeNode): NamedObjectTypeNode;
createParenthesizedType(type: TypeNode): ParenthesizedTypeNode;
createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode;
createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
createStructTypeNode(name: Identifier, keyword: StructKeywordSyntaxKind): StructTypeNode;
createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, type: TypeNode | undefined): PropertySignature;
createStructDeclarationNode(modifiers: readonly Modifier[] | undefined, name: Identifier, heritageName: Identifier | undefined, type: TypeNode): StructDeclaration;
createBlock(statements: readonly Statement[], multiLine?: boolean): Block;
createVariableStatement(modifiers: readonly Modifier[] | undefined, type: TypeNode | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement;
createVariableDeclarationList(declarations: readonly VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList;
createVariableDeclaration(name: string | BindingName, refToken?: RefToken, type?: TypeNode | undefined, initializer?: Expression | undefined): VariableDeclaration;
createFunctionDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
createExpressionStatement(expression: Expression): ExpressionStatement;
createReturnStatement(expression?: Expression): ReturnStatement;
createBreakStatement(label?: string | Identifier): BreakStatement;
createContinueStatement(label?: string | Identifier): ContinueStatement;
createInheritDeclaration(importClause: InheritClauseNodeType, modifiers: readonly Modifier[] | undefined): InheritDeclaration;
createIfStatement(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement;
createSwitchStatement(expression: Expression, preBlock: NodeArray<Statement>, caseBlock: CaseBlock): SwitchStatement;
createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock;
createDefaultClause(statements: readonly Statement[]): DefaultClause;
createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause;
createForStatement(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
createForEachStatement(initializer: ForInitializer | undefined, range: Expression | undefined, statement: Statement): ForEachStatement;
createDoWhileStatement(statement: Statement, expression: Expression): DoWhileStatement;
createWhileStatement(statement: Statement, expression: Expression): WhileStatement;
createParameterDeclaration(modifiers: readonly Modifier[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, ampToken?: AmpersandToken | RefToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration;
createCatchStatement(expression: Expression | undefined, block: Block, modifier?: Identifier, modifierExpression?: Expression): CatchStatement;
createExpressionWithTypeArguments(expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments;
createCatchExpression(expression: Expression, modifier?: Identifier, modifierExpression?: Expression, block?: Block): CatchExpression;
createEvaluateExpression(expression: Expression, argumentsArray: readonly Expression[] | undefined): EvaluateExpression;
createNewExpression(expression: Expression | TypeNode | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly NewExpressionArgument[] | undefined): NewExpression;
createSpreadElement(expression: Expression): SpreadElement;
createByRefElement(ampToken: AmpersandToken | RefToken, expr: Expression): ByRefElement;
createFunctionExpression(modifiers: readonly Modifier[] | undefined, name: string | Identifier | undefined, parameters: readonly ParameterDeclaration[] | undefined, type: TypeNode | undefined, body: Block): FunctionExpression;
createOmittedExpression(): OmittedExpression;
createParenthesizedExpression(expression: Expression): ParenthesizedExpression;
createConditionalExpression(condition: Expression, questionToken: QuestionToken | undefined, whenTrue: Expression, colonToken: ColonToken | undefined, whenFalse: Expression): ConditionalExpression;
createBinaryExpression(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression;
createCallExpression(expression: Expression, argumentsArray: readonly Expression[] | undefined): CallExpression;
createInlineClosure(body: ConciseBody | NodeArray<Expression>): InlineClosureExpression;
createSuperAccessExpression(name: MemberName, namespace?: string | StringLiteral | Identifier): SuperAccessExpression;
createPropertyAccessExpression(expression: Expression, name: string | Identifier | Expression, propertyAccessToken?: PropertyAccessToken): PropertyAccessExpression;
createPrefixUnaryExpression(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression;
createPostfixUnaryExpression(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression;
createElementAccessExpression(expression: Expression, index: number | Expression): ElementAccessExpression;
createArrayLiteralExpression(elements?: readonly Expression[], multiLine?: boolean, trailingComma?: boolean): any;
createObjectLiteralExpression(properties?: readonly ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression;
createMappingLiteralExpression(initializer?: Expression, elements?: readonly Expression[], multiLine?: boolean, trailingComma?: boolean): MappingLiteralExpression;
createMappingEntryExpression(name: Expression, elements: readonly Expression[]): MappingEntryExpression;
convertToAssignmentExpression(node: Mutable<VariableDeclaration>): BinaryExpression;
createLambdaOperatorExpression(op: LambdaOperatorToken): LambdaOperatorExpression;
createLambdaIdentifierExpression(name: Expression): LambdaIdentifierExpression;
createCastExpression(expression: Expression, type: TypeNode): Expression;
createCloneObjectExpression(expression: Expression, argumentsArray: readonly Expression[] | undefined): CloneObjectExpression;
createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion;
createNewStructExpression(type: StructTypeNode, argumentsArray: readonly (Expression | ObjectLiteralElementLike)[] | undefined): NewStructExpression;
createRangeExpression(left: Expression, right: Expression): RangeExpression;
createJSDocText(text: string): JSDocText;
createJSDocComment(comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc;
createJSDocParameterTag(tagName: Identifier | undefined, name: EntityName, defaultExpression: Expression | undefined, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocParameterTag;
createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocReturnTag;
createJSDocOptionalType(type: TypeNode): JSDocOptionalType;
createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocTypeTag;
createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression;
createJSDocNameReference(name: EntityName | JSDocMemberName): JSDocNameReference;
createJSDocLink(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLink;
createJSDocLinkCode(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkCode;
createJSDocLinkPlain(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkPlain;
createJSDocClassTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocClassTag;
createJSDocPublicTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocPublicTag;
createJSDocPrivateTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocPrivateTag;
createJSDocProtectedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocProtectedTag;
createJSDocDeprecatedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
createJSDocOverrideTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocUnknownTag;
createJSDocPropertyTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocPropertyTag;
createJSDocVariableTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocVariableTag;
createJSDocTypeLiteral(propertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral;
createJSDocSeeTag(tagName: Identifier | undefined, name: JSDocNameReference | undefined, comment?: string | NodeArray<JSDocComment>): JSDocSeeTag;
createJSDocAuthorTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocAuthorTag;
createJSDocThrowsTag(tagName: Identifier, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment>): JSDocThrowsTag;
createJSDocImplementsTag(tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment?: string | NodeArray<JSDocComment>): JSDocImplementsTag;
createJSDocTypedefTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | JSDocTypeLiteral, fullName?: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocTypedefTag;
createJSDocAugmentsTag(tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment?: string | NodeArray<JSDocComment>): JSDocAugmentsTag;
createJSDocSatisfiesTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocSatisfiesTag;
createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocThisTag;
createJSDocVariadicType(type: TypeNode): JSDocVariadicType;
createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature;
createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocCallbackTag;
createJSDocOverloadTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, comment?: string | NodeArray<JSDocComment>): JSDocOverloadTag;
createJSDocTemplateTag(tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | NodeArray<JSDocComment>): JSDocTemplateTag;
createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment;
}
export interface CompilerOptions {
skipLibCheck?: boolean;
skipDefaultLibCheck?: boolean;
allowArbitraryExtensions?: boolean;
traceResolution?: boolean;
allowUnreachableCode?: boolean;
noUncheckedIndexedAccess?: boolean;
noFallthroughCasesInSwitch?: boolean;
noCheck?: boolean;
noUnusedLocals?: boolean;
noUnusedParameters?: boolean;
noImplicitReturns?: boolean;
strictObjectTypes?: boolean;
newLine?: NewLineKind;
configFile?: LpcConfigSourceFile;
sefunFile?: string;
masterFile?: string;
playerFile?: string;
configDefines?: MapLike<string>;
forceConsistentCasingInFileNames?: boolean;
noResolve?: boolean;
noLib?: boolean;
maxNodeModuleJsDepth?: number;
getCompilationSettings?: any;
configFilePath?: string;
driverType?: LanguageVariant;
rootDir?: string;
rootDirs?: string[];
outDir?: string;
declarationDir?: string;
outFile?: string;
paths?: MapLike<string[]>;
lib?: string[];
preserveSymlinks?: boolean;
disableSourceOfProjectReferenceRedirect?: boolean;
disableReferencedProjectLoad?: boolean;
module?: ModuleKind;
target?: ScriptTarget;
exactOptionalPropertyTypes?: boolean;
diagnostics?: boolean;
libIncludeDirs?: string[];
globalIncludeFiles?: string[];
resolvedGlobalIncludeFiles?: string[];
[option: string]: CompilerOptionsValue | LpcConfigSourceFile | undefined;
}
export declare const enum OuterExpressionKinds {
Parentheses = 1,
/** @deprecated not supported in lpc */
TypeAssertions = 2,
/** @deprecated not supported in lpc */
NonNullAssertions = 4,
PartiallyEmittedExpressions = 8,
Assertions = 6,
All = 15,
ExcludeJSDocTypeAssertion = 16
}
/** DIAGNOSTICS */
export interface DiagnosticMessage {
key: string;
category: DiagnosticCategory;
code: number;
message: string;
reportsUnnecessary?: {};
reportsDeprecated?: {};
}
export declare enum DiagnosticCategory {
Warning = 0,
Error = 1,
Suggestion = 2,
Message = 3
}
export interface DiagnosticRelatedInformation {
category: DiagnosticCategory;
code: number;
file: SourceFileBase | undefined;
start: number | undefined;
length: number | undefined;
messageText: string | DiagnosticMessageChain;
}
export interface DiagnosticWithLocation extends Diagnostic {
file: SourceFileBase;
start: number;
length: number;
}
/**
* A linked list of formatted diagnostic messages to be used as part of a multiline message.
* It is built from