commit e271c974adf19adc50bc88d6f5d67c55f5f63a6a
Author: Adam <897017+asemy@users.noreply.github.com>
Date: Thu Oct 7 22:14:53 2021 +0200
init
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ff3921f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,249 @@
+
+.idea
+
+# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,gradle,intellij,visualstudiocode,kotlin
+# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,gradle,intellij,visualstudiocode,kotlin
+
+### Intellij ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+.idea/artifacts
+.idea/compiler.xml
+.idea/jarRepositories.xml
+.idea/modules.xml
+.idea/*.iml
+.idea/modules
+*.iml
+*.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### Intellij Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+# https://plugins.jetbrains.com/plugin/7973-sonarlint
+.idea/**/sonarlint/
+
+# SonarQube Plugin
+# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
+.idea/**/sonarIssues.xml
+
+# Markdown Navigator plugin
+# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
+.idea/**/markdown-navigator.xml
+.idea/**/markdown-navigator-enh.xml
+.idea/**/markdown-navigator/
+
+# Cache file creation bug
+# See https://youtrack.jetbrains.com/issue/JBR-2257
+.idea/$CACHE_FILE$
+
+# CodeStream plugin
+# https://plugins.jetbrains.com/plugin/12206-codestream
+.idea/codestream.xml
+
+### Kotlin ###
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+### Linux ###
+*~
+
+# temporary files which can be created if a process still has a handle open of a deleted file
+.fuse_hidden*
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+# .nfs files are created when an open file is removed but is still being accessed
+.nfs*
+
+### macOS ###
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+### VisualStudioCode ###
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+### VisualStudioCode Patch ###
+# Ignore all local history of files
+.history
+.ionide
+
+### Windows ###
+# Windows thumbnail cache files
+Thumbs.db
+Thumbs.db:encryptable
+ehthumbs.db
+ehthumbs_vista.db
+
+# Dump file
+*.stackdump
+
+# Folder config file
+[Dd]esktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+### Gradle ###
+.gradle
+build/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+
+# Cache of project
+.gradletasknamecache
+
+# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
+# gradle/wrapper/gradle-wrapper.properties
+
+### Gradle Patch ###
+**/build/
+
+# Eclipse Gradle plugin generated files
+# Eclipse Core
+.project
+# JDT-specific (Eclipse Java Development Tools)
+.classpath
+
+# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,gradle,intellij,visualstudiocode,kotlin
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..90efe8e
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,137 @@
+import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
+
+plugins {
+ kotlin("multiplatform") version "1.5.31"
+}
+
+group = "dev.adamko.factoriowebmap"
+version = "1.0-SNAPSHOT"
+
+//repositories {
+// mavenCentral()
+// maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
+//}
+
+
+kotlin {
+
+ //
+ val hostOs = System.getProperty("os.name")
+ val isMingwX64 = hostOs.startsWith("Windows")
+ val nativeTarget = when {
+ hostOs == "Mac OS X" -> macosX64("native")
+ hostOs == "Linux" -> linuxX64("native")
+ isMingwX64 -> mingwX64("native")
+ else -> throw GradleException(
+ "Host OS '$hostOs' is not supported in Kotlin/Native.")
+ }
+
+ nativeTarget.apply {
+ binaries {
+ executable {
+ entryPoint = "main"
+ }
+ sharedLib {
+ baseName = if (isMingwX64) "libnative" else "native"
+ }
+ }
+ }
+ sourceSets {
+ val nativeMain by getting {
+ dependencies {
+ implementation("com.soywiz.korlibs.luak:luak:2.4.3")
+ }
+ }
+ val nativeTest by getting {
+ dependencies {
+ implementation(kotlin("test"))
+
+ }
+ }
+ }
+ //
+
+ //
+ js(IR) {
+ binaries.executable()
+ browser {
+ commonWebpackConfig {
+ cssSupport.enabled = true
+ }
+ }
+
+ useCommonJs()
+ nodejs()
+
+ compilations.all {
+ packageJson {
+ customField(
+ "scripts", mapOf(
+ "build" to "tstl",
+ "dev" to "tstl --watch",
+ )
+ )
+ }
+ }
+// compilations["main"]
+// .packageJson {
+// customField(
+// "scripts", mapOf(
+// "build" to "tstl",
+// "dev" to "tstl --watch",
+// )
+// )
+// }
+ }
+
+ sourceSets {
+
+ val jsMain by getting {
+ kotlin.srcDir("externals02")
+// kotlin.srcDir("externals")
+
+ dependencies {
+
+ val kotlinWrappersVersion = "0.0.1-pre.254-kotlin-1.5.31"
+ implementation(
+ project.dependencies.enforcedPlatform(
+ "org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:${kotlinWrappersVersion}"
+ )
+ )
+
+ implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
+ implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
+ implementation(npm("react", "17.0.2"))
+ implementation(npm("react-dom", "17.0.2"))
+
+// implementation("org.jetbrains.kotlinx:kotlinx-nodejs:0.0.7") {
+// because("https://github.com/Kotlin/kotlinx-nodejs")
+// }
+
+ val generateExternals = false
+ implementation(npm("typescript-to-lua", "1.0.1", generateExternals = generateExternals))
+ implementation(npm("typed-factorio", "0.7.1", generateExternals = generateExternals))
+ implementation(npm("lua-types", "2.11.0", generateExternals = generateExternals))
+ implementation(npm("typescript", "4.4.3", generateExternals = generateExternals))
+ }
+ }
+
+ val jsTest by getting {
+ dependencies {
+ implementation(kotlin("test-js"))
+ }
+ }
+ }
+ //
+
+}
+
+configure {
+ versions.dukat.version = "0.5.8-rc.4-dev.20211001"
+// versions.dukat.version = "0.5.8-rc.4"
+}
+
+tasks.wrapper {
+ gradleVersion = "7.2"
+ distributionType = Wrapper.DistributionType.ALL
+}
diff --git a/externals/CompilerOptions.module_typescript-to-lua.kt b/externals/CompilerOptions.module_typescript-to-lua.kt
new file mode 100644
index 0000000..aa83510
--- /dev/null
+++ b/externals/CompilerOptions.module_typescript-to-lua.kt
@@ -0,0 +1,74 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.Diagnostic
+
+typealias OmitIndexSignature = Any
+
+external interface TransformerImport {
+ var transform: String
+ var import: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var after: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+ var afterDeclarations: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+ var type: String? /* "program" | "config" | "checker" | "raw" | "compilerOptions" */
+ get() = definedExternally
+ set(value) = definedExternally
+ @nativeGetter
+ operator fun get(option: String): Any?
+ @nativeSetter
+ operator fun set(option: String, value: Any)
+}
+
+external interface LuaPluginImport {
+ var name: String
+ var import: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ @nativeGetter
+ operator fun get(option: String): Any?
+ @nativeSetter
+ operator fun set(option: String, value: Any)
+}
+
+external enum class LuaLibImportKind {
+ None /* = "none" */,
+ Always /* = "always" */,
+ Inline /* = "inline" */,
+ Require /* = "require" */
+}
+
+external enum class LuaTarget {
+ Universal /* = "universal" */,
+ Lua51 /* = "5.1" */,
+ Lua52 /* = "5.2" */,
+ Lua53 /* = "5.3" */,
+ Lua54 /* = "5.4" */,
+ LuaJIT /* = "JIT" */
+}
+
+external enum class BuildMode {
+ Default /* = "default" */,
+ Library /* = "library" */
+}
+
+external var isBundleEnabled: (options: dynamic /* typealias OmitIndexSignature = dynamic */) -> Boolean
+
+external fun validateOptions(options: dynamic /* typealias OmitIndexSignature = dynamic */): Array
\ No newline at end of file
diff --git a/externals/LuaAST.module_typescript-to-lua.kt b/externals/LuaAST.module_typescript-to-lua.kt
new file mode 100644
index 0000000..079e37f
--- /dev/null
+++ b/externals/LuaAST.module_typescript-to-lua.kt
@@ -0,0 +1,485 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import tsstdlib.Set
+
+external enum class SyntaxKind {
+ File /* = 0 */,
+ Block /* = 1 */,
+ DoStatement /* = 2 */,
+ VariableDeclarationStatement /* = 3 */,
+ AssignmentStatement /* = 4 */,
+ IfStatement /* = 5 */,
+ WhileStatement /* = 6 */,
+ RepeatStatement /* = 7 */,
+ ForStatement /* = 8 */,
+ ForInStatement /* = 9 */,
+ GotoStatement /* = 10 */,
+ LabelStatement /* = 11 */,
+ ReturnStatement /* = 12 */,
+ BreakStatement /* = 13 */,
+ ExpressionStatement /* = 14 */,
+ StringLiteral /* = 15 */,
+ NumericLiteral /* = 16 */,
+ NilKeyword /* = 17 */,
+ DotsKeyword /* = 18 */,
+ TrueKeyword /* = 19 */,
+ FalseKeyword /* = 20 */,
+ FunctionExpression /* = 21 */,
+ TableFieldExpression /* = 22 */,
+ TableExpression /* = 23 */,
+ UnaryExpression /* = 24 */,
+ BinaryExpression /* = 25 */,
+ CallExpression /* = 26 */,
+ MethodCallExpression /* = 27 */,
+ Identifier /* = 28 */,
+ TableIndexExpression /* = 29 */,
+ AdditionOperator /* = 30 */,
+ SubtractionOperator /* = 31 */,
+ MultiplicationOperator /* = 32 */,
+ DivisionOperator /* = 33 */,
+ FloorDivisionOperator /* = 34 */,
+ ModuloOperator /* = 35 */,
+ PowerOperator /* = 36 */,
+ NegationOperator /* = 37 */,
+ ConcatOperator /* = 38 */,
+ LengthOperator /* = 39 */,
+ EqualityOperator /* = 40 */,
+ InequalityOperator /* = 41 */,
+ LessThanOperator /* = 42 */,
+ LessEqualOperator /* = 43 */,
+ GreaterThanOperator /* = 44 */,
+ GreaterEqualOperator /* = 45 */,
+ AndOperator /* = 46 */,
+ OrOperator /* = 47 */,
+ NotOperator /* = 48 */,
+ BitwiseAndOperator /* = 49 */,
+ BitwiseOrOperator /* = 50 */,
+ BitwiseExclusiveOrOperator /* = 51 */,
+ BitwiseRightShiftOperator /* = 52 */,
+ BitwiseLeftShiftOperator /* = 53 */,
+ BitwiseNotOperator /* = 54 */
+}
+
+typealias UnaryBitwiseOperator = SyntaxKind.BitwiseNotOperator
+
+external interface TextRange {
+ var line: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+ var column: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface Node : TextRange {
+ var kind: SyntaxKind
+}
+
+external fun createNode(kind: SyntaxKind, tsOriginal: ts.Node = definedExternally): Node
+
+external fun cloneNode(node: T): T
+
+external fun setNodePosition(node: T, position: TextRange): T
+
+external fun setNodeOriginal(node: T, tsOriginal: ts.Node): T
+
+external fun setNodeOriginal(node: T?, tsOriginal: ts.Node): T?
+
+external fun getOriginalPos(node: Node): TextRange
+
+external interface File : Node {
+ var statements: Array
+ var luaLibFeatures: Set
+ var trivia: String
+}
+
+external fun isFile(node: Node): Boolean
+
+external fun createFile(statements: Array, luaLibFeatures: Set, trivia: String, tsOriginal: ts.Node = definedExternally): File
+
+external interface Block : Node {
+ var statements: Array
+}
+
+external fun isBlock(node: Node): Boolean
+
+external fun createBlock(statements: Array, tsOriginal: ts.Node = definedExternally): Block
+
+external interface Statement : Node {
+ var _statementBrand: Any
+ var leadingComments: Array */>?
+ get() = definedExternally
+ set(value) = definedExternally
+ var trailingComments: Array */>?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface DoStatement : Statement {
+ var statements: Array
+}
+
+external fun isDoStatement(node: Node): Boolean
+
+external fun createDoStatement(statements: Array, tsOriginal: ts.Node = definedExternally): DoStatement
+
+external interface VariableDeclarationStatement : Statement {
+ var left: Array
+ var right: Array?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun isVariableDeclarationStatement(node: Node): Boolean
+
+external fun createVariableDeclarationStatement(left: Identifier, right: Expression = definedExternally, tsOriginal: ts.Node = definedExternally): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Identifier): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Identifier, right: Expression = definedExternally): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Identifier, right: Array = definedExternally, tsOriginal: ts.Node = definedExternally): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Identifier, right: Array = definedExternally): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Array, right: Expression = definedExternally, tsOriginal: ts.Node = definedExternally): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Array): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Array, right: Expression = definedExternally): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Array, right: Array = definedExternally, tsOriginal: ts.Node = definedExternally): VariableDeclarationStatement
+
+external fun createVariableDeclarationStatement(left: Array, right: Array = definedExternally): VariableDeclarationStatement
+
+external interface AssignmentStatement : Statement {
+ var left: Array
+ var right: Array
+}
+
+external fun isAssignmentStatement(node: Node): Boolean
+
+external fun createAssignmentStatement(left: Identifier, right: Expression = definedExternally, tsOriginal: ts.Node = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: Identifier): AssignmentStatement
+
+external fun createAssignmentStatement(left: Identifier, right: Expression = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: Identifier, right: Array = definedExternally, tsOriginal: ts.Node = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: Identifier, right: Array = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: TableIndexExpression, right: Expression = definedExternally, tsOriginal: ts.Node = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: TableIndexExpression): AssignmentStatement
+
+external fun createAssignmentStatement(left: TableIndexExpression, right: Expression = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: TableIndexExpression, right: Array = definedExternally, tsOriginal: ts.Node = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: TableIndexExpression, right: Array = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: Array, right: Expression = definedExternally, tsOriginal: ts.Node = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: Array): AssignmentStatement
+
+external fun createAssignmentStatement(left: Array, right: Expression = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: Array, right: Array = definedExternally, tsOriginal: ts.Node = definedExternally): AssignmentStatement
+
+external fun createAssignmentStatement(left: Array, right: Array = definedExternally): AssignmentStatement
+
+external interface IfStatement : Statement {
+ var condition: Expression
+ var ifBlock: Block
+ var elseBlock: dynamic /* Block? | IfStatement? */
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun isIfStatement(node: Node): Boolean
+
+external fun createIfStatement(condition: Expression, ifBlock: Block, elseBlock: Block = definedExternally, tsOriginal: ts.Node = definedExternally): IfStatement
+
+external fun createIfStatement(condition: Expression, ifBlock: Block): IfStatement
+
+external fun createIfStatement(condition: Expression, ifBlock: Block, elseBlock: Block = definedExternally): IfStatement
+
+external fun createIfStatement(condition: Expression, ifBlock: Block, elseBlock: IfStatement = definedExternally, tsOriginal: ts.Node = definedExternally): IfStatement
+
+external fun createIfStatement(condition: Expression, ifBlock: Block, elseBlock: IfStatement = definedExternally): IfStatement
+
+external interface IterationStatement : Statement {
+ var body: Block
+}
+
+external fun isIterationStatement(node: Node): Boolean
+
+external interface WhileStatement : IterationStatement {
+ var condition: Expression
+}
+
+external fun isWhileStatement(node: Node): Boolean
+
+external fun createWhileStatement(body: Block, condition: Expression, tsOriginal: ts.Node = definedExternally): WhileStatement
+
+external interface RepeatStatement : IterationStatement {
+ var condition: Expression
+}
+
+external fun isRepeatStatement(node: Node): Boolean
+
+external fun createRepeatStatement(body: Block, condition: Expression, tsOriginal: ts.Node = definedExternally): RepeatStatement
+
+external interface ForStatement : IterationStatement {
+ var controlVariable: Identifier
+ var controlVariableInitializer: Expression
+ var limitExpression: Expression
+ var stepExpression: Expression?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun isForStatement(node: Node): Boolean
+
+external fun createForStatement(body: Block, controlVariable: Identifier, controlVariableInitializer: Expression, limitExpression: Expression, stepExpression: Expression = definedExternally, tsOriginal: ts.Node = definedExternally): ForStatement
+
+external interface ForInStatement : IterationStatement {
+ var names: Array
+ var expressions: Array
+}
+
+external fun isForInStatement(node: Node): Boolean
+
+external fun createForInStatement(body: Block, names: Array, expressions: Array, tsOriginal: ts.Node = definedExternally): ForInStatement
+
+external interface GotoStatement : Statement {
+ var label: String
+}
+
+external fun isGotoStatement(node: Node): Boolean
+
+external fun createGotoStatement(label: String, tsOriginal: ts.Node = definedExternally): GotoStatement
+
+external interface LabelStatement : Statement {
+ var name: String
+}
+
+external fun isLabelStatement(node: Node): Boolean
+
+external fun createLabelStatement(name: String, tsOriginal: ts.Node = definedExternally): LabelStatement
+
+external interface ReturnStatement : Statement {
+ var expressions: Array
+}
+
+external fun isReturnStatement(node: Node): Boolean
+
+external fun createReturnStatement(expressions: Array, tsOriginal: ts.Node = definedExternally): ReturnStatement
+
+external interface BreakStatement : Statement
+
+external fun isBreakStatement(node: Node): Boolean
+
+external fun createBreakStatement(tsOriginal: ts.Node = definedExternally): BreakStatement
+
+external interface ExpressionStatement : Statement {
+ var expression: Expression
+}
+
+external fun isExpressionStatement(node: Node): Boolean
+
+external fun createExpressionStatement(expressions: Expression, tsOriginal: ts.Node = definedExternally): ExpressionStatement
+
+external interface Expression : Node {
+ var _expressionBrand: Any
+}
+
+external interface NilLiteral : Expression
+
+external fun isNilLiteral(node: Node): Boolean
+
+external fun createNilLiteral(tsOriginal: ts.Node = definedExternally): NilLiteral
+
+external interface BooleanLiteral : Expression {
+ override var kind: dynamic /* SyntaxKind.TrueKeyword | SyntaxKind.FalseKeyword */
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun isBooleanLiteral(node: Node): Boolean
+
+external fun createBooleanLiteral(value: Boolean, tsOriginal: ts.Node = definedExternally): BooleanLiteral
+
+external interface DotsLiteral : Expression
+
+external fun isDotsLiteral(node: Node): Boolean
+
+external fun createDotsLiteral(tsOriginal: ts.Node = definedExternally): DotsLiteral
+
+external interface NumericLiteral : Expression {
+ var value: Number
+}
+
+external fun isNumericLiteral(node: Node): Boolean
+
+external fun createNumericLiteral(value: Number, tsOriginal: ts.Node = definedExternally): NumericLiteral
+
+external interface StringLiteral : Expression {
+ var value: String
+}
+
+external fun isStringLiteral(node: Node): Boolean
+
+external fun createStringLiteral(value: String, tsOriginal: ts.Node = definedExternally): StringLiteral
+
+external enum class FunctionExpressionFlags {
+ None /* = 1 */,
+ Inline /* = 2 */,
+ Declaration /* = 4 */
+}
+
+external interface FunctionExpression : Expression {
+ var params: Array?
+ get() = definedExternally
+ set(value) = definedExternally
+ var dots: DotsLiteral?
+ get() = definedExternally
+ set(value) = definedExternally
+ var body: Block
+ var flags: FunctionExpressionFlags
+}
+
+external fun isFunctionExpression(node: Node): Boolean
+
+external fun createFunctionExpression(body: Block, params: Array = definedExternally, dots: DotsLiteral = definedExternally, flags: FunctionExpressionFlags = definedExternally, tsOriginal: ts.Node = definedExternally): FunctionExpression
+
+external interface TableFieldExpression : Expression {
+ var value: Expression
+ var key: Expression?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun isTableFieldExpression(node: Node): Boolean
+
+external fun createTableFieldExpression(value: Expression, key: Expression = definedExternally, tsOriginal: ts.Node = definedExternally): TableFieldExpression
+
+external interface TableExpression : Expression {
+ var fields: Array
+}
+
+external fun isTableExpression(node: Node): Boolean
+
+external fun createTableExpression(fields: Array = definedExternally, tsOriginal: ts.Node = definedExternally): TableExpression
+
+external interface UnaryExpression : Expression {
+ var operand: Expression
+ var operator: dynamic /* SyntaxKind.NegationOperator | SyntaxKind.LengthOperator | SyntaxKind.NotOperator | UnaryBitwiseOperator */
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun isUnaryExpression(node: Node): Boolean
+
+external fun createUnaryExpression(operand: Expression, operator: SyntaxKind.NegationOperator, tsOriginal: ts.Node = definedExternally): UnaryExpression
+
+external fun createUnaryExpression(operand: Expression, operator: SyntaxKind.NegationOperator): UnaryExpression
+
+external fun createUnaryExpression(operand: Expression, operator: SyntaxKind.LengthOperator, tsOriginal: ts.Node = definedExternally): UnaryExpression
+
+external fun createUnaryExpression(operand: Expression, operator: SyntaxKind.LengthOperator): UnaryExpression
+
+external fun createUnaryExpression(operand: Expression, operator: SyntaxKind.NotOperator, tsOriginal: ts.Node = definedExternally): UnaryExpression
+
+external fun createUnaryExpression(operand: Expression, operator: SyntaxKind.NotOperator): UnaryExpression
+
+external fun createUnaryExpression(operand: Expression, operator: UnaryBitwiseOperator, tsOriginal: ts.Node = definedExternally): UnaryExpression
+
+external fun createUnaryExpression(operand: Expression, operator: UnaryBitwiseOperator): UnaryExpression
+
+external interface BinaryExpression : Expression {
+ var operator: dynamic /* SyntaxKind.AdditionOperator | SyntaxKind.SubtractionOperator | SyntaxKind.MultiplicationOperator | SyntaxKind.DivisionOperator | SyntaxKind.FloorDivisionOperator | SyntaxKind.ModuloOperator | SyntaxKind.PowerOperator | SyntaxKind.ConcatOperator | SyntaxKind.EqualityOperator | SyntaxKind.InequalityOperator | SyntaxKind.LessThanOperator | SyntaxKind.LessEqualOperator | SyntaxKind.GreaterThanOperator | SyntaxKind.GreaterEqualOperator | SyntaxKind.AndOperator | SyntaxKind.OrOperator | SyntaxKind.BitwiseAndOperator | SyntaxKind.BitwiseOrOperator | SyntaxKind.BitwiseExclusiveOrOperator | SyntaxKind.BitwiseRightShiftOperator | SyntaxKind.BitwiseLeftShiftOperator */
+ get() = definedExternally
+ set(value) = definedExternally
+ var left: Expression
+ var right: Expression
+}
+
+external fun isBinaryExpression(node: Node): Boolean
+
+external fun createBinaryExpression(left: Expression, right: Expression, operator: Any /* SyntaxKind.AdditionOperator | SyntaxKind.SubtractionOperator | SyntaxKind.MultiplicationOperator | SyntaxKind.DivisionOperator | SyntaxKind.FloorDivisionOperator | SyntaxKind.ModuloOperator | SyntaxKind.PowerOperator | SyntaxKind.ConcatOperator | SyntaxKind.EqualityOperator | SyntaxKind.InequalityOperator | SyntaxKind.LessThanOperator | SyntaxKind.LessEqualOperator | SyntaxKind.GreaterThanOperator | SyntaxKind.GreaterEqualOperator | SyntaxKind.AndOperator | SyntaxKind.OrOperator | SyntaxKind.BitwiseAndOperator | SyntaxKind.BitwiseOrOperator | SyntaxKind.BitwiseExclusiveOrOperator | SyntaxKind.BitwiseRightShiftOperator | SyntaxKind.BitwiseLeftShiftOperator */, tsOriginal: ts.Node = definedExternally): BinaryExpression
+
+external interface CallExpression : Expression {
+ var expression: Expression
+ var params: Array
+}
+
+external fun isCallExpression(node: Node): Boolean
+
+external fun createCallExpression(expression: Expression, params: Array, tsOriginal: ts.Node = definedExternally): CallExpression
+
+external interface MethodCallExpression : Expression {
+ var prefixExpression: Expression
+ var name: Identifier
+ var params: Array
+}
+
+external fun isMethodCallExpression(node: Node): Boolean
+
+external fun createMethodCallExpression(prefixExpression: Expression, name: Identifier, params: Array, tsOriginal: ts.Node = definedExternally): MethodCallExpression
+
+external interface Identifier : Expression {
+ var exportable: Boolean
+ var text: String
+ var originalName: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var symbolId: Number? /* Number? & `T$14`? */
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun isIdentifier(node: Node): Boolean
+
+external fun createIdentifier(text: String, tsOriginal: ts.Node = definedExternally, symbolId: Number /* Number & `T$14` */ = definedExternally, originalName: String = definedExternally): Identifier
+
+external fun cloneIdentifier(identifier: Identifier, tsOriginal: ts.Node = definedExternally): Identifier
+
+external fun createAnonymousIdentifier(tsOriginal: ts.Node = definedExternally): Identifier
+
+external interface TableIndexExpression : Expression {
+ var table: Expression
+ var index: Expression
+}
+
+external fun isTableIndexExpression(node: Node): Boolean
+
+external fun createTableIndexExpression(table: Expression, index: Expression, tsOriginal: ts.Node = definedExternally): TableIndexExpression
+
+external fun isAssignmentLeftHandSideExpression(node: Node): Boolean
+
+external fun isFunctionDefinition(statement: VariableDeclarationStatement): Boolean
+
+external fun isFunctionDefinition(statement: AssignmentStatement): Boolean
+
+external interface `T$17` {
+ var statements: dynamic /* JsTuple */
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun isInlineFunctionExpression(expression: FunctionExpression): Boolean
\ No newline at end of file
diff --git a/externals/LuaLib.module_typescript-to-lua.kt b/externals/LuaLib.module_typescript-to-lua.kt
new file mode 100644
index 0000000..f00c242
--- /dev/null
+++ b/externals/LuaLib.module_typescript-to-lua.kt
@@ -0,0 +1,111 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external enum class LuaLibFeature {
+ ArrayConcat /* = "ArrayConcat" */,
+ ArrayEntries /* = "ArrayEntries" */,
+ ArrayEvery /* = "ArrayEvery" */,
+ ArrayFilter /* = "ArrayFilter" */,
+ ArrayForEach /* = "ArrayForEach" */,
+ ArrayFind /* = "ArrayFind" */,
+ ArrayFindIndex /* = "ArrayFindIndex" */,
+ ArrayIncludes /* = "ArrayIncludes" */,
+ ArrayIndexOf /* = "ArrayIndexOf" */,
+ ArrayIsArray /* = "ArrayIsArray" */,
+ ArrayJoin /* = "ArrayJoin" */,
+ ArrayMap /* = "ArrayMap" */,
+ ArrayPush /* = "ArrayPush" */,
+ ArrayReduce /* = "ArrayReduce" */,
+ ArrayReduceRight /* = "ArrayReduceRight" */,
+ ArrayReverse /* = "ArrayReverse" */,
+ ArrayShift /* = "ArrayShift" */,
+ ArrayUnshift /* = "ArrayUnshift" */,
+ ArraySort /* = "ArraySort" */,
+ ArraySlice /* = "ArraySlice" */,
+ ArraySome /* = "ArraySome" */,
+ ArraySplice /* = "ArraySplice" */,
+ ArrayToObject /* = "ArrayToObject" */,
+ ArrayFlat /* = "ArrayFlat" */,
+ ArrayFlatMap /* = "ArrayFlatMap" */,
+ ArraySetLength /* = "ArraySetLength" */,
+ Await /* = "Await" */,
+ Class /* = "Class" */,
+ ClassExtends /* = "ClassExtends" */,
+ CloneDescriptor /* = "CloneDescriptor" */,
+ Decorate /* = "Decorate" */,
+ DecorateParam /* = "DecorateParam" */,
+ Delete /* = "Delete" */,
+ DelegatedYield /* = "DelegatedYield" */,
+ Error /* = "Error" */,
+ FunctionBind /* = "FunctionBind" */,
+ Generator /* = "Generator" */,
+ InstanceOf /* = "InstanceOf" */,
+ InstanceOfObject /* = "InstanceOfObject" */,
+ Iterator /* = "Iterator" */,
+ Map /* = "Map" */,
+ MathAtan2 /* = "MathAtan2" */,
+ New /* = "New" */,
+ Number /* = "Number" */,
+ NumberIsFinite /* = "NumberIsFinite" */,
+ NumberIsNaN /* = "NumberIsNaN" */,
+ NumberToString /* = "NumberToString" */,
+ ObjectAssign /* = "ObjectAssign" */,
+ ObjectDefineProperty /* = "ObjectDefineProperty" */,
+ ObjectEntries /* = "ObjectEntries" */,
+ ObjectFromEntries /* = "ObjectFromEntries" */,
+ ObjectGetOwnPropertyDescriptor /* = "ObjectGetOwnPropertyDescriptor" */,
+ ObjectGetOwnPropertyDescriptors /* = "ObjectGetOwnPropertyDescriptors" */,
+ ObjectKeys /* = "ObjectKeys" */,
+ ObjectRest /* = "ObjectRest" */,
+ ObjectValues /* = "ObjectValues" */,
+ OptionalChainAccess /* = "OptionalChainAccess" */,
+ OptionalFunctionCall /* = "OptionalFunctionCall" */,
+ OptionalMethodCall /* = "OptionalMethodCall" */,
+ ParseFloat /* = "ParseFloat" */,
+ ParseInt /* = "ParseInt" */,
+ Promise /* = "Promise" */,
+ PromiseAll /* = "PromiseAll" */,
+ PromiseAllSettled /* = "PromiseAllSettled" */,
+ PromiseAny /* = "PromiseAny" */,
+ PromiseRace /* = "PromiseRace" */,
+ Set /* = "Set" */,
+ SetDescriptor /* = "SetDescriptor" */,
+ WeakMap /* = "WeakMap" */,
+ WeakSet /* = "WeakSet" */,
+ SourceMapTraceBack /* = "SourceMapTraceBack" */,
+ Spread /* = "Spread" */,
+ StringAccess /* = "StringAccess" */,
+ StringCharAt /* = "StringCharAt" */,
+ StringCharCodeAt /* = "StringCharCodeAt" */,
+ StringConcat /* = "StringConcat" */,
+ StringEndsWith /* = "StringEndsWith" */,
+ StringIncludes /* = "StringIncludes" */,
+ StringPadEnd /* = "StringPadEnd" */,
+ StringPadStart /* = "StringPadStart" */,
+ StringReplace /* = "StringReplace" */,
+ StringSlice /* = "StringSlice" */,
+ StringSplit /* = "StringSplit" */,
+ StringStartsWith /* = "StringStartsWith" */,
+ StringSubstr /* = "StringSubstr" */,
+ StringSubstring /* = "StringSubstring" */,
+ StringTrim /* = "StringTrim" */,
+ StringTrimEnd /* = "StringTrimEnd" */,
+ StringTrimStart /* = "StringTrimStart" */,
+ Symbol /* = "Symbol" */,
+ SymbolRegistry /* = "SymbolRegistry" */,
+ TypeOf /* = "TypeOf" */,
+ Unpack /* = "Unpack" */
+}
\ No newline at end of file
diff --git a/externals/LuaPrinter.module_typescript-to-lua.kt b/externals/LuaPrinter.module_typescript-to-lua.kt
new file mode 100644
index 0000000..6428653
--- /dev/null
+++ b/externals/LuaPrinter.module_typescript-to-lua.kt
@@ -0,0 +1,101 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.Program
+
+external var escapeString: (value: String) -> String
+
+external var tstlHeader: Any
+
+typealias Printer = (program: Program, emitHost: EmitHost, fileName: String, file: File) -> PrintResult
+
+external interface PrintResult {
+ var code: String
+ var sourceMap: String
+ var sourceMapNode: SourceNode
+}
+
+external fun createPrinter(printers: Array): Printer
+
+external open class LuaPrinter(emitHost: EmitHost, program: Program, fileName: String) {
+ open var emitHost: Any
+ open var currentIndent: Any
+ open var sourceFile: Any
+ open var options: Any
+ open fun print(file: File): PrintResult
+ open var printInlineSourceMap: Any
+ open var printStackTraceOverride: Any
+ open var printFile: Any
+ open fun pushIndent()
+ open fun popIndent()
+ open fun indent(input: String = definedExternally): dynamic /* String | SourceNode */
+ open fun indent(): dynamic /* String | SourceNode */
+ open fun indent(input: SourceNode = definedExternally): dynamic /* String | SourceNode */
+ open fun createSourceNode(node: Node, chunks: String, name: String = definedExternally): SourceNode
+ open fun createSourceNode(node: Node, chunks: String): SourceNode
+ open fun createSourceNode(node: Node, chunks: SourceNode, name: String = definedExternally): SourceNode
+ open fun createSourceNode(node: Node, chunks: SourceNode): SourceNode
+ open fun createSourceNode(node: Node, chunks: Array, name: String = definedExternally): SourceNode
+ open fun createSourceNode(node: Node, chunks: Array): SourceNode
+ open fun concatNodes(vararg chunks: Any /* String | SourceNode */): SourceNode
+ open fun printBlock(block: Block): SourceNode
+ open var statementMayRequireSemiColon: Any
+ open var nodeStartsWithParenthesis: Any
+ open fun printStatementArray(statements: Array): Array
+ open fun printStatement(statement: Statement): SourceNode
+ open fun printComment(comment: String): dynamic /* String | SourceNode */
+ open fun printComment(comment: Array): dynamic /* String | SourceNode */
+ open fun printStatementExcludingComments(statement: Statement): SourceNode
+ open fun printDoStatement(statement: DoStatement): SourceNode
+ open fun printVariableDeclarationStatement(statement: VariableDeclarationStatement): SourceNode
+ open fun printVariableAssignmentStatement(statement: AssignmentStatement): SourceNode
+ open fun printIfStatement(statement: IfStatement, isElseIf: Boolean = definedExternally): SourceNode
+ open fun printWhileStatement(statement: WhileStatement): SourceNode
+ open fun printRepeatStatement(statement: RepeatStatement): SourceNode
+ open fun printForStatement(statement: ForStatement): SourceNode
+ open fun printForInStatement(statement: ForInStatement): SourceNode
+ open fun printGotoStatement(statement: GotoStatement): SourceNode
+ open fun printLabelStatement(statement: LabelStatement): SourceNode
+ open fun printReturnStatement(statement: ReturnStatement): SourceNode
+ open fun printBreakStatement(statement: BreakStatement): SourceNode
+ open fun printExpressionStatement(statement: ExpressionStatement): SourceNode
+ open fun printExpression(expression: Expression): SourceNode
+ open fun printStringLiteral(expression: StringLiteral): SourceNode
+ open fun printNumericLiteral(expression: NumericLiteral): SourceNode
+ open fun printNilLiteral(expression: NilLiteral): SourceNode
+ open fun printDotsLiteral(expression: DotsLiteral): SourceNode
+ open fun printBooleanLiteral(expression: BooleanLiteral): SourceNode
+ open var printFunctionParameters: Any
+ open fun printFunctionExpression(expression: FunctionExpression): SourceNode
+ open fun printFunctionDefinition(statement: Any /* VariableDeclarationStatement | AssignmentStatement */): SourceNode
+ open fun printTableFieldExpression(expression: TableFieldExpression): SourceNode
+ open fun printTableExpression(expression: TableExpression): SourceNode
+ open fun printUnaryExpression(expression: UnaryExpression): SourceNode
+ open fun printBinaryExpression(expression: BinaryExpression): SourceNode
+ open var printExpressionInParenthesesIfNeeded: Any
+ open var needsParenthesis: Any
+ open fun printCallExpression(expression: CallExpression): SourceNode
+ open fun printMethodCallExpression(expression: MethodCallExpression): SourceNode
+ open fun printIdentifier(expression: Identifier): SourceNode
+ open fun printTableIndexExpression(expression: TableIndexExpression): SourceNode
+ open fun printOperator(kind: Any /* SyntaxKind.NegationOperator | SyntaxKind.LengthOperator | SyntaxKind.NotOperator | UnaryBitwiseOperator | SyntaxKind.AdditionOperator | SyntaxKind.SubtractionOperator | SyntaxKind.MultiplicationOperator | SyntaxKind.DivisionOperator | SyntaxKind.FloorDivisionOperator | SyntaxKind.ModuloOperator | SyntaxKind.PowerOperator | SyntaxKind.ConcatOperator | SyntaxKind.EqualityOperator | SyntaxKind.InequalityOperator | SyntaxKind.LessThanOperator | SyntaxKind.LessEqualOperator | SyntaxKind.GreaterThanOperator | SyntaxKind.GreaterEqualOperator | SyntaxKind.AndOperator | SyntaxKind.OrOperator | SyntaxKind.BitwiseAndOperator | SyntaxKind.BitwiseOrOperator | SyntaxKind.BitwiseExclusiveOrOperator | SyntaxKind.BitwiseRightShiftOperator | SyntaxKind.BitwiseLeftShiftOperator */): SourceNode
+ open fun joinChunksWithComma(chunks: Array): Array
+ open fun printExpressionList(expressions: Array): Array
+ open var buildSourceMap: Any
+
+ companion object {
+ var operatorMap: Any
+ }
+}
\ No newline at end of file
diff --git a/externals/context.module_typescript-to-lua.kt b/externals/context.module_typescript-to-lua.kt
new file mode 100644
index 0000000..696e339
--- /dev/null
+++ b/externals/context.module_typescript-to-lua.kt
@@ -0,0 +1,79 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.GetAccessorDeclaration
+import ts.SetAccessorDeclaration
+import ts.Node
+import ts.ImportEqualsDeclaration
+import ts.Expression
+import ts.SourceFile
+import ts.CancellationToken
+import ts.TypeChecker
+import ts.Program
+import ts.Diagnostic
+import Node as _Node
+import Expression as _Expression
+import ts.QualifiedName
+import ts.ExternalModuleReference
+
+external interface AllAccessorDeclarations {
+ var firstAccessor: dynamic /* GetAccessorDeclaration | SetAccessorDeclaration */
+ get() = definedExternally
+ set(value) = definedExternally
+ var secondAccessor: dynamic /* GetAccessorDeclaration? | SetAccessorDeclaration? */
+ get() = definedExternally
+ set(value) = definedExternally
+ var getAccessor: GetAccessorDeclaration?
+ var setAccessor: SetAccessorDeclaration?
+}
+
+external interface EmitResolver {
+ fun isValueAliasDeclaration(node: Node): Boolean
+ fun isReferencedAliasDeclaration(node: Node, checkChildren: Boolean = definedExternally): Boolean
+ fun isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): Boolean
+ fun moduleExportsSomeValue(moduleReferenceExpression: Expression): Boolean
+ fun getAllAccessorDeclarations(declaration: GetAccessorDeclaration): AllAccessorDeclarations
+ fun getAllAccessorDeclarations(declaration: SetAccessorDeclaration): AllAccessorDeclarations
+}
+
+external interface DiagnosticsProducingTypeChecker : TypeChecker {
+ fun getEmitResolver(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): EmitResolver
+}
+
+external open class TransformationContext(program: Program, sourceFile: SourceFile, visitorMap: VisitorMap) {
+ open var program: Program
+ open var sourceFile: SourceFile
+ open var visitorMap: Any
+ open val diagnostics: Array
+ open val checker: DiagnosticsProducingTypeChecker
+ open val resolver: EmitResolver
+ open val options: dynamic /* typealias OmitIndexSignature = dynamic */
+ open val luaTarget: LuaTarget
+ open val isModule: Boolean
+ open val isStrict: Boolean
+ open var currentNodeVisitors: Any
+ open fun transformNode(node: Node): Array<_Node>
+ open fun superTransformNode(node: Node): Array<_Node>
+ open fun transformExpression(node: Expression): _Expression
+ open fun transformExpression(node: QualifiedName): _Expression
+ open fun transformExpression(node: ExternalModuleReference): _Expression
+ open fun superTransformExpression(node: Expression): _Expression
+ open fun superTransformExpression(node: QualifiedName): _Expression
+ open fun superTransformExpression(node: ExternalModuleReference): _Expression
+ open fun transformStatements(node: StatementLikeNode): Array
+ open fun transformStatements(node: Array): Array
+ open fun superTransformStatements(node: StatementLikeNode): Array
+ open fun superTransformStatements(node: Array): Array
+}
\ No newline at end of file
diff --git a/externals/index.module_typescript-to-lua.kt b/externals/index.module_typescript-to-lua.kt
new file mode 100644
index 0000000..2016698
--- /dev/null
+++ b/externals/index.module_typescript-to-lua.kt
@@ -0,0 +1,38 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.WriteFileCallback
+import ts.Diagnostic
+import tsstdlib.Record
+
+external fun transpileFiles(rootNames: Array, options: dynamic /* typealias OmitIndexSignature = dynamic */ = definedExternally, writeFile: WriteFileCallback = definedExternally): EmitResult
+
+external fun transpileProject(configFileName: String, optionsToExtend: dynamic /* typealias OmitIndexSignature = dynamic */ = definedExternally, writeFile: WriteFileCallback = definedExternally): EmitResult
+
+external interface TranspileVirtualProjectResult {
+ var diagnostics: Array
+ var transpiledFiles: Array
+}
+
+external fun transpileVirtualProject(files: Record, options: dynamic /* typealias OmitIndexSignature = dynamic */ = definedExternally): TranspileVirtualProjectResult
+
+external interface TranspileStringResult {
+ var diagnostics: Array
+ var file: TranspiledFile?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun transpileString(main: String, options: dynamic /* typealias OmitIndexSignature = dynamic */ = definedExternally): TranspileStringResult
\ No newline at end of file
diff --git a/externals/lib.es2015.collection.kt b/externals/lib.es2015.collection.kt
new file mode 100644
index 0000000..affffa8
--- /dev/null
+++ b/externals/lib.es2015.collection.kt
@@ -0,0 +1,49 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+package tsstdlib
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external interface Map {
+ fun entries(): IterableIterator */>
+ fun keys(): IterableIterator
+ fun values(): IterableIterator
+ fun clear()
+ fun delete(key: K): Boolean
+ fun forEach(callbackfn: (value: V, key: K, map: Map) -> Unit, thisArg: Any = definedExternally)
+ fun get(key: K): V?
+ fun has(key: K): Boolean
+ fun set(key: K, value: V): Map /* this */
+ val size: Number
+}
+
+external interface MapConstructor {
+ val prototype: Map
+}
+
+external interface Set {
+ fun entries(): IterableIterator */>
+ fun keys(): IterableIterator
+ fun values(): IterableIterator
+ fun add(value: T): Set /* this */
+ fun clear()
+ fun delete(value: T): Boolean
+ fun forEach(callbackfn: (value: T, value2: T, set: Set) -> Unit, thisArg: Any = definedExternally)
+ fun has(value: T): Boolean
+ val size: Number
+}
+
+external interface SetConstructor {
+ val prototype: Set
+}
\ No newline at end of file
diff --git a/externals/lib.es2015.iterable.kt b/externals/lib.es2015.iterable.kt
new file mode 100644
index 0000000..1528efa
--- /dev/null
+++ b/externals/lib.es2015.iterable.kt
@@ -0,0 +1,54 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+package tsstdlib
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external interface IteratorYieldResult {
+ var done: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+ var value: TYield
+}
+
+external interface IteratorReturnResult {
+ var done: Boolean
+ var value: TReturn
+}
+
+external interface Iterator {
+ fun next(vararg args: Any /* JsTuple<> | JsTuple */): dynamic /* IteratorYieldResult | IteratorReturnResult */
+ val `return`: ((value: TReturn) -> dynamic)?
+ val `throw`: ((e: Any) -> dynamic)?
+}
+
+typealias Iterator__1 = Iterator
+
+external interface Iterable
+
+external interface IterableIterator : Iterator__1
+
+external interface PromiseConstructor {
+ val prototype: Promise
+ fun all(values: Any /* JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple */): Promise | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple */>
+ fun all(values: Array */>): Promise>
+ fun race(values: Array): Promise
+ fun reject(reason: Any = definedExternally): Promise
+ fun resolve(value: T): Promise
+ fun resolve(value: PromiseLike): Promise
+ fun resolve(): Promise
+ fun all(values: Iterable */>): Promise>
+ fun race(values: Iterable): Promise
+ fun race(values: Iterable */>): Promise
+}
\ No newline at end of file
diff --git a/externals/lib.es5.Intl.module_dukat.kt b/externals/lib.es5.Intl.module_dukat.kt
new file mode 100644
index 0000000..62cbcc7
--- /dev/null
+++ b/externals/lib.es5.Intl.module_dukat.kt
@@ -0,0 +1,220 @@
+@file:JsQualifier("tsstdlib.Intl")
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+package tsstdlib.Intl
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external interface CollatorOptions {
+ var usage: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var localeMatcher: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var numeric: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+ var caseFirst: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var sensitivity: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var ignorePunctuation: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface ResolvedCollatorOptions {
+ var locale: String
+ var usage: String
+ var sensitivity: String
+ var ignorePunctuation: Boolean
+ var collation: String
+ var caseFirst: String
+ var numeric: Boolean
+}
+
+@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
+external interface Collator {
+ fun compare(x: String, y: String): Number
+ fun resolvedOptions(): ResolvedCollatorOptions
+
+ companion object {
+ @nativeInvoke
+ operator fun invoke(locales: Any /* String | Array */ = definedExternally, options: CollatorOptions = definedExternally): Collator
+ fun supportedLocalesOf(locales: Any /* String | Array */, options: CollatorOptions = definedExternally): Array
+ }
+}
+
+external interface NumberFormatOptions {
+ var localeMatcher: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var style: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var currency: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var currencyDisplay: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var useGrouping: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+ var minimumIntegerDigits: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+ var minimumFractionDigits: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+ var maximumFractionDigits: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+ var minimumSignificantDigits: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+ var maximumSignificantDigits: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface ResolvedNumberFormatOptions {
+ var locale: String
+ var numberingSystem: String
+ var style: String
+ var currency: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var currencyDisplay: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var minimumIntegerDigits: Number
+ var minimumFractionDigits: Number
+ var maximumFractionDigits: Number
+ var minimumSignificantDigits: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+ var maximumSignificantDigits: Number?
+ get() = definedExternally
+ set(value) = definedExternally
+ var useGrouping: Boolean
+}
+
+@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
+external interface NumberFormat {
+ fun format(value: Number): String
+ fun resolvedOptions(): ResolvedNumberFormatOptions
+
+ companion object {
+ @nativeInvoke
+ operator fun invoke(locales: Any /* String | Array */ = definedExternally, options: NumberFormatOptions = definedExternally): NumberFormat
+ fun supportedLocalesOf(locales: Any /* String | Array */, options: NumberFormatOptions = definedExternally): Array
+ }
+}
+
+external interface DateTimeFormatOptions {
+ var localeMatcher: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var weekday: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var era: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var year: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var month: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var day: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var hour: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var minute: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var second: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var timeZoneName: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var formatMatcher: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var hour12: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+ var timeZone: String?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface ResolvedDateTimeFormatOptions {
+ var locale: String
+ var calendar: String
+ var numberingSystem: String
+ var timeZone: String
+ var hour12: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+ var weekday: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var era: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var year: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var month: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var day: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var hour: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var minute: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var second: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var timeZoneName: String?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
+external interface DateTimeFormat {
+ fun format(date: Date = definedExternally): String
+ fun format(): String
+ fun format(date: Number = definedExternally): String
+ fun resolvedOptions(): ResolvedDateTimeFormatOptions
+
+ companion object {
+ @nativeInvoke
+ operator fun invoke(locales: Any /* String | Array */ = definedExternally, options: DateTimeFormatOptions = definedExternally): DateTimeFormat
+ fun supportedLocalesOf(locales: Any /* String | Array */, options: DateTimeFormatOptions = definedExternally): Array
+ }
+}
\ No newline at end of file
diff --git a/externals/lib.es5.kt b/externals/lib.es5.kt
new file mode 100644
index 0000000..c9b2102
--- /dev/null
+++ b/externals/lib.es5.kt
@@ -0,0 +1,69 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+package tsstdlib
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external interface DateConstructor {
+ @nativeInvoke
+ operator fun invoke(): String
+ val prototype: Date
+ fun parse(s: String): Number
+ fun UTC(year: Number, month: Number, date: Number = definedExternally, hours: Number = definedExternally, minutes: Number = definedExternally, seconds: Number = definedExternally, ms: Number = definedExternally): Number
+ fun now(): Number
+}
+
+external interface ConcatArray {
+ val length: Number
+ @nativeGetter
+ operator fun get(n: Number): T?
+ @nativeSetter
+ operator fun set(n: Number, value: T)
+ fun join(separator: String = definedExternally): String
+ fun slice(start: Number = definedExternally, end: Number = definedExternally): Array
+}
+
+external interface ArrayConstructor {
+ fun from(iterable: Iterable): Array
+ fun from(iterable: ArrayLike): Array
+ fun from(iterable: Iterable, mapfn: (v: T, k: Number) -> U, thisArg: Any = definedExternally): Array
+ fun from(iterable: Iterable, mapfn: (v: T, k: Number) -> U): Array
+ fun from(iterable: ArrayLike, mapfn: (v: T, k: Number) -> U, thisArg: Any = definedExternally): Array
+ fun from(iterable: ArrayLike, mapfn: (v: T, k: Number) -> U): Array
+ fun of(vararg items: T): Array
+ @nativeInvoke
+ operator fun invoke(arrayLength: Number = definedExternally): Array
+ @nativeInvoke
+ operator fun invoke(): Array
+ @nativeInvoke
+ operator fun invoke(arrayLength: Number): Array
+ @nativeInvoke
+ operator fun invoke(vararg items: T): Array
+ fun isArray(arg: Any): Boolean
+ val prototype: Array
+}
+
+external interface PromiseLike {
+ fun then(onfulfilled: ((value: T) -> Any?)? = definedExternally, onrejected: ((reason: Any) -> Any?)? = definedExternally): PromiseLike
+}
+
+external interface ArrayLike {
+ val length: Number
+ @nativeGetter
+ operator fun get(n: Number): T?
+ @nativeSetter
+ operator fun set(n: Number, value: T)
+}
+
+typealias Record = Any
\ No newline at end of file
diff --git a/externals/lib.scripthost.kt b/externals/lib.scripthost.kt
new file mode 100644
index 0000000..809347e
--- /dev/null
+++ b/externals/lib.scripthost.kt
@@ -0,0 +1,20 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+package tsstdlib
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external open class VarDate {
+ open var VarDate_typekey: VarDate
+}
\ No newline at end of file
diff --git a/externals/nonDeclarations.ts.kt b/externals/nonDeclarations.ts.kt
new file mode 100644
index 0000000..3650dca
--- /dev/null
+++ b/externals/nonDeclarations.ts.kt
@@ -0,0 +1,114 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+package ts
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+typealias SortedReadonlyArray = Array
+
+typealias SortedArray = Array
+
+typealias NodeArray = Array
+
+typealias DotToken = PunctuationToken
+
+typealias DotDotDotToken = PunctuationToken
+
+typealias QuestionToken = PunctuationToken
+
+typealias ExclamationToken = PunctuationToken
+
+typealias ColonToken = PunctuationToken
+
+typealias EqualsToken = PunctuationToken
+
+typealias AsteriskToken = PunctuationToken
+
+typealias EqualsGreaterThanToken = PunctuationToken
+
+typealias PlusToken = PunctuationToken
+
+typealias MinusToken = PunctuationToken
+
+typealias QuestionDotToken = PunctuationToken
+
+typealias AssertsKeyword = KeywordToken
+
+typealias AwaitKeyword = KeywordToken
+
+typealias AwaitKeywordToken = AwaitKeyword
+
+typealias AssertsToken = AssertsKeyword
+
+typealias AbstractKeyword = ModifierToken
+
+typealias AsyncKeyword = ModifierToken
+
+typealias ConstKeyword = ModifierToken
+
+typealias DeclareKeyword = ModifierToken
+
+typealias DefaultKeyword = ModifierToken
+
+typealias ExportKeyword = ModifierToken
+
+typealias PrivateKeyword = ModifierToken
+
+typealias ProtectedKeyword = ModifierToken
+
+typealias PublicKeyword = ModifierToken
+
+typealias ReadonlyKeyword = ModifierToken
+
+typealias OverrideKeyword = ModifierToken
+
+typealias StaticKeyword = ModifierToken
+
+typealias ReadonlyToken = ReadonlyKeyword
+
+typealias ModifiersArray = NodeArray
+
+typealias IncrementExpression = UpdateExpression
+
+typealias ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken
+
+typealias BinaryOperatorToken = Token
+
+typealias AssignmentOperatorToken = Token
+
+typealias FunctionBody = Block
+
+typealias WriteFileCallback = (fileName: String, data: String, writeByteOrderMark: Boolean, onError: (message: String) -> Unit, sourceFiles: Array) -> Unit
+
+typealias CustomTransformerFactory = (context: TransformationContext) -> CustomTransformer
+
+typealias SymbolTable = UnderscoreEscapedMap
+
+typealias JsFileExtensionInfo = FileExtensionInfo
+
+typealias EmitHelperUniqueNameCallback = (name: String) -> String
+
+typealias TransformerFactory = (context: TransformationContext) -> Transformer
+
+typealias Transformer = (node: T) -> T
+
+typealias Visitor = (node: Node) -> dynamic
+
+typealias FileWatcherCallback = (fileName: String, eventKind: FileWatcherEventKind) -> Unit
+
+typealias DirectoryWatcherCallback = (fileName: String) -> Unit
+
+typealias DiagnosticReporter = (diagnostic: Diagnostic) -> Unit
+
+typealias CodeActionCommand = InstallPackageAction
\ No newline at end of file
diff --git a/externals/output-collector.module_typescript-to-lua.kt b/externals/output-collector.module_typescript-to-lua.kt
new file mode 100644
index 0000000..0c57eac
--- /dev/null
+++ b/externals/output-collector.module_typescript-to-lua.kt
@@ -0,0 +1,33 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.SourceFile
+
+external interface TranspiledFile {
+ var outPath: String
+ var sourceFiles: Array
+ var lua: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var luaSourceMap: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var declaration: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var declarationMap: String?
+ get() = definedExternally
+ set(value) = definedExternally
+}
\ No newline at end of file
diff --git a/externals/parse.module_typescript-to-lua.kt b/externals/parse.module_typescript-to-lua.kt
new file mode 100644
index 0000000..ff6e944
--- /dev/null
+++ b/externals/parse.module_typescript-to-lua.kt
@@ -0,0 +1,25 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external interface ParsedCommandLine : ts.ParsedCommandLine {
+ override var options: dynamic /* typealias OmitIndexSignature = dynamic */
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external fun updateParsedConfigFile(parsedConfigFile: ts.ParsedCommandLine): ParsedCommandLine
+
+external fun parseCommandLine(args: Array): ParsedCommandLine
\ No newline at end of file
diff --git a/externals/plugins.module_typescript-to-lua.kt b/externals/plugins.module_typescript-to-lua.kt
new file mode 100644
index 0000000..24d3ea4
--- /dev/null
+++ b/externals/plugins.module_typescript-to-lua.kt
@@ -0,0 +1,24 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external interface Plugin {
+ var visitors: Visitors?
+ get() = definedExternally
+ set(value) = definedExternally
+ var printer: Printer?
+ get() = definedExternally
+ set(value) = definedExternally
+}
\ No newline at end of file
diff --git a/externals/report.module_typescript-to-lua.kt b/externals/report.module_typescript-to-lua.kt
new file mode 100644
index 0000000..f1582a6
--- /dev/null
+++ b/externals/report.module_typescript-to-lua.kt
@@ -0,0 +1,48 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.DiagnosticRelatedInformation
+import ts.DiagnosticCategory
+import ts.SourceFile
+import ts.Diagnostic
+import ts.System
+import ts.DiagnosticReporter
+
+external interface `T$13` {
+ var code: Any
+ var reportsUnnecessary: Any?
+ get() = definedExternally
+ set(value) = definedExternally
+ var reportsDeprecated: Any?
+ get() = definedExternally
+ set(value) = definedExternally
+ var source: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var relatedInformation: Array?
+ get() = definedExternally
+ set(value) = definedExternally
+ var category: DiagnosticCategory
+ var file: SourceFile?
+ var start: Number?
+ var length: Number?
+ var messageText: dynamic /* String | ts.DiagnosticMessageChain */
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external var prepareDiagnosticForFormatting: (diagnostic: Diagnostic) -> `T$13`
+
+external fun createDiagnosticReporter(pretty: Boolean, system: System = definedExternally): DiagnosticReporter
\ No newline at end of file
diff --git a/externals/source-map.module_source-map.kt b/externals/source-map.module_source-map.kt
new file mode 100644
index 0000000..6880a36
--- /dev/null
+++ b/externals/source-map.module_source-map.kt
@@ -0,0 +1,192 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+typealias SourceMapUrl = String
+
+external interface StartOfSourceMap {
+ var file: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var sourceRoot: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var skipValidation: Boolean?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface RawSourceMap {
+ var version: Number
+ var sources: Array
+ var names: Array
+ var sourceRoot: String?
+ get() = definedExternally
+ set(value) = definedExternally
+ var sourcesContent: Array?
+ get() = definedExternally
+ set(value) = definedExternally
+ var mappings: String
+ var file: String
+}
+
+external interface RawIndexMap : StartOfSourceMap {
+ var version: Number
+ var sections: Array
+}
+
+external interface RawSection {
+ var offset: Position
+ var map: RawSourceMap
+}
+
+external interface Position {
+ var line: Number
+ var column: Number
+}
+
+external interface NullablePosition {
+ var line: Number?
+ var column: Number?
+ var lastColumn: Number?
+}
+
+external interface MappedPosition {
+ var source: String
+ var line: Number
+ var column: Number
+ var name: String?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface NullableMappedPosition {
+ var source: String?
+ var line: Number?
+ var column: Number?
+ var name: String?
+}
+
+external interface MappingItem {
+ var source: String
+ var generatedLine: Number
+ var generatedColumn: Number
+ var originalLine: Number
+ var originalColumn: Number
+ var name: String
+}
+
+external interface Mapping {
+ var generated: Position
+ var original: Position
+ var source: String
+ var name: String?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface CodeWithSourceMap {
+ var code: String
+ var map: SourceMapGenerator
+}
+
+external interface SourceMapConsumer {
+ fun computeColumnSpans()
+ fun originalPositionFor(generatedPosition: Position /* Position & `T$19` */): NullableMappedPosition
+ fun generatedPositionFor(originalPosition: MappedPosition /* MappedPosition & `T$19` */): NullablePosition
+ fun allGeneratedPositionsFor(originalPosition: MappedPosition): Array
+ fun hasContentsOfAllSources(): Boolean
+ fun sourceContentFor(source: String, returnNullOnMissing: Boolean = definedExternally): String?
+ fun eachMapping(callback: (mapping: MappingItem) -> Unit, context: Any = definedExternally, order: Number = definedExternally)
+ fun destroy()
+}
+
+external interface SourceMapConsumerConstructor {
+ var prototype: SourceMapConsumer
+ var GENERATED_ORDER: Number
+ var ORIGINAL_ORDER: Number
+ var GREATEST_LOWER_BOUND: Number
+ var LEAST_UPPER_BOUND: Number
+ fun fromSourceMap(sourceMap: SourceMapGenerator, sourceMapUrl: SourceMapUrl = definedExternally): Promise
+ fun with(rawSourceMap: RawSourceMap, sourceMapUrl: SourceMapUrl?, callback: (consumer: Any /* BasicSourceMapConsumer | IndexedSourceMapConsumer */) -> Any?): Promise
+ fun with(rawSourceMap: RawIndexMap, sourceMapUrl: SourceMapUrl?, callback: (consumer: Any /* BasicSourceMapConsumer | IndexedSourceMapConsumer */) -> Any?): Promise
+ fun with(rawSourceMap: String, sourceMapUrl: SourceMapUrl?, callback: (consumer: Any /* BasicSourceMapConsumer | IndexedSourceMapConsumer */) -> Any?): Promise
+}
+
+external interface BasicSourceMapConsumer : SourceMapConsumer {
+ var file: String
+ var sourceRoot: String
+ var sources: Array
+ var sourcesContent: Array
+}
+
+external interface BasicSourceMapConsumerConstructor {
+ var prototype: BasicSourceMapConsumer
+ fun fromSourceMap(sourceMap: SourceMapGenerator): Promise
+}
+
+external interface IndexedSourceMapConsumer : SourceMapConsumer {
+ var sources: Array
+}
+
+external interface IndexedSourceMapConsumerConstructor {
+ var prototype: IndexedSourceMapConsumer
+}
+
+external open class SourceMapGenerator(startOfSourceMap: StartOfSourceMap = definedExternally) {
+ open fun addMapping(mapping: Mapping)
+ open fun setSourceContent(sourceFile: String, sourceContent: String)
+ open fun applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile: String = definedExternally, sourceMapPath: String = definedExternally)
+ override fun toString(): String
+ open fun toJSON(): RawSourceMap
+
+ companion object {
+ fun fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator
+ }
+}
+
+external open class SourceNode {
+ open var children: Array
+ open var sourceContents: Any
+ open var line: Number
+ open var column: Number
+ open var source: String
+ open var name: String
+ constructor()
+ constructor(line: Number?, column: Number?, source: String?, chunks: Array = definedExternally, name: String = definedExternally)
+ constructor(line: Number?, column: Number?, source: String?)
+ constructor(line: Number?, column: Number?, source: String?, chunks: Array = definedExternally)
+ constructor(line: Number?, column: Number?, source: String?, chunks: SourceNode = definedExternally, name: String = definedExternally)
+ constructor(line: Number?, column: Number?, source: String?, chunks: SourceNode = definedExternally)
+ constructor(line: Number?, column: Number?, source: String?, chunks: String = definedExternally, name: String = definedExternally)
+ constructor(line: Number?, column: Number?, source: String?, chunks: String = definedExternally)
+ open fun add(chunk: Array): SourceNode
+ open fun add(chunk: SourceNode): SourceNode
+ open fun add(chunk: String): SourceNode
+ open fun prepend(chunk: Array): SourceNode
+ open fun prepend(chunk: SourceNode): SourceNode
+ open fun prepend(chunk: String): SourceNode
+ open fun setSourceContent(sourceFile: String, sourceContent: String)
+ open fun walk(fn: (chunk: String, mapping: MappedPosition) -> Unit)
+ open fun walkSourceContents(fn: (file: String, content: String) -> Unit)
+ open fun join(sep: String): SourceNode
+ open fun replaceRight(pattern: String, replacement: String): SourceNode
+ override fun toString(): String
+ open fun toStringWithSourceMap(startOfSourceMap: StartOfSourceMap = definedExternally): CodeWithSourceMap
+
+ companion object {
+ fun fromStringWithSourceMap(code: String, sourceMapConsumer: SourceMapConsumer, relativePath: String = definedExternally): SourceNode
+ }
+}
\ No newline at end of file
diff --git a/externals/transpile.module_typescript-to-lua.kt b/externals/transpile.module_typescript-to-lua.kt
new file mode 100644
index 0000000..8681706
--- /dev/null
+++ b/externals/transpile.module_typescript-to-lua.kt
@@ -0,0 +1,40 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.Program
+import ts.SourceFile
+import ts.CustomTransformers
+import ts.Diagnostic
+import ts.WriteFileCallback
+
+external interface TranspileOptions {
+ var program: Program
+ var sourceFiles: Array?
+ get() = definedExternally
+ set(value) = definedExternally
+ var customTransformers: CustomTransformers?
+ get() = definedExternally
+ set(value) = definedExternally
+ var plugins: Array?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface TranspileResult {
+ var diagnostics: Array
+ var transpiledFiles: Array
+}
+
+external fun getProgramTranspileResult(emitHost: EmitHost, writeFileResult: WriteFileCallback, __2: TranspileOptions): TranspileResult
\ No newline at end of file
diff --git a/externals/transpiler.module_typescript-to-lua.kt b/externals/transpiler.module_typescript-to-lua.kt
new file mode 100644
index 0000000..16b18b0
--- /dev/null
+++ b/externals/transpiler.module_typescript-to-lua.kt
@@ -0,0 +1,55 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.WriteFileCallback
+import ts.Diagnostic
+import ts.Program
+
+external interface TranspilerOptions {
+ var emitHost: EmitHost?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface EmitOptions : TranspileOptions {
+ var writeFile: WriteFileCallback?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+external interface EmitResult {
+ var emitSkipped: Boolean
+ var diagnostics: Array
+}
+
+external interface `T$20` {
+ var emitPlan: Array
+}
+
+external open class Transpiler(__0: TranspilerOptions = definedExternally) {
+ open var emitHost: EmitHost
+ open fun emit(emitOptions: EmitOptions): EmitResult
+ open fun getEmitPlan(program: Program, diagnostics: Array, files: Array): `T$20`
+}
+
+external fun getEmitPath(file: String, program: Program): String
+
+external fun getEmitPathRelativeToOutDir(fileName: String, program: Program): String
+
+external fun getSourceDir(program: Program): String
+
+external fun getEmitOutDir(program: Program): String
+
+external fun getProjectRoot(program: Program): String
\ No newline at end of file
diff --git a/externals/tsconfig.module_typescript-to-lua.kt b/externals/tsconfig.module_typescript-to-lua.kt
new file mode 100644
index 0000000..865bc70
--- /dev/null
+++ b/externals/tsconfig.module_typescript-to-lua.kt
@@ -0,0 +1,18 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.System
+
+external fun parseConfigFileWithSystem(configFileName: String, commandLineOptions: dynamic /* typealias OmitIndexSignature = dynamic */ = definedExternally, system: System = definedExternally): ParsedCommandLine
\ No newline at end of file
diff --git a/externals/typescript.module_typescript.kt b/externals/typescript.module_typescript.kt
new file mode 100644
index 0000000..83261af
--- /dev/null
+++ b/externals/typescript.module_typescript.kt
@@ -0,0 +1,19 @@
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external fun setTimeout(handler: (args: Any) -> Unit, timeout: Number): Any
+
+external fun clearTimeout(handle: Any)
\ No newline at end of file
diff --git a/externals/typescript.ts.ScriptSnapshot.module_typescript.kt b/externals/typescript.ts.ScriptSnapshot.module_typescript.kt
new file mode 100644
index 0000000..acab3da
--- /dev/null
+++ b/externals/typescript.ts.ScriptSnapshot.module_typescript.kt
@@ -0,0 +1,20 @@
+@file:JsQualifier("ts.ScriptSnapshot")
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+package ts.ScriptSnapshot
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+import ts.IScriptSnapshot
+
+external fun fromString(text: String): IScriptSnapshot
\ No newline at end of file
diff --git a/externals/typescript.ts.module_typescript.kt b/externals/typescript.ts.module_typescript.kt
new file mode 100644
index 0000000..841356c
--- /dev/null
+++ b/externals/typescript.ts.module_typescript.kt
@@ -0,0 +1,8236 @@
+@file:JsModule("typescript")
+@file:JsNonModule
+@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
+package ts
+
+import kotlin.js.*
+import org.khronos.webgl.*
+import org.w3c.dom.*
+import org.w3c.dom.events.*
+import org.w3c.dom.parsing.*
+import org.w3c.dom.svg.*
+import org.w3c.dom.url.*
+import org.w3c.fetch.*
+import org.w3c.files.*
+import org.w3c.notifications.*
+import org.w3c.performance.*
+import org.w3c.workers.*
+import org.w3c.xhr.*
+
+external var versionMajorMinor: Any
+
+external var version: String
+
+external interface MapLike {
+ @nativeGetter
+ operator fun get(index: String): T?
+ @nativeSetter
+ operator fun set(index: String, value: T)
+}
+
+external interface ReadonlyCollection {
+ val size: Number
+ fun has(key: K): Boolean
+ fun keys(): Iterator
+}
+
+external interface Collection : ReadonlyCollection {
+ fun delete(key: K): Boolean
+ fun clear()
+}
+
+external interface ReadonlyESMap : ReadonlyCollection {
+ fun get(key: K): V?
+ fun values(): Iterator
+ fun entries(): Iterator */>
+ fun forEach(action: (value: V, key: K) -> Unit)
+}
+
+external interface ReadonlyMap : ReadonlyESMap
+
+external interface ESMap : ReadonlyESMap, Collection {
+ fun set(key: K, value: V): ESMap /* this */
+}
+
+external interface Map : ESMap