Skip to content
svallory edited this page Nov 13, 2014 · 13 revisions

Interfaces, Types and Enums

DiagnosticCategory enum

0 Warning
1 Error
2 Message

ScriptTarget enum

0 ES3
1 ES5

FileReference

number pos
number end
string filename

CompilerOptions

boolean fullTypeCheckMode default: false

Diagnostic

[[SourceFile|Interfaces#sourcefile-interface]] file
number start
number length
string messageText
[[DiagnosticCategory|Interfaces#diagnosticcategory-enum]] category
number code

Map<TValue>

TValue some_key
TValue another_key
TValue . . .

    Works just like an object where values are of type TValue

NodeFlags enum

0x0001 Export           Declarations
0x0002 Ambient           Declarations
0x0004 QuestionMark           Parameter/Property/Method
0x0008 Rest           Parameter
0x0010 Public           Property/Method
0x0020 Private           Property/Method
0x0040 Static           Property/Method
0x0080 MultiLine           Multi-line array or object literal
0x0100 Synthetic           Synthetic node (for full fidelity)
0x0200 DeclarationFile           Node is a .d.ts file
0x0073 Modifier = Export | Ambient | Public | Private | Static

Node

number pos
number end
[[SyntaxKind|]] kind
[[NodeFlags|Interfaces#nodeflags-enum]] flags
number id?
         Unique id (used to look up NodeLinks)
[[Node|Interfaces#node]] parent?
         Parent node (initialized by binding)
[[Symbol|]] symbol?
         Symbol declared by node (initialized by binding)
[[SymbolTable|]] locals?
         Locals associated with node (initialized by binding)
[[Node|Interfaces#node]] nextContainer?
         Next container in declaration order (initialized by binding)
[[Symbol|]] localSymbol?
         Local symbol declared by node (initialized by binding only for exported nodes)

SourceFile

string filename
string text
string[] amdDependencies
[[FileReference|Interfaces#filereference]][] referencedFiles
[[Diagnostic[]|Interfaces#diagnostic]] syntacticErrors
[[Diagnostic[]|Interfaces#diagnostic]] semanticErrors
boolean hasNoDefaultLib
[[Node|Interfaces#node]] externalModuleIndicator
number nodeCount
number identifierCount
number symbolCount
boolean isOpen
string version
[[ScriptTarget|Interfaces#scripttarget]] languageVersion
[[Map<string>|Interfaces#maptvalue]] identifiers
getLineAndCharacterFromPosition ( number postion )
        returns { number line, number character }
getPositionFromLineAndCharacter ( number line, number character )
        returns number

SourceType enum

0 File
1 String

Source

SourceType type
string filename?
string contents?

StringSource class

implements: Source

SourceType type = SourceType.String
constructor ( string contents, string filename?)
resetCounter ( )
         Resets the internal counter used to generate file names

FileSource class

implements: Source

SourceType type = SourceType.File
constructor ( string filename )

Clone this wiki locally