diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/Constants.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/Constants.kt deleted file mode 100644 index 95d8bbc..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/Constants.kt +++ /dev/null @@ -1,20 +0,0 @@ -package dev.adamko.gradle.pbandg - -import org.gradle.api.Project -import org.gradle.api.file.Directory -import org.gradle.api.file.ProjectLayout -import org.gradle.api.provider.Provider - -object Constants { - const val PBG_SETTINGS_NAME = "pbAndG" - const val PBG_TASK_GROUP = PBG_SETTINGS_NAME// "pb-and-g" - const val PBG_LIBS_CONF_NAME = "protobufLibrary" - const val PBG_TASK_COMPILE = "protobufCompile" - - val Project.pbAndGBuildDir: Provider - get() = layout.pbAndGBuildDir - - val ProjectLayout.pbAndGBuildDir: Provider - get() = buildDirectory.dir(PBG_TASK_GROUP) - -} diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/ProtobufCompilerDependency.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/ProtobufCompilerDependency.kt deleted file mode 100644 index fb0edbb..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/ProtobufCompilerDependency.kt +++ /dev/null @@ -1,22 +0,0 @@ -package dev.adamko.gradle.pbandg - -import dev.adamko.gradle.pbandg.settings.PBAndGSettings -import org.gradle.api.Project -import org.gradle.api.artifacts.Configuration - - -class ProtobufCompilerDependency( - project: Project, - pluginSettings: PBAndGSettings, - private val conf: Configuration = project.configurations.create("protobufCompiler") { - this.description = "Define a single dependency that provides the protoc.exe for this system" - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - isTransitive = false - - defaultDependencies { - add(pluginSettings.dependency.get()) - } - } -) : Configuration by conf diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/IntelliJPattern.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/IntelliJPattern.kt deleted file mode 100644 index 8749884..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/IntelliJPattern.kt +++ /dev/null @@ -1,53 +0,0 @@ -package dev.adamko.gradle.pbandg.pattern - -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.hasPlugin -import org.gradle.kotlin.dsl.withType -import org.gradle.plugins.ide.idea.GenerateIdeaModule -import org.gradle.plugins.ide.idea.IdeaPlugin -import org.gradle.plugins.ide.idea.model.IdeaModel - -/** - * IntelliJ requires source dirs are configured first. - * - * https://github.com/google/protobuf-gradle-plugin/blob/master/src/main/groovy/com/google/protobuf/gradle/Utils.groovy#L128 - */ -class IntelliJPattern : Plugin { - - fun isIdeaPluginPresent(project: Project) = project.plugins.hasPlugin(IdeaPlugin::class) - - override fun apply(project: Project) { - - if (!isIdeaPluginPresent(project)) { - return - } - - val genSrcDir = project.layout.buildDirectory.dir("pbAndG/generated-sources") - val ktGenSrc = genSrcDir.map { it.dir("kotlin").asFile } - val jGenSrc = genSrcDir.map { it.dir("java").asFile } - - val protoSrc = project.layout.projectDirectory.dir("src/main/proto").asFile - - project.mkdir(ktGenSrc) - project.mkdir(jGenSrc) - - project.plugins.withType { - project.extensions.configure { - module { - generatedSourceDirs.add(ktGenSrc.get()) - generatedSourceDirs.add(jGenSrc.get()) - sourceDirs.add(protoSrc) - } - } - } - - project.tasks.withType { - doFirst { - project.mkdir(ktGenSrc) - } - } - - } -} diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/KotlinJvmProjectConfiguration.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/KotlinJvmProjectConfiguration.kt deleted file mode 100644 index 4d0c429..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/KotlinJvmProjectConfiguration.kt +++ /dev/null @@ -1,46 +0,0 @@ -package dev.adamko.gradle.pbandg.pattern - -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.tasks.SourceSet -import org.gradle.api.tasks.SourceSetContainer -import org.gradle.kotlin.dsl.findByType -import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension - -class KotlinJvmProjectConfiguration : Plugin { - - override fun apply(project: Project) { - addSourceSets(project) - } - - private fun addSourceSets(project: Project) { - - project.beforeEvaluate { - extensions.findByType()?.apply { - extensions.findByType() - ?.named(SourceSet.MAIN_SOURCE_SET_NAME) - ?.configure { - java { - srcDir(layout.buildDirectory.dir("pbAndG/generated-sources/java")) - srcDir(layout.buildDirectory.dir("pbAndG/generated-sources/kotlin")) - } - } - - } - -// val srcSet = project.extensions.getByName(SourceSet.MAIN_SOURCE_SET_NAME) -// -// project.tasks -// .withType() -// .map { it.generatedSources.get() } -// .forEach { generatedSourcesDir -> -// project.logger.lifecycle("-------\nadding generated sources $generatedSourcesDir\n-------") -// -// srcSet.java { -// srcDir(generatedSourcesDir.dir("java")) -// srcDir(generatedSourcesDir.dir("kotlin")) -// } -// } - } - } -} diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/KotlinMultiplatformProjectConfiguration.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/KotlinMultiplatformProjectConfiguration.kt deleted file mode 100644 index 99b5f4d..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pattern/KotlinMultiplatformProjectConfiguration.kt +++ /dev/null @@ -1,66 +0,0 @@ -package dev.adamko.gradle.pbandg.pattern - -import dev.adamko.gradle.pbandg.Constants.pbAndGBuildDir -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.findByType -import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension - -class KotlinMultiplatformProjectConfiguration : Plugin { - - override fun apply(project: Project) { - project.afterEvaluate { - addSourceSets(project) - } - } - - private fun addSourceSets(project: Project) { - - project.extensions.findByType()?.apply { - project.logger.lifecycle("Kotlin Multiplatform source sets: ${sourceSets.joinToString { "${it.name} / ${it.kotlin.sourceDirectories.files.joinToString()}" }}") - - val jvmProto = this.sourceSets.maybeCreate("jvmProto").apply { - - kotlin.srcDir(project.layout.pbAndGBuildDir.get().dir("generated-sources/java")) - kotlin.srcDir(project.layout.pbAndGBuildDir.get().dir("generated-sources/kotlin")) - - dependsOn(sourceSets.maybeCreate("jvmMain")) - } -// - val tsProto = this.sourceSets.maybeCreate("tsProto").apply { - - kotlin.srcDir(project.layout.pbAndGBuildDir.get().dir("generated-sources/typescript")) - - dependsOn(sourceSets.maybeCreate("jsMain")) - } - -// this.sourceSets.findByName("jvmMain")?.apply { -//// protoJvm.dependsOn(this) -//// dependsOn(protoJvm) -// kotlin.srcDir(project.layout.buildDirectory.dir("pbAndG/generated-sources/java")) -// kotlin.srcDir(project.layout.buildDirectory.dir("pbAndG/generated-sources/kotlin")) -// } -// this.sourceSets.findByName("jsMain")?.apply { -//// protoTypescript.dependsOn(this) -//// dependsOn(protoTypescript) -// kotlin.srcDir(project.layout.buildDirectory.dir("pbAndG/generated-sources/typescript")) -// } - - project.logger.lifecycle("Kotlin Multiplatform source sets: ${sourceSets.joinToString { "${it.name} / ${it.kotlin.sourceDirectories.files.joinToString()}" }}") - -// -// targets .forEach { -// when (it.platformType){ -// KotlinPlatformType.jvm -> {} -// KotlinPlatformType.js -> { -// it.defaultConfigurationName -// } -// KotlinPlatformType.androidJvm -> {} -// KotlinPlatformType.common -> {} -// KotlinPlatformType.native -> {} -// } -// } - - } - } -} diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pb-and-g.gradle.kts b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pb-and-g.gradle.kts deleted file mode 100644 index 5735a4b..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/pb-and-g.gradle.kts +++ /dev/null @@ -1,88 +0,0 @@ -package dev.adamko.gradle.pbandg - -import dev.adamko.gradle.pbandg.Constants.pbAndGBuildDir -import dev.adamko.gradle.pbandg.settings.PBAndGSettings -import dev.adamko.gradle.pbandg.task.ProtobufCompileTask -import dev.adamko.gradle.pbandg.task.ProtobufPrepareLibrariesTask - -plugins { - base -} - -// TODO investigate builtBy and sourceDirectorySet? -// project.objects.fileCollection().builtBy() -// val pbSrcSet = project.objects.sourceDirectorySet("protobuf", "protobuf") - -//if (plugins.hasPlugin(IdeaPlugin::class)) { -// IntelliJPattern().apply(project) -//} - -//plugins.withId("org.jetbrains.kotlin.jvm") { -// logger.info("Configuring Kotlin JVM plugin for PB&G") -// KotlinJvmProjectConfiguration().apply(project) -//} -// -//plugins.withId("org.jetbrains.kotlin.multiplatform") { -// logger.info("Configuring Kotlin Multiplatform plugin for PB&G") -// KotlinMultiplatformProjectConfiguration().apply(project) -//} - -val pbAndGSettings = - project.extensions.create(Constants.PBG_SETTINGS_NAME, PBAndGSettings::class, project) - -//val protocDep = ProtobufCompilerDependency(project, pbAndGSettings) -val protocDep: Configuration = project.configurations.create("protobufCompiler") { - this.description = "Define a single dependency that provides the protoc.exe for this system" - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - isTransitive = false - - defaultDependencies { - add(pbAndGSettings.dependency.get()) - } -} - -val protobufLibraryDependencies: Configuration = - project.configurations.create(Constants.PBG_LIBS_CONF_NAME) { - isVisible = true - isCanBeConsumed = false - isCanBeResolved = true - isTransitive = false - } - -project.dependencies { - protobufLibraryDependencies("com.google.protobuf:protobuf-javalite:3.19.1") { - because("This dep contains common Google .proto files that will be extracted") - } -} - -val protobufPrepareLibrariesTask = - project.tasks.register("protobufPrepareLibraries") { - librarySources.set(protobufLibraryDependencies) - } - -project.tasks.withType { - dependsOn(protocDep, protobufPrepareLibrariesTask) - protobufLibraryDirectories.add(protobufPrepareLibrariesTask.flatMap { it.librariesDirectory }) - - val exe = protocDep.singleFile - logger.debug("Configuring Protobuf task with protoc.exe: $exe") - protocExecutable.set(exe) -} - -val aggregateTask = project.tasks.register("protobufCompileAll") { - group = Constants.PBG_TASK_GROUP - - val pbCompileTasks = tasks.withType() - dependsOn(pbCompileTasks) - - val genSrcDir = project.layout.pbAndGBuildDir.map { it.dir("generated-sources") } - - from(pbCompileTasks.map { it.temporaryDir }) - into(genSrcDir) - includeEmptyDirs = false - -} - -project.tasks.assemble { dependsOn(aggregateTask) } diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/settings/PBAndGSettings.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/settings/PBAndGSettings.kt deleted file mode 100644 index 0023061..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/settings/PBAndGSettings.kt +++ /dev/null @@ -1,103 +0,0 @@ -package dev.adamko.gradle.pbandg.settings - - -import java.util.function.Supplier -import org.gradle.api.Project -import org.gradle.api.artifacts.ExternalModuleDependency -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.provider.Property -import org.gradle.api.provider.Provider -import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.property -import org.gradle.nativeplatform.platform.Architecture -import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform -import org.gradle.nativeplatform.platform.internal.DefaultOperatingSystem - -abstract class PBAndGSettings(private val project: Project) { - - val protocWorkingDir: DirectoryProperty = - project.objects.directoryProperty() - .convention(project.rootProject.layout.projectDirectory.dir(".gradle/protoc")) - - val protocVersion: Property = - project.objects.property(String::class).convention("3.19.1") - - val protocGroup: Property = - project.objects.property(String::class).convention("com.google.protobuf") - - val protocArtifactName: Property = - project.objects.property(String::class).convention("protoc") - - val protocArtifactExtension: Property = - project.objects.property(String::class).convention("exe") - - val operatingSystemProvider: Property> = - project.objects.property>() - .convention { DefaultNativePlatform.getCurrentOperatingSystem() } - - /** - * Should return one of - * - * * `linux` - * * `osx` - * * `windows` - */ - val operatingSystemName: Property = - project.objects - .property() - .convention(operatingSystemProvider.map { it.get().toFamilyName() }) - - private val architectureProvider: Provider = - project.provider { DefaultNativePlatform.getCurrentArchitecture() } - - /** - * Should return one of - * - * * `aarch_64` - * * `ppcle_64` - * * `x86_32` - * * `x86_64` - */ - val architectureName: Property = - project.objects - .property() - .convention(architectureProvider.map { it.name.replace("-", "_") }) - - private val classifierProvider: Provider = - project.provider { "${operatingSystemName.get()}-${architectureName.get()}" } - - /** - * Default: concatenate [operatingSystemName] and [architectureName] - * - * Should return one of: - * - * * `linux-aarch_64` - * * `linux-ppcle_64` - * * `linux-x86_64` - * * `osx-x86_32` - * * `osx-x86_64` - * * `windows-x86_32` - */ - val classifier: Property = - project.objects - .property() - .convention(classifierProvider) - - - private val dependencyProvider: Provider = - project.provider { - project.dependencies.create( - group = protocGroup.get(), - name = protocArtifactName.get(), - version = protocVersion.get(), - classifier = classifierProvider.get(), - ext = protocArtifactExtension.get(), - ) - } - - val dependency: Property = - project.objects - .property() - .convention(dependencyProvider) - -} diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtobufCompileTask.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtobufCompileTask.kt deleted file mode 100644 index bf9b84f..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtobufCompileTask.kt +++ /dev/null @@ -1,86 +0,0 @@ -package dev.adamko.gradle.pbandg.task - -import dev.adamko.gradle.pbandg.Constants -import org.gradle.api.DefaultTask -import org.gradle.api.file.Directory -import org.gradle.api.file.RegularFileProperty -import org.gradle.api.provider.ListProperty -import org.gradle.api.provider.Property -import org.gradle.api.provider.Provider -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.InputFile -import org.gradle.api.tasks.InputFiles -import org.gradle.api.tasks.Internal -import org.gradle.api.tasks.OutputDirectory -import org.gradle.api.tasks.TaskAction -import org.gradle.kotlin.dsl.property - -import dev.adamko.gradle.pbandg.Constants.pbAndGBuildDir - -abstract class ProtobufCompileTask : DefaultTask() { - - @get:InputFile - abstract val protocExecutable: RegularFileProperty - - @get:InputFiles - abstract val protobufLibraryDirectories: ListProperty - -// @get:Input -// abstract val protocOutputs: DomainObjectSet -// = project.objects.domainObjectSet(ProtocOutput::class.java) - - @get:Input - abstract val cliArgs: ListProperty - - @get:InputFile - abstract val protoFile: RegularFileProperty - - @get:Input - val cliParamProtoPath: Property = - project.objects.property().convention("--proto_path=") - - @get:OutputDirectory - val outputDir: RegularFileProperty = - project.objects.fileProperty().convention { temporaryDir } - -// @get:Internal -// val outputPath: Provider = outputDir.map { it.asFile.canonicalPath } - - init { - group = Constants.PBG_TASK_GROUP - } - - @TaskAction - fun compile() { - // prepare directories - project.mkdir(outputDir) - - project.exec { - executable(protocExecutable.asFile.get()) - workingDir(outputDir.asFile.get()) - -// val mapOutputsToOutputDir = -// protocOutputs.associateWith { outputDir.get().asFile.resolve(it.outputDirectoryName) } -// mapOutputsToOutputDir.values.forEach { project.mkdir(it) } -// -// // set args -// mapOutputsToOutputDir -// .map { (opt, dir) -> -// val optionsSuffix = if (opt.protocOptions.isBlank()) "" else ":" -// "${opt.cliParam}=${opt.protocOptions}$optionsSuffix$dir" -// } -// .also { args(it) } - args(cliArgs.get()) - - val protoPath = cliParamProtoPath.get() - val libArgs = protobufLibraryDirectories.get().map { "$protoPath${it.asFile}" } - args(libArgs) - - val targetProtoFile = protoFile.get().asFile - args("$protoPath${targetProtoFile.parentFile}") - args("$targetProtoFile") - } - - } - -} diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtobufPrepareLibrariesTask.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtobufPrepareLibrariesTask.kt deleted file mode 100644 index 9f71c27..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtobufPrepareLibrariesTask.kt +++ /dev/null @@ -1,39 +0,0 @@ -package dev.adamko.gradle.pbandg.task - -import dev.adamko.gradle.pbandg.Constants -import dev.adamko.gradle.pbandg.Constants.pbAndGBuildDir -import org.gradle.api.DefaultTask -import org.gradle.api.artifacts.Configuration -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.provider.Property -import org.gradle.api.tasks.InputFiles -import org.gradle.api.tasks.OutputDirectory -import org.gradle.api.tasks.TaskAction -import org.gradle.kotlin.dsl.property - -/** Download protobuf libs */ -abstract class ProtobufPrepareLibrariesTask : DefaultTask() { - - @get:InputFiles - val librarySources: Property = project.objects.property() - - @OutputDirectory - val librariesDirectory: DirectoryProperty = project.objects.directoryProperty() - .convention(project.pbAndGBuildDir.map { it.dir("libs") }) - - init { - group = Constants.PBG_TASK_GROUP - description = "Download and extract protobuf libs" - } - - @TaskAction - fun doTask() { - project.sync { - includeEmptyDirs = false - from(librarySources.map { conf -> conf.map { project.zipTree(it) } }) - into(librariesDirectory) - include("**/*.proto") - } - } - -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtocPrepareTask.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtocPrepareTask.kt deleted file mode 100644 index 75445b4..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/ProtocPrepareTask.kt +++ /dev/null @@ -1,65 +0,0 @@ -package dev.adamko.gradle.pbandg.task - - -import dev.adamko.gradle.pbandg.settings.PBAndGSettings -import org.gradle.api.DefaultTask -import org.gradle.api.artifacts.Configuration -import org.gradle.api.artifacts.ExternalModuleDependency -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.file.RegularFileProperty -import org.gradle.api.provider.Provider -import org.gradle.api.tasks.Internal -import org.gradle.api.tasks.OutputDirectory -import org.gradle.api.tasks.TaskAction -import org.gradle.kotlin.dsl.getByType - - -abstract class ProtocPrepareTask : DefaultTask() { - - @Internal - val protocPluginConfig: Provider = project.provider { - project.extensions.getByType() - } - - @get:OutputDirectory - val outputDirectory: DirectoryProperty = project.objects.directoryProperty() - .convention(protocPluginConfig.flatMap { it.protocWorkingDir }) - - @Internal - val protocOutput: RegularFileProperty = project.objects.fileProperty() - - @Internal - val protocDependency: Provider = - protocPluginConfig.flatMap { it.dependency } - - init { - super.setGroup("protobuf") - outputs.dir(outputDirectory) - } - - @TaskAction - fun action() { - - val protocDep: Configuration = project.configurations.create("protoc") { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - isTransitive = false - - defaultDependencies { - add(protocDependency.get()) - } - } - - logger.lifecycle("Downloading protoc") - val resolvedProtocDep = protocDep.singleFile - logger.lifecycle("Downloaded $resolvedProtocDep") - - project.sync { - from(resolvedProtocDep) - into(outputDirectory) - logger.lifecycle("Syncing from $resolvedProtocDep to ${outputDirectory.asFile.get().canonicalPath}") - protocOutput.set(outputDirectory.asFileTree.singleFile) - } - } -} diff --git a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/options/ProtocOutput.kt b/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/options/ProtocOutput.kt deleted file mode 100644 index a5b33c5..0000000 --- a/buildSrc/src/main/kotlin/dev/adamko/gradle/pbandg/task/options/ProtocOutput.kt +++ /dev/null @@ -1,25 +0,0 @@ -package dev.adamko.gradle.pbandg.task.options - -import java.io.Serializable - - -interface ProtocOutput : Serializable { - val cliParam: String - val protocOptions: String - val outputDirectoryName: String - - data class KotlinOutput( - override val protocOptions: String = "lite", - override val outputDirectoryName: String = "kotlin", - ) : ProtocOutput { - override val cliParam: String = "--kotlin_out" - } - - data class JavaOutput( - override val protocOptions: String = "lite", - override val outputDirectoryName: String = "java", - ) : ProtocOutput { - override val cliParam: String = "--java_out" - } - -} \ No newline at end of file diff --git a/modules/factorio-events-data-model/build.gradle.kts b/modules/factorio-events-data-model/build.gradle.kts index a3f5c6c..d592108 100644 --- a/modules/factorio-events-data-model/build.gradle.kts +++ b/modules/factorio-events-data-model/build.gradle.kts @@ -1,12 +1,6 @@ -import dev.adamko.gradle.pbandg.task.ProtobufCompileTask -import org.jetbrains.kotlin.gradle.targets.js.npm.NpmProject -import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.RootPackageJsonTask - plugins { id("dev.adamko.factoriowebmap.archetype.base") kotlin("multiplatform") - - id("dev.adamko.gradle.pbandg.pb-and-g") } val projectId: String by project.extra @@ -43,9 +37,6 @@ kotlin { sourceSets { val jsMain by getting { - dependencies { - implementation(npm("ts-proto", "1.83.3")) - } } val jsTest by getting { @@ -69,86 +60,3 @@ kotlin { } } } - -dependencies { - protobufLibrary("com.google.protobuf:protobuf-javalite:3.19.1") -} - -val rootPackageJson by rootProject.tasks.getting(RootPackageJsonTask::class) -val nodePath: Directory by extra { - val file = rootPackageJson.rootPackageJson.parentFile.normalize() - logger.lifecycle("Kotlin/JS NODE_PATH: $file") - project.layout.dir(provider { file }).get() -} - -val nodeModulesDir: Directory by extra { - val file = nodePath.dir(NpmProject.NODE_MODULES) - logger.lifecycle("Kotlin/JS NODE_MODULES: $file") - file -} - -afterEvaluate { - val protobufJava by tasks.creating(ProtobufCompileTask::class) { - description = "proto2java" - protoFile.set(file("$projectDir/src/proto/FactorioServerLogRecord.proto")) - - cliArgs.add("--java_out=lite:${project.mkdir("$temporaryDir/java").canonicalPath}") - } - val protobufKotlin by tasks.creating(ProtobufCompileTask::class) { - description = "proto2kotlin" - protoFile.set(file("$projectDir/src/proto/FactorioServerLogRecord.proto")) - - cliArgs.add("--kotlin_out=lite:${project.mkdir("$temporaryDir/kotlin").canonicalPath}") - } - - - val ktProto by configurations.creating { - isCanBeResolved = false - isCanBeConsumed = true - } - - artifacts { - add(ktProto.name, protobufJava.outputDir) { - builtBy(protobufJava) - } - add(ktProto.name, protobufKotlin.outputDir) { - builtBy(protobufKotlin) - } - } - - val protobufTypescript by tasks.creating(ProtobufCompileTask::class) { - description = "proto2typescript" - - // linux: -// cliArgs.add("--plugin=${rootProject.buildDir}/js/packages/factorio-web-map-factorio-events-data-model/node_modules/.bin/protoc-gen-ts_proto.cmd") - // windows: - cliArgs.add("--plugin=protoc-gen-ts_proto=${rootProject.buildDir}/js/packages/factorio-web-map-factorio-events-data-model/node_modules/.bin/protoc-gen-ts_proto.cmd") - - cliArgs.add("--ts_proto_out=${project.mkdir("$temporaryDir/typescript").canonicalPath}") - - cliArgs.addAll( - "--ts_proto_opt=useOptionals=true", - "--ts_proto_opt=outputServices=false", - "--ts_proto_opt=outputJsonMethods=false", -// "--ts_proto_opt=outputEncodeMethods=false", - "--ts_proto_opt=forceLong=string", - "--ts_proto_opt=forceLong=number", - "--ts_proto_opt=esModuleInterop=true", - "--ts_proto_opt=exportCommonSymbols=false", -// "--proto_path=${rootProject.rootDir}", - ) - - protoFile.set(file("$projectDir/src/proto/FactorioServerLogRecord.proto")) - } - - val tsProto by configurations.creating { - isCanBeResolved = false - isCanBeConsumed = true - } - artifacts { - add(tsProto.name, protobufTypescript.outputDir) { - builtBy(protobufTypescript) - } - } - -} diff --git a/modules/factorio-events-data-model/src/proto/FactorioServerLogRecord.proto b/modules/factorio-events-data-model/src/proto/FactorioServerLogRecord.proto deleted file mode 100644 index 02d37ad..0000000 --- a/modules/factorio-events-data-model/src/proto/FactorioServerLogRecord.proto +++ /dev/null @@ -1,94 +0,0 @@ -syntax = "proto3"; - -//option optimize_for = LITE_RUNTIME; -option java_multiple_files = true; - -package dev.adamko.factorioevents; - -//import "google/protobuf/any.proto"; -//import "google/protobuf/timestamp.proto"; - -message FactorioServerLogRecord { - string mod_version = 1; - uint32 tick = 2; - string event_type = 3; - FactorioLuaObject data = 4; - -} - -message FactorioLuaObject { - string object_name = 1; - oneof data { - LuaControl lua_control = 2; - } -} - -// https://lua-api.factorio.com/next/LuaControl.html -message LuaControl { - bool is_player = 2; - uint32 surface_index = 3; - Position position = 4; - uint32 force_index = 5; - - oneof subtype { - LuaPlayer player = 10; - LuaEntity entity = 11; - } -} - -// https://lua-api.factorio.com/next/LuaPlayer.html -message LuaPlayer { - uint32 index = 1; // unique ID - string name = 2; - repeated int32 data = 4 [packed = true]; - - Colour colour = 8; - - bool is_connected = 10; - bool is_admin = 11; - - uint32 afk_time_ticks = 100; - uint32 online_time_ticks = 101; - uint32 last_online_ticks = 102; -} - -// https://lua-api.factorio.com/next/LuaEntity.html -message LuaEntity { - optional uint32 unit_number = 1; // (optional) unique ID - string name = 2; - string type = 3; - string status = 4; // https://lua-api.factorio.com/next/defines.html#defines.entity_status - - bool is_active = 8; - bool is_moving = 9; - - optional uint32 player_index = 50; // (optional) The player connected to this character or nil if none. - optional uint32 last_user_index = 51; // (optional) The last player that changed any setting on this entity. - - Colour colour = 100; // (optional) -} - -message LuaSurface { - uint32 index = 1; // unique ID - string name = 2; - float daytime = 3; -} - -message LuaForce { - uint32 index = 1; // unique ID - string force_name = 2; - - repeated uint32 player_ids = 100 [packed = true]; -} - -message Position { - int32 x = 1; - int32 y = 2; -} - -message Colour { - float red = 1; - float green = 2; - float blue = 3; - float alpha = 4; -} diff --git a/modules/factorio-events-data-model/xsrc/commonMain/kotlin/dev.adamko.factorioevents.model/FactorioEvent.kt b/modules/factorio-events-data-model/xsrc/commonMain/kotlin/dev.adamko.factorioevents.model/FactorioEvent.kt deleted file mode 100644 index 058d02d..0000000 --- a/modules/factorio-events-data-model/xsrc/commonMain/kotlin/dev.adamko.factorioevents.model/FactorioEvent.kt +++ /dev/null @@ -1,63 +0,0 @@ -package dev.adamko.factorioevents.model - -import kotlin.js.JsExport -import kotlin.jvm.JvmInline - -//expect sealed interface JsonPrimitive { -// value class JsonString(val string: String) : JsonPrimitive -// value class JsonNumber(val number: Number) : JsonPrimitive -// value class JsonBoolean(val boolean: Boolean) : JsonPrimitive -//} - -sealed interface JsonPrimitive { - @JvmInline - value class JsonString(val string: String) : JsonPrimitive - @JvmInline - value class JsonNumber(val number: Number) : JsonPrimitive - @JvmInline - value class JsonBoolean(val boolean: Boolean) : JsonPrimitive -} - -class JsonArray( - private val list: MutableList = mutableListOf() -) : MutableList by list - - -sealed interface JsonTableValue { - @JvmInline - value class JsonPrimitiveTV(val primitive: JsonPrimitive) : JsonTableValue - @JvmInline - value class JsonArrayTV(val array: JsonArray) : JsonTableValue - @JvmInline - value class JsonTableTV(val array: JsonTable) : JsonTableValue -} - -//expect class JsonNumber() : JsonPrimitiveType - -//expect class JsonArray - -//expect open class JsonTable - -open class JsonTable( - protected val map: MutableMap = mutableMapOf() -) : MutableMap by map { - - inline fun get2(key: String): T? { - - val jKey = JsonPrimitive.JsonString(key) - - return when { - T::class is Number -> ((get(jKey) as? JsonTableValue.JsonPrimitiveTV)?.primitive as? JsonPrimitive.JsonNumber)?.number as? T - else -> return get(jKey) as? T - } - - } - -} - -//@JsExport -class FactorioEvent : JsonTable() { - val tick: UInt? - get() = get2("tick") -// set(value) = map.put("tick", value) -} \ No newline at end of file diff --git a/modules/factorio-events-data-model/xsrc/jsMain/kotlin/dev.adamko.factorioevents.model/JsonPrimitiveType.kt b/modules/factorio-events-data-model/xsrc/jsMain/kotlin/dev.adamko.factorioevents.model/JsonPrimitiveType.kt deleted file mode 100644 index 06519b0..0000000 --- a/modules/factorio-events-data-model/xsrc/jsMain/kotlin/dev.adamko.factorioevents.model/JsonPrimitiveType.kt +++ /dev/null @@ -1,31 +0,0 @@ -package dev.adamko.factorioevents.model - - -//actual sealed interface JsonPrimitive { -// actual value class JsonString(val string: String) : JsonPrimitive -// actual value class JsonNumber(val number: Number) : JsonPrimitive -// actual value class JsonBoolean(val boolean: Boolean) : JsonPrimitive -//} - -//actual class JsonArray( -// private val list: MutableList = mutableListOf() -//) : MutableList by list - -//actual sealed interface JsonTableValue { -// actual value class JsonPrimitiveTV(val primitive: JsonPrimitive) : JsonTableValue -// actual value class JsonArrayTV(val array: JsonArray) : JsonTableValue -//} - - -//actual open class JsonTable( -// private val map: MutableMap = mutableMapOf() -//) : MutableMap by map - - -fun printMap() { - val f = JsonPrimitive.JsonString("test") - - println(f.string) - println(f) - -} diff --git a/modules/factorio-events-data-model/xsrc/main/kotlin/PlayerModel.kt b/modules/factorio-events-data-model/xsrc/main/kotlin/PlayerModel.kt deleted file mode 100644 index a745430..0000000 --- a/modules/factorio-events-data-model/xsrc/main/kotlin/PlayerModel.kt +++ /dev/null @@ -1,55 +0,0 @@ -interface Identifiable { - val id: T -} - - -interface IndexedModel { - val index: UInt -} - -interface NamedModel { - val name: String -} - - -data class SurfaceModel( - override val name: String, - override val index: UInt, - val daytime: Float, - val darkness: Float, - val wind_speed: Double, -) : IndexedModel, NamedModel - - -/** Player/Entity shared props */ -interface ControlModel { - val driving: Boolean - val forces: List -} - - -//data class PlayerModel( -// val index: UInt, -// val characters: List -//) : Identifiable { -// override val id: UInt = index -//} - -//data class EntityModel( -// val unit_number: Int, -// override val name: String, -// val type: String, -// val active: Boolean, -// val minable: Boolean, -// val health: Boolean, -// val speed: Float, override val driving: Boolean, -//) : ControlModel, NamedModel - - -data class ForceModel( - val index: UInt, - override val name: String, - val research_progress: Double, -) : Identifiable, NamedModel { - override val id: UInt = index -} diff --git a/modules/mod/build.gradle.kts b/modules/mod/build.gradle.kts index 26e634f..5868ba2 100644 --- a/modules/mod/build.gradle.kts +++ b/modules/mod/build.gradle.kts @@ -16,66 +16,6 @@ node { nodeProjectDir.set(tsSrcDir) } -val tsProto: Configuration by configurations.creating { - isCanBeConsumed = false - isCanBeResolved = true -} - -dependencies { - tsProto(projects.modules.factorioEventsDataModel.dependencyProject.configurations.getByName("tsProto")) -} - -val tsProtoFetch by tasks.creating(Sync::class) { - group = project.name - - dependsOn(projects.modules.factorioEventsDataModel.dependencyProject.tasks.named("protobufTypescript")) - - val genSrcDir = projects - .modules - .factorioEventsDataModel - .dependencyProject - .layout - .buildDirectory - .dir("pbAndG/generated-sources/typescript") - - val targetDir = "$projectDir/src/main/typescript/proto" - - inputs.dir(genSrcDir) - - from(genSrcDir) - into(targetDir) - -// doLast { -// -// fileTree(targetDir).forEach { -// var text = it.readText() -// -// text = text.replace( -// Regex( -// """if \(_m0\.util\.Long !== Long\)\s*\{\s*_m0\.util\.Long = Long as any;\s*_m0\.configure\(\);\s*\}""" -// ), -// "" -// ) -// -// text = text.replace( -// Regex("""import Long from "long";"""), -// "" -// ) -// -// text = text.replace( -// Regex("""import _m0 from "protobufjs\/minimal";"""), -// "" -// ) -// -// it.writeText(text) -// } -// } - -} - -tasks.assemble { dependsOn(tsProtoFetch) } - - val tstlTask = tasks.register("typescriptToLua") { description = "Convert Typescript To Lua" group = projectId @@ -86,7 +26,7 @@ val tstlTask = tasks.register("typescriptToLua") { npmCommand.set(listOf("run", "build")) - inputs.dir(node.nodeProjectDir) + inputs.dir(project.node.nodeProjectDir) .skipWhenEmpty() .withPropertyName("sourceFiles") .withPathSensitivity(PathSensitivity.RELATIVE) @@ -124,20 +64,18 @@ idea { } -//val typescriptSrc = -// project.objects.sourceDirectorySet("typescript", "typescript").apply { -// srcDir( -// layout.projectDirectory.dir("src/main/typescript") -// ) -// destinationDirectory.set( -// modBuildDir.dir("typescriptToLua") -// ) -// compiledBy(tstlTask) { -// project.objects.directoryProperty().apply { -// set( modBuildDir.dir("typescriptToLua")) -// } -// } -// } +val typescriptSrcSet = + project.objects.sourceDirectorySet("typescript", "typescript").apply { + srcDir(mkdir("$projectDir/src/main/typescript")) + + destinationDirectory.set(modBuildDir.dir("typescriptToLua").asFile) + compiledBy(tstlTask) { + + project.objects.directoryProperty().apply { + set(modBuildDir.dir("typescriptToLua")) + } + } + } val modPackageTask = tasks.register("packageMod") { description = "Package mod files into ZIP" diff --git a/modules/mod/src/main/typescript/package-lock.json b/modules/mod/src/main/typescript/package-lock.json index 621dcc5..b0ae77b 100644 --- a/modules/mod/src/main/typescript/package-lock.json +++ b/modules/mod/src/main/typescript/package-lock.json @@ -4,85 +4,11 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" - }, "@types/node": { "version": "12.20.33", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.33.tgz", "integrity": "sha512-5XmYX2GECSa+CxMYaFsr2mrql71Q4EvHjKS+ox/SiwSdaASMoBIWE6UmZqFO+VX1jIcsYLStI4FFoB6V7FeIYw==" }, - "@types/object-hash": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", - "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" - }, - "@types/prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ==" - }, - "dataloader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", - "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" - }, "enhanced-resolve": { "version": "5.8.3", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", @@ -118,63 +44,16 @@ "has": "^1.0.3" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, "lua-types": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/lua-types/-/lua-types-2.11.0.tgz", "integrity": "sha512-J/8qHrOjkZuPBDhnuAg0DWoaJEImqXNzgEnUigCTVrSVCcchM5Y5zpcI3aWAZPhuZlb0QKC/f3nc7VGmZmBg7w==" }, - "object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==" - }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, - "prettier": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", - "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==" - }, - "protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "dependencies": { - "@types/node": { - "version": "16.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==" - } - } - }, "resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -194,38 +73,6 @@ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==" }, - "ts-poet": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.6.1.tgz", - "integrity": "sha512-DXJ+mBJIDp+jiaUgB4N5I/sczHHDU2FWacdbDNVAVS4Mh4hb7ckpvUWVW7m7/nAOcjR0r4Wt+7AoO7FeJKExfA==", - "requires": { - "@types/prettier": "^1.19.0", - "lodash": "^4.17.15", - "prettier": "^2.0.2" - } - }, - "ts-proto": { - "version": "1.83.3", - "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.83.3.tgz", - "integrity": "sha512-r6MKFjoc4Og2kB4cNJ/bddLebdIwhouG5plu0Rry1jJMEqp2GKA7AE4FrR/FnTCIGbNPYP4622lBqckZd7UHcQ==", - "requires": { - "@types/object-hash": "^1.3.0", - "dataloader": "^1.4.0", - "object-hash": "^1.3.1", - "protobufjs": "^6.8.8", - "ts-poet": "^4.5.0", - "ts-proto-descriptors": "^1.2.1" - } - }, - "ts-proto-descriptors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.3.1.tgz", - "integrity": "sha512-Cybb3fqceMwA6JzHdC32dIo8eVGVmXrM6TWhdk1XQVVHT/6OQqk0ioyX1dIdu3rCIBhRmWUhUE4HsyK+olmgMw==", - "requires": { - "long": "^4.0.0", - "protobufjs": "^6.8.8" - } - }, "typed-factorio": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/typed-factorio/-/typed-factorio-0.8.0.tgz", diff --git a/modules/mod/src/main/typescript/package.json b/modules/mod/src/main/typescript/package.json index dd451c1..b25c3b9 100644 --- a/modules/mod/src/main/typescript/package.json +++ b/modules/mod/src/main/typescript/package.json @@ -14,25 +14,9 @@ "lua-types": "^2.11.0", "@types/node": "^12.0.8", "typescript-to-lua": "1.0.1", - "typed-factorio": "0.8.0", - "ts-proto": "1.83.3" + "typed-factorio": "0.8.0" }, "peerDependencies": {}, "optionalDependencies": {}, - "bundledDependencies": [], - "//": { - "typescript-json-schema": "0.51.0", - "typescript": "4.4.3", - "@types/node": "^13.7.7", - "kafkajs": "1.15.0", - "lua-types": "^2.11.0", - "react": "17.0.2", - "react-dom": "17.0.2", - "webpack": "5.38.1", - "webpack-cli": "4.7.1", - "format-util": "1.0.5", - "source-map-loader": "3.0.0", - "css-loader": "5.2.6", - "style-loader": "2.0.0" - } + "bundledDependencies": [] } diff --git a/modules/mod/src/main/typescript/proto/FactorioServerLogRecord.ts b/modules/mod/src/main/typescript/proto/FactorioServerLogRecord.ts deleted file mode 100644 index 009a229..0000000 --- a/modules/mod/src/main/typescript/proto/FactorioServerLogRecord.ts +++ /dev/null @@ -1,907 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export interface FactorioServerLogRecord { - modVersion: string; - tick: number; - eventType: string; - data?: FactorioLuaObject; -} - -export interface FactorioLuaObject { - objectName: string; - luaControl?: LuaControl | undefined; -} - -/** https://lua-api.factorio.com/next/LuaControl.html */ -export interface LuaControl { - isPlayer: boolean; - surfaceIndex: number; - position?: Position; - forceIndex: number; - player?: LuaPlayer | undefined; - entity?: LuaEntity | undefined; -} - -/** https://lua-api.factorio.com/next/LuaPlayer.html */ -export interface LuaPlayer { - /** unique ID */ - index: number; - name: string; - data: number[]; - colour?: Colour; - isConnected: boolean; - isAdmin: boolean; - afkTimeTicks: number; - onlineTimeTicks: number; - lastOnlineTicks: number; -} - -/** https://lua-api.factorio.com/next/LuaEntity.html */ -export interface LuaEntity { - /** (optional) unique ID */ - unitNumber?: number | undefined; - name: string; - type: string; - /** https://lua-api.factorio.com/next/defines.html#defines.entity_status */ - status: string; - isActive: boolean; - isMoving: boolean; - /** (optional) The player connected to this character or nil if none. */ - playerIndex?: number | undefined; - /** (optional) The last player that changed any setting on this entity. */ - lastUserIndex?: number | undefined; - /** (optional) */ - colour?: Colour; -} - -export interface LuaSurface { - /** unique ID */ - index: number; - name: string; - daytime: number; -} - -export interface LuaForce { - /** unique ID */ - index: number; - forceName: string; - playerIds: number[]; -} - -export interface Position { - x: number; - y: number; -} - -export interface Colour { - red: number; - green: number; - blue: number; - alpha: number; -} - -const baseFactorioServerLogRecord: object = { - modVersion: "", - tick: 0, - eventType: "", -}; - -export const FactorioServerLogRecord = { - encode( - message: FactorioServerLogRecord, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.modVersion !== "") { - writer.uint32(10).string(message.modVersion); - } - if (message.tick !== 0) { - writer.uint32(16).uint32(message.tick); - } - if (message.eventType !== "") { - writer.uint32(26).string(message.eventType); - } - if (message.data !== undefined) { - FactorioLuaObject.encode(message.data, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): FactorioServerLogRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseFactorioServerLogRecord, - } as FactorioServerLogRecord; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.modVersion = reader.string(); - break; - case 2: - message.tick = reader.uint32(); - break; - case 3: - message.eventType = reader.string(); - break; - case 4: - message.data = FactorioLuaObject.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial( - object: DeepPartial - ): FactorioServerLogRecord { - const message = { - ...baseFactorioServerLogRecord, - } as FactorioServerLogRecord; - if (object.modVersion !== undefined && object.modVersion !== null) { - message.modVersion = object.modVersion; - } else { - message.modVersion = ""; - } - if (object.tick !== undefined && object.tick !== null) { - message.tick = object.tick; - } else { - message.tick = 0; - } - if (object.eventType !== undefined && object.eventType !== null) { - message.eventType = object.eventType; - } else { - message.eventType = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = FactorioLuaObject.fromPartial(object.data); - } else { - message.data = undefined; - } - return message; - }, -}; - -const baseFactorioLuaObject: object = { objectName: "" }; - -export const FactorioLuaObject = { - encode( - message: FactorioLuaObject, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.objectName !== "") { - writer.uint32(10).string(message.objectName); - } - if (message.luaControl !== undefined) { - LuaControl.encode(message.luaControl, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FactorioLuaObject { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFactorioLuaObject } as FactorioLuaObject; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.objectName = reader.string(); - break; - case 2: - message.luaControl = LuaControl.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial(object: DeepPartial): FactorioLuaObject { - const message = { ...baseFactorioLuaObject } as FactorioLuaObject; - if (object.objectName !== undefined && object.objectName !== null) { - message.objectName = object.objectName; - } else { - message.objectName = ""; - } - if (object.luaControl !== undefined && object.luaControl !== null) { - message.luaControl = LuaControl.fromPartial(object.luaControl); - } else { - message.luaControl = undefined; - } - return message; - }, -}; - -const baseLuaControl: object = { - isPlayer: false, - surfaceIndex: 0, - forceIndex: 0, -}; - -export const LuaControl = { - encode( - message: LuaControl, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.isPlayer === true) { - writer.uint32(16).bool(message.isPlayer); - } - if (message.surfaceIndex !== 0) { - writer.uint32(24).uint32(message.surfaceIndex); - } - if (message.position !== undefined) { - Position.encode(message.position, writer.uint32(34).fork()).ldelim(); - } - if (message.forceIndex !== 0) { - writer.uint32(40).uint32(message.forceIndex); - } - if (message.player !== undefined) { - LuaPlayer.encode(message.player, writer.uint32(82).fork()).ldelim(); - } - if (message.entity !== undefined) { - LuaEntity.encode(message.entity, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LuaControl { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLuaControl } as LuaControl; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.isPlayer = reader.bool(); - break; - case 3: - message.surfaceIndex = reader.uint32(); - break; - case 4: - message.position = Position.decode(reader, reader.uint32()); - break; - case 5: - message.forceIndex = reader.uint32(); - break; - case 10: - message.player = LuaPlayer.decode(reader, reader.uint32()); - break; - case 11: - message.entity = LuaEntity.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial(object: DeepPartial): LuaControl { - const message = { ...baseLuaControl } as LuaControl; - if (object.isPlayer !== undefined && object.isPlayer !== null) { - message.isPlayer = object.isPlayer; - } else { - message.isPlayer = false; - } - if (object.surfaceIndex !== undefined && object.surfaceIndex !== null) { - message.surfaceIndex = object.surfaceIndex; - } else { - message.surfaceIndex = 0; - } - if (object.position !== undefined && object.position !== null) { - message.position = Position.fromPartial(object.position); - } else { - message.position = undefined; - } - if (object.forceIndex !== undefined && object.forceIndex !== null) { - message.forceIndex = object.forceIndex; - } else { - message.forceIndex = 0; - } - if (object.player !== undefined && object.player !== null) { - message.player = LuaPlayer.fromPartial(object.player); - } else { - message.player = undefined; - } - if (object.entity !== undefined && object.entity !== null) { - message.entity = LuaEntity.fromPartial(object.entity); - } else { - message.entity = undefined; - } - return message; - }, -}; - -const baseLuaPlayer: object = { - index: 0, - name: "", - data: 0, - isConnected: false, - isAdmin: false, - afkTimeTicks: 0, - onlineTimeTicks: 0, - lastOnlineTicks: 0, -}; - -export const LuaPlayer = { - encode( - message: LuaPlayer, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - if (message.name !== "") { - writer.uint32(18).string(message.name); - } - writer.uint32(34).fork(); - for (const v of message.data) { - writer.int32(v); - } - writer.ldelim(); - if (message.colour !== undefined) { - Colour.encode(message.colour, writer.uint32(66).fork()).ldelim(); - } - if (message.isConnected === true) { - writer.uint32(80).bool(message.isConnected); - } - if (message.isAdmin === true) { - writer.uint32(88).bool(message.isAdmin); - } - if (message.afkTimeTicks !== 0) { - writer.uint32(800).uint32(message.afkTimeTicks); - } - if (message.onlineTimeTicks !== 0) { - writer.uint32(808).uint32(message.onlineTimeTicks); - } - if (message.lastOnlineTicks !== 0) { - writer.uint32(816).uint32(message.lastOnlineTicks); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LuaPlayer { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLuaPlayer } as LuaPlayer; - message.data = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.name = reader.string(); - break; - case 4: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.data.push(reader.int32()); - } - } else { - message.data.push(reader.int32()); - } - break; - case 8: - message.colour = Colour.decode(reader, reader.uint32()); - break; - case 10: - message.isConnected = reader.bool(); - break; - case 11: - message.isAdmin = reader.bool(); - break; - case 100: - message.afkTimeTicks = reader.uint32(); - break; - case 101: - message.onlineTimeTicks = reader.uint32(); - break; - case 102: - message.lastOnlineTicks = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial(object: DeepPartial): LuaPlayer { - const message = { ...baseLuaPlayer } as LuaPlayer; - message.data = []; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.data !== undefined && object.data !== null) { - for (const e of object.data) { - message.data.push(e); - } - } - if (object.colour !== undefined && object.colour !== null) { - message.colour = Colour.fromPartial(object.colour); - } else { - message.colour = undefined; - } - if (object.isConnected !== undefined && object.isConnected !== null) { - message.isConnected = object.isConnected; - } else { - message.isConnected = false; - } - if (object.isAdmin !== undefined && object.isAdmin !== null) { - message.isAdmin = object.isAdmin; - } else { - message.isAdmin = false; - } - if (object.afkTimeTicks !== undefined && object.afkTimeTicks !== null) { - message.afkTimeTicks = object.afkTimeTicks; - } else { - message.afkTimeTicks = 0; - } - if ( - object.onlineTimeTicks !== undefined && - object.onlineTimeTicks !== null - ) { - message.onlineTimeTicks = object.onlineTimeTicks; - } else { - message.onlineTimeTicks = 0; - } - if ( - object.lastOnlineTicks !== undefined && - object.lastOnlineTicks !== null - ) { - message.lastOnlineTicks = object.lastOnlineTicks; - } else { - message.lastOnlineTicks = 0; - } - return message; - }, -}; - -const baseLuaEntity: object = { - name: "", - type: "", - status: "", - isActive: false, - isMoving: false, -}; - -export const LuaEntity = { - encode( - message: LuaEntity, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.unitNumber !== undefined) { - writer.uint32(8).uint32(message.unitNumber); - } - if (message.name !== "") { - writer.uint32(18).string(message.name); - } - if (message.type !== "") { - writer.uint32(26).string(message.type); - } - if (message.status !== "") { - writer.uint32(34).string(message.status); - } - if (message.isActive === true) { - writer.uint32(64).bool(message.isActive); - } - if (message.isMoving === true) { - writer.uint32(72).bool(message.isMoving); - } - if (message.playerIndex !== undefined) { - writer.uint32(400).uint32(message.playerIndex); - } - if (message.lastUserIndex !== undefined) { - writer.uint32(408).uint32(message.lastUserIndex); - } - if (message.colour !== undefined) { - Colour.encode(message.colour, writer.uint32(802).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LuaEntity { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLuaEntity } as LuaEntity; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.unitNumber = reader.uint32(); - break; - case 2: - message.name = reader.string(); - break; - case 3: - message.type = reader.string(); - break; - case 4: - message.status = reader.string(); - break; - case 8: - message.isActive = reader.bool(); - break; - case 9: - message.isMoving = reader.bool(); - break; - case 50: - message.playerIndex = reader.uint32(); - break; - case 51: - message.lastUserIndex = reader.uint32(); - break; - case 100: - message.colour = Colour.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial(object: DeepPartial): LuaEntity { - const message = { ...baseLuaEntity } as LuaEntity; - if (object.unitNumber !== undefined && object.unitNumber !== null) { - message.unitNumber = object.unitNumber; - } else { - message.unitNumber = undefined; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } else { - message.status = ""; - } - if (object.isActive !== undefined && object.isActive !== null) { - message.isActive = object.isActive; - } else { - message.isActive = false; - } - if (object.isMoving !== undefined && object.isMoving !== null) { - message.isMoving = object.isMoving; - } else { - message.isMoving = false; - } - if (object.playerIndex !== undefined && object.playerIndex !== null) { - message.playerIndex = object.playerIndex; - } else { - message.playerIndex = undefined; - } - if (object.lastUserIndex !== undefined && object.lastUserIndex !== null) { - message.lastUserIndex = object.lastUserIndex; - } else { - message.lastUserIndex = undefined; - } - if (object.colour !== undefined && object.colour !== null) { - message.colour = Colour.fromPartial(object.colour); - } else { - message.colour = undefined; - } - return message; - }, -}; - -const baseLuaSurface: object = { index: 0, name: "", daytime: 0 }; - -export const LuaSurface = { - encode( - message: LuaSurface, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - if (message.name !== "") { - writer.uint32(18).string(message.name); - } - if (message.daytime !== 0) { - writer.uint32(29).float(message.daytime); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LuaSurface { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLuaSurface } as LuaSurface; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.name = reader.string(); - break; - case 3: - message.daytime = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial(object: DeepPartial): LuaSurface { - const message = { ...baseLuaSurface } as LuaSurface; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.daytime !== undefined && object.daytime !== null) { - message.daytime = object.daytime; - } else { - message.daytime = 0; - } - return message; - }, -}; - -const baseLuaForce: object = { index: 0, forceName: "", playerIds: 0 }; - -export const LuaForce = { - encode( - message: LuaForce, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - if (message.forceName !== "") { - writer.uint32(18).string(message.forceName); - } - writer.uint32(802).fork(); - for (const v of message.playerIds) { - writer.uint32(v); - } - writer.ldelim(); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LuaForce { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLuaForce } as LuaForce; - message.playerIds = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.forceName = reader.string(); - break; - case 100: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.playerIds.push(reader.uint32()); - } - } else { - message.playerIds.push(reader.uint32()); - } - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial(object: DeepPartial): LuaForce { - const message = { ...baseLuaForce } as LuaForce; - message.playerIds = []; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.forceName !== undefined && object.forceName !== null) { - message.forceName = object.forceName; - } else { - message.forceName = ""; - } - if (object.playerIds !== undefined && object.playerIds !== null) { - for (const e of object.playerIds) { - message.playerIds.push(e); - } - } - return message; - }, -}; - -const basePosition: object = { x: 0, y: 0 }; - -export const Position = { - encode( - message: Position, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.x !== 0) { - writer.uint32(8).int32(message.x); - } - if (message.y !== 0) { - writer.uint32(16).int32(message.y); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Position { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePosition } as Position; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.x = reader.int32(); - break; - case 2: - message.y = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial(object: DeepPartial): Position { - const message = { ...basePosition } as Position; - if (object.x !== undefined && object.x !== null) { - message.x = object.x; - } else { - message.x = 0; - } - if (object.y !== undefined && object.y !== null) { - message.y = object.y; - } else { - message.y = 0; - } - return message; - }, -}; - -const baseColour: object = { red: 0, green: 0, blue: 0, alpha: 0 }; - -export const Colour = { - encode( - message: Colour, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.red !== 0) { - writer.uint32(13).float(message.red); - } - if (message.green !== 0) { - writer.uint32(21).float(message.green); - } - if (message.blue !== 0) { - writer.uint32(29).float(message.blue); - } - if (message.alpha !== 0) { - writer.uint32(37).float(message.alpha); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Colour { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseColour } as Colour; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.red = reader.float(); - break; - case 2: - message.green = reader.float(); - break; - case 3: - message.blue = reader.float(); - break; - case 4: - message.alpha = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromPartial(object: DeepPartial): Colour { - const message = { ...baseColour } as Colour; - if (object.red !== undefined && object.red !== null) { - message.red = object.red; - } else { - message.red = 0; - } - if (object.green !== undefined && object.green !== null) { - message.green = object.green; - } else { - message.green = 0; - } - if (object.blue !== undefined && object.blue !== null) { - message.blue = object.blue; - } else { - message.blue = 0; - } - if (object.alpha !== undefined && object.alpha !== null) { - message.alpha = object.alpha; - } else { - message.alpha = 0; - } - return message; - }, -}; - -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; -type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/modules/mod/src/main/typescript/tsconfig.json b/modules/mod/src/main/typescript/tsconfig.json index 989f0ae..1e9e646 100644 --- a/modules/mod/src/main/typescript/tsconfig.json +++ b/modules/mod/src/main/typescript/tsconfig.json @@ -10,9 +10,7 @@ "types": [ "typescript-to-lua/language-extensions", "lua-types/5.2", - "typed-factorio/runtime", - "protobufjs/minimal.d.ts", - "@types/long" + "typed-factorio/runtime" ], "explainFiles": true, "forceConsistentCasingInFileNames": true, @@ -33,29 +31,5 @@ "noHeader": true, "noImplicitSelf": true, "luaLibImport": "inline" - }, - "//": { - "noResolve": true, - "newLine": "lf", - "exclude": [ - "node_modules" - ], - "exactOptionalPropertyTypes": true, - "skipLibCheck": true, - "skipDefaultLibCheck": true, - "types": [ - "node", - "typed-factorio/runtime", - "lua-types/5.2" - ], - "typeRoots": [ - "node_modules/@types" - ], - "//": "lua-types/5.2", - "luaLibImport": "inline", - "noImplicitSelf": true, - "sourceMapTraceback": true, - "luaBundle ": "bundle.lua", - "luaBundleEntry ": "bundleEntry.lua" } } diff --git a/modules/mod2/build.gradle.kts b/modules/mod2/build.gradle.kts deleted file mode 100644 index 586e5cb..0000000 --- a/modules/mod2/build.gradle.kts +++ /dev/null @@ -1,162 +0,0 @@ -import com.github.gradle.node.npm.task.NpmTask -import com.github.gradle.node.task.NodeTask -import org.gradle.api.internal.project.ProjectInternal -import org.jetbrains.kotlin.gradle.targets.js.dukat.DukatRunner -import org.jetbrains.kotlin.gradle.targets.js.dukat.ExternalsOutputFormat -import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.RootPackageJsonTask -import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinPackageJsonTask -import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs -import org.jetbrains.kotlin.gradle.targets.js.npm.NpmProject -import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject - -plugins { - id("dev.adamko.factoriowebmap.archetype.kotlin-js") -} - -//group = rootProject.group.toString() + "." + project.name -//version = rootProject.version -// -//val projectId = rootProject.name + "-" + project.name -val projectId: String by project.extra -val modBuildDir: Directory = layout.buildDirectory.dir(projectId).get() -val nodeModulesDir: Directory by project.extra - -kotlin { - - js(IR) { - - binaries.executable() - - useCommonJs() - nodejs() - -// compilations.all { - compilations["main"].apply { - packageJson { - customField( - "scripts", - mapOf( - "build" to "tstl", - "dev" to "tstl --watch", - ) - ) - } - } - - -// kotlin.srcDir("src/main/myKotlin") -// } - sourceSets["main"].apply { -// sourceSets.create("dukat").apply { - kotlin.srcDir(project.layout.projectDirectory.dir("dukat-custom")) - } - - -// sourceSets { -// all { -// languageSettings.optIn("kotlin.ExperimentalStdlibApi") -// languageSettings.optIn("kotlin.time.ExperimentalTime") -// } -// } - } -} - -dependencies { - - - // bom is defined in archetype.kotlin-js - - 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 = true)) - implementation(npm("lua-types", "2.11.0", generateExternals = generateExternals)) - implementation(npm("typescript", "4.4.3", generateExternals = generateExternals)) - - testImplementation(kotlin("test-js")) -} - -//val rootPackageJson: RootPackageJsonTask by tasks.getting(RootPackageJsonTask::class) -//val rootPackageJson by rootProject.tasks.getting(RootPackageJsonTask::class) -//val packageJson by rootProject.tasks.getting(KotlinPackageJsonTask::class) -//val packageJson : RootPackageJsonTask by tasks.named(RootPackageJsonTask.NAME) - -//node { -// download.set(true) -// version.set("14.18.0") -// -// distBaseUrl.set(null as String?) // set by dependencyResolutionManagement -// -// nodeProjectDir.set(rootPackageJson.rootPackageJson.parentFile.normalize()) -//// nodeProjectDir.set(packageJson.packageJson.parentFile.normalize()) -//} - - -//fun NpmTask.setNodeModulesPath(path: String): Unit = -// environment.put("NODE_PATH", path) -// -//fun NpmTask.setNodeModulesPath(folder: File): Unit = -// setNodeModulesPath(folder.normalize().absolutePath) - -tasks { - register("tstl") { - description = "Typescript To Lua" - group = projectId - - dependsOn(build) - -// setNodeModulesPath(node.nodeProjectDir.dir("node_modules").get().asFile) -// setNodeModulesPath(node.nodeProjectDir.dir(NpmProject.NODE_MODULES).get().asFile) - val nodeModulesDir: Directory by project.extra - environment.put("NODE_PATH", nodeModulesDir.asFile.absolutePath) - - execOverrides { standardOutput = System.out } - - npmCommand.set(listOf("run", "build")) - - val outputDir = modBuildDir.dir("tstl") - args.set(parseSpaceSeparatedArgs("-- --outDir $outputDir")) - outputs.dir(outputDir) - - ignoreExitValue.set(false) - inputs.dir(rootProject.layout.buildDirectory.dir("js")) - } - - register("dukat-typed-factorio") { - group = projectId - - val npmProject = kotlin.js().compilations["main"].npmProject - - val files = nodeModulesDir.dir("typed-factorio") - .asFileTree - .filter { it.extension in setOf("ts", "d.ts") } - .files - - logger.lifecycle("Converting typed-factorio files: ${files.joinToString { it.name }}") - - val runner = DukatRunner( - npmProject, - files, - ExternalsOutputFormat.SOURCE, - project.layout.projectDirectory.dir("dukat-custom").asFile, - ) - val services = (project as ProjectInternal).services - doLast { - runner.execute(services) - } - } -} - - -configure { - versions.dukat.version = "0.5.8-rc.4-dev.20211001" -// versions.dukat.version = "0.5.8-rc.4" -} diff --git a/modules/mod2/dukat-custom/5.2-only.module_lua-types.kt b/modules/mod2/dukat-custom/5.2-only.module_lua-types.kt deleted file mode 100644 index d47462e..0000000 --- a/modules/mod2/dukat-custom/5.2-only.module_lua-types.kt +++ /dev/null @@ -1,17 +0,0 @@ -@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 collectgarbage(opt: String /* "count" | "generational" | "incremental" */): dynamic /* Unit */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/5.2-plus-or-jit.module_lua-types.kt b/modules/mod2/dukat-custom/5.2-plus-or-jit.module_lua-types.kt deleted file mode 100644 index f68ae03..0000000 --- a/modules/mod2/dukat-custom/5.2-plus-or-jit.module_lua-types.kt +++ /dev/null @@ -1,37 +0,0 @@ -@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 load(chunk: String, chunkname: String = definedExternally, mode: String /* "b" | "t" | "bt" */ = definedExternally, env: Any? = definedExternally): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun load(chunk: String): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun load(chunk: String, chunkname: String = definedExternally): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun load(chunk: String, chunkname: String = definedExternally, mode: String /* "b" | "t" | "bt" */ = definedExternally): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun load(chunk: () -> String?, chunkname: String = definedExternally, mode: String /* "b" | "t" | "bt" */ = definedExternally, env: Any? = definedExternally): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun load(chunk: () -> String?): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun load(chunk: () -> String?, chunkname: String = definedExternally): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun load(chunk: () -> String?, chunkname: String = definedExternally, mode: String /* "b" | "t" | "bt" */ = definedExternally): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun loadfile(filename: String = definedExternally, mode: String /* "b" | "t" | "bt" */ = definedExternally, env: Any? = definedExternally): dynamic /* JsTuple<() -> Any> | JsTuple */ - -external fun , R, E> xpcall(f: (self: This, args: Args) -> R, msgh: (self: Unit, err: Any) -> E, context: This, vararg args: Args): dynamic /* JsTuple | JsTuple */ - -external fun , R, E> xpcall(f: (self: Unit, args: Args) -> R, msgh: (err: Any) -> E, vararg args: Args): dynamic /* JsTuple | JsTuple */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/5.2-plus.module_lua-types.kt b/modules/mod2/dukat-custom/5.2-plus.module_lua-types.kt deleted file mode 100644 index adcf485..0000000 --- a/modules/mod2/dukat-custom/5.2-plus.module_lua-types.kt +++ /dev/null @@ -1,22 +0,0 @@ -@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.Record - -//external var _ENV: Record - -//external fun collectgarbage(opt: String /* "isrunning" */): Boolean - -//external fun module(name: String, vararg options: Function<*>) \ No newline at end of file diff --git a/modules/mod2/dukat-custom/bit32/5.2-only.bit32.module_lua-types.kt b/modules/mod2/dukat-custom/bit32/5.2-only.bit32.module_lua-types.kt deleted file mode 100644 index 92589f5..0000000 --- a/modules/mod2/dukat-custom/bit32/5.2-only.bit32.module_lua-types.kt +++ /dev/null @@ -1,41 +0,0 @@ -@file:JsQualifier("bit32") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package bit32 - -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 arshift(x: Number, disp: Number): Number - -external fun band(vararg operands: Number): Number - -external fun bnot(x: Number): Number - -external fun bor(vararg operands: Number): Number - -external fun btest(vararg operands: Number): Boolean - -external fun bxor(vararg operands: Number): Number - -external fun extract(n: Number, field: Number, width: Number = definedExternally): Number - -external fun replace(n: Number, v: Number, field: Number, width: Number = definedExternally): Number - -external fun lrotate(x: Number, disp: Number): Number - -external fun lshift(x: Number, disp: Number): Number - -external fun rrotate(x: Number, disp: Number): Number - -external fun rshift(x: Number, disp: Number): Number \ No newline at end of file diff --git a/modules/mod2/dukat-custom/builtin-types.module_typed-factorio.kt b/modules/mod2/dukat-custom/builtin-types.module_typed-factorio.kt deleted file mode 100644 index 28b7280..0000000 --- a/modules/mod2/dukat-custom/builtin-types.module_typed-factorio.kt +++ /dev/null @@ -1,51 +0,0 @@ -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") - -import kotlin.js.* -import kotlinext.js.PropertyDescriptor - -typealias float = Number - -typealias double = Number - -typealias int = Number - -typealias int8 = Number - -typealias uint = Number - -typealias uint8 = Number - -typealias uint16 = Number - -typealias uint64 = Number - -//typealias table = Any? -// TODO LuaTable? AnyTable? index.module_typescript-to-lua.kt -@JsName("table") -class table : Object2() - -/** https://github.com/JetBrains/kotlin-wrappers/blob/master/kotlin-extensions/src/main/kotlin/kotlinext/js/Object.kt */ -open external class Object2 { - fun toLocaleString(): String - fun valueOf(): dynamic - fun hasOwnProperty(v: String): Boolean - fun isPrototypeOf(v: Any): Boolean - fun propertyIsEnumerable(v: String): Boolean - - companion object { - fun

getPrototypeOf(o: T): P - fun getOwnPropertyDescriptor(o: Any, p: String): PropertyDescriptor - fun getOwnPropertyNames(o: Any): Array - fun create(o: T?, properties: dynamic = definedExternally): T - fun defineProperty(o: T, p: String, attributes: PropertyDescriptor

): T - fun defineProperties(o: T, properties: dynamic): T - fun seal(o: T): T - fun freeze(o: T): R - fun preventExtensions(o: T): T - fun isSealed(o: Any): Boolean - fun isFrozen(o: Any): Boolean - fun isExtensible(o: Any): Boolean - fun keys(o: Any): Array - fun assign(dest: R, vararg src: T?): R - } -} diff --git a/modules/mod2/dukat-custom/classes.module_typed-factorio.kt b/modules/mod2/dukat-custom/classes.module_typed-factorio.kt deleted file mode 100644 index 6522dd4..0000000 --- a/modules/mod2/dukat-custom/classes.module_typed-factorio.kt +++ /dev/null @@ -1,5729 +0,0 @@ -@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.Omit -import tsstdlib.Record -import defines.wire_type -import defines.circuit_connector_id -import tsstdlib.Position -import defines.inventory -import defines.direction -import defines.shooting -import defines.gui_type -import defines.control_behavior.type -import defines.rail_direction -import defines.rail_connection_direction -import defines.logistic_member_index -import defines.signal_state -import defines.chain_signal_state -import defines.entity_status -import defines.flow_precision_index -import defines.difficulty -import tsstdlib.Extract -import defines.control_behavior.inserter.circuit_mode_of_operation -import defines.control_behavior.inserter.hand_read_mode -import defines.deconstruction_item.entity_filter_mode -import defines.deconstruction_item.tile_filter_mode -import defines.deconstruction_item.tile_selection_mode -import defines.control_behavior.logistic_container.circuit_mode_of_operation as _defines_control_behavior_logistic_container_circuit_mode_of_operation -import defines.logistic_mode -import defines.control_behavior.mining_drill.resource_read_mode -import defines.input_action -import defines.controllers -import defines.alert_type -import defines.render_mode -import defines.rich_text_setting -import defines.build_check_type -import defines.chunk_generated_status -import defines.train_state -import defines.control_behavior.transport_belt.content_read_mode -import defines.group_state - -external interface LuaAISettings { - var allow_destroy_when_commands_fail: Boolean? - var allow_try_return_to_spawner: Boolean? - var do_separation: Boolean? - var path_resolution_modifier: int8 - var valid: Boolean? - var object_name: String /* "LuaAISettings" */ - fun help(): String -} - -external interface LuaAccumulatorControlBehavior : LuaControlBehavior { - var output_signal: SignalID - var valid: Boolean? - var object_name: String /* "LuaAccumulatorControlBehavior" */ - fun help(): String -} - -external interface LuaAchievementPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var allowed_without_fight: Boolean? - var hidden: Boolean? - var valid: Boolean? - var object_name: String /* "LuaAchievementPrototype" */ - fun help(): String -} - -external interface LuaAmmoCategoryPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var bonus_gui_order: String - var valid: Boolean? - var object_name: String /* "LuaAmmoCategoryPrototype" */ - fun help(): String -} - -external interface LuaArithmeticCombinatorControlBehavior : LuaCombinatorControlBehavior { - var parameters: ArithmeticCombinatorParameters - var valid: Boolean? - var object_name: String /* "LuaArithmeticCombinatorControlBehavior" */ - fun help(): String -} - -external interface LuaAutoplaceControlPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var richness: Boolean? - var control_order: String - var category: String - var valid: Boolean? - var object_name: String /* "LuaAutoplaceControlPrototype" */ - fun help(): String -} - -external interface `T$0` { - var player_index: uint - var message: String -} - -external interface `T$1` { - var item_stack: LuaItemStack - var player_index: uint - var recipe: LuaRecipe -} - -external interface `T$2` { - var player_index: uint - var entity: LuaEntity - var from_player: Boolean? -} - -external interface `T$3` { - var entity: LuaEntity -} - -external interface `T$4` { - var player_index: uint - var market: LuaEntity - var offer_index: uint - var count: uint -} - -external interface `T$5` { - var entity: LuaEntity - var tags: Tags? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$6` { - var surface_index: uint - var tiles: Array -} - -external interface `T$7` { - var is_simulation: Boolean? - get() = definedExternally - set(value) = definedExternally - var is_tutorial: Boolean? - get() = definedExternally - set(value) = definedExternally - var campaign_name: String? - get() = definedExternally - set(value) = definedExternally - var level_name: String - var mod_name: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaBootstrap { - fun on_init(f: (() -> Unit)?) - fun on_load(f: (() -> Unit)?) - fun on_configuration_changed(f: ((param1: ConfigurationChangedData) -> Unit)?) - fun on_event(event: E, f: ((data: E) -> Unit)?, filters: Array = definedExternally) - fun on_event(event: E, f: ((data: E) -> Unit)?) - fun on_event(event: Array, f: ((data: Any) -> Unit)?) - fun on_event(event: String, f: ((data: CustomInputEvent) -> Unit)?) - fun on_nth_tick(tick: uint?, f: ((param1: NthTickEventData) -> Unit)?) - fun on_nth_tick(tick: Array?, f: ((param1: NthTickEventData) -> Unit)?) - fun register_on_entity_destroyed(entity: LuaEntity): uint64 - fun generate_event_name(): uint /* uint & `T$93` */ - fun get_event_handler(event: E): (data: Any) -> Unit - fun get_event_handler(event: String): (data: CustomInputEvent) -> Unit - fun get_event_order(): String - fun set_event_filter(event: E, filters: Array?) - fun get_event_filter(event: E): Array? - fun raise_event(event: E, data: Omit) - fun raise_console_chat(params: `T$0`) - fun raise_player_crafted_item(params: `T$1`) - fun raise_player_fast_transferred(params: `T$2`) - fun raise_biter_base_built(params: `T$3`) - fun raise_market_item_purchased(params: `T$4`) - fun raise_script_built(params: `T$3`) - fun raise_script_destroy(params: `T$3`) - fun raise_script_revive(params: `T$5`) - fun raise_script_set_tiles(params: `T$6`) - var mod_name: String - var level: `T$7` - var active_mods: Record - var object_name: String /* "LuaBootstrap" */ -} - -external interface LuaBurner { - var owner: dynamic /* LuaEntity | LuaEquipment */ - get() = definedExternally - set(value) = definedExternally - var inventory: LuaInventory - var burnt_result_inventory: LuaInventory - var heat: double - var heat_capacity: double - var remaining_burning_fuel: double - var currently_burning: LuaItemPrototype - var fuel_categories: Record - var valid: Boolean? - var object_name: String /* "LuaBurner" */ - fun help(): String -} - -external interface `T$8` { - var minimum_intensity: float - var maximum_intensity: float - var derivation_change_frequency: float - var derivation_change_deviation: float - var border_fix_speed: float - var minimum_light_size: float - var light_intensity_to_size_coefficient: float - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaBurnerPrototype { - var emissions: double - var render_no_network_icon: Boolean? - var render_no_power_icon: Boolean? - var effectivity: double - var fuel_inventory_size: uint - var burnt_inventory_size: uint - var smoke: Array - var light_flicker: `T$8` - var fuel_categories: Record - var valid: Boolean? - var object_name: String /* "LuaBurnerPrototype" */ - fun help(): String -} - -external interface LuaIterable : - tsstdlib.Iterable, - LuaIterator -// , -// LuaExtension - -external interface LuaChunkIterator : LuaIterable { - @nativeInvoke - operator fun invoke(): ChunkPositionAndArea? - var valid: Boolean? - var object_name: String /* "LuaChunkIterator" */ - fun help(): String -} - -external interface LuaCircuitNetwork { - fun get_signal(signal: SignalID): int - var entity: LuaEntity - var wire_type: wire_type - var circuit_connector_id: circuit_connector_id - var signals: Array? - var network_id: uint - var connected_circuit_count: uint - var valid: Boolean? - var object_name: String /* "LuaCircuitNetwork" */ - fun help(): String -} - -external interface LuaCombinatorControlBehavior : LuaControlBehavior { - fun get_signal_last_tick(signal: SignalID): int? - var signals_last_tick: Array -} - -external interface LuaCommandProcessor { - fun add_command(name: String, help: Any /* JsTuple */, _function: (param1: CustomCommandData) -> Unit) - fun add_command(name: String, help: String, _function: (param1: CustomCommandData) -> Unit) - fun add_command(name: String, help: Number, _function: (param1: CustomCommandData) -> Unit) - fun remove_command(name: String): Boolean? - var commands: Record | String | Number */> - var game_commands: Record | String | Number */> - var object_name: String /* "LuaCommandProcessor" */ -} - -external interface LuaConstantCombinatorControlBehavior : LuaControlBehavior { - fun set_signal(index: uint, signal: Signal) - fun get_signal(index: uint): Signal - var parameters: Array - var enabled: Boolean? - var signals_count: uint - var valid: Boolean? - var object_name: String /* "LuaConstantCombinatorControlBehavior" */ - fun help(): String -} - -external interface LuaContainerControlBehavior : LuaControlBehavior { - var valid: Boolean? - var object_name: String /* "LuaContainerControlBehavior" */ - fun help(): String -} - -external interface BaseControlSetGuiArrow { - var type: String /* "nowhere" | "goal" | "entity_info" | "active_window" | "entity" | "position" | "crafting_queue" | "item_stack" */ -} - -external interface EntityControlSetGuiArrow : BaseControlSetGuiArrow { - override var type: String /* "entity" */ - var entity: LuaEntity -} - -external interface PositionControlSetGuiArrow : BaseControlSetGuiArrow { - override var type: String /* "position" */ - var position: Position -} - -external interface CraftingQueueControlSetGuiArrow : BaseControlSetGuiArrow { - override var type: String /* "crafting_queue" */ - var crafting_queueindex: uint -} - -external interface ItemStackControlSetGuiArrow : BaseControlSetGuiArrow { - override var type: String /* "item_stack" */ - var inventory_index: inventory - var item_stack_index: uint - var source: String /* "player" | "target" */ -} - -external interface OtherControlSetGuiArrow : BaseControlSetGuiArrow { - override var type: String /* "nowhere" | "goal" | "entity_info" | "active_window" */ -} - -external interface `T$9` { - var count: uint - var recipe: dynamic /* String | LuaRecipe */ - get() = definedExternally - set(value) = definedExternally - var silent: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$10` { - var index: uint - var count: uint -} - -external interface `T$11` { - var walking: Boolean? - var direction: direction -} - -external interface `T$12` { - var mining: Boolean? - var position: Position? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$13` { - var state: shooting - var position: Position -} - -external interface `T$14` { - var repairing: Boolean? - var position: Position -} - -external interface LuaControl { - fun get_inventory(inventory: inventory): LuaInventory? - fun get_main_inventory(): LuaInventory? - fun can_insert(items: String): Boolean? - fun can_insert(items: ItemStackDefinition): Boolean? - fun can_insert(items: LuaItemStack): Boolean? - fun insert(items: String): uint - fun insert(items: ItemStackDefinition): uint - fun insert(items: LuaItemStack): uint - fun set_gui_arrow(params: EntityControlSetGuiArrow) - fun set_gui_arrow(params: PositionControlSetGuiArrow) - fun set_gui_arrow(params: CraftingQueueControlSetGuiArrow) - fun set_gui_arrow(params: ItemStackControlSetGuiArrow) - fun set_gui_arrow(params: OtherControlSetGuiArrow) - fun clear_gui_arrow() - fun get_item_count(item: String = definedExternally): uint - fun has_items_inside(): Boolean? - fun can_reach_entity(entity: LuaEntity): Boolean? - fun clear_items_inside() - fun remove_item(items: String): uint - fun remove_item(items: ItemStackDefinition): uint - fun remove_item(items: LuaItemStack): uint - fun teleport(position: Position, surface: uint = definedExternally): Boolean? - fun teleport(position: Position): Boolean? - fun teleport(position: Position, surface: String = definedExternally): Boolean? - fun teleport(position: Position, surface: LuaSurface = definedExternally): Boolean? - fun update_selected_entity(position: Position) - fun clear_selected_entity() - fun disable_flashlight() - fun enable_flashlight() - fun is_flashlight_enabled() - fun get_craftable_count(recipe: String): uint - fun get_craftable_count(recipe: LuaRecipe): uint - fun begin_crafting(params: `T$9`): uint - fun cancel_crafting(params: `T$10`) - fun mine_entity(entity: LuaEntity, force: Boolean = definedExternally): Boolean? - fun mine_tile(tile: LuaTile): Boolean? - fun is_player(): Boolean? - fun open_technology_gui(technology: String = definedExternally) - fun open_technology_gui() - fun open_technology_gui(technology: LuaTechnology = definedExternally) - fun open_technology_gui(technology: LuaTechnologyPrototype = definedExternally) - fun set_personal_logistic_slot(slot_index: uint, value: PersonalLogisticParameters): Boolean? - fun set_vehicle_logistic_slot(slot_index: uint, value: PersonalLogisticParameters): Boolean? - fun get_personal_logistic_slot(slot_index: uint): PersonalLogisticParameters - fun get_vehicle_logistic_slot(slot_index: uint): PersonalLogisticParameters - fun clear_personal_logistic_slot(slot_index: uint) - fun clear_vehicle_logistic_slot(slot_index: uint) - fun is_cursor_blueprint(): Boolean? - fun get_blueprint_entities(): Array? - fun is_cursor_empty(): Boolean? - var surface: LuaSurface - var position: PositionTable - var vehicle: LuaEntity? - var force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally - var selected: LuaEntity? - var opened: dynamic /* LuaEntity? | LuaItemStack? | LuaEquipment? | LuaEquipmentGrid? | LuaPlayer? | ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers | defines.gui_type? */ - get() = definedExternally - set(value) = definedExternally - var crafting_queue_size: uint - var crafting_queue_progress: double - var walking_state: `T$11` - var riding_state: RidingState - var mining_state: `T$12` - var shooting_state: `T$13` - var picking_state: Boolean? - var repair_state: `T$14` - var cursor_stack: LuaItemStack? - var cursor_ghost: dynamic /* LuaItemStack | LuaItemPrototype | String */ - get() = definedExternally - set(value) = definedExternally - var driving: Boolean? - var crafting_queue: Array - var following_robots: Array - var cheat_mode: Boolean? - var character_crafting_speed_modifier: double - var character_mining_speed_modifier: double - var character_additional_mining_categories: Array - var character_running_speed_modifier: double - var character_build_distance_bonus: uint - var character_item_drop_distance_bonus: uint - var character_reach_distance_bonus: uint - var character_resource_reach_distance_bonus: uint - var character_item_pickup_distance_bonus: uint - var character_loot_pickup_distance_bonus: uint - var character_inventory_slots_bonus: uint - var character_trash_slot_count_bonus: uint - var character_maximum_following_robot_count_bonus: uint - var character_health_bonus: float - var character_personal_logistic_requests_enabled: Boolean? - var vehicle_logistic_requests_enabled: Boolean? - var opened_gui_type: gui_type? - var build_distance: uint - var drop_item_distance: uint - var reach_distance: uint - var item_pickup_distance: double - var loot_pickup_distance: double - var resource_reach_distance: double - var in_combat: Boolean? - var character_running_speed: double - var character_mining_progress: double -} - -external interface LuaControlBehavior { - fun get_circuit_network(wire: wire_type, circuit_connector: circuit_connector_id = definedExternally): LuaCircuitNetwork? - var type: type - var entity: LuaEntity -} - -external interface LuaCustomChartTag { - fun destroy() - var icon: SignalID? - var last_user: LuaPlayer - var position: PositionTable - var text: String - var tag_number: uint - var force: LuaForce - var surface: LuaSurface - var valid: Boolean? - var object_name: String /* "LuaCustomChartTag" */ - fun help(): String -} - -external interface LuaCustomInputPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var key_sequence: String - var alternative_key_sequence: String? - var linked_game_control: String? - var consuming: String /* "none" | "game-only" */ - var action: String - var enabled: Boolean? - var enabled_while_spectating: Boolean? - var enabled_while_in_cutscene: Boolean? - var include_selected_prototype: Boolean? - var item_to_spawn: LuaItemPrototype? - var valid: Boolean? - var object_name: String /* "LuaCustomInputPrototype" */ - fun help(): String -} - -typealias CustomTableIndex = Any - -external interface LuaCustomTableMembers { - var length: () -> uint /* () -> uint & LuaExtension */ - var valid: Boolean? - var object_name: String /* "LuaCustomTable" */ - fun help(): String -} - -external interface LuaDamagePrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var hidden: Boolean? - var valid: Boolean? - var object_name: String /* "LuaDamagePrototype" */ - fun help(): String -} - -external interface LuaDeciderCombinatorControlBehavior : LuaCombinatorControlBehavior { - var parameters: DeciderCombinatorParameters - var valid: Boolean? - var object_name: String /* "LuaDeciderCombinatorControlBehavior" */ - fun help(): String -} - -external interface LuaDecorativePrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var collision_box: BoundingBoxTable - var collision_mask: CollisionMask - var collision_mask_with_flags: CollisionMaskWithFlags - var autoplace_specification: AutoplaceSpecification? - var valid: Boolean? - var object_name: String /* "LuaDecorativePrototype" */ - fun help(): String -} - -external interface LuaElectricEnergySourcePrototype { - var buffer_capacity: double - var usage_priority: String - var input_flow_limit: double - var output_flow_limit: double - var drain: double - var emissions: double - var render_no_network_icon: Boolean? - var render_no_power_icon: Boolean? - var valid: Boolean? - var object_name: String /* "LuaElectricEnergySourcePrototype" */ - fun help(): String -} - -external interface `T$15` { - var do_cliff_correction: Boolean? - get() = definedExternally - set(value) = definedExternally - var raise_destroy: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$16` { - var force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally - var target: dynamic /* LuaEntity | LuaEntityPrototype | String */ - get() = definedExternally - set(value) = definedExternally - var player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var direction: direction? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$17` { - var return_item_request_proxy: Boolean? - get() = definedExternally - set(value) = definedExternally - var raise_revive: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$18` { - var rail_direction: rail_direction - var rail_connection_direction: rail_connection_direction -} - -external interface `T$19` { - var reverse: Boolean? - get() = definedExternally - set(value) = definedExternally - var by_player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var spill_items: Boolean? - get() = definedExternally - set(value) = definedExternally - var enable_looted: Boolean? - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* LuaForce? | String? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$20` { - var position: Position - var surface: LuaSurface? - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally - var create_build_effect_smoke: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$21` { - var name: String - var amount: double - var minimum_temperature: double? - get() = definedExternally - set(value) = definedExternally - var maximum_temperature: double? - get() = definedExternally - set(value) = definedExternally - var temperature: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$22` { - var inventory: LuaInventory? - get() = definedExternally - set(value) = definedExternally - var force: Boolean? - get() = definedExternally - set(value) = definedExternally - var raise_destroyed: Boolean? - get() = definedExternally - set(value) = definedExternally - var ignore_minable: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$23` { - var red: Array - var green: Array -} - -external interface LuaEntity : LuaControl { - fun get_output_inventory(): LuaInventory - fun get_module_inventory(): LuaInventory? - fun get_fuel_inventory(): LuaInventory? - fun get_burnt_result_inventory(): LuaInventory? - fun damage(damage: float, force: String, type: String = definedExternally, dealer: LuaEntity = definedExternally): float - fun damage(damage: float, force: String): float - fun damage(damage: float, force: String, type: String = definedExternally): float - fun damage(damage: float, force: LuaForce, type: String = definedExternally, dealer: LuaEntity = definedExternally): float - fun damage(damage: float, force: LuaForce): float - fun damage(damage: float, force: LuaForce, type: String = definedExternally): float - fun can_be_destroyed(): Boolean? - fun destroy(params: `T$15` = definedExternally): Boolean? - fun set_command(command: AttackCommand) - fun set_command(command: GoToLocationCommand) - fun set_command(command: CompoundCommand) - fun set_command(command: GroupCommand) - fun set_command(command: AttackAreaCommand) - fun set_command(command: WanderCommand) - fun set_command(command: StopCommand) - fun set_command(command: FleeCommand) - fun set_command(command: BuildBaseCommand) - fun set_distraction_command(command: AttackCommand) - fun set_distraction_command(command: GoToLocationCommand) - fun set_distraction_command(command: CompoundCommand) - fun set_distraction_command(command: GroupCommand) - fun set_distraction_command(command: AttackAreaCommand) - fun set_distraction_command(command: WanderCommand) - fun set_distraction_command(command: StopCommand) - fun set_distraction_command(command: FleeCommand) - fun set_distraction_command(command: BuildBaseCommand) - fun has_command(): Boolean? - fun die(force: String = definedExternally, cause: LuaEntity = definedExternally): Boolean? - fun die(): Boolean? - fun die(force: String = definedExternally): Boolean? - fun die(force: LuaForce = definedExternally, cause: LuaEntity = definedExternally): Boolean? - fun die(force: LuaForce = definedExternally): Boolean? - fun has_flag(flag: String): Boolean? - fun ghost_has_flag(flag: String): Boolean? - fun add_market_item(offer: Offer) - fun remove_market_item(offer: uint): Boolean? - fun get_market_items(): Array - fun clear_market_items() - fun connect_neighbour(target: LuaEntity): Boolean? - fun connect_neighbour(target: WireConnectionDefinition): Boolean? - fun disconnect_neighbour(target: wire_type = definedExternally) - fun disconnect_neighbour() - fun disconnect_neighbour(target: LuaEntity = definedExternally) - fun disconnect_neighbour(target: WireConnectionDefinition = definedExternally) - fun order_deconstruction(force: String, player: uint = definedExternally): Boolean? - fun order_deconstruction(force: String): Boolean? - fun order_deconstruction(force: String, player: String = definedExternally): Boolean? - fun order_deconstruction(force: String, player: LuaPlayer = definedExternally): Boolean? - fun order_deconstruction(force: LuaForce, player: uint = definedExternally): Boolean? - fun order_deconstruction(force: LuaForce): Boolean? - fun order_deconstruction(force: LuaForce, player: String = definedExternally): Boolean? - fun order_deconstruction(force: LuaForce, player: LuaPlayer = definedExternally): Boolean? - fun cancel_deconstruction(force: String, player: uint = definedExternally) - fun cancel_deconstruction(force: String) - fun cancel_deconstruction(force: String, player: String = definedExternally) - fun cancel_deconstruction(force: String, player: LuaPlayer = definedExternally) - fun cancel_deconstruction(force: LuaForce, player: uint = definedExternally) - fun cancel_deconstruction(force: LuaForce) - fun cancel_deconstruction(force: LuaForce, player: String = definedExternally) - fun cancel_deconstruction(force: LuaForce, player: LuaPlayer = definedExternally) - fun to_be_deconstructed(): Boolean? - fun order_upgrade(params: `T$16`): Boolean? - fun cancel_upgrade(force: String, player: uint = definedExternally): Boolean? - fun cancel_upgrade(force: String): Boolean? - fun cancel_upgrade(force: String, player: String = definedExternally): Boolean? - fun cancel_upgrade(force: String, player: LuaPlayer = definedExternally): Boolean? - fun cancel_upgrade(force: LuaForce, player: uint = definedExternally): Boolean? - fun cancel_upgrade(force: LuaForce): Boolean? - fun cancel_upgrade(force: LuaForce, player: String = definedExternally): Boolean? - fun cancel_upgrade(force: LuaForce, player: LuaPlayer = definedExternally): Boolean? - fun to_be_upgraded(): Boolean? - fun get_request_slot(slot: uint): dynamic /* String? | ItemStackDefinition? */ - fun set_request_slot(request: String, slot: uint): Boolean? - fun set_request_slot(request: ItemStackDefinition, slot: uint): Boolean? - fun set_request_slot(request: LuaItemStack, slot: uint): Boolean? - fun clear_request_slot(slot: uint) - fun is_crafting() - fun is_opened(): Boolean? - fun is_opening(): Boolean? - fun is_closed(): Boolean? - fun is_closing(): Boolean? - fun request_to_open(force: String, extra_time: uint = definedExternally) - fun request_to_open(force: String) - fun request_to_open(force: LuaForce, extra_time: uint = definedExternally) - fun request_to_open(force: LuaForce) - fun request_to_close(force: String) - fun request_to_close(force: LuaForce) - fun get_transport_line(index: uint): LuaTransportLine - fun get_max_transport_line_index(): uint - fun launch_rocket(): Boolean? - fun revive(params: `T$17` = definedExternally): dynamic /* JsTuple | JsTuple, LuaEntity, LuaEntity?> */ - fun silent_revive(params: `T$17` = definedExternally): dynamic /* JsTuple | JsTuple, LuaEntity, LuaEntity?> */ - fun get_connected_rail(params: `T$18`): LuaEntity - fun get_connected_rails(): Array - fun get_rail_segment_entity(direction: rail_direction, in_else_out: Boolean): LuaEntity? - fun get_rail_segment_end(direction: rail_direction): dynamic /* JsTuple */ - fun get_rail_segment_length(): double - fun get_rail_segment_overlaps(): Array - fun get_filter(slot_index: uint): String? - fun set_filter(slot_index: uint, item: String) - fun get_infinity_container_filter(index: uint): InfinityInventoryFilter? - fun set_infinity_container_filter(index: uint, filter: InfinityInventoryFilter?) - fun get_infinity_pipe_filter(): InfinityPipeFilter? - fun set_infinity_pipe_filter(filter: InfinityPipeFilter?) - fun get_heat_setting(): HeatSetting - fun set_heat_setting(filter: HeatSetting) - fun get_control_behavior(): LuaControlBehavior? - fun get_or_create_control_behavior(): LuaControlBehavior? - fun get_circuit_network(wire: wire_type, circuit_connector: circuit_connector_id = definedExternally): LuaCircuitNetwork? - fun get_merged_signal(signal: SignalID, circuit_connector: circuit_connector_id = definedExternally): int - fun get_merged_signals(circuit_connector: circuit_connector_id = definedExternally): Array? - fun supports_backer_name(): Boolean? - fun copy_settings(entity: LuaEntity, by_player: uint = definedExternally): Record - fun copy_settings(entity: LuaEntity): Record - fun copy_settings(entity: LuaEntity, by_player: String = definedExternally): Record - fun copy_settings(entity: LuaEntity, by_player: LuaPlayer = definedExternally): Record - fun get_logistic_point(index: logistic_member_index = definedExternally): dynamic /* LuaLogisticPoint | Array */ - fun play_note(instrument: uint, note: uint): Boolean? - fun connect_rolling_stock(direction: rail_direction): Boolean? - fun disconnect_rolling_stock(direction: rail_direction): Boolean? - fun update_connections() - fun get_recipe(): LuaRecipe? - fun set_recipe(recipe: String?): Record - fun set_recipe(recipe: LuaRecipe?): Record - fun rotate(params: `T$19` = definedExternally): Boolean? - fun get_driver(): dynamic /* LuaEntity? | LuaPlayer? */ - fun set_driver(driver: LuaEntity?) - fun set_driver(driver: uint?) - fun set_driver(driver: String?) - fun set_driver(driver: LuaPlayer?) - fun get_passenger(): dynamic /* LuaEntity? | LuaPlayer? */ - fun set_passenger(passenger: LuaEntity) - fun set_passenger(passenger: uint) - fun set_passenger(passenger: String) - fun set_passenger(passenger: LuaPlayer) - fun is_connected_to_electric_network(): Boolean? - fun get_train_stop_trains(): Array - fun get_stopped_train(): LuaTrain? - fun clone(params: `T$20`): LuaEntity? - fun get_fluid_count(fluid: String = definedExternally): double - fun get_fluid_contents(): Record - fun remove_fluid(params: `T$21`): double - fun insert_fluid(fluid: Fluid): double - fun clear_fluid_inside() - fun get_beam_source(): BeamTarget - fun set_beam_source(source: LuaEntity) - fun set_beam_source(source: Position) - fun get_beam_target(): BeamTarget - fun set_beam_target(target: LuaEntity) - fun set_beam_target(target: Position) - fun get_radius(): double - fun get_health_ratio(): float - fun create_build_effect_smoke() - fun release_from_spawner() - fun toggle_equipment_movement_bonus() - fun can_shoot(target: LuaEntity, position: Position): Boolean? - fun start_fading_out() - fun get_upgrade_target(): LuaEntityPrototype? - fun get_upgrade_direction(): direction? - fun get_damage_to_be_taken(): float - fun deplete() - fun mine(params: `T$22` = definedExternally): Boolean? - fun spawn_decorations() - fun can_wires_reach(entity: LuaEntity): Boolean? - fun get_connected_rolling_stock(direction: rail_direction): LuaEntity - fun is_registered_for_construction(): Boolean? - fun is_registered_for_deconstruction(force: String): Boolean? - fun is_registered_for_deconstruction(force: LuaForce): Boolean? - fun is_registered_for_upgrade(): Boolean? - fun is_registered_for_repair(): Boolean? - fun add_autopilot_destination(position: Position) - fun connect_linked_belts(neighbour: LuaEntity?) - fun disconnect_linked_belts() - var name: String /* "inserter" | "filter-inserter" */ - var ghost_name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var ghost_localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var ghost_localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var type: String - var ghost_type: String - var active: Boolean? - var destructible: Boolean? - var minable: Boolean? - var rotatable: Boolean? - var operable: Boolean? - var health: float? - var direction: direction - var supports_direction: Boolean? - var orientation: RealOrientation - var cliff_orientation: String /* "west-to-east" | "north-to-south" | "east-to-west" | "south-to-north" | "west-to-north" | "north-to-east" | "east-to-south" | "south-to-west" | "west-to-south" | "north-to-west" | "east-to-north" | "south-to-east" | "west-to-none" | "none-to-east" | "east-to-none" | "none-to-west" | "north-to-none" | "none-to-south" | "south-to-none" | "none-to-north" */ - var relative_turret_orientation: RealOrientation? - var torso_orientation: RealOrientation - var amount: uint - var initial_amount: uint? - var effectivity_modifier: float - var consumption_modifier: float - var friction_modifier: float - var driver_is_gunner: Boolean? - var vehicle_automatic_targeting_parameters: VehicleAutomaticTargetingParameters - var speed: float - var effective_speed: float - var stack: LuaItemStack - var prototype: LuaEntityPrototype - var ghost_prototype: dynamic /* LuaEntityPrototype | LuaTilePrototype */ - get() = definedExternally - set(value) = definedExternally - var drop_position: Position - var pickup_position: Position - var drop_target: LuaEntity? - var pickup_target: LuaEntity - var selected_gun_index: uint? - var energy: double - var temperature: double? - var previous_recipe: LuaRecipe? - var held_stack: LuaItemStack - var held_stack_position: PositionTable - var train: LuaTrain? - var neighbours: dynamic /* Record>? | Array>? | LuaEntity? */ - get() = definedExternally - set(value) = definedExternally - var belt_neighbours: Record> - var fluidbox: LuaFluidBox - var backer_name: String? - var entity_label: String? - var time_to_live: uint - var color: dynamic /* ColorTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var text: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var signal_state: signal_state - var chain_signal_state: chain_signal_state - var to_be_looted: Boolean? - var crafting_speed: double - var crafting_progress: float - var bonus_progress: double - var productivity_bonus: double - var pollution_bonus: double - var speed_bonus: double - var consumption_bonus: double - var belt_to_ground_type: String /* "input" | "output" */ - var loader_type: String /* "input" | "output" */ - var rocket_parts: uint - var logistic_network: LuaLogisticNetwork - var logistic_cell: LuaLogisticCell? - var item_requests: Record - var player: LuaPlayer? - var unit_group: LuaUnitGroup? - var damage_dealt: double - var kills: uint - var last_user: LuaPlayer? - var electric_buffer_size: double? - var electric_input_flow_limit: double? - var electric_output_flow_limit: double? - var electric_drain: double? - var electric_emissions: double? - var unit_number: uint? - var ghost_unit_number: uint? - var mining_progress: double? - var bonus_mining_progress: double? - var power_production: double - var power_usage: double - var bounding_box: BoundingBoxTable - var secondary_bounding_box: BoundingBoxTable? - var selection_box: BoundingBoxTable - var secondary_selection_box: BoundingBoxTable? - var mining_target: LuaEntity? - var circuit_connected_entities: `T$23` - var circuit_connection_definitions: Array - var request_slot_count: uint - var filter_slot_count: uint - var loader_container: LuaEntity - var grid: LuaEquipmentGrid? - var graphics_variation: uint8? - var tree_color_index: uint8 - var tree_color_index_max: uint8 - var tree_stage_index: uint8 - var tree_stage_index_max: uint8 - var tree_gray_stage_index: uint8 - var tree_gray_stage_index_max: uint8 - var burner: LuaBurner? - var shooting_target: LuaEntity? - var proxy_target: LuaEntity? - var stickers: Array? - var sticked_to: LuaEntity - var parameters: ProgrammableSpeakerParameters - var alert_parameters: ProgrammableSpeakerAlertParameters - var electric_network_statistics: LuaFlowStatistics - var inserter_stack_size_override: uint - var products_finished: uint - var spawner: LuaEntity? - var units: Array - var power_switch_state: Boolean? - var effects: ModuleEffects? - var infinity_container_filters: Array - var remove_unfiltered_items: Boolean? - var character_corpse_player_index: uint - var character_corpse_tick_of_death: uint - var character_corpse_death_cause: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var associated_player: LuaPlayer? - var tick_of_last_attack: uint - var tick_of_last_damage: uint - var splitter_filter: LuaItemPrototype? - var inserter_filter_mode: String /* "whitelist" | "blacklist" */ - var splitter_input_priority: String /* "left" | "none" | "right" */ - var splitter_output_priority: String /* "left" | "none" | "right" */ - var armed: Boolean? - var recipe_locked: Boolean? - var connected_rail: LuaEntity? - var trains_in_block: uint - var timeout: uint - var neighbour_bonus: double - var ai_settings: LuaAISettings - var highlight_box_type: String - var highlight_box_blink_interval: uint - var status: entity_status? - var enable_logistics_while_moving: Boolean? - var render_player: LuaPlayer? - var render_to_forces: Array? - var pump_rail_target: LuaEntity? - var moving: Boolean? - var electric_network_id: uint? - var allow_dispatching_robots: Boolean? - var auto_launch: Boolean? - var energy_generated_last_tick: double - var storage_filter: LuaItemPrototype - var request_from_buffers: Boolean? - var corpse_expires: Boolean? - var corpse_immune_to_entity_placement: Boolean? - var tags: Tags? - var command: dynamic /* AttackCommand? | GoToLocationCommand? | CompoundCommand? | GroupCommand? | AttackAreaCommand? | WanderCommand? | StopCommand? | FleeCommand? | BuildBaseCommand? */ - get() = definedExternally - set(value) = definedExternally - var distraction_command: dynamic /* AttackCommand? | GoToLocationCommand? | CompoundCommand? | GroupCommand? | AttackAreaCommand? | WanderCommand? | StopCommand? | FleeCommand? | BuildBaseCommand? */ - get() = definedExternally - set(value) = definedExternally - var time_to_next_effect: uint - var autopilot_destination: Position? - var autopilot_destinations: Array - var trains_count: uint? - var trains_limit: uint - var is_entity_with_force: Boolean? - var is_entity_with_owner: Boolean? - var is_entity_with_health: Boolean? - var combat_robot_owner: LuaEntity - var link_id: uint - var follow_target: LuaEntity - var follow_offset: Position? - var linked_belt_type: String /* "input" | "output" */ - var linked_belt_neighbour: LuaEntity? - var valid: Boolean? - var object_name: String /* "LuaEntity" */ - fun help(): String -} - -external interface `T$24` { - var minable: Boolean? - var mining_time: double - var mining_particle: String? - get() = definedExternally - set(value) = definedExternally - var products: Array? - get() = definedExternally - set(value) = definedExternally - var fluid_amount: double? - get() = definedExternally - set(value) = definedExternally - var required_fluid: String? - get() = definedExternally - set(value) = definedExternally - var mining_trigger: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$25` { - var min: double - var max: double -} - -external interface `T$26` { - var smoke_name: String - var offsets: Array - var offset_deviation: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var initial_height: float - var max_radius: float? - get() = definedExternally - set(value) = definedExternally - var speed: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var speed_multiplier: float - var speed_multiplier_deviation: float - var starting_frame: float - var starting_frame_deviation: float - var starting_frame_speed: float - var starting_frame_speed_deviation: float - var speed_from_center: float - var speed_from_center_deviation: float -} - -external interface LuaEntityPrototype { - fun has_flag(flag: String /* "not-rotatable" | "placeable-neutral" | "placeable-player" | "placeable-enemy" | "placeable-off-grid" | "player-creation" | "filter-directions" | "fast-replaceable-no-build-while-moving" | "breaths-air" | "not-repairable" | "not-on-map" | "not-deconstructable" | "not-blueprintable" | "hide-from-bonus-gui" | "hide-alt-info" | "fast-replaceable-no-cross-type-while-moving" | "no-gap-fill-while-building" | "not-flammable" | "no-automated-item-removal" | "no-automated-item-insertion" | "not-upgradable" */): Boolean? - fun get_inventory_size(index: inventory): uint? - var type: String - var name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var max_health: float - var infinite_resource: Boolean? - var minimum_resource_amount: uint? - var normal_resource_amount: uint? - var infinite_depletion_resource_amount: uint? - var resource_category: String? - var mineable_properties: `T$24` - var items_to_place_this: Array? - var collision_box: BoundingBoxTable - var secondary_collision_box: BoundingBoxTable? - var map_generator_bounding_box: BoundingBoxTable - var selection_box: BoundingBoxTable - var drawing_box: BoundingBoxTable - var sticker_box: BoundingBoxTable - var collision_mask: CollisionMask - var collision_mask_with_flags: CollisionMaskWithFlags - var default_collision_mask_with_flags: CollisionMaskWithFlags - var order: String - var group: LuaGroup - var subgroup: LuaGroup - var healing_per_tick: float - var emissions_per_second: double - var corpses: Record - var selectable_in_game: Boolean? - var selection_priority: uint - var weight: double? - var resistances: Record - var fast_replaceable_group: String? - var next_upgrade: LuaEntityPrototype? - var loot: Array? - var repair_speed_modifier: uint? - var turret_range: uint? - var autoplace_specification: AutoplaceSpecification? - var belt_speed: double? - var result_units: Array - var attack_result: Array? - var final_attack_result: Array? - var attack_parameters: dynamic /* ProjectileAttackParameters? | StreamAttackParameters? | OtherAttackParameters? */ - get() = definedExternally - set(value) = definedExternally - var spawn_cooldown: `T$25`? - var mining_drill_radius: double? - var mining_speed: double? - var logistic_mode: String /* "requester" | "active-provider" | "passive-provider" | "buffer" | "storage" | "none" */ - var max_underground_distance: uint8? - var flags: EntityPrototypeFlags - var remains_when_mined: Array - var additional_pastable_entities: Array - var allow_copy_paste: Boolean? - var shooting_cursor_size: double - var created_smoke: `T$26`? - var created_effect: Array? - var map_color: ColorTable? - var friendly_map_color: ColorTable - var enemy_map_color: ColorTable - var build_base_evolution_requirement: double - var instruments: Array? - var max_polyphony: uint? - var module_inventory_size: uint? - var ingredient_count: uint? - var crafting_speed: double? - var crafting_categories: Record - var resource_categories: Record? - var supply_area_distance: double? - var max_wire_distance: double - var max_circuit_wire_distance: double - var energy_usage: double? - var max_energy_usage: double - var max_energy_production: double - var effectivity: double? - var consumption: double? - var friction_force: double? - var braking_force: double? - var air_resistance: double? - var tank_driving: Boolean? - var rotation_speed: double? - var turret_rotation_speed: double? - var guns: Record? - var speed: double? - var speed_multiplier_when_out_of_energy: float? - var max_payload_size: uint? - var draw_cargo: Boolean? - var energy_per_move: double? - var energy_per_tick: double? - var max_energy: double? - var min_to_charge: float? - var max_to_charge: float? - var burner_prototype: LuaBurnerPrototype? - var electric_energy_source_prototype: LuaElectricEnergySourcePrototype? - var heat_energy_source_prototype: LuaHeatEnergySourcePrototype? - var fluid_energy_source_prototype: LuaFluidEnergySourcePrototype? - var void_energy_source_prototype: LuaVoidEnergySourcePrototype? - var building_grid_bit_shift: uint - var fluid_usage_per_tick: double? - var maximum_temperature: double? - var target_temperature: double? - var fluid: LuaFluidPrototype? - var fluid_capacity: double - var pumping_speed: double? - var stack: Boolean? - var allow_custom_vectors: Boolean? - var allow_burner_leech: Boolean? - var inserter_extension_speed: double? - var inserter_rotation_speed: double? - var inserter_pickup_position: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var inserter_drop_position: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var inserter_chases_belt_items: Boolean? - var count_as_rock_for_filtered_deconstruction: Boolean? - var filter_count: uint? - var time_to_live: uint - var distribution_effectivity: double? - var explosion_beam: double? - var explosion_rotate: double? - var tree_color_count: uint8? - var alert_when_damaged: Boolean? - var alert_when_attacking: Boolean? - var color: ColorTable? - var collision_mask_collides_with_self: Boolean? - var collision_mask_collides_with_tiles_only: Boolean? - var collision_mask_considers_tile_transitions: Boolean? - var allowed_effects: Record? - var rocket_parts_required: uint? - var rocket_rising_delay: uint8? - var launch_wait_time: uint8? - var light_blinking_speed: double? - var door_opening_speed: double? - var rising_speed: double? - var engine_starting_speed: double? - var flying_speed: double? - var flying_acceleration: double? - var fixed_recipe: String? - var construction_radius: double? - var logistic_radius: double? - var energy_per_hit_point: double? - var create_ghost_on_death: Boolean? - var timeout: uint - var fluidbox_prototypes: Array - var neighbour_bonus: double - var neighbour_collision_increase: double - var container_distance: double - var belt_distance: double - var belt_length: double - var is_building: Boolean? - var automated_ammo_count: uint? - var max_speed: double? - var darkness_for_all_lamps_on: float? - var darkness_for_all_lamps_off: float? - var always_on: Boolean? - var min_darkness_to_spawn: float - var max_darkness_to_spawn: float - var call_for_help_radius: double - var max_count_of_owned_units: double - var max_friends_around_to_spawn: double - var spawning_radius: double - var spawning_spacing: double - var radius: double - var cliff_explosive_prototype: String? - var rocket_entity_prototype: LuaEntityPrototype? - var has_belt_immunity: Boolean? - var vision_distance: double? - var pollution_to_join_attack: float? - var min_pursue_time: uint? - var max_pursue_distance: double? - var radar_range: uint? - var move_while_shooting: Boolean? - var can_open_gates: Boolean? - var affected_by_tiles: Boolean? - var distraction_cooldown: uint? - var spawning_time_modifier: double? - var alert_icon_shift: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var lab_inputs: Array? - var researching_speed: double? - var item_slot_count: uint? - var base_productivity: double? - var allow_access_to_all_forces: Boolean? - var supports_direction: Boolean? - var terrain_friction_modifier: float - var allow_passengers: Boolean? - var max_distance_of_sector_revealed: uint - var max_distance_of_nearby_sector_revealed: uint - var adjacent_tile_collision_box: BoundingBoxTable - var adjacent_tile_collision_mask: CollisionMask - var adjacent_tile_collision_test: CollisionMask - var center_collision_mask: CollisionMask - var grid_prototype: LuaEquipmentGridPrototype? - var remove_decoratives: String - var related_underground_belt: LuaEntityPrototype - var running_speed: double - var maximum_corner_sliding_distance: double - var build_distance: uint - var drop_item_distance: uint - var reach_distance: uint - var reach_resource_distance: double - var item_pickup_distance: double - var loot_pickup_distance: double - var enter_vehicle_distance: double - var ticks_to_keep_gun: uint - var ticks_to_keep_aiming_direction: uint - var ticks_to_stay_in_combat: uint - var respawn_time: uint - var damage_hit_tint: ColorTable - var character_corpse: LuaEntityPrototype - var valid: Boolean? - var object_name: String /* "LuaEntityPrototype" */ - fun help(): String -} - -external interface `T$27` { - var width: uint - var height: uint -} - -external interface LuaEquipment { - var name: String - var type: String - var position: PositionTable - var shape: `T$27` - var shield: double - var max_shield: double - var max_solar_power: double - var movement_bonus: double - var generator_power: double - var energy: double - var max_energy: double - var prototype: LuaEquipmentPrototype - var burner: LuaBurner? - var valid: Boolean? - var object_name: String /* "LuaEquipment" */ - fun help(): String -} - -external interface LuaEquipmentCategoryPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaEquipmentCategoryPrototype" */ - fun help(): String -} - -external interface `T$28` { - var position: Position? - get() = definedExternally - set(value) = definedExternally - var equipment: LuaEquipment? - get() = definedExternally - set(value) = definedExternally - var by_player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$29` { - var name: String - var position: Position? - get() = definedExternally - set(value) = definedExternally - var by_player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$30` { - var equipment: LuaEquipment - var position: Position -} - -external interface LuaEquipmentGrid { - fun take(params: `T$28`): dynamic /* String? | ItemStackDefinition? */ - fun take_all(by_player: uint = definedExternally): Record - fun take_all(): Record - fun take_all(by_player: String = definedExternally): Record - fun take_all(by_player: LuaPlayer = definedExternally): Record - fun clear(by_player: uint = definedExternally) - fun clear() - fun clear(by_player: String = definedExternally) - fun clear(by_player: LuaPlayer = definedExternally) - fun put(params: `T$29`): LuaEquipment? - fun can_move(params: `T$30`): Boolean? - fun move(params: `T$30`): Boolean? - fun get(position: Position): LuaEquipment? - fun get_contents(): Record - var prototype: LuaEquipmentGridPrototype - var width: uint - var height: uint - var equipment: Array - var generator_energy: double - var max_solar_energy: double - var available_in_batteries: double - var battery_capacity: double - var shield: float - var max_shield: float - var inhibit_movement_bonus: Boolean? - var valid: Boolean? - var object_name: String /* "LuaEquipmentGrid" */ - fun help(): String -} - -external interface LuaEquipmentGridPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var equipment_categories: Array - var width: uint - var height: uint - var locked: Boolean? - var valid: Boolean? - var object_name: String /* "LuaEquipmentGridPrototype" */ - fun help(): String -} - -external interface `T$31` { - var width: uint - var height: uint - var points: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$32` { - var spawn_and_station_height: float - var spawn_and_station_shadow_height_offset: float - var charge_approach_distance: float - var logistic_radius: float - var construction_radius: float - var charging_station_count: uint - var charging_distance: float - var charging_station_shift: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var charging_energy: double - var charging_threshold_distance: float - var robot_vertical_acceleration: float - var stationing_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var robot_limit: uint - var logistics_connection_distance: float - var robots_shrink_when_entering_and_exiting: Boolean? -} - -external interface LuaEquipmentPrototype { - var name: String - var type: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var shape: `T$31` - var take_result: LuaItemPrototype? - var energy_production: double - var shield: float - var energy_per_shield: double - var logistic_parameters: `T$32` - var energy_consumption: double - var movement_bonus: float - var energy_source: LuaElectricEnergySourcePrototype - var equipment_categories: Array - var burner_prototype: LuaBurnerPrototype? - var electric_energy_source_prototype: LuaElectricEnergySourcePrototype? - var background_color: ColorTable - var attack_parameters: dynamic /* ProjectileAttackParameters? | StreamAttackParameters? | OtherAttackParameters? */ - get() = definedExternally - set(value) = definedExternally - var automatic: Boolean? - var valid: Boolean? - var object_name: String /* "LuaEquipmentPrototype" */ - fun help(): String -} - -external interface `T$33` { - var name: String - var input: Boolean? - var precision_index: flow_precision_index - var count: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaFlowStatistics { - fun get_input_count(name: String): dynamic /* uint64 | double */ - fun set_input_count(name: String, count: uint64) - fun get_output_count(name: String): dynamic /* uint64 | double */ - fun set_output_count(name: String, count: uint64) - fun get_flow_count(params: `T$33`): double - fun on_flow(name: String, count: float) - fun clear() - var input_counts: Record - var output_counts: Record - var force: LuaForce? - var valid: Boolean? - var object_name: String /* "LuaFlowStatistics" */ - fun help(): String -} - -typealias LuaFluidBox = Array - -external interface LuaFluidBoxPrototype { - var entity: LuaEntityPrototype - var index: uint - var pipe_connections: Array - var production_type: String /* "input" | "output" | "input-output" | "none" */ - var base_area: double - var base_level: double - var height: double - var volume: double - var filter: LuaFluidPrototype? - var minimum_temperature: double? - var maximum_temperature: double? - var secondary_draw_orders: Array - var render_layer: String - var valid: Boolean? - var object_name: String /* "LuaFluidBoxPrototype" */ - fun help(): String -} - -external interface LuaFluidEnergySourcePrototype { - var emissions: double - var render_no_network_icon: Boolean? - var render_no_power_icon: Boolean? - var effectivity: double - var burns_fluid: Boolean? - var scale_fluid_usage: Boolean? - var fluid_usage_per_tick: double - var smoke: Array - var maximum_temperature: double - var fluid_box: LuaFluidBoxPrototype - var valid: Boolean? - var object_name: String /* "LuaFluidEnergySourcePrototype" */ - fun help(): String -} - -external interface LuaFluidPrototype { - var name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var default_temperature: double - var max_temperature: double - var heat_capacity: double - var order: String - var group: LuaGroup - var subgroup: LuaGroup - var base_color: ColorTable - var flow_color: ColorTable - var gas_temperature: double - var emissions_multiplier: double - var fuel_value: double - var hidden: Boolean? - var valid: Boolean? - var object_name: String /* "LuaFluidPrototype" */ - fun help(): String -} - -external interface LuaFontPrototype { - var name: String - var from: String - var size: int - var spacing: float - var border: Boolean? - var filtered: Boolean? - var border_color: ColorTable? - var valid: Boolean? - var object_name: String /* "LuaFontPrototype" */ - fun help(): String -} - -external interface `T$34` { - var path: dynamic /* String | */ - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var volume_modifier: double? - get() = definedExternally - set(value) = definedExternally - var override_sound_type: String? /* "game-effect" | "gui-effect" | "ambient" | "environment" | "walking" | "alert" | "wind" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$35` { - var name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint? | String? | LuaSurface? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaForce { - fun get_entity_count(name: String): uint - fun disable_research() - fun enable_research() - fun disable_all_prototypes() - fun enable_all_prototypes() - fun reset_recipes() - fun enable_all_recipes() - fun enable_all_technologies() - fun research_all_technologies(include_disabled_prototypes: Boolean = definedExternally) - fun reset_technologies() - fun reset() - fun reset_technology_effects() - fun chart(surface: uint, area: BoundingBoxTable) - fun chart(surface: uint, area: Any /* JsTuple */) - fun chart(surface: String, area: BoundingBoxTable) - fun chart(surface: String, area: Any /* JsTuple */) - fun chart(surface: LuaSurface, area: BoundingBoxTable) - fun chart(surface: LuaSurface, area: Any /* JsTuple */) - fun clear_chart(surface: uint = definedExternally) - fun clear_chart() - fun clear_chart(surface: String = definedExternally) - fun clear_chart(surface: LuaSurface = definedExternally) - fun rechart() - fun chart_all(surface: uint = definedExternally) - fun chart_all() - fun chart_all(surface: String = definedExternally) - fun chart_all(surface: LuaSurface = definedExternally) - fun is_chunk_charted(surface: uint, position: ChunkPositionTable): Boolean? - fun is_chunk_charted(surface: uint, position: Any /* JsTuple */): Boolean? - fun is_chunk_charted(surface: String, position: ChunkPositionTable): Boolean? - fun is_chunk_charted(surface: String, position: Any /* JsTuple */): Boolean? - fun is_chunk_charted(surface: LuaSurface, position: ChunkPositionTable): Boolean? - fun is_chunk_charted(surface: LuaSurface, position: Any /* JsTuple */): Boolean? - fun is_chunk_visible(surface: uint, position: ChunkPositionTable): Boolean? - fun is_chunk_visible(surface: uint, position: Any /* JsTuple */): Boolean? - fun is_chunk_visible(surface: String, position: ChunkPositionTable): Boolean? - fun is_chunk_visible(surface: String, position: Any /* JsTuple */): Boolean? - fun is_chunk_visible(surface: LuaSurface, position: ChunkPositionTable): Boolean? - fun is_chunk_visible(surface: LuaSurface, position: Any /* JsTuple */): Boolean? - fun cancel_charting(surface: uint = definedExternally) - fun cancel_charting() - fun cancel_charting(surface: String = definedExternally) - fun cancel_charting(surface: LuaSurface = definedExternally) - fun get_ammo_damage_modifier(ammo: String): double - fun set_ammo_damage_modifier(ammo: String, modifier: double) - fun get_gun_speed_modifier(ammo: String): double - fun set_gun_speed_modifier(ammo: String, modifier: double) - fun get_turret_attack_modifier(turret: String): double - fun set_turret_attack_modifier(turret: String, modifier: double) - fun set_cease_fire(other: String, cease_fire: Boolean) - fun set_cease_fire(other: LuaForce, cease_fire: Boolean) - fun get_cease_fire(other: String): Boolean? - fun get_cease_fire(other: LuaForce): Boolean? - fun set_friend(other: String, friend: Boolean) - fun set_friend(other: LuaForce, friend: Boolean) - fun get_friend(other: String): Boolean? - fun get_friend(other: LuaForce): Boolean? - fun is_pathfinder_busy(): Boolean? - fun kill_all_units() - fun find_logistic_network_by_position(position: Position, surface: uint): LuaLogisticNetwork? - fun find_logistic_network_by_position(position: Position, surface: String): LuaLogisticNetwork? - fun find_logistic_network_by_position(position: Position, surface: LuaSurface): LuaLogisticNetwork? - fun set_spawn_position(position: Position, surface: uint) - fun set_spawn_position(position: Position, surface: String) - fun set_spawn_position(position: Position, surface: LuaSurface) - fun get_spawn_position(surface: uint): PositionTable - fun get_spawn_position(surface: String): PositionTable - fun get_spawn_position(surface: LuaSurface): PositionTable - fun unchart_chunk(position: ChunkPositionTable, surface: uint) - fun unchart_chunk(position: ChunkPositionTable, surface: String) - fun unchart_chunk(position: ChunkPositionTable, surface: LuaSurface) - fun unchart_chunk(position: Any /* JsTuple */, surface: uint) - fun unchart_chunk(position: Any /* JsTuple */, surface: String) - fun unchart_chunk(position: Any /* JsTuple */, surface: LuaSurface) - fun get_item_launched(item: String): uint - fun set_item_launched(item: String, count: uint) - fun print(message: Any /* JsTuple */, color: ColorTable = definedExternally) - fun print(message: Any /* JsTuple */) - fun print(message: Any /* JsTuple */, color: Any /* JsTuple */ = definedExternally) - fun print(message: String, color: ColorTable = definedExternally) - fun print(message: String) - fun print(message: String, color: Any /* JsTuple */ = definedExternally) - fun print(message: Number, color: ColorTable = definedExternally) - fun print(message: Number) - fun print(message: Number, color: Any /* JsTuple */ = definedExternally) - fun get_trains(surface: uint = definedExternally): Array - fun get_trains(): Array - fun get_trains(surface: String = definedExternally): Array - fun get_trains(surface: LuaSurface = definedExternally): Array - fun add_chart_tag(surface: uint, tag: ChartTagSpec): LuaCustomChartTag? - fun add_chart_tag(surface: String, tag: ChartTagSpec): LuaCustomChartTag? - fun add_chart_tag(surface: LuaSurface, tag: ChartTagSpec): LuaCustomChartTag? - fun find_chart_tags(surface: uint, area: BoundingBoxTable = definedExternally): Array - fun find_chart_tags(surface: uint): Array - fun find_chart_tags(surface: uint, area: Any /* JsTuple */ = definedExternally): Array - fun find_chart_tags(surface: String, area: BoundingBoxTable = definedExternally): Array - fun find_chart_tags(surface: String): Array - fun find_chart_tags(surface: String, area: Any /* JsTuple */ = definedExternally): Array - fun find_chart_tags(surface: LuaSurface, area: BoundingBoxTable = definedExternally): Array - fun find_chart_tags(surface: LuaSurface): Array - fun find_chart_tags(surface: LuaSurface, area: Any /* JsTuple */ = definedExternally): Array - fun get_saved_technology_progress(technology: String): double? - fun get_saved_technology_progress(technology: LuaTechnology): double? - fun get_saved_technology_progress(technology: LuaTechnologyPrototype): double? - fun set_saved_technology_progress(technology: String, progress: double?) - fun set_saved_technology_progress(technology: LuaTechnology, progress: double?) - fun set_saved_technology_progress(technology: LuaTechnologyPrototype, progress: double?) - fun reset_evolution() - fun play_sound(params: `T$34`) - fun get_train_stops(params: `T$35` = definedExternally): Array - fun get_hand_crafting_disabled_for_recipe(recipe: String): Boolean? - fun get_hand_crafting_disabled_for_recipe(recipe: LuaRecipe): Boolean? - fun set_hand_crafting_disabled_for_recipe(recipe: String, hand_crafting_disabled: Boolean) - fun set_hand_crafting_disabled_for_recipe(recipe: LuaRecipe, hand_crafting_disabled: Boolean) - fun add_research(technology: String): Boolean? - fun add_research(technology: LuaTechnology): Boolean? - fun add_research(technology: LuaTechnologyPrototype): Boolean? - fun cancel_current_research() - fun get_linked_inventory(prototype: LuaEntity, link_id: uint): LuaInventory? - fun get_linked_inventory(prototype: LuaEntityPrototype, link_id: uint): LuaInventory? - fun get_linked_inventory(prototype: String, link_id: uint): LuaInventory? - fun is_friend(other: String): Boolean? - fun is_friend(other: LuaForce): Boolean? - fun is_enemy(other: String): Boolean? - fun is_enemy(other: LuaForce): Boolean? - var name: String - var technologies: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var recipes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var manual_mining_speed_modifier: double - var manual_crafting_speed_modifier: double - var laboratory_speed_modifier: double - var laboratory_productivity_bonus: double - var worker_robots_speed_modifier: double - var worker_robots_battery_modifier: double - var worker_robots_storage_bonus: double - var current_research: LuaTechnology? - var research_progress: double - var previous_research: LuaTechnology - var inserter_stack_size_bonus: double - var stack_inserter_capacity_bonus: uint - var character_trash_slot_count: double - var maximum_following_robot_count: uint - var following_robots_lifetime_modifier: double - var ghost_time_to_live: uint - var players: Array - var ai_controllable: Boolean? - var logistic_networks: Record> - var item_production_statistics: LuaFlowStatistics - var fluid_production_statistics: LuaFlowStatistics - var kill_count_statistics: LuaFlowStatistics - var entity_build_count_statistics: LuaFlowStatistics - var character_running_speed_modifier: double - var artillery_range_modifier: double - var character_build_distance_bonus: uint - var character_item_drop_distance_bonus: uint - var character_reach_distance_bonus: uint - var character_resource_reach_distance_bonus: double - var character_item_pickup_distance_bonus: double - var character_loot_pickup_distance_bonus: double - var character_inventory_slots_bonus: uint - var deconstruction_time_to_live: uint - var character_health_bonus: double - var max_successful_attempts_per_tick_per_construction_queue: uint - var max_failed_attempts_per_tick_per_construction_queue: uint - var zoom_to_world_enabled: Boolean? - var zoom_to_world_ghost_building_enabled: Boolean? - var zoom_to_world_blueprint_enabled: Boolean? - var zoom_to_world_deconstruction_planner_enabled: Boolean? - var zoom_to_world_selection_tool_enabled: Boolean? - var character_logistic_requests: Boolean? - var rockets_launched: uint - var items_launched: Record - var connected_players: Array - var mining_drill_productivity_bonus: double - var train_braking_force_bonus: double - var evolution_factor: double - var evolution_factor_by_pollution: double - var evolution_factor_by_time: double - var evolution_factor_by_killing_spawners: double - var friendly_fire: Boolean? - var share_chart: Boolean? - var research_queue_enabled: Boolean? - var index: uint - var research_queue: Array? - var research_enabled: Boolean? - var valid: Boolean? - var object_name: String /* "LuaForce" */ - fun help(): String -} - -external interface LuaFuelCategoryPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaFuelCategoryPrototype" */ - fun help(): String -} - -external interface `T$36` { - var game_finished: Boolean? - var player_won: Boolean? - var next_level: String - var can_continue: Boolean? - var victorious_force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$37` { - var text: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var image: String? - get() = definedExternally - set(value) = definedExternally - var point_to: dynamic /* EntityGuiArrowSpecification? | PositionGuiArrowSpecification? | CraftingQueueGuiArrowSpecification? | ItemStackGuiArrowSpecification? | OtherGuiArrowSpecification? */ - get() = definedExternally - set(value) = definedExternally - var style: String? - get() = definedExternally - set(value) = definedExternally - var wrapper_frame_style: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$38` { - var player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var by_player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint? | String? | LuaSurface? */ - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var resolution: Position? - get() = definedExternally - set(value) = definedExternally - var zoom: double? - get() = definedExternally - set(value) = definedExternally - var path: String? - get() = definedExternally - set(value) = definedExternally - var show_gui: Boolean? - get() = definedExternally - set(value) = definedExternally - var show_entity_info: Boolean? - get() = definedExternally - set(value) = definedExternally - var show_cursor_building_preview: Boolean? - get() = definedExternally - set(value) = definedExternally - var anti_alias: Boolean? - get() = definedExternally - set(value) = definedExternally - var quality: int? - get() = definedExternally - set(value) = definedExternally - var allow_in_replay: Boolean? - get() = definedExternally - set(value) = definedExternally - var daytime: double? - get() = definedExternally - set(value) = definedExternally - var water_tick: uint? - get() = definedExternally - set(value) = definedExternally - var force_render: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$39` { - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally - var path: String? - get() = definedExternally - set(value) = definedExternally - var by_player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var selected_technology: dynamic /* String? | LuaTechnology? | LuaTechnologyPrototype? */ - get() = definedExternally - set(value) = definedExternally - var skip_disabled: Boolean? - get() = definedExternally - set(value) = definedExternally - var quality: int? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$40` { - var name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint? | String? | LuaSurface? */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaGameScript { - fun set_game_state(params: `T$36`) - fun get_entity_by_tag(tag: String): LuaEntity - fun show_message_dialog(params: `T$37`) - fun is_demo(): Boolean? - fun reload_script() - fun reload_mods() - fun save_atlas() - fun check_consistency() - fun regenerate_entity(entities: String) - fun regenerate_entity(entities: Array) - fun take_screenshot(params: `T$38`) - fun set_wait_for_screenshots_to_finish() - fun take_technology_screenshot(params: `T$39`) - fun table_to_json(data: table): String - fun json_to_table(json: String): dynamic /* String? | Number? | Boolean? | table? */ - fun write_file(filename: String, data: Any /* JsTuple */, append: Boolean = definedExternally, for_player: uint = definedExternally) - fun write_file(filename: String, data: Any /* JsTuple */) - fun write_file(filename: String, data: Any /* JsTuple */, append: Boolean = definedExternally) - fun write_file(filename: String, data: String, append: Boolean = definedExternally, for_player: uint = definedExternally) - fun write_file(filename: String, data: String) - fun write_file(filename: String, data: String, append: Boolean = definedExternally) - fun write_file(filename: String, data: Number, append: Boolean = definedExternally, for_player: uint = definedExternally) - fun write_file(filename: String, data: Number) - fun write_file(filename: String, data: Number, append: Boolean = definedExternally) - fun remove_path(path: String) - fun remove_offline_players(players: Array = definedExternally) - fun force_crc() - fun create_force(force: String): LuaForce - fun merge_forces(source: String, destination: String) - fun merge_forces(source: String, destination: LuaForce) - fun merge_forces(source: LuaForce, destination: String) - fun merge_forces(source: LuaForce, destination: LuaForce) - fun create_surface(name: String, settings: MapGenSettings = definedExternally): LuaSurface - fun server_save(name: String = definedExternally) - fun auto_save(name: String = definedExternally) - fun delete_surface(surface: String) - fun delete_surface(surface: LuaSurface) - fun disable_replay() - fun disable_tutorial_triggers() - fun direction_to_string(direction: direction) - fun print(message: Any /* JsTuple */, color: ColorTable = definedExternally) - fun print(message: Any /* JsTuple */) - fun print(message: Any /* JsTuple */, color: Any /* JsTuple */ = definedExternally) - fun print(message: String, color: ColorTable = definedExternally) - fun print(message: String) - fun print(message: String, color: Any /* JsTuple */ = definedExternally) - fun print(message: Number, color: ColorTable = definedExternally) - fun print(message: Number) - fun print(message: Number, color: Any /* JsTuple */ = definedExternally) - fun create_random_generator(seed: uint = definedExternally): LuaRandomGenerator - fun check_prototype_translations() - fun play_sound(params: `T$34`) - fun is_valid_sound_path(sound_path: String): Boolean? -// fun is_valid_sound_path(sound_path: String): Boolean? - fun is_valid_sprite_path(sprite_path: String): Boolean? -// fun is_valid_sprite_path(sprite_path: String): Boolean? - fun kick_player(player: uint, reason: Any /* JsTuple */ = definedExternally) - fun kick_player(player: uint) - fun kick_player(player: uint, reason: String = definedExternally) - fun kick_player(player: uint, reason: Number = definedExternally) - fun kick_player(player: String, reason: Any /* JsTuple */ = definedExternally) - fun kick_player(player: String) - fun kick_player(player: String, reason: String = definedExternally) - fun kick_player(player: String, reason: Number = definedExternally) - fun kick_player(player: LuaPlayer, reason: Any /* JsTuple */ = definedExternally) - fun kick_player(player: LuaPlayer) - fun kick_player(player: LuaPlayer, reason: String = definedExternally) - fun kick_player(player: LuaPlayer, reason: Number = definedExternally) - fun ban_player(player: uint, reason: Any /* JsTuple */ = definedExternally) - fun ban_player(player: uint) - fun ban_player(player: uint, reason: String = definedExternally) - fun ban_player(player: uint, reason: Number = definedExternally) - fun ban_player(player: String, reason: Any /* JsTuple */ = definedExternally) - fun ban_player(player: String) - fun ban_player(player: String, reason: String = definedExternally) - fun ban_player(player: String, reason: Number = definedExternally) - fun ban_player(player: LuaPlayer, reason: Any /* JsTuple */ = definedExternally) - fun ban_player(player: LuaPlayer) - fun ban_player(player: LuaPlayer, reason: String = definedExternally) - fun ban_player(player: LuaPlayer, reason: Number = definedExternally) - fun unban_player(player: uint) - fun unban_player(player: String) - fun unban_player(player: LuaPlayer) - fun purge_player(player: uint) - fun purge_player(player: String) - fun purge_player(player: LuaPlayer) - fun mute_player(player: uint) - fun mute_player(player: String) - fun mute_player(player: LuaPlayer) - fun unmute_player(player: uint) - fun unmute_player(player: String) - fun unmute_player(player: LuaPlayer) - fun count_pipe_groups() - fun is_multiplayer(): Boolean? - fun get_active_entities_count(surface: uint = definedExternally): uint - fun get_active_entities_count(): uint - fun get_active_entities_count(surface: String = definedExternally): uint - fun get_active_entities_count(surface: LuaSurface = definedExternally): uint - fun get_map_exchange_string(): String - fun parse_map_exchange_string(map_exchange_string: String): MapExchangeStringData - fun get_train_stops(params: `T$40` = definedExternally): Array - fun get_player(player: uint): LuaPlayer? - fun get_player(player: String): LuaPlayer? - fun get_surface(surface: uint): LuaSurface? - fun get_surface(surface: String): LuaSurface? - fun create_profiler(stopped: Boolean = definedExternally): LuaProfiler - fun evaluate_expression(expression: String, variables: Record = definedExternally): double - fun get_filtered_entity_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_item_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_equipment_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_mod_setting_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_achievement_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_tile_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_decorative_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_fluid_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_recipe_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_filtered_technology_prototypes(filters: Array): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun create_inventory(size: uint16): LuaInventory - fun get_script_inventories(mod: String = definedExternally): Record> - fun reset_time_played() - fun encode_string(string: String): String? - fun decode_string(string: String): String? - var player: LuaPlayer? - var players: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var map_settings: MapSettings - var difficulty_settings: DifficultySettings - var difficulty: difficulty - var forces: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var entity_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var item_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var fluid_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var tile_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var equipment_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var damage_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var virtual_signal_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var equipment_grid_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var recipe_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var technology_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var decorative_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var particle_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var autoplace_control_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var noise_layer_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var mod_setting_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var custom_input_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var ammo_category_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var named_noise_expressions: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var item_subgroup_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var item_group_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var fuel_category_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var resource_category_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var achievement_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var module_category_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var equipment_category_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var trivial_smoke_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var shortcut_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var recipe_category_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var font_prototypes: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var map_gen_presets: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var styles: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var tick: uint - var ticks_played: uint - var tick_paused: Boolean? - var ticks_to_run: uint - var finished: Boolean? - var speed: float - var surfaces: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var active_mods: Record - var connected_players: Array - var permissions: LuaPermissionGroups - var backer_names: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var default_map_gen_settings: MapGenSettings - var enemy_has_vision_on_land_mines: Boolean? - var autosave_enabled: Boolean? - var draw_resource_selection: Boolean? - var pollution_statistics: LuaFlowStatistics - var max_force_distraction_distance: double - var max_force_distraction_chunk_distance: uint - var max_electric_pole_supply_area_distance: float - var max_electric_pole_connection_distance: double - var max_beacon_supply_area_distance: double - var max_gate_activation_distance: double - var max_inserter_reach_distance: double - var max_pipe_to_ground_distance: uint8 - var max_underground_belt_distance: uint8 - var object_name: String /* "LuaGameScript" */ -} - -external interface LuaGenericOnOffControlBehavior : LuaControlBehavior { - var disabled: Boolean? - var circuit_condition: CircuitConditionDefinition - var logistic_condition: CircuitConditionDefinition - var connect_to_logistic_network: Boolean? - var valid: Boolean? - var object_name: String - fun help(): String -} - -external interface LuaGroup { - var name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var type: String - var group: LuaGroup? - var subgroups: Array - var order_in_recipe: String - var order: String - var valid: Boolean? - var object_name: String /* "LuaGroup" */ - fun help(): String -} - -external interface LuaGui { - fun is_valid_sprite_path(sprite_path: String): Boolean? -// fun is_valid_sprite_path(sprite_path: ): Boolean? - var player: LuaPlayer - var children: Record - var top: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var left: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var center: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var goal: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var screen: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var relative: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaGui" */ - fun help(): String -} - -external interface BaseGuiSpec { - var type: String /* "choose-elem-button" | "drop-down" | "empty-widget" | "entity-preview" | "list-box" | "scroll-pane" | "sprite-button" | "tabbed-pane" | "text-box" | "button" | "camera" | "checkbox" | "flow" | "frame" | "label" | "line" | "minimap" | "progressbar" | "radiobutton" | "slider" | "sprite" | "switch" | "tab" | "table" | "textfield" */ - var name: String? - get() = definedExternally - set(value) = definedExternally - var caption: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var tooltip: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var enabled: Boolean? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var ignored_by_interaction: Boolean? - get() = definedExternally - set(value) = definedExternally - var style: String? - get() = definedExternally - set(value) = definedExternally - var tags: Tags? - get() = definedExternally - set(value) = definedExternally - var index: uint? - get() = definedExternally - set(value) = definedExternally - var anchor: GuiAnchor? - get() = definedExternally - set(value) = definedExternally -} - -external interface ButtonGuiSpec : BaseGuiSpec { - override var type: String /* "button" */ - var mouse_button_filter: dynamic /* MouseButtonFlagsTable? | MouseButtonFlagsArray? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FlowGuiSpec : BaseGuiSpec { - override var type: String /* "flow" */ - var direction: String? /* "horizontal" | "vertical" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FrameGuiSpec : BaseGuiSpec { - override var type: String /* "frame" */ - var direction: String? /* "horizontal" | "vertical" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TableGuiSpec : BaseGuiSpec { - override var type: String /* "table" */ - var column_count: uint - var draw_vertical_lines: Boolean? - get() = definedExternally - set(value) = definedExternally - var draw_horizontal_lines: Boolean? - get() = definedExternally - set(value) = definedExternally - var draw_horizontal_line_after_headers: Boolean? - get() = definedExternally - set(value) = definedExternally - var vertical_centering: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TextfieldGuiSpec : BaseGuiSpec { - override var type: String /* "textfield" */ - var text: String? - get() = definedExternally - set(value) = definedExternally - var numeric: Boolean? - get() = definedExternally - set(value) = definedExternally - var allow_decimal: Boolean? - get() = definedExternally - set(value) = definedExternally - var allow_negative: Boolean? - get() = definedExternally - set(value) = definedExternally - var is_password: Boolean? - get() = definedExternally - set(value) = definedExternally - var lose_focus_on_confirm: Boolean? - get() = definedExternally - set(value) = definedExternally - var clear_and_focus_on_right_click: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface ProgressbarGuiSpec : BaseGuiSpec { - override var type: String /* "progressbar" */ - var value: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface CheckboxGuiSpec : BaseGuiSpec { - override var type: String /* "checkbox" */ - var state: Boolean? -} - -external interface RadiobuttonGuiSpec : BaseGuiSpec { - override var type: String /* "radiobutton" */ - var state: Boolean? -} - -external interface SpriteButtonGuiSpec : BaseGuiSpec { - override var type: String /* "sprite-button" */ - var sprite: dynamic /* String? | ? */ - get() = definedExternally - set(value) = definedExternally - var hovered_sprite: dynamic /* String? | ? */ - get() = definedExternally - set(value) = definedExternally - var clicked_sprite: dynamic /* String? | ? */ - get() = definedExternally - set(value) = definedExternally - var number: double? - get() = definedExternally - set(value) = definedExternally - var show_percent_for_small_numbers: Boolean? - get() = definedExternally - set(value) = definedExternally - var mouse_button_filter: dynamic /* MouseButtonFlagsTable? | MouseButtonFlagsArray? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface SpriteGuiSpec : BaseGuiSpec { - override var type: String /* "sprite" */ - var sprite: dynamic /* String? | ? */ - get() = definedExternally - set(value) = definedExternally - var resize_to_sprite: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface ScrollPaneGuiSpec : BaseGuiSpec { - override var type: String /* "scroll-pane" */ - var horizontal_scroll_policy: String? /* "auto" | "never" | "always" | "auto-and-reserve-space" | "dont-show-but-allow-scrolling" */ - get() = definedExternally - set(value) = definedExternally - var vertical_scroll_policy: String? /* "auto" | "never" | "always" | "auto-and-reserve-space" | "dont-show-but-allow-scrolling" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface DropDownGuiSpec : BaseGuiSpec { - override var type: String /* "drop-down" */ - var items: Array | String | Number */>? - get() = definedExternally - set(value) = definedExternally - var selected_index: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface LineGuiSpec : BaseGuiSpec { - override var type: String /* "line" */ - var direction: String? /* "horizontal" | "vertical" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ListBoxGuiSpec : BaseGuiSpec { - override var type: String /* "list-box" */ - var items: Array | String | Number */>? - get() = definedExternally - set(value) = definedExternally - var selected_index: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface CameraGuiSpec : BaseGuiSpec { - override var type: String /* "camera" */ - var position: Position - var surface_index: uint? - get() = definedExternally - set(value) = definedExternally - var zoom: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface ChooseElemButtonFilters { - @nativeGetter - operator fun get(key: String): Any? - @nativeSetter - operator fun set(key: String, value: Any) - var item: Array - var tile: Array - var entity: Array - var signal: Any - var fluid: Array - var recipe: Array - var decorative: Array - var achievement: Array - var equipment: Array - var technology: Array -} - -external interface BaseChooseElemButtonSpec : BaseGuiSpec { - override var type: String /* "choose-elem-button" */ - var elem_type: String /* "item" | "tile" | "entity" | "signal" | "fluid" | "recipe" | "decorative" | "item-group" | "achievement" | "equipment" | "technology" */ - var filters: Any? - get() = definedExternally - set(value) = definedExternally -} - -external interface ItemChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "item" */ - var item: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface TileChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "tile" */ - var tile: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface EntityChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "entity" */ - var entity: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface SignalChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "signal" */ - var signal: SignalID? - get() = definedExternally - set(value) = definedExternally -} - -external interface FluidChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "fluid" */ - var fluid: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface RecipeChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "recipe" */ - var recipe: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface DecorativeChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "decorative" */ - var decorative: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface ItemGroupChooseElemButtonSpec : BaseChooseElemButtonSpec { - @nativeGetter - operator fun get(key: String): String? - @nativeSetter - operator fun set(key: String, value: String?) - override var elem_type: String /* "item-group" */ -} - -external interface AchievementChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "achievement" */ - var achievement: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface EquipmentChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "equipment" */ - var equipment: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface TechnologyChooseElemButtonSpec : BaseChooseElemButtonSpec { - override var elem_type: String /* "technology" */ - var technology: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface TextBoxGuiSpec : BaseGuiSpec { - override var type: String /* "text-box" */ - var text: String? - get() = definedExternally - set(value) = definedExternally - var clear_and_focus_on_right_click: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface SliderGuiSpec : BaseGuiSpec { - override var type: String /* "slider" */ - var minimum_value: double? - get() = definedExternally - set(value) = definedExternally - var maximum_value: double? - get() = definedExternally - set(value) = definedExternally - var value: double? - get() = definedExternally - set(value) = definedExternally - var value_step: double? - get() = definedExternally - set(value) = definedExternally - var discrete_slider: Boolean? - get() = definedExternally - set(value) = definedExternally - var discrete_values: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface MinimapGuiSpec : BaseGuiSpec { - override var type: String /* "minimap" */ - var position: Position? - get() = definedExternally - set(value) = definedExternally - var surface_index: uint? - get() = definedExternally - set(value) = definedExternally - var chart_player_index: uint? - get() = definedExternally - set(value) = definedExternally - var force: String? - get() = definedExternally - set(value) = definedExternally - var zoom: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface TabGuiSpec : BaseGuiSpec { - override var type: String /* "tab" */ - var badge_text: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface SwitchGuiSpec : BaseGuiSpec { - override var type: String /* "switch" */ - var switch_state: String? /* "left" | "right" | "none" */ - get() = definedExternally - set(value) = definedExternally - var allow_none_state: Boolean? - get() = definedExternally - set(value) = definedExternally - var left_label_caption: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var left_label_tooltip: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var right_label_caption: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var right_label_tooltip: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface OtherGuiSpec : BaseGuiSpec { - override var type: String /* "empty-widget" | "entity-preview" | "tabbed-pane" | "label" */ -} - -external interface GuiElementIndex { - @nativeGetter - operator fun get(name: String): dynamic /* ChooseElemButtonGuiElementMembers? | DropDownGuiElementMembers? | EmptyWidgetGuiElementMembers? | EntityPreviewGuiElementMembers? | ListBoxGuiElementMembers? | ScrollPaneGuiElementMembers? | SpriteButtonGuiElementMembers? | TabbedPaneGuiElementMembers? | TextBoxGuiElementMembers? | ButtonGuiElementMembers? | CameraGuiElementMembers? | CheckboxGuiElementMembers? | FlowGuiElementMembers? | FrameGuiElementMembers? | LabelGuiElementMembers? | LineGuiElementMembers? | MinimapGuiElementMembers? | ProgressbarGuiElementMembers? | RadiobuttonGuiElementMembers? | SliderGuiElementMembers? | SpriteGuiElementMembers? | SwitchGuiElementMembers? | TabGuiElementMembers? | TableGuiElementMembers? | TextfieldGuiElementMembers? */ - @nativeSetter - operator fun set(name: String, value: ChooseElemButtonGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: DropDownGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: EmptyWidgetGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: EntityPreviewGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: ListBoxGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: ScrollPaneGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: SpriteButtonGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: TabbedPaneGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: TextBoxGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: ButtonGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: CameraGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: CheckboxGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: FlowGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: FrameGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: LabelGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: LineGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: MinimapGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: ProgressbarGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: RadiobuttonGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: SliderGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: SpriteGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: SwitchGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: TabGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: TableGuiElementMembers) - @nativeSetter - operator fun set(name: String, value: TextfieldGuiElementMembers) -} - -external interface `T$41` { - var type: Type -} - -external interface BaseGuiElement { - fun add(element: Any /* ButtonGuiSpec | FlowGuiSpec | FrameGuiSpec | TableGuiSpec | TextfieldGuiSpec | ProgressbarGuiSpec | CheckboxGuiSpec | RadiobuttonGuiSpec | SpriteButtonGuiSpec | SpriteGuiSpec | ScrollPaneGuiSpec | DropDownGuiSpec | LineGuiSpec | ListBoxGuiSpec | CameraGuiSpec | ItemChooseElemButtonSpec | TileChooseElemButtonSpec | EntityChooseElemButtonSpec | SignalChooseElemButtonSpec | FluidChooseElemButtonSpec | RecipeChooseElemButtonSpec | DecorativeChooseElemButtonSpec | ItemGroupChooseElemButtonSpec | AchievementChooseElemButtonSpec | EquipmentChooseElemButtonSpec | TechnologyChooseElemButtonSpec | TextBoxGuiSpec | SliderGuiSpec | MinimapGuiSpec | TabGuiSpec | SwitchGuiSpec | OtherGuiSpec */): Extract> - fun clear() - fun destroy() - fun get_mod(): String? - fun get_index_in_parent(): uint - fun clear_items() - fun get_item(index: uint): dynamic /* JsTuple | String | Number */ - fun set_item(index: uint, string: Any /* JsTuple */) - fun set_item(index: uint, string: String) - fun set_item(index: uint, string: Number) - fun add_item(string: Any /* JsTuple */, index: uint = definedExternally) - fun add_item(string: Any /* JsTuple */) - fun add_item(string: String, index: uint = definedExternally) - fun add_item(string: String) - fun add_item(string: Number, index: uint = definedExternally) - fun add_item(string: Number) - fun remove_item(index: uint) - fun get_slider_minimum(): double - fun get_slider_maximum(): double - fun set_slider_minimum_maximum(minimum: double, maximum: double) - fun get_slider_value_step(): double - fun get_slider_discrete_slider(): Boolean? - fun get_slider_discrete_values(): Boolean? - fun set_slider_value_step(value: double) - fun set_slider_discrete_slider(value: Boolean) - fun set_slider_discrete_values(value: Boolean) - fun focus() - fun bring_to_front() - var index: uint - var gui: LuaGui - var parent: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var name: String - var caption: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var style: dynamic /* LuaStyle | String */ - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - var children_names: Array - var player_index: uint - var sprite: dynamic /* String | */ - get() = definedExternally - set(value) = definedExternally - var resize_to_sprite: Boolean? - var clicked_sprite: dynamic /* String | */ - get() = definedExternally - set(value) = definedExternally - var tooltip: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var type: String /* "choose-elem-button" | "drop-down" | "empty-widget" | "entity-preview" | "list-box" | "scroll-pane" | "sprite-button" | "tabbed-pane" | "text-box" | "button" | "camera" | "checkbox" | "flow" | "frame" | "label" | "line" | "minimap" | "progressbar" | "radiobutton" | "slider" | "sprite" | "switch" | "tab" | "table" | "textfield" */ - var children: Array - var items: Array | String | Number */> - var selected_index: uint - var number: double? - var show_percent_for_small_numbers: Boolean? - var location: dynamic /* GuiLocationTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var position: Position - var surface_index: uint - var zoom: double - var force: String? - var enabled: Boolean? - var ignored_by_interaction: Boolean? - var mouse_button_filter: dynamic /* MouseButtonFlagsTable | MouseButtonFlagsArray */ - get() = definedExternally - set(value) = definedExternally - var drag_target: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var tabs: Array - var entity: LuaEntity? - var anchor: GuiAnchor? - var tags: Tags - var valid: Boolean? - var object_name: String /* "LuaGuiElement" */ - fun help(): String -} - -external interface ChooseElemButtonGuiElementMembers : BaseGuiElement { - override var type: String /* "choose-elem-button" */ - var elem_type: String /* "item" | "tile" | "entity" | "signal" | "fluid" | "recipe" | "decorative" | "item-group" | "achievement" | "equipment" | "technology" */ - var elem_value: Any? - var elem_filters: Any - var locked: Boolean? -} - -external interface DropDownGuiElementMembers : BaseGuiElement { - override var type: String /* "drop-down" */ -} - -external interface EmptyWidgetGuiElementMembers : BaseGuiElement { - override var type: String /* "empty-widget" */ -} - -external interface EntityPreviewGuiElementMembers : BaseGuiElement { - override var type: String /* "entity-preview" */ -} - -external interface ListBoxGuiElementMembers : BaseGuiElement { - override var type: String /* "list-box" */ - fun scroll_to_item(index: int, scroll_mode: String /* "in-view" | "top-third" */ = definedExternally) -} - -external interface ScrollPaneGuiElementMembers : BaseGuiElement { - override var type: String /* "scroll-pane" */ - fun scroll_to_top() - fun scroll_to_bottom() - fun scroll_to_left() - fun scroll_to_right() - fun scroll_to_element(element: Any /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */, scroll_mode: String /* "in-view" | "top-third" */ = definedExternally) - var horizontal_scroll_policy: String /* "auto" | "never" | "always" | "auto-and-reserve-space" | "dont-show-but-allow-scrolling" */ - var vertical_scroll_policy: String /* "auto" | "never" | "always" | "auto-and-reserve-space" | "dont-show-but-allow-scrolling" */ -} - -external interface SpriteButtonGuiElementMembers : BaseGuiElement { - override var type: String /* "sprite-button" */ - var hovered_sprite: dynamic /* String | */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TabbedPaneGuiElementMembers : BaseGuiElement { - override var type: String /* "tabbed-pane" */ - fun add_tab(tab: Any /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */, content: Any /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */) - fun remove_tab(tab: Any /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */) - var selected_tab_index: uint? -} - -external interface TextBoxGuiElementMembers : BaseGuiElement { - override var type: String /* "text-box" */ - fun scroll_to_top() - fun scroll_to_bottom() - fun scroll_to_left() - fun scroll_to_right() - fun select_all() - fun select(start: int, end: int) - var text: String - var selectable: Boolean? - var word_wrap: Boolean? - var read_only: Boolean? - var clear_and_focus_on_right_click: Boolean? -} - -external interface ButtonGuiElementMembers : BaseGuiElement { - override var type: String /* "button" */ -} - -external interface CameraGuiElementMembers : BaseGuiElement { - override var type: String /* "camera" */ -} - -external interface CheckboxGuiElementMembers : BaseGuiElement { - override var type: String /* "checkbox" */ - var state: Boolean? -} - -external interface FlowGuiElementMembers : BaseGuiElement { - override var type: String /* "flow" */ - var direction: String /* "horizontal" | "vertical" */ -} - -external interface FrameGuiElementMembers : BaseGuiElement { - override var type: String /* "frame" */ - fun force_auto_center() - var direction: String /* "horizontal" | "vertical" */ - var auto_center: Boolean? -} - -external interface LabelGuiElementMembers : BaseGuiElement { - override var type: String /* "label" */ -} - -external interface LineGuiElementMembers : BaseGuiElement { - override var type: String /* "line" */ - var direction: String /* "horizontal" | "vertical" */ -} - -external interface MinimapGuiElementMembers : BaseGuiElement { - override var type: String /* "minimap" */ - var minimap_player_index: uint -} - -external interface ProgressbarGuiElementMembers : BaseGuiElement { - override var type: String /* "progressbar" */ - var value: double -} - -external interface RadiobuttonGuiElementMembers : BaseGuiElement { - override var type: String /* "radiobutton" */ - var state: Boolean? -} - -external interface SliderGuiElementMembers : BaseGuiElement { - override var type: String /* "slider" */ - var slider_value: double -} - -external interface SpriteGuiElementMembers : BaseGuiElement { - override var type: String /* "sprite" */ -} - -external interface SwitchGuiElementMembers : BaseGuiElement { - override var type: String /* "switch" */ - var switch_state: String - var allow_none_state: Boolean? - var left_label_caption: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var left_label_tooltip: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var right_label_caption: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var right_label_tooltip: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TabGuiElementMembers : BaseGuiElement { - override var type: String /* "tab" */ - var badge_text: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TableGuiElementMembers : BaseGuiElement { - override var type: String /* "table" */ - var draw_vertical_lines: Boolean? - var draw_horizontal_lines: Boolean? - var draw_horizontal_line_after_headers: Boolean? - var column_count: uint - var vertical_centering: Boolean? -} - -external interface TextfieldGuiElementMembers : BaseGuiElement { - override var type: String /* "textfield" */ - fun select_all() - fun select(start: int, end: int) - var text: String - var numeric: Boolean? - var allow_decimal: Boolean? - var allow_negative: Boolean? - var is_password: Boolean? - var lose_focus_on_confirm: Boolean? - var clear_and_focus_on_right_click: Boolean? -} - -external interface LuaHeatEnergySourcePrototype { - var emissions: double - var render_no_network_icon: Boolean? - var render_no_power_icon: Boolean? - var max_temperature: double - var default_temperature: double - var specific_heat: double - var max_transfer: double - var min_temperature_gradient: double - var min_working_temperature: double - var minimum_glow_temperature: double - var connections: Array - var valid: Boolean? - var object_name: String /* "LuaHeatEnergySourcePrototype" */ - fun help(): String -} - -external interface LuaInserterControlBehavior : LuaGenericOnOffControlBehavior { - var circuit_read_hand_contents: Boolean? - var circuit_mode_of_operation: circuit_mode_of_operation - var circuit_hand_read_mode: hand_read_mode - var circuit_set_stack_size: Boolean? - var circuit_stack_control_signal: SignalID - override var valid: Boolean? - override var object_name: String /* "LuaInserterControlBehavior" */ - override fun help(): String -} - -typealias LuaInventory = Array - -external interface LuaItemPrototype { - fun has_flag(flag: String): Boolean? - fun get_ammo_type(ammo_source_type: String /* "default" | "player" | "turret" | "vehicle" */ = definedExternally): AmmoType? - var type: String /* "gun" | "mining-tool" */ - var name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var order: String - var place_result: LuaEntityPrototype? - var place_as_equipment_result: LuaEquipmentPrototype? - var place_as_tile_result: PlaceAsTileResult? - var stackable: Boolean? - var default_request_amount: uint - var stack_size: uint - var wire_count: uint - var fuel_category: String? - var burnt_result: LuaItemPrototype? - var fuel_value: float - var fuel_acceleration_multiplier: double - var fuel_top_speed_multiplier: double - var fuel_emissions_multiplier: double - var subgroup: LuaGroup - var group: LuaGroup - var flags: ItemPrototypeFlags - var rocket_launch_products: Array - var can_be_mod_opened: Boolean? - var magazine_size: float? - var reload_time: float? - var equipment_grid: LuaEquipmentGridPrototype? - var resistances: Record? - var inventory_size_bonus: uint? - var capsule_action: CapsuleAction? - var attack_parameters: dynamic /* ProjectileAttackParameters? | StreamAttackParameters? | OtherAttackParameters? */ - get() = definedExternally - set(value) = definedExternally - var inventory_size: uint? - var item_filters: Record - var item_group_filters: Record - var item_subgroup_filters: Record - var filter_mode: String - var insertion_priority_mode: String - var localised_filter_message: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var extend_inventory_by_default: Boolean? - var default_label_color: ColorTable? - var draw_label_for_cursor_render: Boolean? - var speed: float? - var module_effects: ModuleEffects? - var category: String - var tier: uint - var limitations: Array - var limitation_message_key: String - var straight_rail: LuaEntityPrototype - var curved_rail: LuaEntityPrototype - var repair_result: Array? - var selection_border_color: ColorTable - var alt_selection_border_color: ColorTable - var selection_mode_flags: SelectionModeFlags - var alt_selection_mode_flags: SelectionModeFlags - var selection_cursor_box_type: String - var alt_selection_cursor_box_type: String - var always_include_tiles: Boolean? - var entity_filter_mode: String - var alt_entity_filter_mode: String - var tile_filter_mode: String - var alt_tile_filter_mode: String - var entity_filters: Record - var alt_entity_filters: Record - var entity_type_filters: Record - var alt_entity_type_filters: Record - var tile_filters: Record - var alt_tile_filters: Record - var entity_filter_slots: uint? - var tile_filter_slots: uint? - var durability_description_key: String - var durability: double? - var infinite: Boolean? - var mapper_count: uint? - var valid: Boolean? - var object_name: String /* "LuaItemPrototype" */ - fun help(): String -} - -external interface `T$42` { - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally - var position: Position - var force_build: Boolean? - get() = definedExternally - set(value) = definedExternally - var direction: direction? - get() = definedExternally - set(value) = definedExternally - var skip_fog_of_war: Boolean? - get() = definedExternally - set(value) = definedExternally - var by_player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var raise_built: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$43` { - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var skip_fog_of_war: Boolean? - get() = definedExternally - set(value) = definedExternally - var by_player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$44` { - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var always_include_tiles: Boolean? - get() = definedExternally - set(value) = definedExternally - var include_entities: Boolean? - get() = definedExternally - set(value) = definedExternally - var include_modules: Boolean? - get() = definedExternally - set(value) = definedExternally - var include_station_names: Boolean? - get() = definedExternally - set(value) = definedExternally - var include_trains: Boolean? - get() = definedExternally - set(value) = definedExternally - var include_fuel: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaItemStack { - fun is_blueprint_setup(): Boolean? - fun get_blueprint_entities(): Array - fun set_blueprint_entities(entities: Array) - fun add_ammo(amount: float) - fun drain_ammo(amount: float) - fun add_durability(amount: double) - fun drain_durability(amount: double) - fun can_set_stack(stack: String = definedExternally): Boolean? - fun can_set_stack(): Boolean? - fun can_set_stack(stack: ItemStackDefinition = definedExternally): Boolean? - fun can_set_stack(stack: LuaItemStack = definedExternally): Boolean? - fun set_stack(stack: String = definedExternally): Boolean? - fun set_stack(): Boolean? - fun set_stack(stack: ItemStackDefinition = definedExternally): Boolean? - fun set_stack(stack: LuaItemStack = definedExternally): Boolean? - fun transfer_stack(stack: String): Boolean? - fun transfer_stack(stack: ItemStackDefinition): Boolean? - fun transfer_stack(stack: LuaItemStack): Boolean? - fun export_stack(): String - fun import_stack(data: String): int - fun swap_stack(stack: LuaItemStack): Boolean? - fun clear() - fun get_blueprint_tiles(): Array - fun set_blueprint_tiles(tiles: Array) - fun get_inventory(inventory: inventory): LuaInventory? - fun build_blueprint(params: `T$42`): Array - fun deconstruct_area(params: `T$43`) - fun cancel_deconstruct_area(params: `T$43`) - fun create_blueprint(params: `T$44`): Record - fun get_tag(tag_name: String): dynamic /* String? | Number? | Boolean? | table? */ - fun set_tag(tag_name: String, tag: String): dynamic /* String | Number | Boolean | table */ - fun set_tag(tag_name: String, tag: Number): dynamic /* String | Number | Boolean | table */ - fun set_tag(tag_name: String, tag: Boolean): dynamic /* String | Number | Boolean | table */ - fun set_tag(tag_name: String, tag: table): dynamic /* String | Number | Boolean | table */ - fun remove_tag(tag: String): Boolean? - fun clear_blueprint() - fun get_entity_filter(index: uint): String - fun set_entity_filter(index: uint, filter: String?): Boolean? - fun set_entity_filter(index: uint, filter: LuaEntityPrototype?): Boolean? - fun set_entity_filter(index: uint, filter: LuaEntity?): Boolean? - fun get_tile_filter(index: uint): String - fun set_tile_filter(index: uint, filter: String?): Boolean? - fun set_tile_filter(index: uint, filter: LuaTilePrototype?): Boolean? - fun set_tile_filter(index: uint, filter: LuaTile?): Boolean? - fun clear_deconstruction_item() - fun clear_upgrade_item() - fun get_mapper(index: uint, type: String /* "from" | "to" */): UpgradeFilter - fun set_mapper(index: uint, type: String, filter: UpgradeFilter?) - fun get_blueprint_entity_count(): uint - fun get_blueprint_entity_tags(index: uint): Tags - fun set_blueprint_entity_tags(index: uint, tags: Tags) - fun get_blueprint_entity_tag(index: uint, tag: String): dynamic /* String | Number | Boolean | table */ - fun set_blueprint_entity_tag(index: uint, tag: String, value: String?) - fun set_blueprint_entity_tag(index: uint, tag: String, value: Number?) - fun set_blueprint_entity_tag(index: uint, tag: String, value: Boolean?) - fun set_blueprint_entity_tag(index: uint, tag: String, value: table?) - fun create_grid(): LuaEquipmentGrid - var valid_for_read: Boolean? - var prototype: LuaItemPrototype - var name: String - var type: String - var count: uint - var grid: LuaEquipmentGrid? - var health: float - var durability: double? - var ammo: uint - var blueprint_icons: Array? - var blueprint_snap_to_grid: Position? - var blueprint_position_relative_to_grid: Position? - var blueprint_absolute_snapping: Boolean? - var label: String? - var label_color: dynamic /* ColorTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var allow_manual_label_change: Boolean? - var cost_to_build: Record - var extends_inventory: Boolean? - var prioritize_insertion_mode: String - var default_icons: Array - var tags: Tags - var custom_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var entity_filters: Array - var tile_filters: Array - var entity_filter_mode: entity_filter_mode - var tile_filter_mode: tile_filter_mode - var tile_selection_mode: tile_selection_mode - var trees_and_rocks_only: Boolean? - var entity_filter_count: uint - var tile_filter_count: uint - var active_index: uint? - var item_number: uint? - var connected_entity: LuaEntity? - var is_blueprint: Boolean? - var is_blueprint_book: Boolean? - var is_module: Boolean? - var is_tool: Boolean? - var is_mining_tool: Boolean? - var is_armor: Boolean? - var is_repair_tool: Boolean? - var is_item_with_label: Boolean? - var is_item_with_inventory: Boolean? - var is_item_with_entity_data: Boolean? - var is_selection_tool: Boolean? - var is_item_with_tags: Boolean? - var is_deconstruction_item: Boolean? - var is_upgrade_item: Boolean? - var valid: Boolean? - var object_name: String /* "LuaItemStack" */ - fun help(): String -} - -external interface LuaLampControlBehavior : LuaGenericOnOffControlBehavior { - var use_colors: Boolean? - var color: ColorTable? - override var valid: Boolean? - override var object_name: String /* "LuaLampControlBehavior" */ - override fun help(): String -} - -external interface LuaLazyLoadedValue { - fun get(): T - var valid: Boolean? - var object_name: String /* "LuaLazyLoadedValue" */ - fun help(): String -} - -external interface LuaLogisticCell { - fun is_in_logistic_range(position: Position): Boolean? - fun is_in_construction_range(position: Position): Boolean? - fun is_neighbour_with(other: LuaLogisticCell): Boolean? - var logistic_radius: float - var logistics_connection_distance: float - var construction_radius: float - var stationed_logistic_robot_count: uint - var stationed_construction_robot_count: uint - var mobile: Boolean? - var transmitting: Boolean? - var charge_approach_distance: float - var charging_robot_count: uint - var to_charge_robot_count: uint - var owner: LuaEntity - var logistic_network: LuaLogisticNetwork? - var neighbours: Array - var charging_robots: Array - var to_charge_robots: Array - var valid: Boolean? - var object_name: String /* "LuaLogisticCell" */ - fun help(): String -} - -external interface LuaLogisticContainerControlBehavior : LuaControlBehavior { - var circuit_mode_of_operation: _defines_control_behavior_logistic_container_circuit_mode_of_operation - var valid: Boolean? - var object_name: String /* "LuaLogisticContainerControlBehavior" */ - fun help(): String -} - -external interface `T$45` { - var name: String - var position: Position? - get() = definedExternally - set(value) = definedExternally - var include_buffers: Boolean? - get() = definedExternally - set(value) = definedExternally - var members: String? /* "storage" | "passive-provider" | "buffer" | "active-provider" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$46` { - var stack: dynamic /* String | ItemStackDefinition | LuaItemStack */ - get() = definedExternally - set(value) = definedExternally - var members: String? /* "storage" | "storage-empty" | "storage-empty-slot" | "requester" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaLogisticNetwork { - fun get_item_count(item: String = definedExternally, member: String /* "storage" | "providers" */ = definedExternally): int - fun get_contents(): Record - fun remove_item(item: String, members: String /* "storage" | "passive-provider" | "buffer" | "active-provider" */ = definedExternally): uint - fun remove_item(item: String): uint - fun remove_item(item: ItemStackDefinition, members: String /* "storage" | "passive-provider" | "buffer" | "active-provider" */ = definedExternally): uint - fun remove_item(item: ItemStackDefinition): uint - fun remove_item(item: LuaItemStack, members: String /* "storage" | "passive-provider" | "buffer" | "active-provider" */ = definedExternally): uint - fun remove_item(item: LuaItemStack): uint - fun insert(item: String, members: String /* "storage" | "storage-empty" | "storage-empty-slot" | "requester" */ = definedExternally): uint - fun insert(item: String): uint - fun insert(item: ItemStackDefinition, members: String /* "storage" | "storage-empty" | "storage-empty-slot" | "requester" */ = definedExternally): uint - fun insert(item: ItemStackDefinition): uint - fun insert(item: LuaItemStack, members: String /* "storage" | "storage-empty" | "storage-empty-slot" | "requester" */ = definedExternally): uint - fun insert(item: LuaItemStack): uint - fun find_cell_closest_to(position: Position): LuaLogisticCell? - fun select_pickup_point(params: `T$45`): LuaLogisticPoint? - fun select_drop_point(params: `T$46`): LuaLogisticPoint? - var force: LuaForce - var available_logistic_robots: uint - var all_logistic_robots: uint - var available_construction_robots: uint - var all_construction_robots: uint - var robot_limit: uint - var cells: Array - var providers: Array - var empty_providers: Array - var requesters: Array - var storages: Array - var logistic_members: Array - var provider_points: Array - var passive_provider_points: Array - var active_provider_points: Array - var empty_provider_points: Array - var requester_points: Array - var storage_points: Array - var robots: Array - var construction_robots: Array - var logistic_robots: Array - var valid: Boolean? - var object_name: String /* "LuaLogisticNetwork" */ - fun help(): String -} - -external interface LuaLogisticPoint { - var owner: LuaEntity - var logistic_network: LuaLogisticNetwork - var logistic_member_index: uint - var filters: Array? - var mode: logistic_mode - var force: LuaForce - var targeted_items_pickup: Record - var targeted_items_deliver: Record - var exact: Boolean? - var valid: Boolean? - var object_name: String /* "LuaLogisticPoint" */ - fun help(): String -} - -external interface LuaMiningDrillControlBehavior : LuaGenericOnOffControlBehavior { - var circuit_enable_disable: Boolean? - var circuit_read_resources: Boolean? - var resource_read_mode: resource_read_mode - var resource_read_targets: Array - override var valid: Boolean? - override var object_name: String /* "LuaMiningDrillControlBehavior" */ - override fun help(): String -} - -external interface LuaModSettingPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var mod: String - var setting_type: String - var default_value: dynamic /* Boolean | double | int | String */ - get() = definedExternally - set(value) = definedExternally - var minimum_value: dynamic /* double? | int? */ - get() = definedExternally - set(value) = definedExternally - var maximum_value: dynamic /* double? | int? */ - get() = definedExternally - set(value) = definedExternally - var allowed_values: dynamic /* Array? | Array? | Array? */ - get() = definedExternally - set(value) = definedExternally - var allow_blank: Boolean? - var auto_trim: Boolean? - var hidden: Boolean? - var valid: Boolean? - var object_name: String /* "LuaModSettingPrototype" */ - fun help(): String -} - -external interface LuaModuleCategoryPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaModuleCategoryPrototype" */ - fun help(): String -} - -external interface LuaNamedNoiseExpression { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var intended_property: String - var expression: NoiseExpression - var valid: Boolean? - var object_name: String /* "LuaNamedNoiseExpression" */ - fun help(): String -} - -external interface LuaNoiseLayerPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaNoiseLayerPrototype" */ - fun help(): String -} - -external interface LuaParticlePrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var regular_trigger_effect: TriggerEffectItem - var ended_in_water_trigger_effect: TriggerEffectItem - var render_layer: dynamic /* Number | */ - get() = definedExternally - set(value) = definedExternally - var render_layer_when_on_ground: dynamic /* Number | */ - get() = definedExternally - set(value) = definedExternally - var life_time: uint - var regular_trigger_effect_frequency: uint - var movement_modifier_when_on_ground: float - var movement_modifier: float - var mining_particle_frame_speed: float - var valid: Boolean? - var object_name: String /* "LuaParticlePrototype" */ - fun help(): String -} - -external interface LuaPermissionGroup { - fun add_player(player: uint): Boolean? - fun add_player(player: String): Boolean? - fun add_player(player: LuaPlayer): Boolean? - fun remove_player(player: uint): Boolean? - fun remove_player(player: String): Boolean? - fun remove_player(player: LuaPlayer): Boolean? - fun allows_action(action: input_action): Boolean? - fun set_allows_action(action: input_action, allow_action: Boolean): Boolean? - fun destroy(): Boolean? - var name: String - var players: Array - var group_id: uint - var valid: Boolean? - var object_name: String /* "LuaPermissionGroup" */ - fun help(): String -} - -external interface LuaPermissionGroups { - fun create_group(name: String = definedExternally): LuaPermissionGroup? - fun get_group(group: String): LuaPermissionGroup? - fun get_group(group: uint): LuaPermissionGroup? - var groups: Array - var valid: Boolean? - var object_name: String /* "LuaPermissionGroups" */ - fun help(): String -} - -external interface `T$47` { - var type: controllers - var character: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var waypoints: CutsceneWaypoint? - get() = definedExternally - set(value) = definedExternally - var start_position: Position? - get() = definedExternally - set(value) = definedExternally - var start_zoom: double? - get() = definedExternally - set(value) = definedExternally - var final_transition_time: uint? - get() = definedExternally - set(value) = definedExternally - var chart_mode_cutoff: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$48` { - var position: Position -} - -external interface `T$49` { - var entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var prototype: LuaEntityPrototype? - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var type: alert_type? - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint? | String? | LuaSurface? */ - get() = definedExternally - set(value) = definedExternally - var icon: SignalID? - get() = definedExternally - set(value) = definedExternally - var message: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$50` { - var entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var prototype: LuaEntityPrototype? - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var type: alert_type? - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint? | String? | LuaSurface? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$51` { - var name: String - var position: Position - var direction: direction? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$52` { - var position: Position - var direction: direction? - get() = definedExternally - set(value) = definedExternally - var alt: Boolean? - get() = definedExternally - set(value) = definedExternally - var terrain_building_size: uint? - get() = definedExternally - set(value) = definedExternally - var skip_fog_of_war: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$53` { - var text: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var create_at_cursor: Boolean? - get() = definedExternally - set(value) = definedExternally - var color: dynamic /* ColorTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var speed: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$54` { - var address: String - var name: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var description: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var password: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaPlayer : LuaControl { - fun set_ending_screen_data(message: Any /* JsTuple */, file: String = definedExternally) - fun set_ending_screen_data(message: Any /* JsTuple */) - fun set_ending_screen_data(message: String, file: String = definedExternally) - fun set_ending_screen_data(message: String) - fun set_ending_screen_data(message: Number, file: String = definedExternally) - fun set_ending_screen_data(message: Number) - fun print(message: Any /* JsTuple */, color: ColorTable = definedExternally) - fun print(message: Any /* JsTuple */) - fun print(message: Any /* JsTuple */, color: Any /* JsTuple */ = definedExternally) - fun print(message: String, color: ColorTable = definedExternally) - fun print(message: String) - fun print(message: String, color: Any /* JsTuple */ = definedExternally) - fun print(message: Number, color: ColorTable = definedExternally) - fun print(message: Number) - fun print(message: Number, color: Any /* JsTuple */ = definedExternally) - fun clear_console() - fun get_goal_description(): dynamic /* JsTuple | String | Number */ - fun set_goal_description(text: Any /* JsTuple */ = definedExternally, only_update: Boolean = definedExternally) - fun set_goal_description() - fun set_goal_description(text: Any /* JsTuple */ = definedExternally) - fun set_goal_description(text: String = definedExternally, only_update: Boolean = definedExternally) - fun set_goal_description(text: String = definedExternally) - fun set_goal_description(text: Number = definedExternally, only_update: Boolean = definedExternally) - fun set_goal_description(text: Number = definedExternally) - fun set_controller(params: `T$47`) - fun drag_wire(params: `T$48`): Boolean? - fun disable_recipe_groups() - fun enable_recipe_groups() - fun disable_recipe_subgroups() - fun enable_recipe_subgroups() - fun print_entity_statistics(entities: Array = definedExternally) - fun print_robot_jobs() - fun print_lua_object_statistics() - fun log_active_entity_chunk_counts() - fun log_active_entity_counts() - fun unlock_achievement(name: String) - fun clear_cursor(): Boolean? - fun create_character(character: String = definedExternally): Boolean? - fun add_alert(entity: LuaEntity, type: alert_type) - fun add_custom_alert(entity: LuaEntity, icon: SignalID, message: Any /* JsTuple */, show_on_map: Boolean) - fun add_custom_alert(entity: LuaEntity, icon: SignalID, message: String, show_on_map: Boolean) - fun add_custom_alert(entity: LuaEntity, icon: SignalID, message: Number, show_on_map: Boolean) - fun remove_alert(params: `T$49`) - fun get_alerts(params: `T$50`): Record>> - fun mute_alert(alert_type: alert_type): Boolean? - fun unmute_alert(alert_type: alert_type): Boolean? - fun is_alert_muted(alert_type: alert_type): Boolean? - fun enable_alert(alert_type: alert_type): Boolean? - fun disable_alert(alert_type: alert_type): Boolean? - fun is_alert_enabled(alert_type: alert_type): Boolean? - fun pipette_entity(entity: String): Boolean? - fun pipette_entity(entity: LuaEntity): Boolean? - fun pipette_entity(entity: LuaEntityPrototype): Boolean? - fun can_place_entity(params: `T$51`): Boolean? - fun can_build_from_cursor(params: `T$52`): Boolean? - fun build_from_cursor(params: `T$52`) - fun use_from_cursor(position: Position) - fun play_sound(params: `T$34`) - fun get_associated_characters(): Array - fun associate_character(character: LuaEntity) - fun disassociate_character(character: LuaEntity) - fun create_local_flying_text(params: `T$53`) - fun get_quick_bar_slot(index: uint): LuaItemPrototype? - fun set_quick_bar_slot(index: uint, filter: String?) - fun set_quick_bar_slot(index: uint, filter: LuaItemPrototype?) - fun set_quick_bar_slot(index: uint, filter: LuaItemStack?) - fun get_active_quick_bar_page(index: uint): uint8? - fun set_active_quick_bar_page(screen_index: uint, page_index: uint) - fun jump_to_cutscene_waypoint(waypoint_index: uint) - fun exit_cutscene() - fun open_map(position: Position, scale: double = definedExternally) - fun zoom_to_world(position: Position, scale: double = definedExternally) - fun close_map() - fun is_shortcut_toggled(prototype_name: String): Boolean? - fun is_shortcut_available(prototype_name: String): Boolean? - fun set_shortcut_toggled(prototype_name: String, toggled: Boolean) - fun set_shortcut_available(prototype_name: String, available: Boolean) - fun connect_to_server(params: `T$54`) - fun toggle_map_editor() - fun request_translation(localised_string: Any /* JsTuple */): Boolean? - fun request_translation(localised_string: String): Boolean? - fun request_translation(localised_string: Number): Boolean? - fun get_infinity_inventory_filter(index: uint): InfinityInventoryFilter? - fun set_infinity_inventory_filter(index: uint, filter: InfinityInventoryFilter?) - fun clear_recipe_notifications() - fun add_recipe_notification(recipe: String) - fun add_to_clipboard(blueprint: LuaItemStack) - fun activate_paste() - fun start_selection(position: Position, selection_mode: String) - fun clear_selection() - var character: LuaEntity? - var cutscene_character: LuaEntity? - var index: uint - var gui: LuaGui - var opened_self: Boolean? - var controller_type: controllers - var stashed_controller_type: controllers? - var game_view_settings: GameViewSettings - var minimap_enabled: Boolean? - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var chat_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var name: String - var tag: String - var connected: Boolean? - var admin: Boolean? - var entity_copy_source: LuaEntity? - var afk_time: uint - var online_time: uint - var last_online: uint - var permission_group: LuaPermissionGroup? - var mod_settings: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var ticks_to_respawn: uint? - var display_resolution: DisplayResolution - var display_scale: double - var blueprint_to_setup: LuaItemStack - var render_mode: render_mode - var spectator: Boolean? - var remove_unfiltered_items: Boolean? - var infinity_inventory_filters: Array - var auto_sort_main_inventory: Boolean? - var hand_location: ItemStackLocation -} - -external interface LuaProfiler { - fun reset() - fun stop() - fun restart() - fun add(other: LuaProfiler) - fun divide(number: double) - var valid: Boolean? - var object_name: String /* "LuaProfiler" */ - fun help(): String -} - -external interface LuaProgrammableSpeakerControlBehavior : LuaControlBehavior { - var circuit_parameters: ProgrammableSpeakerCircuitParameters - var circuit_condition: CircuitConditionDefinition - var valid: Boolean? - var object_name: String /* "LuaProgrammableSpeakerControlBehavior" */ - fun help(): String -} - -external interface LuaRCON { - fun print(message: Any /* JsTuple */) - fun print(message: String) - fun print(message: Number) - var object_name: String /* "LuaRCON" */ -} - -external interface LuaRailChainSignalControlBehavior : LuaControlBehavior { - var red_signal: SignalID - var orange_signal: SignalID - var green_signal: SignalID - var blue_signal: SignalID - var valid: Boolean? - var object_name: String /* "LuaRailChainSignalControlBehavior" */ - fun help(): String -} - -external interface LuaRailPath { - var size: uint - var current: uint - var total_distance: double - var travelled_distance: double - var rails: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var valid: Boolean? - var object_name: String /* "LuaRailPath" */ - fun help(): String -} - -external interface LuaRailSignalControlBehavior : LuaControlBehavior { - var red_signal: SignalID - var orange_signal: SignalID - var green_signal: SignalID - var close_signal: Boolean? - var read_signal: Boolean? - var circuit_condition: CircuitConditionDefinition - var valid: Boolean? - var object_name: String /* "LuaRailSignalControlBehavior" */ - fun help(): String -} - -external interface LuaRandomGenerator { - fun re_seed(seed: uint) - @nativeInvoke - operator fun invoke(lower: int = definedExternally, upper: int = definedExternally): double - var valid: Boolean? - var object_name: String /* "LuaRandomGenerator" */ - fun help(): String -} - -external interface LuaRecipe { - fun reload() - var name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var prototype: LuaRecipePrototype - var enabled: Boolean? - var category: String - var ingredients: Array - var products: Array - var hidden: Boolean? - var hidden_from_flow_stats: Boolean? - var energy: double - var order: String - var group: LuaGroup - var subgroup: LuaGroup - var force: LuaForce - var valid: Boolean? - var object_name: String /* "LuaRecipe" */ - fun help(): String -} - -external interface LuaRecipeCategoryPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaRecipeCategoryPrototype" */ - fun help(): String -} - -external interface LuaRecipePrototype { - var enabled: Boolean? - var name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var category: String - var ingredients: Array - var products: Array - var main_product: dynamic /* FluidProduct? | OtherProduct? */ - get() = definedExternally - set(value) = definedExternally - var hidden: Boolean? - var hidden_from_flow_stats: Boolean? - var hidden_from_player_crafting: Boolean? - var always_show_made_in: Boolean? - var energy: double - var order: String - var group: LuaGroup - var subgroup: LuaGroup - var request_paste_multiplier: uint - var overload_multiplier: uint - var allow_inserter_overload: Boolean? - var allow_as_intermediate: Boolean? - var allow_intermediates: Boolean? - var show_amount_in_title: Boolean? - var always_show_products: Boolean? - var emissions_multiplier: double - var allow_decomposition: Boolean? - var unlock_results: Boolean? - var valid: Boolean? - var object_name: String /* "LuaRecipePrototype" */ - fun help(): String -} - -external interface LuaRemote { - fun add_interface(name: String, functions: Record Unit>) - fun remove_interface(name: String): Boolean? - fun call(_interface: String, _function: String, vararg args: Any): Any - var interfaces: Record> - var object_name: String /* "LuaRemote" */ -} - -external interface `T$55` { - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var width: float - var gap_length: double? - get() = definedExternally - set(value) = definedExternally - var dash_length: double? - get() = definedExternally - set(value) = definedExternally - var from: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var from_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var to: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var to_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var draw_on_ground: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$56` { - var text: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var target: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var scale: double? - get() = definedExternally - set(value) = definedExternally - var font: String? - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var draw_on_ground: Boolean? - get() = definedExternally - set(value) = definedExternally - var orientation: RealOrientation? - get() = definedExternally - set(value) = definedExternally - var alignment: String? /* "left" | "right" | "center" */ - get() = definedExternally - set(value) = definedExternally - var vertical_alignment: String? /* "top" | "middle" | "baseline" | "bottom" */ - get() = definedExternally - set(value) = definedExternally - var scale_with_zoom: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$57` { - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var radius: double - var width: float? - get() = definedExternally - set(value) = definedExternally - var filled: Boolean? - var target: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var draw_on_ground: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$58` { - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var width: float? - get() = definedExternally - set(value) = definedExternally - var filled: Boolean? - var left_top: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var left_top_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var right_bottom: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var right_bottom_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var draw_on_ground: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$59` { - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var max_radius: double - var min_radius: double - var start_angle: float - var angle: float - var target: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var draw_on_ground: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$60` { - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var vertices: Array - var target: dynamic /* Position? | LuaEntity? */ - get() = definedExternally - set(value) = definedExternally - var target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var orientation: RealOrientation? - get() = definedExternally - set(value) = definedExternally - var orientation_target: dynamic /* Position? | LuaEntity? */ - get() = definedExternally - set(value) = definedExternally - var orientation_target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var draw_on_ground: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$61` { - var sprite: dynamic /* String | */ - get() = definedExternally - set(value) = definedExternally - var orientation: RealOrientation? - get() = definedExternally - set(value) = definedExternally - var x_scale: double? - get() = definedExternally - set(value) = definedExternally - var y_scale: double? - get() = definedExternally - set(value) = definedExternally - var tint: dynamic /* ColorTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var render_layer: dynamic /* Number? | ? */ - get() = definedExternally - set(value) = definedExternally - var orientation_target: dynamic /* Position? | LuaEntity? */ - get() = definedExternally - set(value) = definedExternally - var orientation_target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var oriented_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var target: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$62` { - var sprite: dynamic /* String | */ - get() = definedExternally - set(value) = definedExternally - var orientation: RealOrientation? - get() = definedExternally - set(value) = definedExternally - var scale: float? - get() = definedExternally - set(value) = definedExternally - var intensity: float? - get() = definedExternally - set(value) = definedExternally - var minimum_darkness: float? - get() = definedExternally - set(value) = definedExternally - var oriented: Boolean? - get() = definedExternally - set(value) = definedExternally - var color: dynamic /* ColorTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var target: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$63` { - var animation: String - var orientation: RealOrientation? - get() = definedExternally - set(value) = definedExternally - var x_scale: double? - get() = definedExternally - set(value) = definedExternally - var y_scale: double? - get() = definedExternally - set(value) = definedExternally - var tint: dynamic /* ColorTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var render_layer: dynamic /* Number? | ? */ - get() = definedExternally - set(value) = definedExternally - var animation_speed: double? - get() = definedExternally - set(value) = definedExternally - var animation_offset: double? - get() = definedExternally - set(value) = definedExternally - var orientation_target: dynamic /* Position? | LuaEntity? */ - get() = definedExternally - set(value) = definedExternally - var orientation_target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var oriented_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var target: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var surface: dynamic /* uint | String | LuaSurface */ - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally - var forces: Array? - get() = definedExternally - set(value) = definedExternally - var players: Array? - get() = definedExternally - set(value) = definedExternally - var visible: Boolean? - get() = definedExternally - set(value) = definedExternally - var only_in_alt_mode: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaRendering { - fun draw_line(params: `T$55`): uint64 - fun draw_text(params: `T$56`): uint64 - fun draw_circle(params: `T$57`): uint64 - fun draw_rectangle(params: `T$58`): uint64 - fun draw_arc(params: `T$59`): uint64 - fun draw_polygon(params: `T$60`): uint64 - fun draw_sprite(params: `T$61`): uint64 - fun draw_light(params: `T$62`): uint64 - fun draw_animation(params: `T$63`): uint64 - fun destroy(id: uint64) - fun is_font_valid(font_name: String): Boolean? - fun is_valid(id: uint64): Boolean? - fun get_all_ids(mod_name: String = definedExternally): Array - fun clear(mod_name: String = definedExternally) - fun get_type(id: uint64): String /* "text" | "line" | "circle" | "rectangle" | "arc" | "polygon" | "sprite" | "light" | "animation" */ - fun bring_to_front(id: uint64) - fun get_surface(id: uint64): LuaSurface - fun get_time_to_live(id: uint64): uint - fun set_time_to_live(id: uint64, time_to_live: uint) - fun get_forces(id: uint64): Array? - fun set_forces(id: uint64, forces: Array) - fun get_players(id: uint64): Array? - fun set_players(id: uint64, players: Array) - fun get_visible(id: uint64): Boolean? - fun set_visible(id: uint64, visible: Boolean) - fun get_draw_on_ground(id: uint64): Boolean? - fun set_draw_on_ground(id: uint64, draw_on_ground: Boolean) - fun get_only_in_alt_mode(id: uint64): Boolean? - fun set_only_in_alt_mode(id: uint64, only_in_alt_mode: Boolean) - fun get_color(id: uint64): ColorTable? - fun set_color(id: uint64, color: ColorTable) - fun set_color(id: uint64, color: Any /* JsTuple */) - fun get_width(id: uint64): float? - fun set_width(id: uint64, width: float) - fun get_from(id: uint64): ScriptRenderTarget? - fun set_from(id: uint64, from: Position, from_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_from(id: uint64, from: Position) - fun set_from(id: uint64, from: LuaEntity, from_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_from(id: uint64, from: LuaEntity) - fun get_to(id: uint64): ScriptRenderTarget? - fun set_to(id: uint64, to: Position, to_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_to(id: uint64, to: Position) - fun set_to(id: uint64, to: LuaEntity, to_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_to(id: uint64, to: LuaEntity) - fun get_dash_length(id: uint64): double? - fun set_dash_length(id: uint64, dash_length: double) - fun get_gap_length(id: uint64): double? - fun set_gap_length(id: uint64, gap_length: double) - fun set_dashes(id: uint64, dash_length: double, gap_length: double) - fun get_target(id: uint64): ScriptRenderTarget? - fun set_target(id: uint64, target: Position, target_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_target(id: uint64, target: Position) - fun set_target(id: uint64, target: LuaEntity, target_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_target(id: uint64, target: LuaEntity) - fun get_orientation(id: uint64): RealOrientation? - fun set_orientation(id: uint64, orientation: RealOrientation) - fun get_scale(id: uint64): double? - fun set_scale(id: uint64, scale: double) - fun get_text(id: uint64): dynamic /* JsTuple | String? | Number? */ - fun set_text(id: uint64, text: Any /* JsTuple */) - fun set_text(id: uint64, text: String) - fun set_text(id: uint64, text: Number) - fun get_font(id: uint64): String? - fun set_font(id: uint64, font: String) - fun get_alignment(id: uint64): String? - fun set_alignment(id: uint64, alignment: String /* "left" | "right" | "center" */) - fun get_vertical_alignment(id: uint64): String? - fun set_vertical_alignment(id: uint64, alignment: String /* "top" | "middle" | "baseline" | "bottom" */) - fun get_scale_with_zoom(id: uint64): Boolean? - fun set_scale_with_zoom(id: uint64, scale_with_zoom: Boolean) - fun get_filled(id: uint64): Boolean? - fun set_filled(id: uint64, filled: Boolean) - fun get_radius(id: uint64): double? - fun set_radius(id: uint64, radius: double) - fun get_left_top(id: uint64): ScriptRenderTarget? - fun set_left_top(id: uint64, left_top: Position, left_top_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_left_top(id: uint64, left_top: Position) - fun set_left_top(id: uint64, left_top: LuaEntity, left_top_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_left_top(id: uint64, left_top: LuaEntity) - fun get_right_bottom(id: uint64): ScriptRenderTarget? - fun set_right_bottom(id: uint64, right_bottom: Position, right_bottom_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_right_bottom(id: uint64, right_bottom: Position) - fun set_right_bottom(id: uint64, right_bottom: LuaEntity, right_bottom_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_right_bottom(id: uint64, right_bottom: LuaEntity) - fun set_corners(id: uint64, left_top: Position, left_top_offset: dynamic /* typealias Vector = dynamic */, right_bottom: Position, right_bottom_offset: dynamic /* typealias Vector = dynamic */) - fun set_corners(id: uint64, left_top: Position, left_top_offset: dynamic /* typealias Vector = dynamic */, right_bottom: LuaEntity, right_bottom_offset: dynamic /* typealias Vector = dynamic */) - fun set_corners(id: uint64, left_top: LuaEntity, left_top_offset: dynamic /* typealias Vector = dynamic */, right_bottom: Position, right_bottom_offset: dynamic /* typealias Vector = dynamic */) - fun set_corners(id: uint64, left_top: LuaEntity, left_top_offset: dynamic /* typealias Vector = dynamic */, right_bottom: LuaEntity, right_bottom_offset: dynamic /* typealias Vector = dynamic */) - fun get_max_radius(id: uint64): double? - fun set_max_radius(id: uint64, max_radius: double) - fun get_min_radius(id: uint64): double? - fun set_min_radius(id: uint64, min_radius: double) - fun get_start_angle(id: uint64): float? - fun set_start_angle(id: uint64, start_angle: float) - fun get_angle(id: uint64): float? - fun set_angle(id: uint64, angle: float) - fun get_vertices(id: uint64): Array? - fun set_vertices(id: uint64, vertices: Array) - fun get_sprite(id: uint64): dynamic /* String? | ? */ - fun set_sprite(id: uint64, sprite: String) -// fun set_sprite(id: uint64, sprite: ) - fun get_x_scale(id: uint64): double? - fun set_x_scale(id: uint64, x_scale: double) - fun get_y_scale(id: uint64): double? - fun set_y_scale(id: uint64, y_scale: double) - fun get_render_layer(id: uint64): dynamic /* Number? | ? */ - fun set_render_layer(id: uint64, render_layer: Number) - fun set_render_layer(id: uint64, render_layer: String) - fun get_orientation_target(id: uint64): ScriptRenderTarget? - fun set_orientation_target(id: uint64, orientation_target: Position, orientation_target_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_orientation_target(id: uint64, orientation_target: Position) - fun set_orientation_target(id: uint64, orientation_target: LuaEntity, orientation_target_offset: dynamic /* typealias Vector = dynamic */ = definedExternally) - fun set_orientation_target(id: uint64, orientation_target: LuaEntity) - fun get_oriented_offset(id: uint64): dynamic /* typealias Vector = dynamic */ - fun set_oriented_offset(id: uint64, oriented_offset: dynamic /* typealias Vector = dynamic */) - fun get_intensity(id: uint64): float? - fun set_intensity(id: uint64, intensity: float) - fun get_minimum_darkness(id: uint64): float? - fun set_minimum_darkness(id: uint64, minimum_darkness: float) - fun get_oriented(id: uint64): Boolean? - fun set_oriented(id: uint64, oriented: Boolean) - fun get_animation(id: uint64): String? - fun set_animation(id: uint64, animation: String) - fun get_animation_speed(id: uint64): double? - fun set_animation_speed(id: uint64, animation_speed: double) - fun get_animation_offset(id: uint64): double? - fun set_animation_offset(id: uint64, animation_offset: double) - var object_name: String /* "LuaRendering" */ -} - -external interface LuaResourceCategoryPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaResourceCategoryPrototype" */ - fun help(): String -} - -external interface LuaRoboportControlBehavior : LuaControlBehavior { - var read_logistics: Boolean? - var read_robot_stats: Boolean? - var available_logistic_output_signal: SignalID - var total_logistic_output_signal: SignalID - var available_construction_output_signal: SignalID - var total_construction_output_signal: SignalID - var valid: Boolean? - var object_name: String /* "LuaRoboportControlBehavior" */ - fun help(): String -} - -external interface LuaSettings { - fun get_player_settings(player: uint): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_player_settings(player: String): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - fun get_player_settings(player: LuaPlayer): LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var startup: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var global: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var player: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var object_name: String /* "LuaSettings" */ -} - -external interface LuaShortcutPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var action: String - var item_to_spawn: LuaItemPrototype - var technology_to_unlock: LuaTechnologyPrototype - var toggleable: Boolean? - var associated_control_input: String - var valid: Boolean? - var object_name: String /* "LuaShortcutPrototype" */ - fun help(): String -} - -external interface LuaStorageTankControlBehavior : LuaControlBehavior { - var valid: Boolean? - var object_name: String /* "LuaStorageTankControlBehavior" */ - fun help(): String -} - -external interface LuaStyle { - var gui: LuaGui - var name: String - var minimal_width: int - var maximal_width: int - var minimal_height: int - var maximal_height: int - var natural_width: int - var natural_height: int - var top_padding: int - var right_padding: int - var bottom_padding: int - var left_padding: int - var top_margin: int - var right_margin: int - var bottom_margin: int - var left_margin: int - var horizontal_align: String /* "left" | "center" | "right" */ - var vertical_align: String /* "top" | "center" | "bottom" */ - var font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var font: String - var top_cell_padding: int - var right_cell_padding: int - var bottom_cell_padding: int - var left_cell_padding: int - var horizontally_stretchable: Boolean? - var vertically_stretchable: Boolean? - var horizontally_squashable: Boolean? - var vertically_squashable: Boolean? - var rich_text_setting: rich_text_setting - var hovered_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var clicked_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var disabled_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var pie_progress_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var clicked_vertical_offset: int - var selected_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var selected_hovered_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var selected_clicked_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var strikethrough_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var horizontal_spacing: int - var vertical_spacing: int - var use_header_filler: Boolean? - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var column_alignments: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */ - var single_line: Boolean? - var extra_top_padding_when_activated: int - var extra_bottom_padding_when_activated: int - var extra_left_padding_when_activated: int - var extra_right_padding_when_activated: int - var extra_top_margin_when_activated: int - var extra_bottom_margin_when_activated: int - var extra_left_margin_when_activated: int - var extra_right_margin_when_activated: int - var stretch_image_to_widget_size: Boolean? - var badge_font: String - var badge_horizontal_spacing: int - var default_badge_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var selected_badge_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var disabled_badge_font_color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally -} - -external interface BaseSurfaceCreateEntity { - var name: String - var position: Position - var direction: direction? - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally - var target: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var source: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var fast_replace: Boolean? - get() = definedExternally - set(value) = definedExternally - var player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var spill: Boolean? - get() = definedExternally - set(value) = definedExternally - var raise_built: Boolean? - get() = definedExternally - set(value) = definedExternally - var create_build_effect_smoke: Boolean? - get() = definedExternally - set(value) = definedExternally - var spawn_decorations: Boolean? - get() = definedExternally - set(value) = definedExternally - var move_stuck_players: Boolean? - get() = definedExternally - set(value) = definedExternally - var item: LuaItemStack? - get() = definedExternally - set(value) = definedExternally -} - -external interface AssemblingMachineSurfaceCreateEntity : BaseSurfaceCreateEntity { - var recipe: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface BeamSurfaceCreateEntity : BaseSurfaceCreateEntity { - var target_position: Position? - get() = definedExternally - set(value) = definedExternally - var source_position: Position? - get() = definedExternally - set(value) = definedExternally - var max_length: uint? - get() = definedExternally - set(value) = definedExternally - var duration: uint? - get() = definedExternally - set(value) = definedExternally - var source_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ContainerSurfaceCreateEntity : BaseSurfaceCreateEntity { - var bar: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface CliffSurfaceCreateEntity : BaseSurfaceCreateEntity { - var cliff_orientation: String? /* "west-to-east" | "north-to-south" | "east-to-west" | "south-to-north" | "west-to-north" | "north-to-east" | "east-to-south" | "south-to-west" | "west-to-south" | "north-to-west" | "east-to-north" | "south-to-east" | "west-to-none" | "none-to-east" | "east-to-none" | "none-to-west" | "north-to-none" | "none-to-south" | "south-to-none" | "none-to-north" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FlyingTextSurfaceCreateEntity : BaseSurfaceCreateEntity { - var text: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var color: dynamic /* ColorTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var render_player_index: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface EntityGhostSurfaceCreateEntity : BaseSurfaceCreateEntity { - var inner_name: String - var expires: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface FireSurfaceCreateEntity : BaseSurfaceCreateEntity { - var initial_ground_flame_count: uint8? - get() = definedExternally - set(value) = definedExternally -} - -external interface InserterSurfaceCreateEntity : BaseSurfaceCreateEntity { - var conditions: InserterCircuitConditions - var filters: Array -} - -external interface ItemEntitySurfaceCreateEntity : BaseSurfaceCreateEntity { - var stack: dynamic /* String | ItemStackDefinition */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ItemRequestProxySurfaceCreateEntity : BaseSurfaceCreateEntity { - var modules: Record -} - -external interface RollingStockSurfaceCreateEntity : BaseSurfaceCreateEntity { - var orientation: RealOrientation? - get() = definedExternally - set(value) = definedExternally - var color: dynamic /* ColorTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally -} - -external interface LocomotiveSurfaceCreateEntity : BaseSurfaceCreateEntity { - var snap_to_train_stop: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface LogisticContainerSurfaceCreateEntity : BaseSurfaceCreateEntity { - var request_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface ParticleSurfaceCreateEntity : BaseSurfaceCreateEntity { - var movement: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var height: float - var vertical_speed: float - var frame_speed: float -} - -external interface ArtilleryFlareSurfaceCreateEntity : BaseSurfaceCreateEntity { - var movement: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var height: float - var vertical_speed: float - var frame_speed: float -} - -external interface ProjectileSurfaceCreateEntity : BaseSurfaceCreateEntity { - var speed: double - var max_range: double -} - -external interface ResourceSurfaceCreateEntity : BaseSurfaceCreateEntity { - var amount: uint - var enable_tree_removal: Boolean? - get() = definedExternally - set(value) = definedExternally - var enable_cliff_removal: Boolean? - get() = definedExternally - set(value) = definedExternally - var snap_to_tile_center: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface UndergroundBeltSurfaceCreateEntity : BaseSurfaceCreateEntity { - var type: String? /* "output" | "input" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ProgrammableSpeakerSurfaceCreateEntity : BaseSurfaceCreateEntity { - var parameters: ProgrammableSpeakerParameters? - get() = definedExternally - set(value) = definedExternally - var alert_parameters: ProgrammableSpeakerAlertParameters? - get() = definedExternally - set(value) = definedExternally -} - -external interface CharacterCorpseSurfaceCreateEntity : BaseSurfaceCreateEntity { - var inventory_size: uint? - get() = definedExternally - set(value) = definedExternally - var player_index: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface HighlightBoxSurfaceCreateEntity : BaseSurfaceCreateEntity { - var bounding_box: dynamic /* BoundingBoxTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var box_type: String? /* "entity" | "not-allowed" | "electricity" | "pair" | "copy" | "train-visualization" | "logistics" | "blueprint-snap-rectangle" */ - get() = definedExternally - set(value) = definedExternally - var render_player_index: uint? - get() = definedExternally - set(value) = definedExternally - var blink_interval: uint? - get() = definedExternally - set(value) = definedExternally - var time_to_live: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface SpeechBubbleSurfaceCreateEntity : BaseSurfaceCreateEntity { - var text: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var lifetime: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface SimpleEntityWithOwnerSurfaceCreateEntity : BaseSurfaceCreateEntity { - var render_player_index: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface SimpleEntityWithForceSurfaceCreateEntity : BaseSurfaceCreateEntity { - var render_player_index: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$64` { - var name: String - var position: Position - var direction: direction? - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally - var build_check_type: build_check_type? - get() = definedExternally - set(value) = definedExternally - var forced: Boolean? - get() = definedExternally - set(value) = definedExternally - var inner_name: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$65` { - var name: String - var position: Position - var direction: direction? - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$66` { - var area: dynamic /* BoundingBoxTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var radius: double? - get() = definedExternally - set(value) = definedExternally - var name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var type: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var ghost_name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var ghost_type: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var direction: dynamic /* defines.direction? | Array? */ - get() = definedExternally - set(value) = definedExternally - var collision_mask: dynamic /* "ground-tile" | "water-tile" | "resource-layer" | "doodad-layer" | "floor-layer" | "item-layer" | "ghost-layer" | "object-layer" | "player-layer" | "train-layer" | "rail-layer" | "transport-belt-layer" | "not-setup" | ? | Array? */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String? | LuaForce? | Array? */ - get() = definedExternally - set(value) = definedExternally - var to_be_deconstructed: Boolean? - get() = definedExternally - set(value) = definedExternally - var to_be_upgraded: Boolean? - get() = definedExternally - set(value) = definedExternally - var limit: uint? - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$67` { - var area: dynamic /* BoundingBoxTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var radius: double? - get() = definedExternally - set(value) = definedExternally - var name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var limit: uint? - get() = definedExternally - set(value) = definedExternally - var has_hidden_tile: Boolean? - get() = definedExternally - set(value) = definedExternally - var collision_mask: dynamic /* "ground-tile" | "water-tile" | "resource-layer" | "doodad-layer" | "floor-layer" | "item-layer" | "ghost-layer" | "object-layer" | "player-layer" | "train-layer" | "rail-layer" | "transport-belt-layer" | "not-setup" | ? | Array? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$68` { - var area: dynamic /* BoundingBoxTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var radius: double? - get() = definedExternally - set(value) = definedExternally - var name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var type: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var ghost_name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var ghost_type: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var direction: dynamic /* defines.direction? | Array? */ - get() = definedExternally - set(value) = definedExternally - var collision_mask: dynamic /* "ground-tile" | "water-tile" | "resource-layer" | "doodad-layer" | "floor-layer" | "item-layer" | "ghost-layer" | "object-layer" | "player-layer" | "train-layer" | "rail-layer" | "transport-belt-layer" | "not-setup" | ? | Array? */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String? | LuaForce? | Array? */ - get() = definedExternally - set(value) = definedExternally - var to_be_deconstructed: Boolean? - get() = definedExternally - set(value) = definedExternally - var to_be_upgraded: Boolean? - get() = definedExternally - set(value) = definedExternally - var limit: uint? - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$69` { - var area: dynamic /* BoundingBoxTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var radius: double? - get() = definedExternally - set(value) = definedExternally - var name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var limit: uint? - get() = definedExternally - set(value) = definedExternally - var has_hidden_tile: Boolean? - get() = definedExternally - set(value) = definedExternally - var collision_mask: dynamic /* "ground-tile" | "water-tile" | "resource-layer" | "doodad-layer" | "floor-layer" | "item-layer" | "ghost-layer" | "object-layer" | "player-layer" | "train-layer" | "rail-layer" | "transport-belt-layer" | "not-setup" | ? | Array? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$70` { - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* LuaForce | String */ - get() = definedExternally - set(value) = definedExternally - var condition: String /* "all" | "enemy" | "ally" | "friend" | "not-friend" | "same" | "not-same" */ -} - -external interface `T$71` { - var position: Position - var max_distance: double - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$72` { - var command: dynamic /* AttackCommand | GoToLocationCommand | CompoundCommand | GroupCommand | AttackAreaCommand | WanderCommand | StopCommand | FleeCommand | BuildBaseCommand */ - get() = definedExternally - set(value) = definedExternally - var unit_count: uint - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally - var unit_search_distance: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$73` { - var name: String - var position: Position -} - -external interface `T$74` { - var name: String - var position: Position - var movement: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var height: float - var vertical_speed: float - var frame_speed: float -} - -external interface `T$75` { - var position: Position - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$76` { - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally - var player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var skip_fog_of_war: Boolean? - get() = definedExternally - set(value) = definedExternally - var item: LuaItemStack? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$77` { - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally - var player: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally - var skip_fog_of_war: Boolean? - get() = definedExternally - set(value) = definedExternally - var item: LuaItemStack -} - -external interface `T$78` { - var area: dynamic /* BoundingBoxTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var position: dynamic /* TilePositionTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var name: dynamic /* String? | Array? | LuaDecorativePrototype? | Array? */ - get() = definedExternally - set(value) = definedExternally - var limit: uint? - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$79` { - var check_collision: Boolean? - get() = definedExternally - set(value) = definedExternally - var decoratives: Array -} - -external interface `T$80` { - var area: dynamic /* BoundingBoxTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var position: dynamic /* TilePositionTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var name: dynamic /* String? | Array? | LuaDecorativePrototype? | Array? */ - get() = definedExternally - set(value) = definedExternally - var limit: uint? - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$81` { - var source_area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var destination_area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var destination_surface: dynamic /* uint? | String? | LuaSurface? */ - get() = definedExternally - set(value) = definedExternally - var destination_force: dynamic /* LuaForce? | String? */ - get() = definedExternally - set(value) = definedExternally - var clone_tiles: Boolean? - get() = definedExternally - set(value) = definedExternally - var clone_entities: Boolean? - get() = definedExternally - set(value) = definedExternally - var clone_decoratives: Boolean? - get() = definedExternally - set(value) = definedExternally - var clear_destination_entities: Boolean? - get() = definedExternally - set(value) = definedExternally - var clear_destination_decoratives: Boolean? - get() = definedExternally - set(value) = definedExternally - var expand_map: Boolean? - get() = definedExternally - set(value) = definedExternally - var create_build_effect_smoke: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$82` { - var source_offset: dynamic /* TilePositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var destination_offset: dynamic /* TilePositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var source_positions: Array */> - var destination_surface: dynamic /* uint? | String? | LuaSurface? */ - get() = definedExternally - set(value) = definedExternally - var destination_force: dynamic /* LuaForce? | String? */ - get() = definedExternally - set(value) = definedExternally - var clone_tiles: Boolean? - get() = definedExternally - set(value) = definedExternally - var clone_entities: Boolean? - get() = definedExternally - set(value) = definedExternally - var clone_decoratives: Boolean? - get() = definedExternally - set(value) = definedExternally - var clear_destination_entities: Boolean? - get() = definedExternally - set(value) = definedExternally - var clear_destination_decoratives: Boolean? - get() = definedExternally - set(value) = definedExternally - var expand_map: Boolean? - get() = definedExternally - set(value) = definedExternally - var manual_collision_mode: Boolean? - get() = definedExternally - set(value) = definedExternally - var create_build_effect_smoke: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$83` { - var entities: Array - var destination_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var destination_surface: dynamic /* uint? | String? | LuaSurface? */ - get() = definedExternally - set(value) = definedExternally - var destination_force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally - var snap_to_grid: Boolean? - get() = definedExternally - set(value) = definedExternally - var create_build_effect_smoke: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$84` { - var bounding_box: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var collision_mask: dynamic /* CollisionMask | Array */ - get() = definedExternally - set(value) = definedExternally - var start: Position - var goal: Position - var force: dynamic /* String | LuaForce */ - get() = definedExternally - set(value) = definedExternally - var radius: double? - get() = definedExternally - set(value) = definedExternally - var pathfind_flags: PathfinderFlags? - get() = definedExternally - set(value) = definedExternally - var can_open_gates: Boolean? - get() = definedExternally - set(value) = definedExternally - var path_resolution_modifier: int? - get() = definedExternally - set(value) = definedExternally - var entity_to_ignore: LuaEntity? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$85` { - var name: dynamic /* String? | Array? */ - get() = definedExternally - set(value) = definedExternally - var force: dynamic /* String? | LuaForce? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaSurface { - fun get_pollution(position: Position): double - fun can_place_entity(params: `T$64`): Boolean? - fun can_fast_replace(params: `T$65`): Boolean? - fun find_entity(entity: String, position: Position): LuaEntity? - fun find_entities(area: BoundingBoxTable = definedExternally): Array - fun find_entities(): Array - fun find_entities(area: Any /* JsTuple */ = definedExternally): Array - fun find_entities_filtered(params: `T$66`): Array - fun find_tiles_filtered(params: `T$67`): Array - fun count_entities_filtered(params: `T$68`): uint - fun count_tiles_filtered(params: `T$69`): uint - fun find_non_colliding_position(name: String, center: Position, radius: double, precision: double, force_to_tile_center: Boolean = definedExternally): PositionTable? - fun find_non_colliding_position_in_box(name: String, search_space: BoundingBoxTable, precision: double, force_to_tile_center: Boolean = definedExternally): PositionTable? - fun find_non_colliding_position_in_box(name: String, search_space: BoundingBoxTable, precision: double): PositionTable? - fun find_non_colliding_position_in_box(name: String, search_space: Any /* JsTuple */, precision: double, force_to_tile_center: Boolean = definedExternally): PositionTable? - fun find_non_colliding_position_in_box(name: String, search_space: Any /* JsTuple */, precision: double): PositionTable? - fun spill_item_stack(position: Position, items: String, enable_looted: Boolean = definedExternally, force: LuaForce = definedExternally, allow_belts: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: String): Array - fun spill_item_stack(position: Position, items: String, enable_looted: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: String, enable_looted: Boolean = definedExternally, force: LuaForce = definedExternally): Array - fun spill_item_stack(position: Position, items: String, enable_looted: Boolean = definedExternally, force: String = definedExternally, allow_belts: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: String, enable_looted: Boolean = definedExternally, force: String = definedExternally): Array - fun spill_item_stack(position: Position, items: ItemStackDefinition, enable_looted: Boolean = definedExternally, force: LuaForce = definedExternally, allow_belts: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: ItemStackDefinition): Array - fun spill_item_stack(position: Position, items: ItemStackDefinition, enable_looted: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: ItemStackDefinition, enable_looted: Boolean = definedExternally, force: LuaForce = definedExternally): Array - fun spill_item_stack(position: Position, items: ItemStackDefinition, enable_looted: Boolean = definedExternally, force: String = definedExternally, allow_belts: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: ItemStackDefinition, enable_looted: Boolean = definedExternally, force: String = definedExternally): Array - fun spill_item_stack(position: Position, items: LuaItemStack, enable_looted: Boolean = definedExternally, force: LuaForce = definedExternally, allow_belts: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: LuaItemStack): Array - fun spill_item_stack(position: Position, items: LuaItemStack, enable_looted: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: LuaItemStack, enable_looted: Boolean = definedExternally, force: LuaForce = definedExternally): Array - fun spill_item_stack(position: Position, items: LuaItemStack, enable_looted: Boolean = definedExternally, force: String = definedExternally, allow_belts: Boolean = definedExternally): Array - fun spill_item_stack(position: Position, items: LuaItemStack, enable_looted: Boolean = definedExternally, force: String = definedExternally): Array - fun find_enemy_units(center: Position, radius: double, force: LuaForce = definedExternally): Array - fun find_enemy_units(center: Position, radius: double): Array - fun find_enemy_units(center: Position, radius: double, force: String = definedExternally): Array - fun find_units(params: `T$70`): Array - fun find_nearest_enemy(params: `T$71`): LuaEntity? - fun find_nearest_enemy_entity_with_owner(params: `T$71`): LuaEntity? - fun set_multi_command(params: `T$72`): uint - fun create_entity(params: Any /* AssemblingMachineSurfaceCreateEntity | BeamSurfaceCreateEntity | ContainerSurfaceCreateEntity | CliffSurfaceCreateEntity | FlyingTextSurfaceCreateEntity | EntityGhostSurfaceCreateEntity | FireSurfaceCreateEntity | InserterSurfaceCreateEntity | ItemEntitySurfaceCreateEntity | ItemRequestProxySurfaceCreateEntity | RollingStockSurfaceCreateEntity | LocomotiveSurfaceCreateEntity | LogisticContainerSurfaceCreateEntity | ParticleSurfaceCreateEntity | ArtilleryFlareSurfaceCreateEntity | ProjectileSurfaceCreateEntity | ResourceSurfaceCreateEntity | UndergroundBeltSurfaceCreateEntity | ProgrammableSpeakerSurfaceCreateEntity | CharacterCorpseSurfaceCreateEntity | HighlightBoxSurfaceCreateEntity | SpeechBubbleSurfaceCreateEntity | SimpleEntityWithOwnerSurfaceCreateEntity | SimpleEntityWithForceSurfaceCreateEntity */): LuaEntity? - fun create_trivial_smoke(params: `T$73`) - fun create_particle(params: `T$74`) - fun create_unit_group(params: `T$75`): LuaUnitGroup - fun build_enemy_base(position: Position, unit_count: uint, force: String = definedExternally) - fun build_enemy_base(position: Position, unit_count: uint) - fun build_enemy_base(position: Position, unit_count: uint, force: LuaForce = definedExternally) - fun get_tile(x: int, y: int): LuaTile - fun set_tiles(tiles: Array, correct_tiles: Boolean = definedExternally, remove_colliding_entities: Boolean = definedExternally, remove_colliding_decoratives: Boolean = definedExternally, raise_event: Boolean = definedExternally) - fun set_tiles(tiles: Array) - fun set_tiles(tiles: Array, correct_tiles: Boolean = definedExternally) - fun set_tiles(tiles: Array, correct_tiles: Boolean = definedExternally, remove_colliding_entities: Boolean = definedExternally) - fun set_tiles(tiles: Array, correct_tiles: Boolean = definedExternally, remove_colliding_entities: Boolean = definedExternally, remove_colliding_decoratives: Boolean = definedExternally) - fun set_tiles(tiles: Array, correct_tiles: Boolean = definedExternally, remove_colliding_entities: String = definedExternally, remove_colliding_decoratives: Boolean = definedExternally, raise_event: Boolean = definedExternally) - fun set_tiles(tiles: Array, correct_tiles: Boolean = definedExternally, remove_colliding_entities: String = definedExternally) - fun set_tiles(tiles: Array, correct_tiles: Boolean = definedExternally, remove_colliding_entities: String = definedExternally, remove_colliding_decoratives: Boolean = definedExternally) - fun pollute(source: Position, amount: double) - fun get_chunks(): LuaChunkIterator - fun is_chunk_generated(position: ChunkPositionTable): Boolean? - fun is_chunk_generated(position: Any /* JsTuple */): Boolean? - fun request_to_generate_chunks(position: Position, radius: uint) - fun force_generate_chunk_requests() - fun set_chunk_generated_status(position: ChunkPositionTable, status: chunk_generated_status) - fun set_chunk_generated_status(position: Any /* JsTuple */, status: chunk_generated_status) - fun find_logistic_network_by_position(position: Position, force: String): LuaLogisticNetwork? - fun find_logistic_network_by_position(position: Position, force: LuaForce): LuaLogisticNetwork? - fun find_logistic_networks_by_construction_area(position: Position, force: String): Array - fun find_logistic_networks_by_construction_area(position: Position, force: LuaForce): Array - fun deconstruct_area(params: `T$76`) - fun cancel_deconstruct_area(params: `T$76`) - fun upgrade_area(params: `T$77`) - fun cancel_upgrade_area(params: `T$76`) - fun get_hidden_tile(position: TilePositionTable): String? - fun get_hidden_tile(position: Any /* JsTuple */): String? - fun set_hidden_tile(position: TilePositionTable, tile: String?) - fun set_hidden_tile(position: TilePositionTable, tile: LuaTilePrototype?) - fun set_hidden_tile(position: Any /* JsTuple */, tile: String?) - fun set_hidden_tile(position: Any /* JsTuple */, tile: LuaTilePrototype?) - fun get_connected_tiles(position: Position, tiles: Array): Array - fun delete_chunk(position: ChunkPositionTable) - fun delete_chunk(position: Any /* JsTuple */) - fun regenerate_entity(entities: String = definedExternally, chunks: Array */> = definedExternally) - fun regenerate_entity() - fun regenerate_entity(entities: String = definedExternally) - fun regenerate_entity(entities: Array = definedExternally, chunks: Array */> = definedExternally) - fun regenerate_entity(entities: Array = definedExternally) - fun regenerate_decorative(decoratives: String = definedExternally, chunks: Array */> = definedExternally) - fun regenerate_decorative() - fun regenerate_decorative(decoratives: String = definedExternally) - fun regenerate_decorative(decoratives: Array = definedExternally, chunks: Array */> = definedExternally) - fun regenerate_decorative(decoratives: Array = definedExternally) - fun print(message: Any /* JsTuple */, color: ColorTable = definedExternally) - fun print(message: Any /* JsTuple */) - fun print(message: Any /* JsTuple */, color: Any /* JsTuple */ = definedExternally) - fun print(message: String, color: ColorTable = definedExternally) - fun print(message: String) - fun print(message: String, color: Any /* JsTuple */ = definedExternally) - fun print(message: Number, color: ColorTable = definedExternally) - fun print(message: Number) - fun print(message: Number, color: Any /* JsTuple */ = definedExternally) - fun destroy_decoratives(params: `T$78`) - fun create_decoratives(params: `T$79`) - fun find_decoratives_filtered(params: `T$80`): Array - fun get_trains(force: String = definedExternally): Array - fun get_trains(): Array - fun get_trains(force: LuaForce = definedExternally): Array - fun clear_pollution() - fun play_sound(params: `T$34`) - fun get_resource_counts(): Record - fun get_random_chunk(): ChunkPositionTable - fun clone_area(params: `T$81`) - fun clone_brush(params: `T$82`) - fun clone_entities(params: `T$83`) - fun clear(ignore_characters: Boolean = definedExternally) - fun request_path(params: `T$84`): uint - fun get_script_areas(name: String = definedExternally): Array - fun get_script_area(key: String = definedExternally): ScriptArea - fun get_script_area(): ScriptArea - fun get_script_area(key: uint = definedExternally): ScriptArea - fun edit_script_area(id: uint, area: ScriptArea) - fun add_script_area(area: ScriptArea): uint - fun remove_script_area(id: uint): Boolean? - fun get_script_positions(name: String = definedExternally): Array - fun get_script_position(key: String = definedExternally): ScriptPosition - fun get_script_position(): ScriptPosition - fun get_script_position(key: uint = definedExternally): ScriptPosition - fun edit_script_position(id: uint, area: ScriptPosition) - fun add_script_position(area: ScriptPosition): uint - fun remove_script_position(id: uint): Boolean? - fun get_map_exchange_string(): String - fun get_starting_area_radius(): double - fun get_closest(position: Position, entities: Array): LuaEntity - fun get_train_stops(params: `T$85` = definedExternally): Array - fun get_total_pollution(): double - fun entity_prototype_collides(prototype: LuaEntity, position: Position, use_map_generation_bounding_box: Boolean, direction: direction = definedExternally) - fun entity_prototype_collides(prototype: LuaEntity, position: Position, use_map_generation_bounding_box: Boolean) - fun entity_prototype_collides(prototype: LuaEntityPrototype, position: Position, use_map_generation_bounding_box: Boolean, direction: direction = definedExternally) - fun entity_prototype_collides(prototype: LuaEntityPrototype, position: Position, use_map_generation_bounding_box: Boolean) - fun entity_prototype_collides(prototype: String, position: Position, use_map_generation_bounding_box: Boolean, direction: direction = definedExternally) - fun entity_prototype_collides(prototype: String, position: Position, use_map_generation_bounding_box: Boolean) - fun decorative_prototype_collides(prototype: String, position: Position) - fun calculate_tile_properties(property_names: Array, positions: Array): Record> - fun get_entities_with_force(position: ChunkPositionTable, force: LuaForce): Array - fun get_entities_with_force(position: ChunkPositionTable, force: String): Array - fun get_entities_with_force(position: Any /* JsTuple */, force: LuaForce): Array - fun get_entities_with_force(position: Any /* JsTuple */, force: String): Array - fun build_checkerboard(area: BoundingBoxTable) - fun build_checkerboard(area: Any /* JsTuple */) - var name: String - var index: uint - var map_gen_settings: MapGenSettings - var generate_with_lab_tiles: Boolean? - var always_day: Boolean? - var daytime: float - var darkness: float - var wind_speed: double - var wind_orientation: RealOrientation - var wind_orientation_change: double - var peaceful_mode: Boolean? - var freeze_daytime: Boolean? - var ticks_per_day: uint - var dusk: double - var dawn: double - var evening: double - var morning: double - var solar_power_multiplier: double - var min_brightness: double - var brightness_visual_weights: dynamic /* ColorModifierTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var show_clouds: Boolean? - var valid: Boolean? - var object_name: String /* "LuaSurface" */ - fun help(): String -} - -external interface LuaTechnology { - fun reload() - var force: LuaForce - var name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var prototype: LuaTechnologyPrototype - var enabled: Boolean? - var visible_when_disabled: Boolean? - var upgrade: Boolean? - var researched: Boolean? - var prerequisites: Record - var research_unit_ingredients: Array - var effects: Array - var research_unit_count: uint - var research_unit_energy: double - var order: String - var level: uint - var research_unit_count_formula: String? - var valid: Boolean? - var object_name: String /* "LuaTechnology" */ - fun help(): String -} - -external interface LuaTechnologyPrototype { - var name: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var enabled: Boolean? - var hidden: Boolean? - var visible_when_disabled: Boolean? - var ignore_tech_cost_multiplier: Boolean? - var upgrade: Boolean? - var prerequisites: Record - var research_unit_ingredients: Array - var effects: Array - var research_unit_count: uint - var research_unit_energy: double - var order: String - var level: uint - var max_level: uint - var research_unit_count_formula: String? - var valid: Boolean? - var object_name: String /* "LuaTechnologyPrototype" */ - fun help(): String -} - -external interface LuaTile { - fun collides_with(layer: String /* "ground-tile" | "water-tile" | "resource-layer" | "doodad-layer" | "floor-layer" | "item-layer" | "ghost-layer" | "object-layer" | "player-layer" | "train-layer" | "rail-layer" | "transport-belt-layer" | "not-setup" */): Boolean? -// fun collides_with(layer: ): Boolean? - fun to_be_deconstructed(): Boolean? - fun order_deconstruction(force: String, player: uint = definedExternally): LuaEntity? - fun order_deconstruction(force: String): LuaEntity? - fun order_deconstruction(force: String, player: String = definedExternally): LuaEntity? - fun order_deconstruction(force: String, player: LuaPlayer = definedExternally): LuaEntity? - fun order_deconstruction(force: LuaForce, player: uint = definedExternally): LuaEntity? - fun order_deconstruction(force: LuaForce): LuaEntity? - fun order_deconstruction(force: LuaForce, player: String = definedExternally): LuaEntity? - fun order_deconstruction(force: LuaForce, player: LuaPlayer = definedExternally): LuaEntity? - fun cancel_deconstruction(force: String, player: uint = definedExternally) - fun cancel_deconstruction(force: String) - fun cancel_deconstruction(force: String, player: String = definedExternally) - fun cancel_deconstruction(force: String, player: LuaPlayer = definedExternally) - fun cancel_deconstruction(force: LuaForce, player: uint = definedExternally) - fun cancel_deconstruction(force: LuaForce) - fun cancel_deconstruction(force: LuaForce, player: String = definedExternally) - fun cancel_deconstruction(force: LuaForce, player: LuaPlayer = definedExternally) - var name: String - var prototype: LuaTilePrototype - var position: PositionTable - var hidden_tile: String? - var surface: LuaSurface - var valid: Boolean? - var object_name: String /* "LuaTile" */ - fun help(): String -} - -external interface `T$86` { - var minable: Boolean? - var miningtime: double - var miningparticle: String? - get() = definedExternally - set(value) = definedExternally - var products: Array -} - -external interface LuaTilePrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var collision_mask: CollisionMask - var collision_mask_with_flags: CollisionMaskWithFlags - var layer: uint - var autoplace_specification: AutoplaceSpecification? - var walking_speed_modifier: float - var vehicle_friction_modifier: float - var map_color: ColorTable - var decorative_removal_probability: float - var automatic_neighbors: Boolean? - var allowed_neighbors: Record - var needs_correction: Boolean? - var mineable_properties: `T$86` - var next_direction: LuaTilePrototype? - var items_to_place_this: Array - var can_be_part_of_blueprint: Boolean? - var emissions_per_second: double - var valid: Boolean? - var object_name: String /* "LuaTilePrototype" */ - fun help(): String -} - -external interface LuaTrain { - fun get_item_count(item: String = definedExternally): uint - fun get_contents(): Record - fun remove_item(stack: String): uint - fun remove_item(stack: ItemStackDefinition): uint - fun remove_item(stack: LuaItemStack): uint - fun insert(stack: String) - fun insert(stack: ItemStackDefinition) - fun insert(stack: LuaItemStack) - fun clear_items_inside() - fun recalculate_path(force: Boolean = definedExternally): Boolean? - fun get_fluid_count(fluid: String = definedExternally): double - fun get_fluid_contents(): Record - fun remove_fluid(fluid: Fluid): double - fun insert_fluid(fluid: Fluid): double - fun clear_fluids_inside() - fun go_to_station(index: uint) - fun get_rails(): Array - var manual_mode: Boolean? - var speed: double - var max_forward_speed: double - var max_backward_speed: double - var weight: double - var carriages: Array - var locomotives: Record> - var cargo_wagons: Array - var fluid_wagons: Array - var schedule: TrainSchedule? - var state: train_state - var front_rail: LuaEntity? - var back_rail: LuaEntity? - var rail_direction_from_front_rail: rail_direction - var rail_direction_from_back_rail: rail_direction - var front_stock: LuaEntity? - var back_stock: LuaEntity? - var station: LuaEntity? - var has_path: Boolean? - var path_end_rail: LuaEntity? - var path_end_stop: LuaEntity? - var id: uint - var passengers: Array - var riding_state: RidingState - var killed_players: Record - var kill_count: uint - var path: LuaRailPath? - var signal: LuaEntity? - var valid: Boolean? - var object_name: String /* "LuaTrain" */ - fun help(): String -} - -external interface LuaTrainStopControlBehavior : LuaGenericOnOffControlBehavior { - var send_to_train: Boolean? - var read_from_train: Boolean? - var read_stopped_train: Boolean? - var set_trains_limit: Boolean? - var read_trains_count: Boolean? - var enable_disable: Boolean? - var stopped_train_signal: SignalID - var trains_count_signal: SignalID - var trains_limit_signal: SignalID - override var valid: Boolean? - override var object_name: String /* "LuaTrainStopControlBehavior" */ - override fun help(): String -} - -external interface LuaTransportBeltControlBehavior : LuaGenericOnOffControlBehavior { - var enable_disable: Boolean? - var read_contents: Boolean? - var read_contents_mode: content_read_mode - override var valid: Boolean? - override var object_name: String /* "LuaTransportBeltControlBehavior" */ - override fun help(): String -} - -typealias LuaTransportLine = Array - -external interface LuaTrivialSmokePrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var color: ColorTable - var start_scale: double - var end_scale: double - var movement_slow_down_factor: double - var duration: uint - var spread_duration: uint - var fade_away_duration: uint - var fade_in_duration: uint - var glow_fade_away_duration: uint - var cyclic: Boolean? - var affected_by_wind: Boolean? - var show_when_smoke_off: Boolean? - var glow_animation: Boolean? - var render_layer: dynamic /* Number | */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaTrivialSmokePrototype" */ - fun help(): String -} - -external interface LuaUnitGroup { - fun add_member(unit: LuaEntity) - fun set_command(command: AttackCommand) - fun set_command(command: GoToLocationCommand) - fun set_command(command: CompoundCommand) - fun set_command(command: GroupCommand) - fun set_command(command: AttackAreaCommand) - fun set_command(command: WanderCommand) - fun set_command(command: StopCommand) - fun set_command(command: FleeCommand) - fun set_command(command: BuildBaseCommand) - fun set_distraction_command(command: AttackCommand) - fun set_distraction_command(command: GoToLocationCommand) - fun set_distraction_command(command: CompoundCommand) - fun set_distraction_command(command: GroupCommand) - fun set_distraction_command(command: AttackAreaCommand) - fun set_distraction_command(command: WanderCommand) - fun set_distraction_command(command: StopCommand) - fun set_distraction_command(command: FleeCommand) - fun set_distraction_command(command: BuildBaseCommand) - fun set_autonomous() - fun start_moving() - fun destroy() - var members: Array - var position: PositionTable - var state: group_state - var force: LuaForce - var surface: LuaSurface - var group_number: uint - var is_script_driven: Boolean? - var command: dynamic /* AttackCommand? | GoToLocationCommand? | CompoundCommand? | GroupCommand? | AttackAreaCommand? | WanderCommand? | StopCommand? | FleeCommand? | BuildBaseCommand? */ - get() = definedExternally - set(value) = definedExternally - var distraction_command: dynamic /* AttackCommand? | GoToLocationCommand? | CompoundCommand? | GroupCommand? | AttackAreaCommand? | WanderCommand? | StopCommand? | FleeCommand? | BuildBaseCommand? */ - get() = definedExternally - set(value) = definedExternally - var valid: Boolean? - var object_name: String /* "LuaUnitGroup" */ - fun help(): String -} - -external interface LuaVirtualSignalPrototype { - var name: String - var order: String - var localised_name: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var localised_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var special: Boolean? - var subgroup: LuaGroup - var valid: Boolean? - var object_name: String /* "LuaVirtualSignalPrototype" */ - fun help(): String -} - -external interface LuaVoidEnergySourcePrototype { - var emissions: double - var render_no_network_icon: Boolean? - var render_no_power_icon: Boolean? - var valid: Boolean? - var object_name: String /* "LuaVoidEnergySourcePrototype" */ - fun help(): String -} - -external interface LuaWallControlBehavior : LuaControlBehavior { - var circuit_condition: CircuitConditionDefinition - var open_gate: Boolean? - var read_sensor: Boolean? - var output_signal: SignalID - var valid: Boolean? - var object_name: String /* "LuaWallControlBehavior" */ - fun help(): String -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/concepts.module_typed-factorio.kt b/modules/mod2/dukat-custom/concepts.module_typed-factorio.kt deleted file mode 100644 index b30c7c9..0000000 --- a/modules/mod2/dukat-custom/concepts.module_typed-factorio.kt +++ /dev/null @@ -1,2924 +0,0 @@ -@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 defines.relative_gui_type -import defines.relative_gui_position -import tsstdlib.Record -import tsstdlib.Position -import defines.difficulty_settings.recipe_difficulty -import defines.difficulty_settings.technology_difficulty -import defines.circuit_connector_id -import defines.direction -import defines.wire_type -import defines.command -import defines.distraction -import defines.compound_command -import defines.inventory -import defines.riding.acceleration -import defines.riding.direction as _defines_riding_direction -import defines.control_behavior.mining_drill.resource_read_mode -import defines.control_behavior.inserter.hand_read_mode -import defines.control_behavior.transport_belt.content_read_mode - -external interface DisplayResolution { - var width: uint - var height: uint -} - -external interface PersonalLogisticParameters { - var name: String? - get() = definedExternally - set(value) = definedExternally - var min: uint? - get() = definedExternally - set(value) = definedExternally - var max: uint? - get() = definedExternally - set(value) = definedExternally -} - -typealias RealOrientation = float - -external interface PositionTable { - var x: int - var y: int -} - -external interface ChunkPositionTable { - var x: int - var y: int -} - -external interface TilePositionTable { - var x: int - var y: int -} - -external interface GuiLocationTable { - var x: int - var y: int -} - -external interface ChunkPositionAndArea { - var x: int - var y: int - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally -} - -external interface EquipmentPoint { - var x: uint - var y: uint -} - -external interface GuiAnchor { - var gui: relative_gui_type - var position: relative_gui_position - var type: String? - get() = definedExternally - set(value) = definedExternally - var name: String? - get() = definedExternally - set(value) = definedExternally - var names: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface TabAndContent { - var tab: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var content: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally -} - -external interface OldTileAndPosition { - var old_tile: LuaTilePrototype - var position: dynamic /* TilePositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally -} - -typealias Tags = Record - -external interface SmokeSource { - var name: String - var frequency: double - var offset: double - var position: PositionTable? - get() = definedExternally - set(value) = definedExternally - var north_position: PositionTable? - get() = definedExternally - set(value) = definedExternally - var east_position: PositionTable? - get() = definedExternally - set(value) = definedExternally - var south_position: PositionTable? - get() = definedExternally - set(value) = definedExternally - var west_position: PositionTable? - get() = definedExternally - set(value) = definedExternally - var deviation: Position? - get() = definedExternally - set(value) = definedExternally - var starting_frame_speed: uint16 - var starting_frame_speed_deviation: double - var starting_frame: uint16 - var starting_frame_deviation: double - var slow_down_factor: uint8 - var height: float - var height_deviation: float - var starting_vertical_speed: float - var starting_vertical_speed_deviation: float - var vertical_speed_slowdown: float -} - -external interface BoundingBoxTable { - var left_top: Position - var right_bottom: Position - var orientation: RealOrientation? - get() = definedExternally - set(value) = definedExternally -} - -external interface ScriptArea { - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var name: String - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var id: uint -} - -external interface ScriptPosition { - var position: Position - var name: String - var color: dynamic /* ColorTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var id: uint -} - -external interface ColorTable { - var r: float? - get() = definedExternally - set(value) = definedExternally - var g: float? - get() = definedExternally - set(value) = definedExternally - var b: float? - get() = definedExternally - set(value) = definedExternally - var a: float? - get() = definedExternally - set(value) = definedExternally -} - -external interface ColorModifierTable { - var r: float? - get() = definedExternally - set(value) = definedExternally - var g: float? - get() = definedExternally - set(value) = definedExternally - var b: float? - get() = definedExternally - set(value) = definedExternally - var a: float? - get() = definedExternally - set(value) = definedExternally -} - -external interface CraftingQueueItem { - var index: uint - var recipe: String - var count: uint -} - -external interface Alert { - var tick: uint - var target: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var prototype: LuaEntityPrototype? - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally - var icon: SignalID? - get() = definedExternally - set(value) = definedExternally - var message: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ScriptRenderVertexTarget { - var target: dynamic /* Position | LuaEntity */ - get() = definedExternally - set(value) = definedExternally - var target_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally -} - -external interface PathfinderWaypoint { - var position: Position - var needs_destroy_to_reach: Boolean -} - -external interface CutsceneWaypoint { - var position: Position? - get() = definedExternally - set(value) = definedExternally - var target: dynamic /* LuaEntity? | LuaUnitGroup? */ - get() = definedExternally - set(value) = definedExternally - var transition_time: uint - var time_to_wait: uint - var zoom: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface Decorative { - var name: String - var position: Position - var amount: uint8 -} - -external interface DecorativeResult { - var position: dynamic /* TilePositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var decorative: LuaDecorativePrototype - var amount: uint -} - -external interface ChartTagSpec { - var position: Position - var icon: SignalID? - get() = definedExternally - set(value) = definedExternally - var text: String? - get() = definedExternally - set(value) = definedExternally - var last_user: dynamic /* uint? | String? | LuaPlayer? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface GameViewSettings { - var show_controller_gui: Boolean - var show_minimap: Boolean - var show_research_info: Boolean - var show_entity_info: Boolean - var show_alert_gui: Boolean - var update_entity_selection: Boolean - var show_rail_block_visualisation: Boolean - var show_side_menu: Boolean - var show_map_view_options: Boolean - var show_quickbar: Boolean - var show_shortcut_bar: Boolean -} - -external interface MapViewSettings { - @nativeGetter - operator fun get(key: String): Boolean? - @nativeSetter - operator fun set(key: String, value: Boolean?) -} - -external interface PollutionMapSettings { - var enabled: Boolean - var diffusion_ratio: double - var min_to_diffuse: double - var aeging: double - var expected_max_per_chunk: double - var min_to_show_per_chunk: double - var min_pollution_to_damage_trees: double - var pollution_with_max_forest_damage: double - var pollution_per_tree_damage: double - var pollution_restored_per_tree_damage: double - var max_pollution_to_restore_trees: double - var enemy_attack_pollution_consumption_modifier: double -} - -external interface EnemyEvolutionMapSettings { - var enabled: Boolean - var time_factor: double - var destroy_factor: double - var pollution_factor: double -} - -external interface EnemyExpansionMapSettings { - var enabled: Boolean - var max_expansion_distance: uint - var friendly_base_influence_radius: uint - var enemy_building_influence_radius: uint - var building_coefficient: double - var other_base_coefficient: double - var neighbouring_chunk_coefficient: double - var neighbouring_base_chunk_coefficient: double - var max_colliding_tiles_coefficient: double - var settler_group_min_size: uint - var settler_group_max_size: uint - var min_expansion_cooldown: uint - var max_expansion_cooldown: uint -} - -external interface UnitGroupMapSettings { - var min_group_gathering_time: uint - var max_group_gathering_time: uint - var max_wait_time_for_late_members: uint - var min_group_radius: double - var max_group_radius: double - var max_member_speedup_when_behind: double - var max_member_slowdown_when_ahead: double - var max_group_slowdown_factor: double - var max_group_member_fallback_factor: double - var member_disown_distance: double - var tick_tolerance_when_member_arrives: uint - var max_gathering_unit_groups: uint - var max_unit_group_size: uint -} - -external interface SteeringMapSetting { - var radius: double - var separation_factor: double - var separation_force: double - var force_unit_fuzzy_goto_behavior: Boolean -} - -external interface SteeringMapSettings { - var default: SteeringMapSetting - var moving: SteeringMapSetting -} - -external interface PathFinderMapSettings { - var fwd2bwd_ratio: uint - var goal_pressure_ratio: double - var max_steps_worked_per_tick: double - var max_work_done_per_tick: uint - var use_path_cache: Boolean - var short_cache_size: uint - var long_cache_size: uint - var short_cache_min_cacheable_distance: double - var short_cache_min_algo_steps_to_cache: uint - var long_cache_min_cacheable_distance: double - var cache_max_connect_to_cache_steps_multiplier: uint - var cache_accept_path_start_distance_ratio: double - var cache_accept_path_end_distance_ratio: double - var negative_cache_accept_path_start_distance_ratio: double - var negative_cache_accept_path_end_distance_ratio: double - var cache_path_start_distance_rating_multiplier: double - var cache_path_end_distance_rating_multiplier: double - var stale_enemy_with_same_destination_collision_penalty: double - var ignore_moving_enemy_collision_distance: double - var enemy_with_different_destination_collision_penalty: double - var general_entity_collision_penalty: double - var general_entity_subsequent_collision_penalty: double - var extended_collision_penalty: double - var max_clients_to_accept_any_new_request: uint - var max_clients_to_accept_short_new_request: uint - var direct_distance_to_consider_short_request: uint - var short_request_max_steps: uint - var short_request_ratio: double - var min_steps_to_check_path_find_termination: uint - var start_to_goal_cost_multiplier_to_terminate_path_find: double - var overload_levels: Array - var overload_multipliers: Array - var negative_path_cache_delay_interval: uint -} - -external interface MapSettings { - var pollution: PollutionMapSettings - var enemy_evolution: EnemyEvolutionMapSettings - var enemy_expansion: EnemyExpansionMapSettings - var unit_group: UnitGroupMapSettings - var steering: SteeringMapSettings - var path_finder: PathFinderMapSettings - var max_failed_behavior_count: uint -} - -external interface DifficultySettings { - var recipe_difficulty: recipe_difficulty - var technology_difficulty: technology_difficulty - var technology_price_multiplier: double - var research_queue_setting: String /* "after-victory" | "always" | "never" */ -} - -external interface MapExchangeStringData { - var map_settings: MapSettings - var map_gen_settings: MapGenSettings -} - -external interface BlueprintItemIcon { - var name: String - var index: uint -} - -external interface BlueprintSignalIcon { - var signal: SignalID - var index: uint -} - -external interface BlueprintConnectionData { - var entity_id: uint - var circuit_id: circuit_connector_id? - get() = definedExternally - set(value) = definedExternally -} - -external interface BlueprintConnectionPoint { - var red: Array? - get() = definedExternally - set(value) = definedExternally - var green: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface BlueprintCircuitConnection { - @nativeGetter - operator fun get(key: String): BlueprintConnectionPoint? - @nativeSetter - operator fun set(key: String, value: BlueprintConnectionPoint?) -} - -external interface BlueprintEntity { - var entity_number: uint - var name: String - var position: Position - var direction: direction? - get() = definedExternally - set(value) = definedExternally - var tags: Tags? - get() = definedExternally - set(value) = definedExternally - var items: Record? - get() = definedExternally - set(value) = definedExternally - var connections: BlueprintCircuitConnection? - get() = definedExternally - set(value) = definedExternally - var control_behavior: BlueprintControlBehavior? - get() = definedExternally - set(value) = definedExternally - var schedule: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface Tile { - var position: Position - var name: String -} - -external interface Fluid { - var name: String - var amount: double - var temperature: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface BaseIngredient { - var type: String /* "item" | "fluid" */ - var name: String - var amount: double - var catalyst_amount: dynamic /* uint? | double? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FluidIngredient : BaseIngredient { - override var type: String /* "fluid" */ - var minimum_temperature: double? - get() = definedExternally - set(value) = definedExternally - var maximum_temperature: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface OtherIngredient : BaseIngredient { - override var type: String /* "item" */ -} - -external interface BaseProduct { - var type: String /* "item" | "fluid" */ - var name: String - var amount: double? - get() = definedExternally - set(value) = definedExternally - var amount_min: dynamic /* uint? | double? */ - get() = definedExternally - set(value) = definedExternally - var amount_max: dynamic /* uint? | double? */ - get() = definedExternally - set(value) = definedExternally - var probability: double? - get() = definedExternally - set(value) = definedExternally - var catalyst_amount: dynamic /* uint? | double? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FluidProduct : BaseProduct { - override var type: String /* "fluid" */ - var temperature: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface OtherProduct : BaseProduct { - override var type: String /* "item" */ -} - -external interface Loot { - var item: String - var probability: double - var count_min: double - var count_max: double -} - -external interface BaseTechnologyModifier { - var type: String /* "inserter-stack-size-bonus" | "stack-inserter-capacity-bonus" | "laboratory-speed" | "character-logistic-trash-slots" | "maximum-following-robots-count" | "worker-robot-speed" | "worker-robot-storage" | "ghost-time-to-live" | "turret-attack" | "ammo-damage" | "give-item" | "gun-speed" | "unlock-recipe" | "character-crafting-speed" | "character-mining-speed" | "character-running-speed" | "character-build-distance" | "character-item-drop-distance" | "character-reach-distance" | "character-resource-reach-distance" | "character-item-pickup-distance" | "character-loot-pickup-distance" | "character-inventory-slots-bonus" | "deconstruction-time-to-live" | "max-failed-attempts-per-tick-per-construction-queue" | "max-successful-attempts-per-tick-per-construction-queue" | "character-health-bonus" | "mining-drill-productivity-bonus" | "train-braking-force-bonus" | "zoom-to-world-enabled" | "zoom-to-world-ghost-building-enabled" | "zoom-to-world-blueprint-enabled" | "zoom-to-world-deconstruction-planner-enabled" | "zoom-to-world-upgrade-planner-enabled" | "zoom-to-world-selection-tool-enabled" | "worker-robot-battery" | "laboratory-productivity" | "follower-robot-lifetime" | "artillery-range" | "nothing" | "character-additional-mining-categories" | "character-logistic-requests" */ -} - -external interface GunSpeedTechnologyModifier : BaseTechnologyModifier { - override var type: String /* "gun-speed" */ - var ammo_category: String - var modifier: double -} - -external interface AmmoDamageTechnologyModifier : BaseTechnologyModifier { - override var type: String /* "ammo-damage" */ - var ammo_category: String - var modifier: double -} - -external interface GiveItemTechnologyModifier : BaseTechnologyModifier { - override var type: String /* "give-item" */ - var item: String - var count: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface TurretAttackTechnologyModifier : BaseTechnologyModifier { - override var type: String /* "turret-attack" */ - var turret_id: String - var modifier: double -} - -external interface UnlockRecipeTechnologyModifier : BaseTechnologyModifier { - override var type: String /* "unlock-recipe" */ - var recipe: String -} - -external interface NothingTechnologyModifier : BaseTechnologyModifier { - override var type: String /* "nothing" */ - var effect_description: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally -} - -external interface OtherTechnologyModifier : BaseTechnologyModifier { - override var type: String /* "inserter-stack-size-bonus" | "stack-inserter-capacity-bonus" | "laboratory-speed" | "character-logistic-trash-slots" | "maximum-following-robots-count" | "worker-robot-speed" | "worker-robot-storage" | "ghost-time-to-live" | "character-crafting-speed" | "character-mining-speed" | "character-running-speed" | "character-build-distance" | "character-item-drop-distance" | "character-reach-distance" | "character-resource-reach-distance" | "character-item-pickup-distance" | "character-loot-pickup-distance" | "character-inventory-slots-bonus" | "deconstruction-time-to-live" | "max-failed-attempts-per-tick-per-construction-queue" | "max-successful-attempts-per-tick-per-construction-queue" | "character-health-bonus" | "mining-drill-productivity-bonus" | "train-braking-force-bonus" | "zoom-to-world-enabled" | "zoom-to-world-ghost-building-enabled" | "zoom-to-world-blueprint-enabled" | "zoom-to-world-deconstruction-planner-enabled" | "zoom-to-world-upgrade-planner-enabled" | "zoom-to-world-selection-tool-enabled" | "worker-robot-battery" | "laboratory-productivity" | "follower-robot-lifetime" | "artillery-range" | "character-additional-mining-categories" | "character-logistic-requests" */ - var modifier: double -} - -external interface Offer { - var price: Array - var offer: dynamic /* GunSpeedTechnologyModifier | AmmoDamageTechnologyModifier | GiveItemTechnologyModifier | TurretAttackTechnologyModifier | UnlockRecipeTechnologyModifier | NothingTechnologyModifier | OtherTechnologyModifier */ - get() = definedExternally - set(value) = definedExternally -} - -external interface AutoplaceSpecification { - var probability_expression: NoiseExpression - var richness_expression: NoiseExpression - var coverage: double - var sharpness: double - var max_probability: double - var placement_density: uint - var richness_base: double - var richness_multiplier: double - var richness_multiplier_distance_bonus: double - var starting_area_size: uint - var order: String - var default_enabled: Boolean - var peaks: Array? - get() = definedExternally - set(value) = definedExternally - var control: String? - get() = definedExternally - set(value) = definedExternally - var tile_restriction: Array? - get() = definedExternally - set(value) = definedExternally - var force: String - var random_probability_penalty: double -} - -external interface NoiseExpression { - var type: String -} - -external interface AutoplaceSpecificationPeak { - var influence: double - var max_influence: double - var min_influence: double - var richness_influence: double - var noisePersistence: double - var noise_layer: String? - get() = definedExternally - set(value) = definedExternally - var noise_octaves_difference: double - var water_optimal: double - var water_range: double - var water_max_range: double - var water_top_property_limit: double - var elevation_optimal: double - var elevation_range: double - var elevation_max_range: double - var elevation_top_property_limit: double - var temperature_optimal: double - var temperature_range: double - var temperature_max_range: double - var temperature_top_property_limit: double - var starting_area_weight_optimal: double - var starting_area_weight_range: double - var starting_area_weight_max_range: double - var starting_area_weight_top_property_limit: double - var tier_from_start_optimal: double - var tier_from_start_range: double - var tier_from_start_max_range: double - var tier_from_start_top_property_limit: double - var distance_optimal: double - var distance_range: double - var distance_max_range: double - var distance_top_property_limit: double - var aux_optimal: double - var aux_range: double - var aux_max_range: double - var aux_top_property_limit: double -} - -external interface AutoplaceSpecificationRestriction { - var first: String? - get() = definedExternally - set(value) = definedExternally - var second: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface Resistance { - var decrease: float - var percent: float -} - -external interface AutoplaceSetting { - var frequency: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var size: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var richness: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface AutoplaceSettings { - var treat_missing_as_default: Boolean - var settings: Record -} - -external interface AutoplaceControl { - var frequency: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var size: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var richness: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface CliffPlacementSettings { - var name: String - var cliff_elevation_0: float - var cliff_elevation_interval: float - var richness: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface MapGenSettings { - var terrain_segmentation: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var water: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var autoplace_controls: Record - var default_enable_all_autoplace_controls: Boolean - var autoplace_settings: Record - var cliff_settings: CliffPlacementSettings - var seed: uint - var width: uint - var height: uint - var starting_area: dynamic /* Number | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var starting_points: Array - var peaceful_mode: Boolean - var property_expression_names: Record -} - -external interface MapGenSettingsPartial { - var terrain_segmentation: dynamic /* Number? | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var water: dynamic /* Number? | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var autoplace_controls: Record? - get() = definedExternally - set(value) = definedExternally - var default_enable_all_autoplace_controls: Boolean? - get() = definedExternally - set(value) = definedExternally - var autoplace_settings: Record? - get() = definedExternally - set(value) = definedExternally - var cliff_settings: CliffPlacementSettings? - get() = definedExternally - set(value) = definedExternally - var seed: uint? - get() = definedExternally - set(value) = definedExternally - var width: uint? - get() = definedExternally - set(value) = definedExternally - var height: uint? - get() = definedExternally - set(value) = definedExternally - var starting_area: dynamic /* Number? | "none" | "very-low" | "very-small" | "very-poor" | "low" | "small" | "poor" | "normal" | "medium" | "regular" | "high" | "big" | "good" | "very-high" | "very-big" | "very-good" */ - get() = definedExternally - set(value) = definedExternally - var starting_points: Array? - get() = definedExternally - set(value) = definedExternally - var peaceful_mode: Boolean? - get() = definedExternally - set(value) = definedExternally - var property_expression_names: Record? - get() = definedExternally - set(value) = definedExternally -} - -external interface SignalID { - var type: String /* "item" | "fluid" | "virtual" */ - var name: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface Signal { - var signal: SignalID - var count: int -} - -external interface UpgradeFilter { - var type: String /* "item" | "entity" */ - var name: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface InfinityInventoryFilter { - var name: String - var count: uint? - get() = definedExternally - set(value) = definedExternally - var mode: String? /* "at-least" | "at-most" | "exactly" */ - get() = definedExternally - set(value) = definedExternally - var index: uint -} - -external interface InfinityPipeFilter { - var name: String - var percentage: double? - get() = definedExternally - set(value) = definedExternally - var temperature: double? - get() = definedExternally - set(value) = definedExternally - var mode: String? /* "at-least" | "at-most" | "exactly" | "add" | "remove" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FluidBoxFilter { - var name: String - var minimum_temperature: double - var maximum_temperature: double -} - -external interface FluidBoxFilterSpec { - var name: String - var minimum_temperature: double? - get() = definedExternally - set(value) = definedExternally - var maximum_temperature: double? - get() = definedExternally - set(value) = definedExternally - var force: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface HeatSetting { - var temperature: double? - get() = definedExternally - set(value) = definedExternally - var mode: String? /* "at-least" | "at-most" | "exactly" | "add" | "remove" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface HeatConnection { - var position: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var direction: direction -} - -external interface FluidBoxConnection { - var type: String /* "input" | "output" | "input-output" */ - var positions: Array - var max_underground_distance: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface ArithmeticCombinatorParameters { - var first_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var second_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var first_constant: int? - get() = definedExternally - set(value) = definedExternally - var second_constant: int? - get() = definedExternally - set(value) = definedExternally - var operation: String? /* "*" | "/" | "+" | "-" | "%" | "^" | "<<" | ">>" | "AND" | "OR" | "XOR" */ - get() = definedExternally - set(value) = definedExternally - var output_signal: SignalID? - get() = definedExternally - set(value) = definedExternally -} - -external interface ConstantCombinatorParameters { - var signal: SignalID - var count: int - var index: uint -} - -external interface DeciderCombinatorParameters { - var first_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var second_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var constant: uint? - get() = definedExternally - set(value) = definedExternally - var comparator: String? /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - get() = definedExternally - set(value) = definedExternally - var output_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var copy_count_from_input: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface InserterCircuitConditions { - var circuit: CircuitCondition? - get() = definedExternally - set(value) = definedExternally - var logistics: CircuitCondition? - get() = definedExternally - set(value) = definedExternally -} - -external interface CircuitCondition { - var comparator: String? /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - get() = definedExternally - set(value) = definedExternally - var first_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var second_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var constant: int? - get() = definedExternally - set(value) = definedExternally -} - -external interface CircuitConditionDefinition { - var condition: CircuitCondition - var fulfilled: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface CircuitConnectionDefinition { - var wire: wire_type - var target_entity: LuaEntity - var source_circuit_id: circuit_connector_id - var target_circuit_id: circuit_connector_id -} - -external interface WireConnectionDefinition { - var wire: wire_type - var target_entity: LuaEntity - var source_circuit_id: circuit_connector_id? - get() = definedExternally - set(value) = definedExternally - var target_circuit_id: circuit_connector_id? - get() = definedExternally - set(value) = definedExternally - var source_wire_id: circuit_connector_id? - get() = definedExternally - set(value) = definedExternally - var target_wire_id: circuit_connector_id? - get() = definedExternally - set(value) = definedExternally -} - -external interface InventoryFilter { - var index: uint - var name: String -} - -external interface PlaceAsTileResult { - var result: LuaTilePrototype - var condition_size: uint - var condition: CollisionMask -} - -external interface BaseCommand { - var type: command -} - -external interface AttackCommand : BaseCommand { - var target: LuaEntity - var distraction: distraction? - get() = definedExternally - set(value) = definedExternally -} - -external interface GoToLocationCommand : BaseCommand { - var destination: Position? - get() = definedExternally - set(value) = definedExternally - var destination_entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var distraction: distraction? - get() = definedExternally - set(value) = definedExternally - var pathfind_flags: PathfinderFlags? - get() = definedExternally - set(value) = definedExternally - var radius: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface CompoundCommand : BaseCommand { - var structure_type: compound_command - var commands: Array -} - -external interface GroupCommand : BaseCommand { - var group: LuaUnitGroup - var distraction: distraction? - get() = definedExternally - set(value) = definedExternally - var use_group_distraction: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface AttackAreaCommand : BaseCommand { - var destination: Position - var radius: double - var distraction: distraction? - get() = definedExternally - set(value) = definedExternally -} - -external interface WanderCommand : BaseCommand { - var distraction: distraction? - get() = definedExternally - set(value) = definedExternally - var radius: double? - get() = definedExternally - set(value) = definedExternally - var wander_in_group: Boolean? - get() = definedExternally - set(value) = definedExternally - var ticks_to_wait: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface StopCommand : BaseCommand { - var distraction: distraction? - get() = definedExternally - set(value) = definedExternally - var ticks_to_wait: uint? - get() = definedExternally - set(value) = definedExternally -} - -external interface FleeCommand : BaseCommand { - var from: LuaEntity - var distraction: distraction? - get() = definedExternally - set(value) = definedExternally -} - -external interface BuildBaseCommand : BaseCommand { - var destination: Position - var distraction: distraction? - get() = definedExternally - set(value) = definedExternally - var ignore_planner: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface PathfinderFlags { - var allow_destroy_friendly_entities: Boolean? - get() = definedExternally - set(value) = definedExternally - var allow_paths_through_own_entities: Boolean? - get() = definedExternally - set(value) = definedExternally - var cache: Boolean? - get() = definedExternally - set(value) = definedExternally - var prefer_straight_paths: Boolean? - get() = definedExternally - set(value) = definedExternally - var low_priority: Boolean? - get() = definedExternally - set(value) = definedExternally - var no_break: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface UnitSpawnDefinition { - var unit: String - var spawn_points: Array -} - -external interface SpawnPointDefinition { - var evolution_factor: double - var weight: double -} - -external interface ItemStackDefinition { - var name: String - var count: uint? - get() = definedExternally - set(value) = definedExternally - var health: float? - get() = definedExternally - set(value) = definedExternally - var durability: double? - get() = definedExternally - set(value) = definedExternally - var ammo: double? - get() = definedExternally - set(value) = definedExternally - var tags: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface WaitCondition { - var type: String /* "time" | "inactivity" | "full" | "empty" | "item_count" | "circuit" | "robots_inactive" | "fluid_count" | "passenger_present" | "passenger_not_present" */ - var compare_type: String /* "and" | "or" */ - var ticks: uint? - get() = definedExternally - set(value) = definedExternally - var condition: CircuitCondition? - get() = definedExternally - set(value) = definedExternally -} - -external interface TrainScheduleRecord { - var station: String? - get() = definedExternally - set(value) = definedExternally - var rail: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var wait_conditions: Array? - get() = definedExternally - set(value) = definedExternally - var temporary: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TrainSchedule { - var current: uint - var records: Array -} - -external interface BaseGuiArrowSpecification { - var type: String /* "nowhere" | "goal" | "entity_info" | "active_window" | "entity" | "position" | "crafting_queue" | "item_stack" */ -} - -external interface EntityGuiArrowSpecification : BaseGuiArrowSpecification { - override var type: String /* "entity" */ - var entity: LuaEntity -} - -external interface PositionGuiArrowSpecification : BaseGuiArrowSpecification { - override var type: String /* "position" */ - var position: Position -} - -external interface CraftingQueueGuiArrowSpecification : BaseGuiArrowSpecification { - override var type: String /* "crafting_queue" */ - var crafting_queueindex: uint -} - -external interface ItemStackGuiArrowSpecification : BaseGuiArrowSpecification { - override var type: String /* "item_stack" */ - var inventory_index: inventory - var item_stack_index: uint - var source: String /* "player" | "target" | "player-quickbar" | "player-equipment-bar" */ -} - -external interface OtherGuiArrowSpecification : BaseGuiArrowSpecification { - override var type: String /* "nowhere" | "goal" | "entity_info" | "active_window" */ -} - -external interface AmmoType { - var action: Array? - get() = definedExternally - set(value) = definedExternally - var target_type: String /* "entity" | "position" | "direction" */ - var clamp_position: Boolean? - get() = definedExternally - set(value) = definedExternally - var category: String - var energy_consumption: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface BeamTarget { - var entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally -} - -external interface RidingState { - var acceleration: acceleration - var direction: _defines_riding_direction -} - -external interface ModuleEffectValue { - var bonus: float -} - -external interface ModuleEffects { - var consumption: ModuleEffectValue? - get() = definedExternally - set(value) = definedExternally - var speed: ModuleEffectValue? - get() = definedExternally - set(value) = definedExternally - var productivity: ModuleEffectValue? - get() = definedExternally - set(value) = definedExternally - var pollution: ModuleEffectValue? - get() = definedExternally - set(value) = definedExternally -} - -external interface EntityPrototypeFlags { - @nativeGetter - operator fun get(key: String): Boolean? - @nativeSetter - operator fun set(key: String, value: Boolean?) - var hidden: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface ItemPrototypeFlags { - @nativeGetter - operator fun get(key: String): Boolean? - @nativeSetter - operator fun set(key: String, value: Boolean?) - var hidden: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -typealias CollisionMask = Any - -typealias CollisionMaskWithFlags = Any - -typealias TriggerTargetMask = Any - -external interface TriggerEffectItem { - var type: String /* "damage" | "create-entity" | "create-explosion" | "create-fire" | "create-smoke" | "create-trivial-smoke" | "create-particle" | "create-sticker" | "nested-result" | "play-sound" | "push-back" | "destroy-cliffs" | "show-explosion-on-chart" | "insert-item" | "script" */ - var repeat_count: uint - var affects_target: Boolean - var show_in_tooltip: Boolean -} - -external interface TriggerDelivery { - var type: String /* "instant" | "projectile" | "flame-thrower" | "beam" | "stream" | "artillery" */ - var source_effects: Array - var target_effects: Array -} - -external interface TriggerItem { - var type: String /* "direct" | "area" | "line" | "cluster" */ - var action_delivery: Array? - get() = definedExternally - set(value) = definedExternally - var entity_flags: EntityPrototypeFlags? - get() = definedExternally - set(value) = definedExternally - var ignore_collision_condition: Boolean - var collision_mask: CollisionMask - var trigger_target_mask: TriggerTargetMask - var force: String /* "all" | "enemy" | "ally" | "friend" | "not-friend" | "same" | "not-same" */ - var repeat_count: uint -} - -external interface CircularParticleCreationSpecification { - var name: String - var direction: float - var direction_deviation: float - var speed: float - var speed_deviation: float - var starting_frame_speed: float - var starting_frame_speed_deviation: float - var height: float - var height_deviation: float - var vertical_speed: float - var vertical_speed_deviation: float - var center: PositionTable - var creation_distance: double - var creation_distance_orientation: double - var use_source_position: Boolean -} - -external interface AttackParameterFluid { - var type: String - var damage_modifier: double -} - -external interface BaseAttackParameters { - var type: String /* "projectile" | "stream" | "beam" */ - var range: float - var min_range: float - var range_mode: String /* "center-to-center" | "bounding-box-to-bounding-box" */ - var fire_penalty: float - var rotate_penalty: float - var health_penalty: float - var min_attack_distance: float - var turn_range: float - var damage_modifier: float - var ammo_consumption_modifier: float - var cooldown: float - var warmup: uint - var movement_slow_down_factor: double - var movement_slow_down_cooldown: float - var ammo_type: AmmoType? - get() = definedExternally - set(value) = definedExternally - var ammo_categories: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface ProjectileAttackParameters : BaseAttackParameters { - override var type: String /* "projectile" */ - var projectile_center: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var projectile_creation_distance: float - var projectile_orientation_offset: float - var shell_particle: CircularParticleCreationSpecification? - get() = definedExternally - set(value) = definedExternally - var projectile_creation_parameters: Array */>? - get() = definedExternally - set(value) = definedExternally -} - -external interface StreamAttackParameters : BaseAttackParameters { - override var type: String /* "stream" */ - var gun_barrel_length: float - var gun_center_shift: Record - var fluid_consumption: float - var fluids: Array? - get() = definedExternally - set(value) = definedExternally - var projectile_creation_parameters: Array */>? - get() = definedExternally - set(value) = definedExternally -} - -external interface OtherAttackParameters : BaseAttackParameters { - override var type: String /* "beam" */ -} - -external interface CapsuleAction { - var type: String /* "throw" | "equipment-remote" | "use-on-self" */ - var attack_parameters: dynamic /* ProjectileAttackParameters? | StreamAttackParameters? | OtherAttackParameters? */ - get() = definedExternally - set(value) = definedExternally - var equipment: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface SelectionModeFlags { - @nativeGetter - operator fun get(key: String): Boolean? - @nativeSetter - operator fun set(key: String, value: Boolean?) - var blueprint: Boolean? - get() = definedExternally - set(value) = definedExternally - var deconstruct: Boolean? - get() = definedExternally - set(value) = definedExternally - var items: Boolean? - get() = definedExternally - set(value) = definedExternally - var trees: Boolean? - get() = definedExternally - set(value) = definedExternally - var nothing: Boolean? - get() = definedExternally - set(value) = definedExternally - var friend: Boolean? - get() = definedExternally - set(value) = definedExternally - var enemy: Boolean? - get() = definedExternally - set(value) = definedExternally - var upgrade: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface LogisticFilter { - var index: uint - var name: String - var count: uint -} - -external interface ModSetting { - var value: dynamic /* uint | double | Boolean | String */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ProgrammableSpeakerParameters { - var playback_volume: double - var playback_globally: Boolean - var allow_polyphony: Boolean -} - -external interface ProgrammableSpeakerAlertParameters { - var show_alert: Boolean - var show_on_map: Boolean - var icon_signal_id: SignalID - var alert_message: String -} - -external interface ProgrammableSpeakerCircuitParameters { - var signal_value_is_pitch: Boolean - var instrument_id: uint - var note_id: uint -} - -external interface ProgrammableSpeakerInstrument { - var name: String - var notes: Array -} - -external interface EventData { - var name: uint /* uint & `T$93` */ - var tick: uint - var mod_name: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface NthTickEventData { - var tick: uint - var nth_tick: uint -} - -external interface ModChangeData { - var old_version: String? - var new_version: String? -} - -external interface ConfigurationChangedData { - var old_version: String? - get() = definedExternally - set(value) = definedExternally - var new_version: String? - get() = definedExternally - set(value) = definedExternally - var mod_changes: Record - var mod_startup_settings_changed: Boolean - var migration_applied: Boolean -} - -external interface CustomCommandData { - var name: String - var tick: uint - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var parameter: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface SelectedPrototypeData { - var base_type: String - var derived_type: String - var name: String -} - -external interface ScriptRenderTarget { - var entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var entity_offset: dynamic /* typealias Vector = dynamic */ - get() = definedExternally - set(value) = definedExternally - var position: Position? - get() = definedExternally - set(value) = definedExternally -} - -typealias MouseButtonFlagsTable = Any - -typealias MouseButtonFlagsArray = Array - -external interface ItemStackLocation { - var inventory: inventory - var slot: uint -} - -external interface VehicleAutomaticTargetingParameters { - var auto_target_without_gunner: Boolean - var auto_target_with_gunner: Boolean -} - -external interface BaseItemPrototypeFilter { - var filter: String /* "tool" | "mergeable" | "item-with-inventory" | "selection-tool" | "item-with-label" | "has-rocket-launch-products" | "fuel" | "place-result" | "burnt-result" | "place-as-tile" | "placed-as-equipment-result" | "name" | "type" | "flag" | "subgroup" | "fuel-category" | "stack-size" | "default-request-amount" | "wire-count" | "fuel-value" | "fuel-acceleration-multiplier" | "fuel-top-speed-multiplier" | "fuel-emissions-multiplier" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface PlaceResultItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "place-result" */ - var elem_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface BurntResultItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "burnt-result" */ - var elem_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface PlaceAsTileItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "place-as-tile" */ - var elem_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface PlacedAsEquipmentResultItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "placed-as-equipment-result" */ - var elem_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface NameItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "name" */ - var name: dynamic /* String | Array */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface FlagItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "flag" */ - var flag: String -} - -external interface SubgroupItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "subgroup" */ - var subgroup: String -} - -external interface FuelCategoryItemPrototypeFilter : BaseItemPrototypeFilter { - @nativeGetter - operator fun get(key: String): String? - @nativeSetter - operator fun set(key: String, value: String) - override var filter: String /* "fuel-category" */ -} - -external interface StackSizeItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "stack-size" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint -} - -external interface DefaultRequestAmountItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "default-request-amount" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint -} - -external interface WireCountItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "wire-count" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint -} - -external interface FuelValueItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "fuel-value" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface FuelAccelerationMultiplierItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "fuel-acceleration-multiplier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface FuelTopSpeedMultiplierItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "fuel-top-speed-multiplier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface FuelEmissionsMultiplierItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "fuel-emissions-multiplier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface OtherItemPrototypeFilter : BaseItemPrototypeFilter { - override var filter: String /* "tool" | "mergeable" | "item-with-inventory" | "selection-tool" | "item-with-label" | "has-rocket-launch-products" | "fuel" */ -} - -external interface BaseModSettingPrototypeFilter { - var filter: String /* "type" | "mod" | "setting-type" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeModSettingPrototypeFilter : BaseModSettingPrototypeFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface ModModSettingPrototypeFilter : BaseModSettingPrototypeFilter { - override var filter: String /* "mod" */ - var mod: String -} - -external interface SettingTypeModSettingPrototypeFilter : BaseModSettingPrototypeFilter { - override var filter: String /* "setting-type" */ - var type: String -} - -external interface BaseTechnologyPrototypeFilter { - var filter: String /* "enabled" | "hidden" | "upgrade" | "visible-when-disabled" | "has-effects" | "has-prerequisites" | "research-unit-ingredient" | "level" | "max-level" | "time" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface ResearchUnitIngredientTechnologyPrototypeFilter : BaseTechnologyPrototypeFilter { - override var filter: String /* "research-unit-ingredient" */ - var ingredient: String -} - -external interface LevelTechnologyPrototypeFilter : BaseTechnologyPrototypeFilter { - override var filter: String /* "level" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint -} - -external interface MaxLevelTechnologyPrototypeFilter : BaseTechnologyPrototypeFilter { - override var filter: String /* "max-level" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint -} - -external interface TimeTechnologyPrototypeFilter : BaseTechnologyPrototypeFilter { - override var filter: String /* "time" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint -} - -external interface OtherTechnologyPrototypeFilter : BaseTechnologyPrototypeFilter { - override var filter: String /* "enabled" | "hidden" | "upgrade" | "visible-when-disabled" | "has-effects" | "has-prerequisites" */ -} - -external interface BaseDecorativePrototypeFilter { - var filter: String /* "decal" | "autoplace" | "collision-mask" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface CollisionMaskDecorativePrototypeFilter : BaseDecorativePrototypeFilter { - override var filter: String /* "collision-mask" */ - var mask: dynamic /* CollisionMask | CollisionMaskWithFlags */ - get() = definedExternally - set(value) = definedExternally - var mask_mode: String /* "collides" | "layers-equals" */ -} - -external interface OtherDecorativePrototypeFilter : BaseDecorativePrototypeFilter { - override var filter: String /* "decal" | "autoplace" */ -} - -external interface BaseAchievementPrototypeFilter { - var filter: String /* "allowed-without-fight" | "type" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeAchievementPrototypeFilter : BaseAchievementPrototypeFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface OtherAchievementPrototypeFilter : BaseAchievementPrototypeFilter { - override var filter: String /* "allowed-without-fight" */ -} - -external interface BaseFluidPrototypeFilter { - var filter: String /* "hidden" | "name" | "subgroup" | "default-temperature" | "max-temperature" | "heat-capacity" | "fuel-value" | "emissions-multiplier" | "gas-temperature" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface NameFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "name" */ - var name: dynamic /* String | Array */ - get() = definedExternally - set(value) = definedExternally -} - -external interface SubgroupFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "subgroup" */ - var subgroup: String -} - -external interface DefaultTemperatureFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "default-temperature" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface MaxTemperatureFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "max-temperature" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface HeatCapacityFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "heat-capacity" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface FuelValueFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "fuel-value" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface EmissionsMultiplierFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "emissions-multiplier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface GasTemperatureFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "gas-temperature" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface OtherFluidPrototypeFilter : BaseFluidPrototypeFilter { - override var filter: String /* "hidden" */ -} - -external interface BaseEquipmentPrototypeFilter { - var filter: String /* "item-to-place" | "type" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeEquipmentPrototypeFilter : BaseEquipmentPrototypeFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface OtherEquipmentPrototypeFilter : BaseEquipmentPrototypeFilter { - override var filter: String /* "item-to-place" */ -} - -external interface BaseTilePrototypeFilter { - var filter: String /* "minable" | "autoplace" | "blueprintable" | "item-to-place" | "collision-mask" | "walking-speed-modifier" | "vehicle-friction-modifier" | "decorative-removal-probability" | "emissions" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface CollisionMaskTilePrototypeFilter : BaseTilePrototypeFilter { - override var filter: String /* "collision-mask" */ - var mask: dynamic /* CollisionMask | CollisionMaskWithFlags */ - get() = definedExternally - set(value) = definedExternally - var mask_mode: String /* "collides" | "layers-equals" */ -} - -external interface WalkingSpeedModifierTilePrototypeFilter : BaseTilePrototypeFilter { - override var filter: String /* "walking-speed-modifier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface VehicleFrictionModifierTilePrototypeFilter : BaseTilePrototypeFilter { - override var filter: String /* "vehicle-friction-modifier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface DecorativeRemovalProbabilityTilePrototypeFilter : BaseTilePrototypeFilter { - override var filter: String /* "decorative-removal-probability" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: float -} - -external interface EmissionsTilePrototypeFilter : BaseTilePrototypeFilter { - override var filter: String /* "emissions" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface OtherTilePrototypeFilter : BaseTilePrototypeFilter { - override var filter: String /* "minable" | "autoplace" | "blueprintable" | "item-to-place" */ -} - -external interface BaseRecipePrototypeFilter { - var filter: String /* "enabled" | "hidden" | "hidden-from-flow-stats" | "hidden-from-player-crafting" | "allow-as-intermediate" | "allow-intermediates" | "allow-decomposition" | "always-show-made-in" | "always-show-products" | "show-amount-in-title" | "has-ingredients" | "has-products" | "has-ingredient-item" | "has-ingredient-fluid" | "has-product-item" | "has-product-fluid" | "subgroup" | "category" | "energy" | "emissions-multiplier" | "request-paste-multiplier" | "overload-multiplier" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface HasIngredientItemRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "has-ingredient-item" */ - var elem_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface HasIngredientFluidRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "has-ingredient-fluid" */ - var elem_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface HasProductItemRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "has-product-item" */ - var elem_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface HasProductFluidRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "has-product-fluid" */ - var elem_filters: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface SubgroupRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "subgroup" */ - var subgroup: String -} - -external interface CategoryRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "category" */ - var category: String -} - -external interface EnergyRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "energy" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface EmissionsMultiplierRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "emissions-multiplier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface RequestPasteMultiplierRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "request-paste-multiplier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint -} - -external interface OverloadMultiplierRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "overload-multiplier" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint -} - -external interface OtherRecipePrototypeFilter : BaseRecipePrototypeFilter { - override var filter: String /* "enabled" | "hidden" | "hidden-from-flow-stats" | "hidden-from-player-crafting" | "allow-as-intermediate" | "allow-intermediates" | "allow-decomposition" | "always-show-made-in" | "always-show-products" | "show-amount-in-title" | "has-ingredients" | "has-products" */ -} - -external interface BaseEntityPrototypeFilter { - var filter: String /* "flying-robot" | "robot-with-logistics-interface" | "rail" | "ghost" | "explosion" | "vehicle" | "crafting-machine" | "rolling-stock" | "turret" | "transport-belt-connectable" | "wall-connectable" | "buildable" | "placable-in-editor" | "clonable" | "selectable" | "hidden" | "entity-with-health" | "building" | "fast-replaceable" | "uses-direction" | "minable" | "circuit-connectable" | "autoplace" | "blueprintable" | "item-to-place" | "name" | "type" | "collision-mask" | "flag" | "build-base-evolution-requirement" | "selection-priority" | "emissions" | "crafting-category" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface NameEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "name" */ - var name: dynamic /* String | Array */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface CollisionMaskEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "collision-mask" */ - var mask: dynamic /* CollisionMask | CollisionMaskWithFlags */ - get() = definedExternally - set(value) = definedExternally - var mask_mode: String /* "collides" | "layers-equals" */ -} - -external interface FlagEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "flag" */ - var flag: String -} - -external interface BuildBaseEvolutionRequirementEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "build-base-evolution-requirement" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface SelectionPriorityEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "selection-priority" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: uint8 -} - -external interface EmissionsEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "emissions" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: double -} - -external interface CraftingCategoryEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "crafting-category" */ - var crafting_category: String -} - -external interface OtherEntityPrototypeFilter : BaseEntityPrototypeFilter { - override var filter: String /* "flying-robot" | "robot-with-logistics-interface" | "rail" | "ghost" | "explosion" | "vehicle" | "crafting-machine" | "rolling-stock" | "turret" | "transport-belt-connectable" | "wall-connectable" | "buildable" | "placable-in-editor" | "clonable" | "selectable" | "hidden" | "entity-with-health" | "building" | "fast-replaceable" | "uses-direction" | "minable" | "circuit-connectable" | "autoplace" | "blueprintable" | "item-to-place" */ -} - -external interface BaseScriptRaisedReviveEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeScriptRaisedReviveEventFilter : BaseScriptRaisedReviveEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameScriptRaisedReviveEventFilter : BaseScriptRaisedReviveEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeScriptRaisedReviveEventFilter : BaseScriptRaisedReviveEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameScriptRaisedReviveEventFilter : BaseScriptRaisedReviveEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherScriptRaisedReviveEventFilter : BaseScriptRaisedReviveEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseEntityDiedEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeEntityDiedEventFilter : BaseEntityDiedEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameEntityDiedEventFilter : BaseEntityDiedEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeEntityDiedEventFilter : BaseEntityDiedEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameEntityDiedEventFilter : BaseEntityDiedEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherEntityDiedEventFilter : BaseEntityDiedEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseEntityMarkedForDeconstructionEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeEntityMarkedForDeconstructionEventFilter : BaseEntityMarkedForDeconstructionEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameEntityMarkedForDeconstructionEventFilter : BaseEntityMarkedForDeconstructionEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeEntityMarkedForDeconstructionEventFilter : BaseEntityMarkedForDeconstructionEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameEntityMarkedForDeconstructionEventFilter : BaseEntityMarkedForDeconstructionEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherEntityMarkedForDeconstructionEventFilter : BaseEntityMarkedForDeconstructionEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BasePreGhostDeconstructedEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypePreGhostDeconstructedEventFilter : BasePreGhostDeconstructedEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NamePreGhostDeconstructedEventFilter : BasePreGhostDeconstructedEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypePreGhostDeconstructedEventFilter : BasePreGhostDeconstructedEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNamePreGhostDeconstructedEventFilter : BasePreGhostDeconstructedEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherPreGhostDeconstructedEventFilter : BasePreGhostDeconstructedEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseScriptRaisedDestroyEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeScriptRaisedDestroyEventFilter : BaseScriptRaisedDestroyEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameScriptRaisedDestroyEventFilter : BaseScriptRaisedDestroyEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeScriptRaisedDestroyEventFilter : BaseScriptRaisedDestroyEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameScriptRaisedDestroyEventFilter : BaseScriptRaisedDestroyEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherScriptRaisedDestroyEventFilter : BaseScriptRaisedDestroyEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseUpgradeCancelledEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeUpgradeCancelledEventFilter : BaseUpgradeCancelledEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameUpgradeCancelledEventFilter : BaseUpgradeCancelledEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeUpgradeCancelledEventFilter : BaseUpgradeCancelledEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameUpgradeCancelledEventFilter : BaseUpgradeCancelledEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherUpgradeCancelledEventFilter : BaseUpgradeCancelledEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BasePlayerRepairedEntityEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypePlayerRepairedEntityEventFilter : BasePlayerRepairedEntityEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NamePlayerRepairedEntityEventFilter : BasePlayerRepairedEntityEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypePlayerRepairedEntityEventFilter : BasePlayerRepairedEntityEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNamePlayerRepairedEntityEventFilter : BasePlayerRepairedEntityEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherPlayerRepairedEntityEventFilter : BasePlayerRepairedEntityEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseEntityMarkedForUpgradeEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeEntityMarkedForUpgradeEventFilter : BaseEntityMarkedForUpgradeEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameEntityMarkedForUpgradeEventFilter : BaseEntityMarkedForUpgradeEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeEntityMarkedForUpgradeEventFilter : BaseEntityMarkedForUpgradeEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameEntityMarkedForUpgradeEventFilter : BaseEntityMarkedForUpgradeEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherEntityMarkedForUpgradeEventFilter : BaseEntityMarkedForUpgradeEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BasePostEntityDiedEventFilter { - var filter: String /* "type" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypePostEntityDiedEventFilter : BasePostEntityDiedEventFilter { - override var filter: String /* "type" */ - var type: String -} - -typealias LuaPostEntityDiedEventFilter = TypePostEntityDiedEventFilter - -external interface BasePreRobotMinedEntityEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypePreRobotMinedEntityEventFilter : BasePreRobotMinedEntityEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NamePreRobotMinedEntityEventFilter : BasePreRobotMinedEntityEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypePreRobotMinedEntityEventFilter : BasePreRobotMinedEntityEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNamePreRobotMinedEntityEventFilter : BasePreRobotMinedEntityEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherPreRobotMinedEntityEventFilter : BasePreRobotMinedEntityEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseEntityClonedEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeEntityClonedEventFilter : BaseEntityClonedEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameEntityClonedEventFilter : BaseEntityClonedEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeEntityClonedEventFilter : BaseEntityClonedEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameEntityClonedEventFilter : BaseEntityClonedEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherEntityClonedEventFilter : BaseEntityClonedEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseScriptRaisedBuiltEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeScriptRaisedBuiltEventFilter : BaseScriptRaisedBuiltEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameScriptRaisedBuiltEventFilter : BaseScriptRaisedBuiltEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeScriptRaisedBuiltEventFilter : BaseScriptRaisedBuiltEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameScriptRaisedBuiltEventFilter : BaseScriptRaisedBuiltEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherScriptRaisedBuiltEventFilter : BaseScriptRaisedBuiltEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseRobotMinedEntityEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeRobotMinedEntityEventFilter : BaseRobotMinedEntityEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameRobotMinedEntityEventFilter : BaseRobotMinedEntityEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeRobotMinedEntityEventFilter : BaseRobotMinedEntityEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameRobotMinedEntityEventFilter : BaseRobotMinedEntityEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherRobotMinedEntityEventFilter : BaseRobotMinedEntityEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BasePrePlayerMinedEntityEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypePrePlayerMinedEntityEventFilter : BasePrePlayerMinedEntityEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NamePrePlayerMinedEntityEventFilter : BasePrePlayerMinedEntityEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypePrePlayerMinedEntityEventFilter : BasePrePlayerMinedEntityEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNamePrePlayerMinedEntityEventFilter : BasePrePlayerMinedEntityEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherPrePlayerMinedEntityEventFilter : BasePrePlayerMinedEntityEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseRobotBuiltEntityEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" | "force" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeRobotBuiltEntityEventFilter : BaseRobotBuiltEntityEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameRobotBuiltEntityEventFilter : BaseRobotBuiltEntityEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeRobotBuiltEntityEventFilter : BaseRobotBuiltEntityEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameRobotBuiltEntityEventFilter : BaseRobotBuiltEntityEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface ForceRobotBuiltEntityEventFilter : BaseRobotBuiltEntityEventFilter { - override var filter: String /* "force" */ - var force: String -} - -external interface OtherRobotBuiltEntityEventFilter : BaseRobotBuiltEntityEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseEntityDeconstructionCancelledEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeEntityDeconstructionCancelledEventFilter : BaseEntityDeconstructionCancelledEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameEntityDeconstructionCancelledEventFilter : BaseEntityDeconstructionCancelledEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeEntityDeconstructionCancelledEventFilter : BaseEntityDeconstructionCancelledEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameEntityDeconstructionCancelledEventFilter : BaseEntityDeconstructionCancelledEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherEntityDeconstructionCancelledEventFilter : BaseEntityDeconstructionCancelledEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BasePlayerBuiltEntityEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" | "force" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypePlayerBuiltEntityEventFilter : BasePlayerBuiltEntityEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NamePlayerBuiltEntityEventFilter : BasePlayerBuiltEntityEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypePlayerBuiltEntityEventFilter : BasePlayerBuiltEntityEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNamePlayerBuiltEntityEventFilter : BasePlayerBuiltEntityEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface ForcePlayerBuiltEntityEventFilter : BasePlayerBuiltEntityEventFilter { - override var filter: String /* "force" */ - var force: String -} - -external interface OtherPlayerBuiltEntityEventFilter : BasePlayerBuiltEntityEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BasePlayerMinedEntityEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypePlayerMinedEntityEventFilter : BasePlayerMinedEntityEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NamePlayerMinedEntityEventFilter : BasePlayerMinedEntityEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypePlayerMinedEntityEventFilter : BasePlayerMinedEntityEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNamePlayerMinedEntityEventFilter : BasePlayerMinedEntityEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherPlayerMinedEntityEventFilter : BasePlayerMinedEntityEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseEntityDamagedEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" | "original-damage-amount" | "final-damage-amount" | "damage-type" | "final-health" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OriginalDamageAmountEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "original-damage-amount" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: float -} - -external interface FinalDamageAmountEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "final-damage-amount" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: float -} - -external interface DamageTypeEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "damage-type" */ - var type: String -} - -external interface FinalHealthEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "final-health" */ - var comparison: String /* "=" | ">" | "<" | "≥" | ">=" | "≤" | "<=" | "≠" | "!=" */ - var value: float -} - -external interface OtherEntityDamagedEventFilter : BaseEntityDamagedEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface BaseSectorScannedEventFilter { - var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" | "type" | "name" | "ghost_type" | "ghost_name" */ - var mode: String? /* "or" | "and" */ - get() = definedExternally - set(value) = definedExternally - var invert: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeSectorScannedEventFilter : BaseSectorScannedEventFilter { - override var filter: String /* "type" */ - var type: String -} - -external interface NameSectorScannedEventFilter : BaseSectorScannedEventFilter { - override var filter: String /* "name" */ - var name: String -} - -external interface GhostTypeSectorScannedEventFilter : BaseSectorScannedEventFilter { - override var filter: String /* "ghost_type" */ - var type: String -} - -external interface GhostNameSectorScannedEventFilter : BaseSectorScannedEventFilter { - override var filter: String /* "ghost_name" */ - var name: String -} - -external interface OtherSectorScannedEventFilter : BaseSectorScannedEventFilter { - override var filter: String /* "ghost" | "rail" | "rail-signal" | "rolling-stock" | "robot-with-logistics-interface" | "vehicle" | "turret" | "crafting-machine" | "wall-connectable" | "transport-belt-connectable" | "circuit-network-connectable" */ -} - -external interface `T$87` { - var enabled: Boolean? - get() = definedExternally - set(value) = definedExternally - var diffusion_ratio: double? - get() = definedExternally - set(value) = definedExternally - var ageing: double? - get() = definedExternally - set(value) = definedExternally - var enemy_attack_pollution_consumption_modifier: double? - get() = definedExternally - set(value) = definedExternally - var min_pollution_to_damage_trees: double? - get() = definedExternally - set(value) = definedExternally - var pollution_restored_per_tree_damage: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$88` { - var enabled: Boolean? - get() = definedExternally - set(value) = definedExternally - var time_factor: double? - get() = definedExternally - set(value) = definedExternally - var destroy_factor: double? - get() = definedExternally - set(value) = definedExternally - var pollution_factor: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$89` { - var enabled: Boolean? - get() = definedExternally - set(value) = definedExternally - var max_expansion_distance: double? - get() = definedExternally - set(value) = definedExternally - var settler_group_min_size: double? - get() = definedExternally - set(value) = definedExternally - var settler_group_max_size: double? - get() = definedExternally - set(value) = definedExternally - var min_expansion_cooldown: double? - get() = definedExternally - set(value) = definedExternally - var max_expansion_cooldown: double? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$90` { - var recipe_difficulty: recipe_difficulty? - get() = definedExternally - set(value) = definedExternally - var technology_difficulty: technology_difficulty? - get() = definedExternally - set(value) = definedExternally - var technology_price_multiplier: double? - get() = definedExternally - set(value) = definedExternally - var research_queue_setting: String? /* "after-victory" | "always" | "never" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$91` { - var pollution: `T$87`? - get() = definedExternally - set(value) = definedExternally - var enemy_evolution: `T$88`? - get() = definedExternally - set(value) = definedExternally - var enemy_expansion: `T$89`? - get() = definedExternally - set(value) = definedExternally - var difficulty_settings: `T$90`? - get() = definedExternally - set(value) = definedExternally -} - -external interface MapGenPreset { - var order: String - var default: Boolean? - get() = definedExternally - set(value) = definedExternally - var basic_settings: MapGenSettingsPartial - var advanced_settings: `T$91` -} - -external interface BlueprintControlBehavior { - var condition: CircuitCondition? - get() = definedExternally - set(value) = definedExternally - var circuit_condition: CircuitCondition? - get() = definedExternally - set(value) = definedExternally - var filters: Array? - get() = definedExternally - set(value) = definedExternally - var is_on: Boolean? - get() = definedExternally - set(value) = definedExternally - var arithmetic_conditions: ArithmeticCombinatorParameters? - get() = definedExternally - set(value) = definedExternally - var decider_conditions: DeciderCombinatorParameters? - get() = definedExternally - set(value) = definedExternally - var circuit_enable_disable: Boolean? - get() = definedExternally - set(value) = definedExternally - var circuit_read_resources: Boolean? - get() = definedExternally - set(value) = definedExternally - var circuit_resource_read_mode: resource_read_mode? - get() = definedExternally - set(value) = definedExternally - var read_stopped_train: Boolean? - get() = definedExternally - set(value) = definedExternally - var train_stopped_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var read_from_train: Boolean? - get() = definedExternally - set(value) = definedExternally - var send_to_train: Boolean? - get() = definedExternally - set(value) = definedExternally - var circuit_mode_of_operation: Number? - get() = definedExternally - set(value) = definedExternally - var circuit_read_hand_contents: Boolean? - get() = definedExternally - set(value) = definedExternally - var circuit_hand_read_mode: hand_read_mode? - get() = definedExternally - set(value) = definedExternally - var circuit_set_stack_size: Boolean? - get() = definedExternally - set(value) = definedExternally - var stack_control_input_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var use_colors: Boolean? - get() = definedExternally - set(value) = definedExternally - var read_robot_stats: Boolean? - get() = definedExternally - set(value) = definedExternally - var read_logistics: Boolean? - get() = definedExternally - set(value) = definedExternally - var available_logistic_output_signal: Boolean? - get() = definedExternally - set(value) = definedExternally - var total_logistic_output_signal: Boolean? - get() = definedExternally - set(value) = definedExternally - var available_construction_output_signal: Boolean? - get() = definedExternally - set(value) = definedExternally - var total_construction_output_signal: Boolean? - get() = definedExternally - set(value) = definedExternally - var circuit_contents_read_mode: content_read_mode? - get() = definedExternally - set(value) = definedExternally - var output_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var circuit_close_signal: Boolean? - get() = definedExternally - set(value) = definedExternally - var circuit_read_signal: Boolean? - get() = definedExternally - set(value) = definedExternally - var red_output_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var orange_output_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var green_output_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var blue_output_signal: SignalID? - get() = definedExternally - set(value) = definedExternally - var circuit_open_gate: Boolean? - get() = definedExternally - set(value) = definedExternally - var circuit_read_sensor: Boolean? - get() = definedExternally - set(value) = definedExternally - var circuit_parameters: ProgrammableSpeakerCircuitParameters? - get() = definedExternally - set(value) = definedExternally -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/coroutine/coroutine.coroutine.module_lua-types.kt b/modules/mod2/dukat-custom/coroutine/coroutine.coroutine.module_lua-types.kt deleted file mode 100644 index 2228c85..0000000 --- a/modules/mod2/dukat-custom/coroutine/coroutine.coroutine.module_lua-types.kt +++ /dev/null @@ -1,30 +0,0 @@ -@file:JsQualifier("coroutine") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package coroutine - -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 LuaThread - -external fun create(f: (args: Any) -> Any): LuaThread - -external fun resume(co: LuaThread, vararg param_val: Any): dynamic /* JsTuple | JsTuple */ - -external fun status(co: LuaThread): String /* "running" | "suspended" | "normal" | "dead" */ - -external fun wrap(f: (args: Any) -> Any): (args: Any) -> Array - -external fun yield(vararg args: Any): Array /* Array & LuaExtension */ - -external fun running(): dynamic /* JsTuple */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/debug/debug.debug.module_lua-types.kt b/modules/mod2/dukat-custom/debug/debug.debug.module_lua-types.kt deleted file mode 100644 index fd5215e..0000000 --- a/modules/mod2/dukat-custom/debug/debug.debug.module_lua-types.kt +++ /dev/null @@ -1,162 +0,0 @@ -@file:JsQualifier("debug") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package debug - -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 LuaThread -import LuaMetatable__1 -import tsstdlib.Record -import LuaUserdata -import LuaMetatable - -external fun debug() - -external fun gethook(thread: LuaThread = definedExternally): dynamic /* JsTuple | JsTuple, Number, Any> */ - -external interface FunctionInfo> { - var nparams: Number - var isvararg: Boolean? - var istailcall: Boolean? - var func: T - var name: String? - get() = definedExternally - set(value) = definedExternally - var namewhat: String /* "global" | "local" | "method" | "field" | "" */ - var source: String - var short_src: String - var linedefined: Number - var lastlinedefined: Number - var what: String /* "Lua" | "C" | "main" */ - var currentline: Number - var nups: Number -} - -external interface FunctionInfoPartial> { - var nparams: Number? - get() = definedExternally - set(value) = definedExternally - var isvararg: Boolean? - get() = definedExternally - set(value) = definedExternally - var istailcall: Boolean? - get() = definedExternally - set(value) = definedExternally - var func: T? - get() = definedExternally - set(value) = definedExternally - var name: String? - get() = definedExternally - set(value) = definedExternally - var namewhat: String? /* "global" | "local" | "method" | "field" | "" */ - get() = definedExternally - set(value) = definedExternally - var source: String? - get() = definedExternally - set(value) = definedExternally - var short_src: String? - get() = definedExternally - set(value) = definedExternally - var linedefined: Number? - get() = definedExternally - set(value) = definedExternally - var lastlinedefined: Number? - get() = definedExternally - set(value) = definedExternally - var what: String? /* "Lua" | "C" | "main" */ - get() = definedExternally - set(value) = definedExternally - var currentline: Number? - get() = definedExternally - set(value) = definedExternally - var nups: Number? - get() = definedExternally - set(value) = definedExternally -} - -external interface FunctionInfo__0 : FunctionInfo> - -external interface FunctionInfo__0Partial : FunctionInfoPartial> - -external fun > getinfo(f: T): FunctionInfo - -external fun > getinfo(f: T, what: String): FunctionInfoPartial - -external fun > getinfo(thread: LuaThread, f: T): FunctionInfo - -external fun > getinfo(thread: LuaThread, f: T, what: String): FunctionInfoPartial - -external fun getinfo(f: Number): FunctionInfo__0? - -external fun getinfo(f: Number, what: String): FunctionInfo__0Partial? - -external fun getinfo(thread: LuaThread, f: Number): FunctionInfo__0? - -external fun getinfo(thread: LuaThread, f: Number, what: String): FunctionInfo__0Partial? - -external fun getmetatable(value: T): LuaMetatable__1? - -external fun getregistry(): Record - -external fun getupvalue(f: Function<*>, up: Number): dynamic /* JsTuple | JsTuple<> */ - -external fun getuservalue(u: LuaUserdata): Any - -external fun sethook() - -external fun sethook(hook: (event: String /* "call" | "return" | "line" | "count" */, line: Number) -> Any, mask: String, count: Number = definedExternally) - -external fun sethook(hook: (event: String /* "call" | "return" | "line" | "count" */, line: Number) -> Any, mask: String) - -external fun sethook(thread: LuaThread, hook: (event: String /* "call" | "return" | "line" | "count" */, line: Number) -> Any, mask: String, count: Number = definedExternally) - -external fun sethook(thread: LuaThread, hook: (event: String /* "call" | "return" | "line" | "count" */, line: Number) -> Any, mask: String) - -external fun setlocal(level: Number, local: Number, value: Any): String? - -external fun setlocal(thread: LuaThread, level: Number, local: Number, value: Any): String? - -external fun setmetatable(value: T, table: LuaMetatable? = definedExternally): Any - -external fun setupvalue(f: Function<*>, up: Number, value: Any): String? - -external fun setuservalue(udata: LuaUserdata, value: Any): LuaUserdata - -external fun traceback(message: String? = definedExternally, level: Number? = definedExternally): String - -external fun traceback(): String - -external fun traceback(message: String? = definedExternally): String - -external fun traceback(thread: LuaThread = definedExternally, message: String? = definedExternally, level: Number? = definedExternally): String - -external fun traceback(thread: LuaThread = definedExternally): String - -external fun traceback(thread: LuaThread = definedExternally, message: String? = definedExternally): String - -external fun traceback(message: T): T - -external fun traceback(thread: LuaThread, message: T): T - -external fun getlocal(f: Function<*>, local: Number): dynamic /* JsTuple */ - -external fun getlocal(f: Number, local: Number): dynamic /* JsTuple */ - -external fun getlocal(thread: LuaThread, f: Function<*>, local: Number): dynamic /* JsTuple */ - -external fun getlocal(thread: LuaThread, f: Number, local: Number): dynamic /* JsTuple */ - -external fun upvalueid(f: Function<*>, n: Number): LuaUserdata - -external fun upvaluejoin(f1: Function<*>, n1: Number, f2: Function<*>, n2: Number) \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/control_behavior/defines.defines.control_behavior.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/control_behavior/defines.defines.control_behavior.module_typed-factorio.kt deleted file mode 100644 index 4c0ec5b..0000000 --- a/modules/mod2/dukat-custom/defines/control_behavior/defines.defines.control_behavior.module_typed-factorio.kt +++ /dev/null @@ -1,38 +0,0 @@ -@file:JsQualifier("defines.control_behavior") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.control_behavior - -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 type { - container, - generic_on_off, - inserter, - lamp, - logistic_container, - roboport, - storage_tank, - train_stop, - decider_combinator, - arithmetic_combinator, - constant_combinator, - transport_belt, - accumulator, - rail_signal, - rail_chain_signal, - wall, - mining_drill, - programmable_speaker -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/control_behavior/inserter/defines.defines.control_behavior.inserter.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/control_behavior/inserter/defines.defines.control_behavior.inserter.module_typed-factorio.kt deleted file mode 100644 index 9a91be8..0000000 --- a/modules/mod2/dukat-custom/defines/control_behavior/inserter/defines.defines.control_behavior.inserter.module_typed-factorio.kt +++ /dev/null @@ -1,30 +0,0 @@ -@file:JsQualifier("defines.control_behavior.inserter") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.control_behavior.inserter - -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 circuit_mode_of_operation { - none, - enable_disable, - set_filters, - read_hand_contents, - set_stack_size -} - -external enum class hand_read_mode { - hold, - pulse -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/control_behavior/lamp/defines.defines.control_behavior.lamp.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/control_behavior/lamp/defines.defines.control_behavior.lamp.module_typed-factorio.kt deleted file mode 100644 index 4688694..0000000 --- a/modules/mod2/dukat-custom/defines/control_behavior/lamp/defines.defines.control_behavior.lamp.module_typed-factorio.kt +++ /dev/null @@ -1,21 +0,0 @@ -@file:JsQualifier("defines.control_behavior.lamp") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.control_behavior.lamp - -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 circuit_mode_of_operation { - use_colors -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/control_behavior/logistic_container/defines.defines.control_behavior.logistic_container.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/control_behavior/logistic_container/defines.defines.control_behavior.logistic_container.module_typed-factorio.kt deleted file mode 100644 index e9a2d7a..0000000 --- a/modules/mod2/dukat-custom/defines/control_behavior/logistic_container/defines.defines.control_behavior.logistic_container.module_typed-factorio.kt +++ /dev/null @@ -1,22 +0,0 @@ -@file:JsQualifier("defines.control_behavior.logistic_container") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.control_behavior.logistic_container - -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 circuit_mode_of_operation { - send_contents, - set_requests -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/control_behavior/mining_drill/defines.defines.control_behavior.mining_drill.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/control_behavior/mining_drill/defines.defines.control_behavior.mining_drill.module_typed-factorio.kt deleted file mode 100644 index 86c2231..0000000 --- a/modules/mod2/dukat-custom/defines/control_behavior/mining_drill/defines.defines.control_behavior.mining_drill.module_typed-factorio.kt +++ /dev/null @@ -1,22 +0,0 @@ -@file:JsQualifier("defines.control_behavior.mining_drill") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.control_behavior.mining_drill - -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 resource_read_mode { - this_miner, - entire_patch -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/control_behavior/transport_belt/defines.defines.control_behavior.transport_belt.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/control_behavior/transport_belt/defines.defines.control_behavior.transport_belt.module_typed-factorio.kt deleted file mode 100644 index c78e4e7..0000000 --- a/modules/mod2/dukat-custom/defines/control_behavior/transport_belt/defines.defines.control_behavior.transport_belt.module_typed-factorio.kt +++ /dev/null @@ -1,22 +0,0 @@ -@file:JsQualifier("defines.control_behavior.transport_belt") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.control_behavior.transport_belt - -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 content_read_mode { - pulse, - hold -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/deconstruction_item/defines.defines.deconstruction_item.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/deconstruction_item/defines.defines.deconstruction_item.module_typed-factorio.kt deleted file mode 100644 index 26ee0cc..0000000 --- a/modules/mod2/dukat-custom/defines/deconstruction_item/defines.defines.deconstruction_item.module_typed-factorio.kt +++ /dev/null @@ -1,34 +0,0 @@ -@file:JsQualifier("defines.deconstruction_item") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.deconstruction_item - -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 entity_filter_mode { - whitelist, - blacklist -} - -external enum class tile_filter_mode { - whitelist, - blacklist -} - -external enum class tile_selection_mode { - normal, - always, - never, - only -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/defines.defines.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/defines.defines.module_typed-factorio.kt deleted file mode 100644 index 0c4e085..0000000 --- a/modules/mod2/dukat-custom/defines/defines.defines.module_typed-factorio.kt +++ /dev/null @@ -1,668 +0,0 @@ -@file:JsQualifier("defines") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines - -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 alert_type { - entity_destroyed, - entity_under_attack, - not_enough_construction_robots, - no_material_for_construction, - not_enough_repair_packs, - turret_fire, - custom, - no_storage, - train_out_of_fuel -} - -external enum class behavior_result { - in_progress, - fail, - success, - deleted -} - -external enum class build_check_type { - script, - manual, - manual_ghost, - script_ghost, - blueprint_ghost, - ghost_revive -} - -external enum class chain_signal_state { - none, - all_open, - partially_open, - none_open -} - -external enum class chunk_generated_status { - nothing, - custom_tiles, - basic_tiles, - corrected_tiles, - tiles, - entities -} - -external enum class circuit_condition_index { - inserter_circuit, - inserter_logistic, - lamp, - arithmetic_combinator, - decider_combinator, - constant_combinator, - offshore_pump, - pump -} - -external enum class circuit_connector_id { - accumulator, - constant_combinator, - container, - programmable_speaker, - rail_signal, - rail_chain_signal, - roboport, - storage_tank, - wall, - electric_pole, - inserter, - lamp, - combinator_input, - combinator_output, - offshore_pump, - pump -} - -external enum class command { - attack /* = 0 */, - go_to_location /* = 1 */, - compound /* = 2 */, - group /* = 3 */, - attack_area /* = 4 */, - wander /* = 5 */, - flee /* = 6 */, - stop /* = 7 */, - build_base /* = 8 */ -} - -external enum class compound_command { - logical_and, - logical_or, - return_last -} - -external enum class controllers { - ghost, - character, - god, - editor, - cutscene, - spectator -} - -external enum class difficulty { - easy, - normal, - hard -} - -external enum class direction { - north /* = 0 */, - northeast /* = 1 */, - east /* = 2 */, - southeast /* = 3 */, - south /* = 4 */, - southwest /* = 5 */, - west /* = 6 */, - northwest /* = 7 */ -} - -external enum class disconnect_reason { - quit, - dropped, - reconnect, - wrong_input, - desync_limit_reached, - cannot_keep_up, - afk, - kicked, - kicked_and_deleted, - banned, - switching_servers -} - -external enum class distraction { - none, - by_enemy, - by_anything, - by_damage -} - -external enum class entity_status { - working, - normal, - no_power, - low_power, - no_fuel, - disabled_by_control_behavior, - opened_by_circuit_network, - closed_by_circuit_network, - disabled_by_script, - marked_for_deconstruction, - not_plugged_in_electric_network, - networks_connected, - networks_disconnected, - charging, - discharging, - fully_charged, - out_of_logistic_network, - no_recipe, - no_ingredients, - no_input_fluid, - no_research_in_progress, - no_minable_resources, - low_input_fluid, - fluid_ingredient_shortage, - full_output, - item_ingredient_shortage, - missing_required_fluid, - missing_science_packs, - waiting_for_source_items, - waiting_for_space_in_destination, - preparing_rocket_for_launch, - waiting_to_launch_rocket, - launching_rocket, - no_modules_to_transmit, - recharging_after_power_outage, - waiting_for_target_to_be_built, - waiting_for_train, - no_ammo, - low_temperature, - disabled, - turned_off_during_daytime, - not_connected_to_rail, - cant_divide_segments -} - -external enum class flow_precision_index { - five_seconds, - one_minute, - ten_minutes, - one_hour, - ten_hours, - fifty_hours, - two_hundred_fifty_hours, - one_thousand_hours -} - -external enum class group_state { - gathering, - moving, - attacking_distraction, - attacking_target, - finished, - pathfinding, - wander_in_group -} - -external enum class gui_type { - none, - entity, - research, - controller, - production, - item, - bonus, - trains, - achievement, - blueprint_library, - equipment, - logistic, - other_player, - permissions, - tutorials, - custom, - server_management, - player_management, - tile -} - -external enum class input_action { - activate_copy, - activate_cut, - activate_paste, - add_permission_group, - add_train_station, - admin_action, - alt_select_area, - alt_select_blueprint_entities, - alternative_copy, - begin_mining, - begin_mining_terrain, - build, - build_rail, - build_terrain, - cancel_craft, - cancel_deconstruct, - cancel_new_blueprint, - cancel_research, - cancel_upgrade, - change_active_character_tab, - change_active_item_group_for_crafting, - change_active_item_group_for_filters, - change_active_quick_bar, - change_arithmetic_combinator_parameters, - change_decider_combinator_parameters, - change_entity_label, - change_item_description, - change_item_label, - change_multiplayer_config, - change_picking_state, - change_programmable_speaker_alert_parameters, - change_programmable_speaker_circuit_parameters, - change_programmable_speaker_parameters, - change_riding_state, - change_shooting_state, - change_train_stop_station, - change_train_wait_condition, - change_train_wait_condition_data, - clear_cursor, - connect_rolling_stock, - copy, - copy_entity_settings, - copy_opened_blueprint, - copy_opened_item, - craft, - cursor_split, - cursor_transfer, - custom_input, - cycle_blueprint_book_backwards, - cycle_blueprint_book_forwards, - deconstruct, - delete_blueprint_library, - delete_blueprint_record, - delete_custom_tag, - delete_permission_group, - destroy_item, - destroy_opened_item, - disconnect_rolling_stock, - drag_train_schedule, - drag_train_wait_condition, - drop_blueprint_record, - drop_item, - edit_blueprint_tool_preview, - edit_custom_tag, - edit_permission_group, - export_blueprint, - fast_entity_split, - fast_entity_transfer, - flush_opened_entity_fluid, - flush_opened_entity_specific_fluid, - go_to_train_station, - grab_blueprint_record, - gui_checked_state_changed, - gui_click, - gui_confirmed, - gui_elem_changed, - gui_location_changed, - gui_selected_tab_changed, - gui_selection_state_changed, - gui_switch_state_changed, - gui_text_changed, - gui_value_changed, - import_blueprint, - import_blueprint_string, - import_blueprints_filtered, - import_permissions_string, - inventory_split, - inventory_transfer, - launch_rocket, - lua_shortcut, - map_editor_action, - market_offer, - mod_settings_changed, - open_achievements_gui, - open_blueprint_library_gui, - open_blueprint_record, - open_bonus_gui, - open_character_gui, - open_current_vehicle_gui, - open_equipment, - open_gui, - open_item, - open_logistic_gui, - open_mod_item, - open_parent_of_opened_item, - open_production_gui, - open_technology_gui, - open_tips_and_tricks_gui, - open_train_gui, - open_train_station_gui, - open_trains_gui, - paste_entity_settings, - place_equipment, - quick_bar_pick_slot, - quick_bar_set_selected_page, - quick_bar_set_slot, - reassign_blueprint, - remove_cables, - remove_train_station, - reset_assembling_machine, - reset_item, - rotate_entity, - select_area, - select_blueprint_entities, - select_entity_slot, - select_item, - select_mapper_slot, - select_next_valid_gun, - select_tile_slot, - send_spidertron, - set_auto_launch_rocket, - set_autosort_inventory, - set_behavior_mode, - set_car_weapons_control, - set_circuit_condition, - set_circuit_mode_of_operation, - set_controller_logistic_trash_filter_item, - set_deconstruction_item_tile_selection_mode, - set_deconstruction_item_trees_and_rocks_only, - set_entity_color, - set_entity_energy_property, - set_entity_logistic_trash_filter_item, - set_filter, - set_flat_controller_gui, - set_heat_interface_mode, - set_heat_interface_temperature, - set_infinity_container_filter_item, - set_infinity_container_remove_unfiltered_items, - set_infinity_pipe_filter, - set_inserter_max_stack_size, - set_inventory_bar, - set_linked_container_link_i_d, - set_logistic_filter_item, - set_logistic_filter_signal, - set_player_color, - set_recipe_notifications, - set_request_from_buffers, - set_research_finished_stops_game, - set_signal, - set_splitter_priority, - set_train_stopped, - set_trains_limit, - set_vehicle_automatic_targeting_parameters, - setup_assembling_machine, - setup_blueprint, - setup_single_blueprint_record, - smart_pipette, - spawn_item, - stack_split, - stack_transfer, - start_repair, - start_research, - start_walking, - stop_building_by_moving, - switch_connect_to_logistic_network, - switch_constant_combinator_state, - switch_inserter_filter_mode_state, - switch_power_switch_state, - switch_to_rename_stop_gui, - take_equipment, - toggle_deconstruction_item_entity_filter_mode, - toggle_deconstruction_item_tile_filter_mode, - toggle_driving, - toggle_enable_vehicle_logistics_while_moving, - toggle_entity_logistic_requests, - toggle_equipment_movement_bonus, - toggle_map_editor, - toggle_personal_logistic_requests, - toggle_personal_roboport, - toggle_show_entity_info, - translate_string, - undo, - upgrade, - upgrade_opened_blueprint_by_item, - upgrade_opened_blueprint_by_record, - use_artillery_remote, - use_item, - wire_dragging, - write_to_console -} - -external enum class inventory { - fuel, - burnt_result, - chest, - furnace_source, - furnace_result, - furnace_modules, - character_main, - character_guns, - character_ammo, - character_armor, - character_vehicle, - character_trash, - god_main, - editor_main, - editor_guns, - editor_ammo, - editor_armor, - roboport_robot, - roboport_material, - robot_cargo, - robot_repair, - assembling_machine_input, - assembling_machine_output, - assembling_machine_modules, - lab_input, - lab_modules, - mining_drill_modules, - item_main, - rocket_silo_rocket, - rocket_silo_result, - rocket, - car_trunk, - car_ammo, - cargo_wagon, - turret_ammo, - beacon_modules, - character_corpse, - artillery_turret_ammo, - artillery_wagon_ammo, - spider_trunk, - spider_ammo, - spider_trash -} - -external enum class logistic_member_index { - logistic_container, - vehicle_storage, - character_requester, - character_storage, - character_provider, - generic_on_off_behavior -} - -external enum class logistic_mode { - none, - active_provider, - storage, - requester, - passive_provider, - buffer -} - -external enum class mouse_button_type { - none, - left, - right, - middle -} - -external var prototypes: Any - -external enum class rail_connection_direction { - left, - straight, - right, - none -} - -external enum class rail_direction { - front, - back -} - -external enum class relative_gui_position { - top, - bottom, - left, - right -} - -external enum class relative_gui_type { - accumulator_gui, - achievement_gui, - additional_entity_info_gui, - admin_gui, - arithmetic_combinator_gui, - armor_gui, - assembling_machine_gui, - assembling_machine_select_recipe_gui, - beacon_gui, - blueprint_book_gui, - blueprint_library_gui, - blueprint_setup_gui, - bonus_gui, - burner_equipment_gui, - car_gui, - constant_combinator_gui, - container_gui, - controller_gui, - decider_combinator_gui, - deconstruction_item_gui, - electric_energy_interface_gui, - electric_network_gui, - entity_variations_gui, - entity_with_energy_source_gui, - equipment_grid_gui, - furnace_gui, - generic_on_off_entity_gui, - heat_interface_gui, - infinity_pipe_gui, - inserter_gui, - item_with_inventory_gui, - lab_gui, - lamp_gui, - linked_container_gui, - loader_gui, - logistic_gui, - market_gui, - mining_drill_gui, - other_player_gui, - permissions_gui, - pipe_gui, - power_switch_gui, - production_gui, - programmable_speaker_gui, - rail_chain_signal_gui, - rail_signal_gui, - reactor_gui, - rename_stop_gui, - resource_entity_gui, - roboport_gui, - rocket_silo_gui, - server_config_gui, - spider_vehicle_gui, - splitter_gui, - standalone_character_gui, - storage_tank_gui, - tile_variations_gui, - train_gui, - train_stop_gui, - trains_gui, - transport_belt_gui, - upgrade_item_gui, - wall_gui -} - -external enum class render_mode { - game, - chart, - chart_zoomed_in -} - -external enum class rich_text_setting { - enabled, - disabled, - highlight -} - -external enum class shooting { - not_shooting, - shooting_enemies, - shooting_selected -} - -external enum class signal_state { - open, - closed, - reserved, - reserved_by_circuit_network -} - -external enum class train_state { - on_the_path, - path_lost, - no_schedule, - no_path, - arrive_signal, - wait_signal, - arrive_station, - wait_station, - manual_control_stop, - manual_control, - destination_full -} - -external enum class transport_line { - left_line, - right_line, - left_underground_line, - right_underground_line, - secondary_left_line, - secondary_right_line, - left_split_line, - right_split_line, - secondary_left_split_line, - secondary_right_split_line -} - -external enum class wire_connection_id { - electric_pole, - power_switch_left, - power_switch_right -} - -external enum class wire_type { - red, - green, - copper -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/difficulty_settings/defines.defines.difficulty_settings.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/difficulty_settings/defines.defines.difficulty_settings.module_typed-factorio.kt deleted file mode 100644 index bc978a6..0000000 --- a/modules/mod2/dukat-custom/defines/difficulty_settings/defines.defines.difficulty_settings.module_typed-factorio.kt +++ /dev/null @@ -1,27 +0,0 @@ -@file:JsQualifier("defines.difficulty_settings") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.difficulty_settings - -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 recipe_difficulty { - normal, - expensive -} - -external enum class technology_difficulty { - normal, - expensive -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/events/defines.defines.events.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/events/defines.defines.events.module_typed-factorio.kt deleted file mode 100644 index cccc0aa..0000000 --- a/modules/mod2/dukat-custom/defines/events/defines.defines.events.module_typed-factorio.kt +++ /dev/null @@ -1,366 +0,0 @@ -@file:JsQualifier("defines.events") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.events - -import EventId -import OnTickEvent -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 uint - -external var on_tick: EventId /* uint & `T$93` */ - -external var on_gui_click: uint /* uint & `T$93` */ - -external var on_gui_confirmed: uint /* uint & `T$93` */ - -external var on_gui_text_changed: uint /* uint & `T$93` */ - -external var on_gui_checked_state_changed: uint /* uint & `T$93` */ - -external var on_entity_died: uint /* uint & `T$93` */ - -external var on_post_entity_died: uint /* uint & `T$93` */ - -external var on_entity_damaged: uint /* uint & `T$93` */ - -external var on_picked_up_item: uint /* uint & `T$93` */ - -external var on_built_entity: uint /* uint & `T$93` */ - -external var on_sector_scanned: uint /* uint & `T$93` */ - -external var on_player_mined_item: uint /* uint & `T$93` */ - -external var on_pre_build: uint /* uint & `T$93` */ - -external var on_rocket_launched: uint /* uint & `T$93` */ - -external var on_pre_player_mined_item: uint /* uint & `T$93` */ - -external var on_chunk_generated: uint /* uint & `T$93` */ - -external var on_player_crafted_item: uint /* uint & `T$93` */ - -external var on_robot_built_entity: uint /* uint & `T$93` */ - -external var on_robot_pre_mined: uint /* uint & `T$93` */ - -external var on_robot_mined: uint /* uint & `T$93` */ - -external var on_research_started: uint /* uint & `T$93` */ - -external var on_research_finished: uint /* uint & `T$93` */ - -external var on_research_reversed: uint /* uint & `T$93` */ - -external var on_player_rotated_entity: uint /* uint & `T$93` */ - -external var on_marked_for_deconstruction: uint /* uint & `T$93` */ - -external var on_cancelled_deconstruction: uint /* uint & `T$93` */ - -external var on_trigger_created_entity: uint /* uint & `T$93` */ - -external var on_trigger_fired_artillery: uint /* uint & `T$93` */ - -external var on_train_changed_state: uint /* uint & `T$93` */ - -external var on_player_created: uint /* uint & `T$93` */ - -external var on_resource_depleted: uint /* uint & `T$93` */ - -external var on_player_driving_changed_state: uint /* uint & `T$93` */ - -external var on_force_created: uint /* uint & `T$93` */ - -external var on_forces_merging: uint /* uint & `T$93` */ - -external var on_player_cursor_stack_changed: uint /* uint & `T$93` */ - -external var on_pre_entity_settings_pasted: uint /* uint & `T$93` */ - -external var on_entity_settings_pasted: uint /* uint & `T$93` */ - -external var on_player_main_inventory_changed: uint /* uint & `T$93` */ - -external var on_player_armor_inventory_changed: uint /* uint & `T$93` */ - -external var on_player_ammo_inventory_changed: uint /* uint & `T$93` */ - -external var on_player_gun_inventory_changed: uint /* uint & `T$93` */ - -external var on_player_placed_equipment: uint /* uint & `T$93` */ - -external var on_player_removed_equipment: uint /* uint & `T$93` */ - -external var on_pre_player_died: uint /* uint & `T$93` */ - -external var on_player_died: uint /* uint & `T$93` */ - -external var on_player_respawned: uint /* uint & `T$93` */ - -external var on_player_joined_game: uint /* uint & `T$93` */ - -external var on_player_left_game: uint /* uint & `T$93` */ - -external var on_player_built_tile: uint /* uint & `T$93` */ - -external var on_player_mined_tile: uint /* uint & `T$93` */ - -external var on_robot_built_tile: uint /* uint & `T$93` */ - -external var on_robot_mined_tile: uint /* uint & `T$93` */ - -external var on_player_selected_area: uint /* uint & `T$93` */ - -external var on_player_alt_selected_area: uint /* uint & `T$93` */ - -external var on_player_changed_surface: uint /* uint & `T$93` */ - -external var on_selected_entity_changed: uint /* uint & `T$93` */ - -external var on_market_item_purchased: uint /* uint & `T$93` */ - -external var on_player_dropped_item: uint /* uint & `T$93` */ - -external var on_biter_base_built: uint /* uint & `T$93` */ - -external var on_player_changed_force: uint /* uint & `T$93` */ - -external var on_entity_renamed: uint /* uint & `T$93` */ - -external var on_gui_selection_state_changed: uint /* uint & `T$93` */ - -external var on_runtime_mod_setting_changed: uint /* uint & `T$93` */ - -external var on_difficulty_settings_changed: uint /* uint & `T$93` */ - -external var on_surface_created: uint /* uint & `T$93` */ - -external var on_surface_deleted: uint /* uint & `T$93` */ - -external var on_pre_surface_deleted: uint /* uint & `T$93` */ - -external var on_player_mined_entity: uint /* uint & `T$93` */ - -external var on_robot_mined_entity: uint /* uint & `T$93` */ - -external var on_train_created: uint /* uint & `T$93` */ - -external var on_gui_elem_changed: uint /* uint & `T$93` */ - -external var on_player_setup_blueprint: uint /* uint & `T$93` */ - -external var on_player_deconstructed_area: uint /* uint & `T$93` */ - -external var on_player_configured_blueprint: uint /* uint & `T$93` */ - -external var on_console_chat: uint /* uint & `T$93` */ - -external var on_console_command: uint /* uint & `T$93` */ - -external var on_player_removed: uint /* uint & `T$93` */ - -external var on_pre_player_removed: uint /* uint & `T$93` */ - -external var on_player_used_capsule: uint /* uint & `T$93` */ - -external var script_raised_built: uint /* uint & `T$93` */ - -external var script_raised_destroy: uint /* uint & `T$93` */ - -external var script_raised_revive: uint /* uint & `T$93` */ - -external var script_raised_set_tiles: uint /* uint & `T$93` */ - -external var on_player_promoted: uint /* uint & `T$93` */ - -external var on_player_demoted: uint /* uint & `T$93` */ - -external var on_combat_robot_expired: uint /* uint & `T$93` */ - -external var on_worker_robot_expired: uint /* uint & `T$93` */ - -external var on_player_changed_position: uint /* uint & `T$93` */ - -external var on_mod_item_opened: uint /* uint & `T$93` */ - -external var on_gui_opened: uint /* uint & `T$93` */ - -external var on_gui_closed: uint /* uint & `T$93` */ - -external var on_gui_value_changed: uint /* uint & `T$93` */ - -external var on_player_muted: uint /* uint & `T$93` */ - -external var on_player_unmuted: uint /* uint & `T$93` */ - -external var on_player_cheat_mode_enabled: uint /* uint & `T$93` */ - -external var on_player_cheat_mode_disabled: uint /* uint & `T$93` */ - -external var on_character_corpse_expired: uint /* uint & `T$93` */ - -external var on_pre_ghost_deconstructed: uint /* uint & `T$93` */ - -external var on_player_pipette: uint /* uint & `T$93` */ - -external var on_player_display_resolution_changed: uint /* uint & `T$93` */ - -external var on_player_display_scale_changed: uint /* uint & `T$93` */ - -external var on_pre_player_crafted_item: uint /* uint & `T$93` */ - -external var on_player_cancelled_crafting: uint /* uint & `T$93` */ - -external var on_chunk_charted: uint /* uint & `T$93` */ - -external var on_technology_effects_reset: uint /* uint & `T$93` */ - -external var on_force_reset: uint /* uint & `T$93` */ - -external var on_land_mine_armed: uint /* uint & `T$93` */ - -external var on_forces_merged: uint /* uint & `T$93` */ - -external var on_player_trash_inventory_changed: uint /* uint & `T$93` */ - -external var on_pre_player_left_game: uint /* uint & `T$93` */ - -external var on_pre_surface_cleared: uint /* uint & `T$93` */ - -external var on_surface_cleared: uint /* uint & `T$93` */ - -external var on_chunk_deleted: uint /* uint & `T$93` */ - -external var on_pre_chunk_deleted: uint /* uint & `T$93` */ - -external var on_train_schedule_changed: uint /* uint & `T$93` */ - -external var on_player_banned: uint /* uint & `T$93` */ - -external var on_player_kicked: uint /* uint & `T$93` */ - -external var on_player_unbanned: uint /* uint & `T$93` */ - -external var on_rocket_launch_ordered: uint /* uint & `T$93` */ - -external var on_script_path_request_finished: uint /* uint & `T$93` */ - -external var on_ai_command_completed: uint /* uint & `T$93` */ - -external var on_marked_for_upgrade: uint /* uint & `T$93` */ - -external var on_cancelled_upgrade: uint /* uint & `T$93` */ - -external var on_player_toggled_map_editor: uint /* uint & `T$93` */ - -external var on_entity_cloned: uint /* uint & `T$93` */ - -external var on_area_cloned: uint /* uint & `T$93` */ - -external var on_brush_cloned: uint /* uint & `T$93` */ - -external var on_game_created_from_scenario: uint /* uint & `T$93` */ - -external var on_surface_imported: uint /* uint & `T$93` */ - -external var on_surface_renamed: uint /* uint & `T$93` */ - -external var on_player_toggled_alt_mode: uint /* uint & `T$93` */ - -external var on_player_repaired_entity: uint /* uint & `T$93` */ - -external var on_player_fast_transferred: uint /* uint & `T$93` */ - -external var on_pre_robot_exploded_cliff: uint /* uint & `T$93` */ - -external var on_robot_exploded_cliff: uint /* uint & `T$93` */ - -external var on_entity_spawned: uint /* uint & `T$93` */ - -external var on_cutscene_waypoint_reached: uint /* uint & `T$93` */ - -external var on_unit_group_created: uint /* uint & `T$93` */ - -external var on_unit_added_to_group: uint /* uint & `T$93` */ - -external var on_unit_removed_from_group: uint /* uint & `T$93` */ - -external var on_unit_group_finished_gathering: uint /* uint & `T$93` */ - -external var on_build_base_arrived: uint /* uint & `T$93` */ - -external var on_chart_tag_added: uint /* uint & `T$93` */ - -external var on_chart_tag_modified: uint /* uint & `T$93` */ - -external var on_chart_tag_removed: uint /* uint & `T$93` */ - -external var on_lua_shortcut: uint /* uint & `T$93` */ - -external var on_gui_location_changed: uint /* uint & `T$93` */ - -external var on_gui_selected_tab_changed: uint /* uint & `T$93` */ - -external var on_gui_switch_state_changed: uint /* uint & `T$93` */ - -external var on_force_cease_fire_changed: uint /* uint & `T$93` */ - -external var on_force_friends_changed: uint /* uint & `T$93` */ - -external var on_string_translated: uint /* uint & `T$93` */ - -external var on_script_trigger_effect: uint /* uint & `T$93` */ - -external var on_player_set_quick_bar_slot: uint /* uint & `T$93` */ - -external var on_pre_player_toggled_map_editor: uint /* uint & `T$93` */ - -external var on_pre_script_inventory_resized: uint /* uint & `T$93` */ - -external var on_script_inventory_resized: uint /* uint & `T$93` */ - -external var on_entity_destroyed: uint /* uint & `T$93` */ - -external var on_player_clicked_gps_tag: uint /* uint & `T$93` */ - -external var on_player_flushed_fluid: uint /* uint & `T$93` */ - -external var on_permission_group_edited: uint /* uint & `T$93` */ - -external var on_pre_permission_string_imported: uint /* uint & `T$93` */ - -external var on_permission_string_imported: uint /* uint & `T$93` */ - -external var on_pre_permission_group_deleted: uint /* uint & `T$93` */ - -external var on_permission_group_deleted: uint /* uint & `T$93` */ - -external var on_permission_group_added: uint /* uint & `T$93` */ - -external var on_cutscene_cancelled: uint /* uint & `T$93` */ - -external var on_player_configured_spider_remote: uint /* uint & `T$93` */ - -external var on_player_used_spider_remote: uint /* uint & `T$93` */ - -external var on_spider_command_completed: uint /* uint & `T$93` */ - -external var on_entity_logistic_slot_changed: uint /* uint & `T$93` */ - -external var on_equipment_inserted: uint /* uint & `T$93` */ - -external var on_equipment_removed: uint /* uint & `T$93` */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/defines/riding/defines.defines.riding.module_typed-factorio.kt b/modules/mod2/dukat-custom/defines/riding/defines.defines.riding.module_typed-factorio.kt deleted file mode 100644 index 936be1e..0000000 --- a/modules/mod2/dukat-custom/defines/riding/defines.defines.riding.module_typed-factorio.kt +++ /dev/null @@ -1,30 +0,0 @@ -@file:JsQualifier("defines.riding") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package defines.riding - -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 acceleration { - nothing, - accelerating, - braking, - reversing -} - -external enum class direction { - left, - straight, - right -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/eventId.kt b/modules/mod2/dukat-custom/eventId.kt deleted file mode 100644 index b4cd976..0000000 --- a/modules/mod2/dukat-custom/eventId.kt +++ /dev/null @@ -1,11 +0,0 @@ - -external class TsUInt : tsstdlib.Number - -external class EventId { - @JsName("_eventData") - val eventData: DataT - - @JsName("_filter") - val filter: FilterT - -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/events.module_typed-factorio.kt b/modules/mod2/dukat-custom/events.module_typed-factorio.kt deleted file mode 100644 index 497a8ff..0000000 --- a/modules/mod2/dukat-custom/events.module_typed-factorio.kt +++ /dev/null @@ -1,1574 +0,0 @@ -@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.Position -import defines.behavior_result -import defines.mouse_button_type -import defines.gui_type -import defines.direction -import defines.input_action -import defines.disconnect_reason -import tsstdlib.Record -import defines.train_state - -external interface CustomInputEvent { - var player_index: uint - var input_name: String - var cursor_position: Position - var selected_prototype: SelectedPrototypeData? - get() = definedExternally - set(value) = definedExternally - var name: String - var tick: uint -} - -external interface OnAiCommandCompletedEvent { - var unit_number: uint - var result: behavior_result - var was_distracted: Boolean? - var name: Any - var tick: uint -} - -external interface OnAreaClonedEvent { - var source_surface: LuaSurface - var source_area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var destination_surface: LuaSurface - var destination_area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var destination_force: LuaForce? - get() = definedExternally - set(value) = definedExternally - var clone_tiles: Boolean? - var clone_entities: Boolean? - var clone_decoratives: Boolean? - var clear_destination_entities: Boolean? - var clear_destination_decoratives: Boolean? - var name: Any - var tick: uint -} - -external interface OnBiterBaseBuiltEvent { - var entity: LuaEntity - var name: Any - var tick: uint -} - -external interface OnBrushClonedEvent { - var source_offset: dynamic /* TilePositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var destination_offset: dynamic /* TilePositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var source_surface: LuaSurface - var source_positions: Array */> - var destination_surface: LuaSurface - var destination_force: LuaForce? - get() = definedExternally - set(value) = definedExternally - var clone_tiles: Boolean? - var clone_entities: Boolean? - var clone_decoratives: Boolean? - var clear_destination_entities: Boolean? - var clear_destination_decoratives: Boolean? - var name: Any - var tick: uint -} - -external interface OnBuildBaseArrivedEvent { - var unit: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var group: LuaUnitGroup? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnBuiltEntityEvent { - var created_entity: LuaEntity - var player_index: uint - var stack: LuaItemStack - var item: LuaItemPrototype? - get() = definedExternally - set(value) = definedExternally - var tags: Tags? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnCancelledDeconstructionEvent { - var entity: LuaEntity - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnCancelledUpgradeEvent { - var entity: LuaEntity - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnCharacterCorpseExpiredEvent { - var corpse: LuaEntity - var name: Any - var tick: uint -} - -external interface OnChartTagAddedEvent { - var tag: LuaCustomChartTag - var force: LuaForce - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnChartTagModifiedEvent { - var tag: LuaCustomChartTag - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var force: LuaForce - var old_text: String - var old_icon: SignalID? - get() = definedExternally - set(value) = definedExternally - var old_player: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnChartTagRemovedEvent { - var tag: LuaCustomChartTag - var force: LuaForce - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnChunkChartedEvent { - var surface_index: uint - var position: dynamic /* ChunkPositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var force: LuaForce - var name: Any - var tick: uint -} - -external interface OnChunkDeletedEvent { - var surface_index: uint - var positions: Array */> - var name: Any - var tick: uint -} - -external interface OnChunkGeneratedEvent { - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var position: dynamic /* ChunkPositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var surface: LuaSurface - var name: Any - var tick: uint -} - -external interface OnCombatRobotExpiredEvent { - var robot: LuaEntity - var owner: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnConsoleChatEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var message: String - var name: Any - var tick: uint -} - -external interface OnConsoleCommandEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var command: String - var parameters: String - var name: Any - var tick: uint -} - -external interface OnCutsceneCancelledEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnCutsceneWaypointReachedEvent { - var player_index: uint - var waypoint_index: uint - var name: Any - var tick: uint -} - -external interface OnDifficultySettingsChangedEvent { - var old_recipe_difficulty: uint - var old_technology_difficulty: uint - var name: Any - var tick: uint -} - -external interface OnEntityClonedEvent { - var source: LuaEntity - var destination: LuaEntity - var name: Any - var tick: uint -} - -external interface OnEntityDamagedEvent { - var entity: LuaEntity - var damage_type: LuaDamagePrototype - var original_damage_amount: float - var final_damage_amount: float - var final_health: float - var cause: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var force: LuaForce? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnEntityDestroyedEvent { - var registration_number: uint64 - var unit_number: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnEntityDiedEvent { - var entity: LuaEntity - var cause: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var loot: LuaInventory - var force: LuaForce? - get() = definedExternally - set(value) = definedExternally - var damage_type: LuaDamagePrototype? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnEntityLogisticSlotChangedEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var entity: LuaEntity - var slot_index: uint - var name: Any - var tick: uint -} - -external interface OnEntityRenamedEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var by_script: Boolean? - var entity: LuaEntity - var old_name: String - var name: Any - var tick: uint -} - -external interface OnEntitySettingsPastedEvent { - var player_index: uint - var source: LuaEntity - var destination: LuaEntity - var name: Any - var tick: uint -} - -external interface OnEntitySpawnedEvent { - var spawner: LuaEntity - var entity: LuaEntity - var name: Any - var tick: uint -} - -external interface OnEquipmentInsertedEvent { - var grid: LuaEquipmentGrid - var equipment: LuaEquipment - var name: Any - var tick: uint -} - -external interface OnEquipmentRemovedEvent { - var grid: LuaEquipmentGrid - var equipment: String - var count: uint - var name: Any - var tick: uint -} - -external interface OnForceCeaseFireChangedEvent { - var force: LuaForce - var other_force: LuaForce - var added: Boolean? - var name: Any - var tick: uint -} - -external interface OnForceCreatedEvent { - var force: LuaForce - var name: Any - var tick: uint -} - -external interface OnForceFriendsChangedEvent { - var force: LuaForce - var other_force: LuaForce - var added: Boolean? - var name: Any - var tick: uint -} - -external interface OnForceResetEvent { - var force: LuaForce - var name: Any - var tick: uint -} - -external interface OnForcesMergedEvent { - var source_name: String - var source_index: uint - var destination: LuaForce - var name: Any - var tick: uint -} - -external interface OnForcesMergingEvent { - var source: LuaForce - var destination: LuaForce - var name: Any - var tick: uint -} - -external interface OnGameCreatedFromScenarioEvent { - var name: Any - var tick: uint -} - -external interface OnGuiCheckedStateChangedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnGuiClickEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var button: mouse_button_type - var alt: Boolean? - var control: Boolean? - var shift: Boolean? - var name: Any - var tick: uint -} - -external interface OnGuiClosedEvent { - var player_index: uint - var gui_type: gui_type - var entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var item: LuaItemStack? - get() = definedExternally - set(value) = definedExternally - var equipment: LuaEquipment? - get() = definedExternally - set(value) = definedExternally - var other_player: LuaPlayer? - get() = definedExternally - set(value) = definedExternally - var element: dynamic /* ChooseElemButtonGuiElementMembers? | DropDownGuiElementMembers? | EmptyWidgetGuiElementMembers? | EntityPreviewGuiElementMembers? | ListBoxGuiElementMembers? | ScrollPaneGuiElementMembers? | SpriteButtonGuiElementMembers? | TabbedPaneGuiElementMembers? | TextBoxGuiElementMembers? | ButtonGuiElementMembers? | CameraGuiElementMembers? | CheckboxGuiElementMembers? | FlowGuiElementMembers? | FrameGuiElementMembers? | LabelGuiElementMembers? | LineGuiElementMembers? | MinimapGuiElementMembers? | ProgressbarGuiElementMembers? | RadiobuttonGuiElementMembers? | SliderGuiElementMembers? | SpriteGuiElementMembers? | SwitchGuiElementMembers? | TabGuiElementMembers? | TableGuiElementMembers? | TextfieldGuiElementMembers? */ - get() = definedExternally - set(value) = definedExternally - var technology: LuaTechnology? - get() = definedExternally - set(value) = definedExternally - var tile_position: dynamic /* TilePositionTable? | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnGuiConfirmedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var alt: Boolean? - var control: Boolean? - var shift: Boolean? - var name: Any - var tick: uint -} - -external interface OnGuiElemChangedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnGuiLocationChangedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnGuiOpenedEvent { - var player_index: uint - var gui_type: gui_type - var entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var item: LuaItemStack? - get() = definedExternally - set(value) = definedExternally - var equipment: LuaEquipment? - get() = definedExternally - set(value) = definedExternally - var other_player: LuaPlayer? - get() = definedExternally - set(value) = definedExternally - var element: dynamic /* ChooseElemButtonGuiElementMembers? | DropDownGuiElementMembers? | EmptyWidgetGuiElementMembers? | EntityPreviewGuiElementMembers? | ListBoxGuiElementMembers? | ScrollPaneGuiElementMembers? | SpriteButtonGuiElementMembers? | TabbedPaneGuiElementMembers? | TextBoxGuiElementMembers? | ButtonGuiElementMembers? | CameraGuiElementMembers? | CheckboxGuiElementMembers? | FlowGuiElementMembers? | FrameGuiElementMembers? | LabelGuiElementMembers? | LineGuiElementMembers? | MinimapGuiElementMembers? | ProgressbarGuiElementMembers? | RadiobuttonGuiElementMembers? | SliderGuiElementMembers? | SpriteGuiElementMembers? | SwitchGuiElementMembers? | TabGuiElementMembers? | TableGuiElementMembers? | TextfieldGuiElementMembers? */ - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnGuiSelectedTabChangedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnGuiSelectionStateChangedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnGuiSwitchStateChangedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnGuiTextChangedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var text: String - var name: Any - var tick: uint -} - -external interface OnGuiValueChangedEvent { - var element: dynamic /* ChooseElemButtonGuiElementMembers | DropDownGuiElementMembers | EmptyWidgetGuiElementMembers | EntityPreviewGuiElementMembers | ListBoxGuiElementMembers | ScrollPaneGuiElementMembers | SpriteButtonGuiElementMembers | TabbedPaneGuiElementMembers | TextBoxGuiElementMembers | ButtonGuiElementMembers | CameraGuiElementMembers | CheckboxGuiElementMembers | FlowGuiElementMembers | FrameGuiElementMembers | LabelGuiElementMembers | LineGuiElementMembers | MinimapGuiElementMembers | ProgressbarGuiElementMembers | RadiobuttonGuiElementMembers | SliderGuiElementMembers | SpriteGuiElementMembers | SwitchGuiElementMembers | TabGuiElementMembers | TableGuiElementMembers | TextfieldGuiElementMembers */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnLandMineArmedEvent { - var mine: LuaEntity - var name: Any - var tick: uint -} - -external interface OnLuaShortcutEvent { - var player_index: uint - var prototype_name: String - var name: Any - var tick: uint -} - -external interface OnMarkedForDeconstructionEvent { - var entity: LuaEntity - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnMarkedForUpgradeEvent { - var entity: LuaEntity - var target: LuaEntityPrototype - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var direction: direction? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnMarketItemPurchasedEvent { - var player_index: uint - var market: LuaEntity - var offer_index: uint - var count: uint - var name: Any - var tick: uint -} - -external interface OnModItemOpenedEvent { - var player_index: uint - var item: LuaItemPrototype - var name: Any - var tick: uint -} - -external interface OnPermissionGroupAddedEvent { - var player_index: uint - var group: LuaPermissionGroup - var name: Any - var tick: uint -} - -external interface OnPermissionGroupDeletedEvent { - var player_index: uint - var group_name: String - var id: uint - var name: Any - var tick: uint -} - -external interface OnPermissionGroupEditedEvent { - var player_index: uint - var group: LuaPermissionGroup - var type: String /* "add-permission" | "remove-permission" | "enable-all" | "disable-all" | "add-player" | "remove-player" | "rename" */ - var action: input_action - var other_player_index: uint - var old_name: String - var new_name: String - var name: Any - var tick: uint -} - -external interface OnPermissionStringImportedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPickedUpItemEvent { - var item_stack: dynamic /* String | ItemStackDefinition */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerAltSelectedAreaEvent { - var player_index: uint - var surface: LuaSurface - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var item: String - var entities: Array - var tiles: Array - var name: Any - var tick: uint -} - -external interface OnPlayerAmmoInventoryChangedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerArmorInventoryChangedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerBannedEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var player_name: String - var by_player: uint? - get() = definedExternally - set(value) = definedExternally - var reason: String? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPlayerBuiltTileEvent { - var player_index: uint - var surface_index: uint - var tiles: Array - var tile: LuaTilePrototype - var item: LuaItemPrototype? - get() = definedExternally - set(value) = definedExternally - var stack: LuaItemStack? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPlayerCancelledCraftingEvent { - var player_index: uint - var items: LuaInventory - var recipe: LuaRecipe - var cancel_count: uint - var name: Any - var tick: uint -} - -external interface OnPlayerChangedForceEvent { - var player_index: uint - var force: LuaForce - var name: Any - var tick: uint -} - -external interface OnPlayerChangedPositionEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerChangedSurfaceEvent { - var player_index: uint - var surface_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerCheatModeDisabledEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerCheatModeEnabledEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerClickedGpsTagEvent { - var player_index: uint - var position: Position - var surface: String - var name: Any - var tick: uint -} - -external interface OnPlayerConfiguredBlueprintEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerConfiguredSpiderRemoteEvent { - var player_index: uint - var vehicle: LuaEntity - var name: Any - var tick: uint -} - -external interface OnPlayerCraftedItemEvent { - var item_stack: LuaItemStack - var player_index: uint - var recipe: LuaRecipe - var name: Any - var tick: uint -} - -external interface OnPlayerCreatedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerCursorStackChangedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerDeconstructedAreaEvent { - var player_index: uint - var surface: LuaSurface - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var item: String - var alt: Boolean? - var name: Any - var tick: uint -} - -external interface OnPlayerDemotedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerDiedEvent { - var player_index: uint - var cause: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPlayerDisplayResolutionChangedEvent { - var player_index: uint - var old_resolution: DisplayResolution - var name: Any - var tick: uint -} - -external interface OnPlayerDisplayScaleChangedEvent { - var player_index: uint - var old_scale: double - var name: Any - var tick: uint -} - -external interface OnPlayerDrivingChangedStateEvent { - var player_index: uint - var entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPlayerDroppedItemEvent { - var player_index: uint - var entity: LuaEntity - var name: Any - var tick: uint -} - -external interface OnPlayerFastTransferredEvent { - var player_index: uint - var entity: LuaEntity - var from_player: Boolean? - var name: Any - var tick: uint -} - -external interface OnPlayerFlushedFluidEvent { - var player_index: uint - var fluid: String - var amount: double - var entity: LuaEntity - var only_this_entity: Boolean? - var name: Any - var tick: uint -} - -external interface OnPlayerGunInventoryChangedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerJoinedGameEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerKickedEvent { - var player_index: uint - var by_player: uint? - get() = definedExternally - set(value) = definedExternally - var reason: String? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPlayerLeftGameEvent { - var player_index: uint - var reason: disconnect_reason - var name: Any - var tick: uint -} - -external interface OnPlayerMainInventoryChangedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerMinedEntityEvent { - var player_index: uint - var entity: LuaEntity - var buffer: LuaInventory - var name: Any - var tick: uint -} - -external interface OnPlayerMinedItemEvent { - var item_stack: dynamic /* String | ItemStackDefinition */ - get() = definedExternally - set(value) = definedExternally - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerMinedTileEvent { - var player_index: uint - var surface_index: uint - var tiles: Array - var name: Any - var tick: uint -} - -external interface OnPlayerMutedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerPipetteEvent { - var player_index: uint - var item: LuaItemPrototype - var used_cheat_mode: Boolean? - var name: Any - var tick: uint -} - -external interface OnPlayerPlacedEquipmentEvent { - var player_index: uint - var equipment: LuaEquipment - var grid: LuaEquipmentGrid - var name: Any - var tick: uint -} - -external interface OnPlayerPromotedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerRemovedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerRemovedEquipmentEvent { - var player_index: uint - var grid: LuaEquipmentGrid - var equipment: String - var count: uint - var name: Any - var tick: uint -} - -external interface OnPlayerRepairedEntityEvent { - var player_index: uint - var entity: LuaEntity - var name: Any - var tick: uint -} - -external interface OnPlayerRespawnedEvent { - var player_index: uint - var player_port: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPlayerRotatedEntityEvent { - var entity: LuaEntity - var previous_direction: direction - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerSelectedAreaEvent { - var player_index: uint - var surface: LuaSurface - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var item: String - var entities: Array - var tiles: Array - var name: Any - var tick: uint -} - -external interface OnPlayerSetQuickBarSlotEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerSetupBlueprintEvent { - var player_index: uint - var surface: LuaSurface - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var item: String - var alt: Boolean? - var mapping: LuaLazyLoadedValue> - var name: Any - var tick: uint -} - -external interface OnPlayerToggledAltModeEvent { - var player_index: uint - var alt_mode: Boolean? - var name: Any - var tick: uint -} - -external interface OnPlayerToggledMapEditorEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerTrashInventoryChangedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerUnbannedEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var player_name: String - var by_player: uint? - get() = definedExternally - set(value) = definedExternally - var reason: String? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPlayerUnmutedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPlayerUsedCapsuleEvent { - var player_index: uint - var item: LuaItemPrototype - var position: Position - var name: Any - var tick: uint -} - -external interface OnPlayerUsedSpiderRemoteEvent { - var player_index: uint - var vehicle: LuaEntity - var position: Position - var success: Boolean? - var name: Any - var tick: uint -} - -external interface OnPostEntityDiedEvent { - var ghost: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var force: LuaForce? - get() = definedExternally - set(value) = definedExternally - var position: Position - var prototype: LuaEntityPrototype - var damage_type: LuaDamagePrototype? - get() = definedExternally - set(value) = definedExternally - var corpses: Array - var surface_index: uint - var unit_number: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPreBuildEvent { - var player_index: uint - var position: Position - var shift_build: Boolean? - var direction: direction - var flip_horizontal: Boolean? - var flip_vertical: Boolean? - var created_by_moving: Boolean? - var name: Any - var tick: uint -} - -external interface OnPreChunkDeletedEvent { - var surface_index: uint - var positions: Array */> - var name: Any - var tick: uint -} - -external interface OnPreEntitySettingsPastedEvent { - var player_index: uint - var source: LuaEntity - var destination: LuaEntity - var name: Any - var tick: uint -} - -external interface OnPreGhostDeconstructedEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var ghost: LuaEntity - var name: Any - var tick: uint -} - -external interface OnPrePermissionGroupDeletedEvent { - var player_index: uint - var group: LuaPermissionGroup - var name: Any - var tick: uint -} - -external interface OnPrePermissionStringImportedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPrePlayerCraftedItemEvent { - var player_index: uint - var recipe: LuaRecipe - var items: LuaInventory - var queued_count: uint - var name: Any - var tick: uint -} - -external interface OnPrePlayerDiedEvent { - var player_index: uint - var cause: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnPrePlayerLeftGameEvent { - var player_index: uint - var reason: disconnect_reason - var name: Any - var tick: uint -} - -external interface OnPrePlayerMinedItemEvent { - var entity: LuaEntity - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPrePlayerRemovedEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPrePlayerToggledMapEditorEvent { - var player_index: uint - var name: Any - var tick: uint -} - -external interface OnPreRobotExplodedCliffEvent { - var robot: LuaEntity - var cliff: LuaEntity - var item: LuaItemPrototype - var name: Any - var tick: uint -} - -external interface OnPreScriptInventoryResizedEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var mod: String - var inventory: LuaInventory - var old_size: uint - var new_size: uint - var name: Any - var tick: uint -} - -external interface OnPreSurfaceClearedEvent { - var surface_index: uint - var name: Any - var tick: uint -} - -external interface OnPreSurfaceDeletedEvent { - var surface_index: uint - var name: Any - var tick: uint -} - -external interface OnResearchFinishedEvent { - var research: LuaTechnology - var by_script: Boolean? - var name: Any - var tick: uint -} - -external interface OnResearchReversedEvent { - var research: LuaTechnology - var by_script: Boolean? - var name: Any - var tick: uint -} - -external interface OnResearchStartedEvent { - var research: LuaTechnology - var last_research: LuaTechnology? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnResourceDepletedEvent { - var entity: LuaEntity - var name: Any - var tick: uint -} - -external interface OnRobotBuiltEntityEvent { - var robot: LuaEntity - var created_entity: LuaEntity - var stack: LuaItemStack - var tags: Tags? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnRobotBuiltTileEvent { - var robot: LuaEntity - var tiles: Array - var tile: LuaTilePrototype - var item: LuaItemPrototype - var stack: LuaItemStack - var surface_index: uint - var name: Any - var tick: uint -} - -external interface OnRobotExplodedCliffEvent { - var robot: LuaEntity - var item: LuaItemPrototype - var name: Any - var tick: uint -} - -external interface OnRobotMinedEvent { - var robot: LuaEntity - var item_stack: dynamic /* String | ItemStackDefinition */ - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnRobotMinedEntityEvent { - var robot: LuaEntity - var entity: LuaEntity - var buffer: LuaInventory - var name: Any - var tick: uint -} - -external interface OnRobotMinedTileEvent { - var robot: LuaEntity - var tiles: Array - var surface_index: uint - var name: Any - var tick: uint -} - -external interface OnRobotPreMinedEvent { - var robot: LuaEntity - var entity: LuaEntity - var name: Any - var tick: uint -} - -external interface OnRocketLaunchOrderedEvent { - var rocket: LuaEntity - var rocket_silo: LuaEntity - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnRocketLaunchedEvent { - var rocket: LuaEntity - var rocket_silo: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnRuntimeModSettingChangedEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var setting: String - var setting_type: String /* "runtime-per-user" | "runtime-global" */ - var name: Any - var tick: uint -} - -external interface OnScriptInventoryResizedEvent { - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var mod: String - var inventory: LuaInventory - var old_size: uint - var new_size: uint - var overflow_inventory: LuaInventory - var name: Any - var tick: uint -} - -external interface OnScriptPathRequestFinishedEvent { - var path: Array? - get() = definedExternally - set(value) = definedExternally - var id: uint - var try_again_later: Boolean? - var name: Any - var tick: uint -} - -external interface OnScriptTriggerEffectEvent { - var effect_id: String - var surface_index: uint - var source_position: Position? - get() = definedExternally - set(value) = definedExternally - var source_entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var target_position: Position? - get() = definedExternally - set(value) = definedExternally - var target_entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnSectorScannedEvent { - var radar: LuaEntity - var chunk_position: dynamic /* ChunkPositionTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var area: dynamic /* BoundingBoxTable | JsTuple */ - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnSelectedEntityChangedEvent { - var player_index: uint - var last_entity: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnSpiderCommandCompletedEvent { - var vehicle: LuaEntity - var name: Any - var tick: uint -} - -external interface OnStringTranslatedEvent { - var player_index: uint - var localised_string: dynamic /* JsTuple | String | Number */ - get() = definedExternally - set(value) = definedExternally - var result: String - var translated: Boolean? - var name: Any - var tick: uint -} - -external interface OnSurfaceClearedEvent { - var surface_index: uint - var name: Any - var tick: uint -} - -external interface OnSurfaceCreatedEvent { - var surface_index: uint - var name: Any - var tick: uint -} - -external interface OnSurfaceDeletedEvent { - var surface_index: uint - var name: Any - var tick: uint -} - -external interface OnSurfaceImportedEvent { - var surface_index: uint - var original_name: String - var name: Any - var tick: uint -} - -external interface OnSurfaceRenamedEvent { - var surface_index: uint - var old_name: String - var new_name: String - var name: Any - var tick: uint -} - -external interface OnTechnologyEffectsResetEvent { - var force: LuaForce - var name: Any - var tick: uint -} - -external interface OnTickEvent { - var name: Any - var tick: uint -} - -external interface OnTrainChangedStateEvent { - var train: LuaTrain - var old_state: train_state - var name: Any - var tick: uint -} - -external interface OnTrainCreatedEvent { - var train: LuaTrain - var old_train_id_1: uint? - get() = definedExternally - set(value) = definedExternally - var old_train_id_2: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnTrainScheduleChangedEvent { - var train: LuaTrain - var player_index: uint? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnTriggerCreatedEntityEvent { - var entity: LuaEntity - var source: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnTriggerFiredArtilleryEvent { - var entity: LuaEntity - var source: LuaEntity? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface OnUnitAddedToGroupEvent { - var unit: LuaEntity - var group: LuaUnitGroup - var name: Any - var tick: uint -} - -external interface OnUnitGroupCreatedEvent { - var group: LuaUnitGroup - var name: Any - var tick: uint -} - -external interface OnUnitGroupFinishedGatheringEvent { - var group: LuaUnitGroup - var name: Any - var tick: uint -} - -external interface OnUnitRemovedFromGroupEvent { - var unit: LuaEntity - var group: LuaUnitGroup - var name: Any - var tick: uint -} - -external interface OnWorkerRobotExpiredEvent { - var robot: LuaEntity - var name: Any - var tick: uint -} - -external interface ScriptRaisedBuiltEvent { - var entity: LuaEntity - var name: Any - var tick: uint -} - -external interface ScriptRaisedDestroyEvent { - var entity: LuaEntity - var name: Any - var tick: uint -} - -external interface ScriptRaisedReviveEvent { - var entity: LuaEntity - var tags: Tags? - get() = definedExternally - set(value) = definedExternally - var name: Any - var tick: uint -} - -external interface ScriptRaisedSetTilesEvent { - var surface_index: uint - var tiles: Array - var name: Any - var tick: uint -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/global-objects.module_typed-factorio.kt b/modules/mod2/dukat-custom/global-objects.module_typed-factorio.kt deleted file mode 100644 index 5eaab96..0000000 --- a/modules/mod2/dukat-custom/global-objects.module_typed-factorio.kt +++ /dev/null @@ -1,29 +0,0 @@ -@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 var game: LuaGameScript - -external var script: LuaBootstrap - -external var remote: LuaRemote - -external var commands: LuaCommandProcessor - -external var settings: LuaSettings - -external var rcon: LuaRCON - -external var rendering: LuaRendering \ No newline at end of file diff --git a/modules/mod2/dukat-custom/global.module_lua-types.kt b/modules/mod2/dukat-custom/global.module_lua-types.kt deleted file mode 100644 index 470dcc5..0000000 --- a/modules/mod2/dukat-custom/global.module_lua-types.kt +++ /dev/null @@ -1,95 +0,0 @@ -@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.Record -import tsstdlib.Iterable - -external interface LuaThread { - var __internal__: Any -} - -external interface LuaUserdata { - var __internal__: Any -} - -external var _VERSION: String /* "Lua 5.1" | "Lua 5.2" | "Lua 5.3" | "Lua 5.4" */ - -external var _G: Any - -external fun assert(v: V): Any - -external fun > assert(v: V, - vararg args: A): dynamic /* JsTuple, Any> */ - -external fun collectgarbage(opt: String /* "collect" | "stop" | "restart" */ = definedExternally) - -external fun collectgarbage() - -external fun collectgarbage(opt: String /* "setpause" | "setstepmul" | "step" */, - arg: Number): dynamic /* Number | Boolean */ - -external fun dofile(filename: String = definedExternally): Any - -external fun error(message: String, level: Number = definedExternally): Any - -external fun getmetatable(obj: T): LuaMetatable__1? - -external fun ipairs( - t: kotlinext.js.Record): - Iterable> */> -/* Iterable> */> & LuaIterator> */, undefined> & LuaExtension */ - -external fun next(table: Any?, - index: Any = definedExternally): dynamic /* JsTuple | JsTuple<> */ - -external fun pairs( - t: LuaTable): Iterable> */> /* Iterable> */> & LuaIterator> */, undefined> & LuaExtension */ - -external fun pairs( - t: T): Iterable> */> /* Iterable> */> & LuaIterator> */, undefined> & LuaExtension */ - -external fun , R> pcall(f: (self: This, args: Args) -> R, context: This, - vararg args: Args): dynamic /* JsTuple | JsTuple */ - -external fun , R> pcall(f: (self: Unit, args: A) -> R, - vararg args: A): dynamic /* JsTuple | JsTuple */ - -external fun print(vararg args: Any) - -external fun rawequal(v1: T, v2: T): Boolean - -external fun rawget(table: T, index: K): Any - -external fun rawlen(v: Any?): Number - -external fun rawlen(v: String?): Number - -external fun rawset(table: T, index: K, value: Any): T - -external fun select(index: Number, - vararg args: T): Array /* Array & LuaExtension */ - -external fun select(index: String /* "#" */, vararg args: T): Number - -external fun setmetatable(table: T, - metatable: LuaMetatable? = definedExternally): Any - -external fun tonumber(e: Any, base: Number = definedExternally): Number? - -external fun tostring(v: Any): String - -external fun type( - v: Any): String /* "nil" | "number" | "string" | "boolean" | "table" | "function" | "thread" | "userdata" */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/index.module_typescript-to-lua.kt b/modules/mod2/dukat-custom/index.module_typescript-to-lua.kt deleted file mode 100644 index cb772bd..0000000 --- a/modules/mod2/dukat-custom/index.module_typescript-to-lua.kt +++ /dev/null @@ -1,43 +0,0 @@ -@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.Record -import tsstdlib.Iterable - -typealias AnyTable = Record - -external interface AnyNotNil - -typealias LuaExtension = Any - -//external var `$multi`: (values: T) -> T /* (values: T) -> T & LuaExtension */ -external fun `$multi`(values: T): T /* (values: T) -> T & LuaExtension */ - -external var `$range`: (start: Number, limit: Number, step: Number) -> Iterable /* (start: Number, limit: Number, step: Number) -> Iterable & LuaExtension */ - -external var `$vararg`: Array /* Array & LuaExtension */ - -typealias LuaIterator = Any - -@Suppress("EXTERNAL_DELEGATION", "NESTED_CLASS_IN_EXTERNAL_INTERFACE") -external interface LuaTable { - var length: () -> Number /* () -> Number & LuaExtension */ - var get: (key: TKey) -> TValue /* (key: TKey) -> TValue & LuaExtension */ - var set: (key: TKey, value: TValue) -> Unit /* (key: TKey, value: TValue) -> Unit & LuaExtension */ - var has: (key: TKey) -> Boolean /* (key: TKey) -> Boolean & LuaExtension */ - var delete: (key: TKey) -> Boolean /* (key: TKey) -> Boolean & LuaExtension */ - -// companion object : Any by definedExternally -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/io.module_lua-types.kt b/modules/mod2/dukat-custom/io.module_lua-types.kt deleted file mode 100644 index af58374..0000000 --- a/modules/mod2/dukat-custom/io.module_lua-types.kt +++ /dev/null @@ -1,28 +0,0 @@ -@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.Iterable -import io.FileReadFormatToType - -external interface LuaFile { - fun close(): Boolean - fun flush(): Boolean - fun > lines(vararg formats: T): Iterable */> /* Iterable */> & LuaIterator */, undefined> & LuaExtension */ - fun read(): FileReadFormatToType? - fun read(format: T): FileReadFormatToType? /* Any & LuaExtension */ - fun seek(whence: String /* "set" | "cur" | "end" */ = definedExternally, offset: Number = definedExternally): dynamic /* JsTuple | JsTuple */ - fun setvbuf(mode: String /* "no" | "full" | "line" */, size: Number = definedExternally) - fun write(vararg args: Any /* String | Number */): dynamic /* JsTuple | JsTuple */ -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/io/io.io.module_lua-types.kt b/modules/mod2/dukat-custom/io/io.io.module_lua-types.kt deleted file mode 100644 index 87ba8d5..0000000 --- a/modules/mod2/dukat-custom/io/io.io.module_lua-types.kt +++ /dev/null @@ -1,57 +0,0 @@ -@file:JsQualifier("io") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package io - -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 LuaFile -import tsstdlib.Iterable - -external fun close(file: LuaFile = definedExternally): Boolean - -external fun flush(): Boolean - -external fun input(file: String = definedExternally): LuaFile - -external fun input(): LuaFile - -external fun input(file: LuaFile = definedExternally): LuaFile - -external fun > lines(filename: String = definedExternally, vararg formats: T): Iterable */> /* Iterable */> & LuaIterator */, undefined> & LuaExtension */ - -external fun open(filename: String, mode: String = definedExternally): dynamic /* JsTuple | JsTuple */ - -external fun output(file: String = definedExternally): LuaFile - -external fun output(): LuaFile - -external fun output(file: LuaFile = definedExternally): LuaFile - -external fun popen(prog: String, mode: String /* "r" | "w" */ = definedExternally): dynamic /* JsTuple | JsTuple */ - -external fun read(): FileReadFormatToType? - -external fun read(format: T): FileReadFormatToType? /* Any & LuaExtension */ - -external var stderr: LuaFile - -external var stdin: LuaFile - -external var stdout: LuaFile - -external fun tmpfile(): LuaFile - -external fun type(obj: Any): String /* "file" | "closed file" */ - -external fun write(vararg args: Any /* String | Number */): dynamic /* JsTuple | JsTuple */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/io/nonDeclarations.io.kt b/modules/mod2/dukat-custom/io/nonDeclarations.io.kt deleted file mode 100644 index 3fc06db..0000000 --- a/modules/mod2/dukat-custom/io/nonDeclarations.io.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package io - -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 FileReadFormatToType = Any \ No newline at end of file diff --git a/modules/mod2/dukat-custom/librariesAndFunctions.module_typed-factorio.kt b/modules/mod2/dukat-custom/librariesAndFunctions.module_typed-factorio.kt deleted file mode 100644 index dec76ff..0000000 --- a/modules/mod2/dukat-custom/librariesAndFunctions.module_typed-factorio.kt +++ /dev/null @@ -1,135 +0,0 @@ -@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 `T$95` { - var tag: String - var head: String - var body: String - var tail: String - var level: Number -} - -external interface SerpentOptions { - var indent: String - var comment: dynamic /* Boolean | Number */ - get() = definedExternally - set(value) = definedExternally - var sortkeys: dynamic /* Boolean | (this: Unit, keys: Array, table: Any) -> Unit */ - get() = definedExternally - set(value) = definedExternally - var sparse: Boolean? - var compact: Boolean? - var fatal: Boolean? - var nocode: Boolean? - var nohuge: Boolean? - var maxlevel: Number - var maxnum: Number - var maxlength: Number - var metatostring: Boolean? - var numformat: String - var valignore: Array - var keyallow: Array - var keyignore: Array - var valtypeignore: Array - fun custom(opts: `T$95`): String - var name: String - var refcomment: dynamic /* Boolean | Number */ - get() = definedExternally - set(value) = definedExternally - var tablecomment: dynamic /* Boolean | Number */ - get() = definedExternally - set(value) = definedExternally -} - -external interface SerpentOptionsPartial { - var indent: String? - get() = definedExternally - set(value) = definedExternally - var comment: dynamic /* Boolean? | Number? */ - get() = definedExternally - set(value) = definedExternally - var sortkeys: dynamic /* Boolean? | ((this: Unit, keys: Array, table: Any) -> Unit)? */ - get() = definedExternally - set(value) = definedExternally - var sparse: Boolean? - get() = definedExternally - set(value) = definedExternally - var compact: Boolean? - get() = definedExternally - set(value) = definedExternally - var fatal: Boolean? - get() = definedExternally - set(value) = definedExternally - var nocode: Boolean? - get() = definedExternally - set(value) = definedExternally - var nohuge: Boolean? - get() = definedExternally - set(value) = definedExternally - var maxlevel: Number? - get() = definedExternally - set(value) = definedExternally - var maxnum: Number? - get() = definedExternally - set(value) = definedExternally - var maxlength: Number? - get() = definedExternally - set(value) = definedExternally - var metatostring: Boolean? - get() = definedExternally - set(value) = definedExternally - var numformat: String? - get() = definedExternally - set(value) = definedExternally - var valignore: Array? - get() = definedExternally - set(value) = definedExternally - var keyallow: Array? - get() = definedExternally - set(value) = definedExternally - var keyignore: Array? - get() = definedExternally - set(value) = definedExternally - var valtypeignore: Array? - get() = definedExternally - set(value) = definedExternally - var custom: ((opts: `T$95`) -> String)? - get() = definedExternally - set(value) = definedExternally - var name: String? - get() = definedExternally - set(value) = definedExternally - var refcomment: dynamic /* Boolean? | Number? */ - get() = definedExternally - set(value) = definedExternally - var tablecomment: dynamic /* Boolean? | Number? */ - get() = definedExternally - set(value) = definedExternally -} - -external fun log(ls: Any /* JsTuple */) - -external fun log(ls: String) - -external fun log(ls: Number) - -external fun localised_print(ls: Any /* JsTuple */) - -external fun localised_print(ls: String) - -external fun localised_print(ls: Number) - -external fun table_size(tbl: table): Number \ No newline at end of file diff --git a/modules/mod2/dukat-custom/math/math.math.module_lua-types.kt b/modules/mod2/dukat-custom/math/math.math.module_lua-types.kt deleted file mode 100644 index 8012ac2..0000000 --- a/modules/mod2/dukat-custom/math/math.math.module_lua-types.kt +++ /dev/null @@ -1,75 +0,0 @@ -@file:JsQualifier("math") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package math - -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 abs(x: Number): Number - -external fun acos(x: Number): Number - -external fun asin(x: Number): Number - -external fun ceil(x: Number): Number - -external fun cos(x: Number): Number - -external fun deg(x: Number): Number - -external fun exp(x: Number): Number - -external fun floor(x: Number): Number - -external fun fmod(x: Number, y: Number): Number - -external var huge: Number - -external fun max(x: Number, vararg numbers: Number): Number - -external fun min(x: Number, vararg numbers: Number): Number - -external fun modf(x: Number): dynamic /* JsTuple */ - -external var pi: Number - -external fun rad(x: Number): Number - -external fun sin(x: Number): Number - -external fun sqrt(x: Number): Number - -external fun tan(x: Number): Number - -external fun log(x: Number, base: Number = definedExternally): Number - -external fun atan(x: Number): Number - -external fun atan2(y: Number, x: Number): Number - -external fun cosh(x: Number): Number - -external fun frexp(x: Number): Number - -external fun ldexp(m: Number, e: Number): Number - -external fun pow(x: Number, y: Number): Number - -external fun sinh(x: Number): Number - -external fun tanh(x: Number): Number - -external fun random(m: Number = definedExternally, n: Number = definedExternally): Number - -external fun randomseed(x: Number): Number \ No newline at end of file diff --git a/modules/mod2/dukat-custom/metatable.module_lua-types.kt b/modules/mod2/dukat-custom/metatable.module_lua-types.kt deleted file mode 100644 index 654ca6c..0000000 --- a/modules/mod2/dukat-custom/metatable.module_lua-types.kt +++ /dev/null @@ -1,51 +0,0 @@ -@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 LuaMetatable { -// val __pairs: ((t: T) -> dynamic)? -// val __ipairs: ((t: T) -> dynamic)? - fun __pairs(t: T): dynamic - fun __ipairs(t: T): dynamic - val __add: ((operand: Any) -> Any)? - val __sub: ((operand: Any) -> Any)? - val __mul: ((operand: Any) -> Any)? - val __div: ((operand: Any) -> Any)? - val __mod: ((operand: Any) -> Any)? - val __pow: ((operand: Any) -> Any)? - val __unm: ((operand: Any) -> Any)? - val __concat: ((operand: Any) -> Any)? - val __len: (() -> Any)? - val __eq: ((operand: Any) -> Boolean)? - val __lt: ((operand: Any) -> Boolean)? - val __le: ((operand: Any) -> Boolean)? - var __index: TIndex? - get() = definedExternally - set(value) = definedExternally - var __newindex: dynamic /* Any? | ((this: T, key: Any, value: Any) -> Unit)? */ - get() = definedExternally - set(value) = definedExternally - val __call: ((args: Any) -> Any)? - val __tostring: (() -> String)? - var __mode: String? /* "k" | "v" | "kv" */ - get() = definedExternally - set(value) = definedExternally - var __metatable: Any? - get() = definedExternally - set(value) = definedExternally - val __gc: (() -> Unit)? -} - -external interface LuaMetatable__1 : LuaMetatable Any)? */> \ No newline at end of file diff --git a/modules/mod2/dukat-custom/mod_gui/mod-gui.mod_gui.module_typed-factorio.kt b/modules/mod2/dukat-custom/mod_gui/mod-gui.mod_gui.module_typed-factorio.kt deleted file mode 100644 index 64f0b7b..0000000 --- a/modules/mod2/dukat-custom/mod_gui/mod-gui.mod_gui.module_typed-factorio.kt +++ /dev/null @@ -1,29 +0,0 @@ -@file:JsModule("mod-gui") -@file:JsNonModule -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package mod_gui - -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 LuaPlayer -import FrameGuiElementMembers -import FlowGuiElementMembers - -external var button_style: String - -external var frame_style: String - -external fun get_button_flow(player: LuaPlayer): FrameGuiElementMembers /* FrameGuiElementMembers & GuiElementIndex */ - -external fun get_frame_flow(player: LuaPlayer): FlowGuiElementMembers /* FlowGuiElementMembers & GuiElementIndex */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/modules.module_lua-types.kt b/modules/mod2/dukat-custom/modules.module_lua-types.kt deleted file mode 100644 index b4ffe28..0000000 --- a/modules/mod2/dukat-custom/modules.module_lua-types.kt +++ /dev/null @@ -1,17 +0,0 @@ -@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 require(modname: String): Any \ No newline at end of file diff --git a/modules/mod2/dukat-custom/os.module_lua-types.kt b/modules/mod2/dukat-custom/os.module_lua-types.kt deleted file mode 100644 index 8f6fe7b..0000000 --- a/modules/mod2/dukat-custom/os.module_lua-types.kt +++ /dev/null @@ -1,45 +0,0 @@ -@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 LuaDateInfo { - var year: Number - var month: Number - var day: Number - var hour: Number? - get() = definedExternally - set(value) = definedExternally - var min: Number? - get() = definedExternally - set(value) = definedExternally - var sec: Number? - get() = definedExternally - set(value) = definedExternally - var isdst: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface LuaDateInfoResult { - var year: Number - var month: Number - var day: Number - var hour: Number - var min: Number - var sec: Number - var isdst: Boolean? - var yday: Number - var wday: Number -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/os/os.os.module_lua-types.kt b/modules/mod2/dukat-custom/os/os.os.module_lua-types.kt deleted file mode 100644 index 9fc56e1..0000000 --- a/modules/mod2/dukat-custom/os/os.os.module_lua-types.kt +++ /dev/null @@ -1,56 +0,0 @@ -@file:JsQualifier("os") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package os - -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 LuaDateInfo - -external fun clock(): Number - -external fun date(format: String /* "*t" */ = definedExternally, time: Number = definedExternally): dynamic /* String | LuaDateInfoResult */ - -external fun date(): String - -external fun date(format: String /* "*t" */ = definedExternally): dynamic /* String | LuaDateInfoResult */ - -external fun difftime(t1: Number, t2: Number): Number - -external fun getenv(varname: String): String? - -external fun remove(filename: String): dynamic /* JsTuple | JsTuple */ - -external fun rename(oldname: String, newname: String): dynamic /* JsTuple | JsTuple */ - -external fun setlocale(locale: String = definedExternally, category: String /* "all" | "collate" | "ctype" | "monetary" | "numeric" | "time" */ = definedExternally): String? - -external fun time(): Number - -external fun time(table: LuaDateInfo): Number - -external fun tmpname(): String - -external fun execute(): Boolean - -external fun execute(command: String): dynamic /* JsTuple */ - -external fun exit(code: Boolean = definedExternally, close: Boolean = definedExternally): Any - -external fun exit(): Any - -external fun exit(code: Boolean = definedExternally): Any - -external fun exit(code: Number = definedExternally, close: Boolean = definedExternally): Any - -external fun exit(code: Number = definedExternally): Any \ No newline at end of file diff --git a/modules/mod2/dukat-custom/package/modules.package.module_lua-types.kt b/modules/mod2/dukat-custom/package/modules.package.module_lua-types.kt deleted file mode 100644 index fefc008..0000000 --- a/modules/mod2/dukat-custom/package/modules.package.module_lua-types.kt +++ /dev/null @@ -1,34 +0,0 @@ -@file:JsQualifier("package") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package `package` - -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.Record - -external var config: String - -external var cpath: String - -external var loaded: Record - -external fun loadlib(libname: String, funcname: String): dynamic /* JsTuple> | JsTuple */ - -external var path: String - -external var preload: Record Any> - -external fun searchpath(name: String, path: String, sep: String = definedExternally, rep: String = definedExternally): String - -external var searchers: Array dynamic | (modname: String) -> dynamic | String */> \ No newline at end of file diff --git a/modules/mod2/dukat-custom/pairs.module_typed-factorio.kt b/modules/mod2/dukat-custom/pairs.module_typed-factorio.kt deleted file mode 100644 index 18d966d..0000000 --- a/modules/mod2/dukat-custom/pairs.module_typed-factorio.kt +++ /dev/null @@ -1,22 +0,0 @@ -@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.Iterable - -external fun pairs(table: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */): Iterable */> /* Iterable */> & LuaIterator */, undefined> & LuaExtension */ - -external fun pairs(table: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */): Iterable */> /* Iterable */> & LuaIterator */, undefined> & LuaExtension */ - -external fun ipairs(table: LuaCustomTableMembers /* LuaCustomTableMembers & CustomTableIndex */): Any \ No newline at end of file diff --git a/modules/mod2/dukat-custom/serpent/librariesAndFunctions.serpent.module_typed-factorio.kt b/modules/mod2/dukat-custom/serpent/librariesAndFunctions.serpent.module_typed-factorio.kt deleted file mode 100644 index 223480e..0000000 --- a/modules/mod2/dukat-custom/serpent/librariesAndFunctions.serpent.module_typed-factorio.kt +++ /dev/null @@ -1,32 +0,0 @@ -@file:JsQualifier("serpent") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package serpent - -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 SerpentOptionsPartial - -external fun dump(tbl: Any, options: SerpentOptionsPartial = definedExternally): String - -external fun line(tbl: Any, options: SerpentOptionsPartial = definedExternally): String - -external fun block(tbl: Any, options: SerpentOptionsPartial = definedExternally): String - -external interface `T$96` { - var safe: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external fun load(str: String, options: `T$96` = definedExternally): dynamic /* JsTuple | JsTuple */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/string/string.string.module_lua-types.kt b/modules/mod2/dukat-custom/string/string.string.module_lua-types.kt deleted file mode 100644 index 8910e62..0000000 --- a/modules/mod2/dukat-custom/string/string.string.module_lua-types.kt +++ /dev/null @@ -1,63 +0,0 @@ -@file:JsQualifier("string") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package string - -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.Iterable -import tsstdlib.Record - -external fun byte(s: String, i: Number = definedExternally): dynamic /* Number | Array */ - -external fun byte(s: String): dynamic /* Number | Array */ - -external fun byte(s: String, i: Number = definedExternally, j: Number = definedExternally): Array /* Array & LuaExtension */ - -external fun char(vararg args: Number): String - -external fun dump(func: Function<*>): String - -external fun find(s: String, pattern: String, init: Number = definedExternally, plain: Boolean = definedExternally): dynamic /* JsTuple | JsTuple<> */ - -external fun format(formatstring: String, vararg args: Any): String - -external fun gmatch(s: String, pattern: String): Iterable /* Array & LuaExtension */> /* Iterable /* Array & LuaExtension */> & LuaIterator /* Array & LuaExtension */, undefined> & LuaExtension */ - -external fun gsub(s: String, pattern: String, repl: String, n: Number = definedExternally): dynamic /* JsTuple */ - -external fun gsub(s: String, pattern: String, repl: String): dynamic /* JsTuple */ - -external fun gsub(s: String, pattern: String, repl: Record, n: Number = definedExternally): dynamic /* JsTuple */ - -external fun gsub(s: String, pattern: String, repl: Record): dynamic /* JsTuple */ - -external fun gsub(s: String, pattern: String, repl: (matches: String) -> String, n: Number = definedExternally): dynamic /* JsTuple */ - -external fun gsub(s: String, pattern: String, repl: (matches: String) -> String): dynamic /* JsTuple */ - -external fun len(s: String): Number - -external fun lower(s: String): String - -external fun match(s: String, pattern: String, init: Number = definedExternally): Array /* Array & LuaExtension */ - -external fun rep(s: String, n: Number): String - -external fun reverse(s: String): String - -external fun sub(s: String, i: Number, j: Number = definedExternally): String - -external fun upper(s: String): String - -external fun rep(s: String, n: Number, sep: String = definedExternally): String \ No newline at end of file diff --git a/modules/mod2/dukat-custom/table/table.table.module_lua-types.kt b/modules/mod2/dukat-custom/table/table.table.module_lua-types.kt deleted file mode 100644 index f39ea86..0000000 --- a/modules/mod2/dukat-custom/table/table.table.module_lua-types.kt +++ /dev/null @@ -1,39 +0,0 @@ -@file:JsQualifier("table") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package table2 - -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 concat(list: Array, sep: String = definedExternally, i: Number = definedExternally, j: Number = definedExternally): String - -external fun insert(list: Array, value: T) - -external fun insert(list: Array, pos: Number, value: T) - -external fun remove(list: Array, pos: Number = definedExternally): T? - -external fun sort(list: Array, comp: (a: T, b: T) -> Boolean = definedExternally) - -external fun > unpack(list: T): T /* T & LuaExtension */ - -external fun unpack(list: Array, i: Number, j: Number = definedExternally): Array /* Array & LuaExtension */ - -external fun unpack(list: Array, i: Number): Array /* Array & LuaExtension */ - -external interface `T$92` { - var n: Number -} - -external fun > pack(vararg args: T): T /* T & `T$92` */ \ No newline at end of file diff --git a/modules/mod2/dukat-custom/tsstdlib/lib.dom.kt b/modules/mod2/dukat-custom/tsstdlib/lib.dom.kt deleted file mode 100644 index 09e0f80..0000000 --- a/modules/mod2/dukat-custom/tsstdlib/lib.dom.kt +++ /dev/null @@ -1,31 +0,0 @@ -@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 Coordinates { - var accuracy: Number - var altitude: Number? - var altitudeAccuracy: Number? - var heading: Number? - var latitude: Number - var longitude: Number - var speed: Number? -} - -external interface Position { - var coords: Coordinates - var timestamp: Number -} \ No newline at end of file diff --git a/modules/mod2/dukat-custom/tsstdlib/lib.es2015.iterable.kt b/modules/mod2/dukat-custom/tsstdlib/lib.es2015.iterable.kt deleted file mode 100644 index 41ccc71..0000000 --- a/modules/mod2/dukat-custom/tsstdlib/lib.es2015.iterable.kt +++ /dev/null @@ -1,40 +0,0 @@ -@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 \ No newline at end of file diff --git a/modules/mod2/dukat-custom/tsstdlib/lib.es5.kt b/modules/mod2/dukat-custom/tsstdlib/lib.es5.kt deleted file mode 100644 index a96c4b5..0000000 --- a/modules/mod2/dukat-custom/tsstdlib/lib.es5.kt +++ /dev/null @@ -1,76 +0,0 @@ -@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 FunctionConstructor { - @nativeInvoke - operator fun invoke(vararg args: String): Function<*> - var prototype: Function<*> -} - -external interface ConcatArray { - var 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 - var prototype: Array -} - -external interface ArrayLike { - var length: Number - @nativeGetter - operator fun get(n: Number): T? - @nativeSetter - operator fun set(n: Number, value: T) -} - -typealias Partial = Any - -typealias Pick = Any - -@Deprecated("use Kotlin Wrapper", ReplaceWith("kotlinext.js.Record")) -typealias Record = kotlinext.js.Record - - -typealias Exclude = Any - -typealias Extract = Any - -typealias Omit = Any - -typealias NonNullable = Any \ No newline at end of file diff --git a/modules/mod2/dukat-custom/types.module_typed-factorio.kt b/modules/mod2/dukat-custom/types.module_typed-factorio.kt deleted file mode 100644 index 3b00bbe..0000000 --- a/modules/mod2/dukat-custom/types.module_typed-factorio.kt +++ /dev/null @@ -1,91 +0,0 @@ -@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.Record - -external interface BaseSettingDefinition { - var type: String /* "bool-setting" | "int-setting" | "double-setting" | "string-setting" */ - var name: String - var localized_name: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var localized_description: dynamic /* JsTuple | String? | Number? */ - get() = definedExternally - set(value) = definedExternally - var order: String? - get() = definedExternally - set(value) = definedExternally - var hidden: Boolean? - get() = definedExternally - set(value) = definedExternally - var setting_type: String /* "startup" | "runtime-global" | "runtime-per-user" */ -} - -external interface BoolSettingDefinition : BaseSettingDefinition { - override var type: String /* "bool-setting" */ - var default_value: Boolean? - var forced_value: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface IntSettingDefinition : BaseSettingDefinition { - override var type: String /* "int-setting" */ - var default_value: Number - var minimum_value: Number? - get() = definedExternally - set(value) = definedExternally - var maximum_value: Number? - get() = definedExternally - set(value) = definedExternally - var allowed_values: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface DoubleSettingDefinition : BaseSettingDefinition { - override var type: String /* "double-setting" */ - var default_value: Number - var minimum_value: Number? - get() = definedExternally - set(value) = definedExternally - var maximum_value: Number? - get() = definedExternally - set(value) = definedExternally - var allowed_values: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface StringSettingDefinition : BaseSettingDefinition { - override var type: String /* "string-setting" */ - var default_value: String - var allow_blank: Boolean? - get() = definedExternally - set(value) = definedExternally - var auto_trim: Boolean? - get() = definedExternally - set(value) = definedExternally - var allowed_values: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface Data { - var raw: Any - fun extend(prototypes: Array) -} - -typealias Mods = Record \ No newline at end of file diff --git a/modules/mod2/dukat-custom/util/table/util.util.table.module_typed-factorio.kt b/modules/mod2/dukat-custom/util/table/util.util.table.module_typed-factorio.kt deleted file mode 100644 index bd20fee..0000000 --- a/modules/mod2/dukat-custom/util/table/util.util.table.module_typed-factorio.kt +++ /dev/null @@ -1,21 +0,0 @@ -@file:JsQualifier("util.table") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package util.table - -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 deepcopy(table: T): T - -external fun compare(tb1: T, tb2: T): Boolean \ No newline at end of file diff --git a/modules/mod2/dukat-custom/util/util.util.module_typed-factorio.kt b/modules/mod2/dukat-custom/util/util.util.module_typed-factorio.kt deleted file mode 100644 index ed78e1c..0000000 --- a/modules/mod2/dukat-custom/util/util.util.module_typed-factorio.kt +++ /dev/null @@ -1,110 +0,0 @@ -@file:JsModule("util") -@file:JsNonModule -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package util - -import AnyNotNil -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.Position -import ColorTable -import defines.direction -import LuaEntity -import tsstdlib.Record -import LuaTable - -external fun copy(table: T): T - -external fun distance(position1: Position, position2: Position): Number - -external fun positiontostr(position: Position): String - -external fun formattime(ticks: Number): String - -external fun color(hex: String): ColorTable - -external fun premul_color(color: ColorTable): ColorTable - -external fun premul_color(color: Any /* JsTuple */): ColorTable - -external fun mix_color(c1: ColorTable, c2: ColorTable): dynamic /* JsTuple */ - -external fun mix_color(c1: ColorTable, c2: Any /* JsTuple */): dynamic /* JsTuple */ - -external fun mix_color(c1: Any /* JsTuple */, c2: ColorTable): dynamic /* JsTuple */ - -external fun mix_color(c1: Any /* JsTuple */, c2: Any /* JsTuple */): dynamic /* JsTuple */ - -external fun multiply_color(c1: ColorTable, n: Number): dynamic /* JsTuple */ - -external fun multiply_color(c1: Any /* JsTuple */, n: Number): dynamic /* JsTuple */ - -external fun moveposition(position: Position, direction: defines.direction, distance: Number): Position? -//external fun moveposition(position: Position, direction: defines.direction.north, distance: Number): Position -//external fun moveposition(position: Position, direction: defines.direction.east, distance: Number): Position -//external fun moveposition(position: Position, direction: defines.direction.south, distance: Number): Position -//external fun moveposition(position: Position, direction: defines.direction.west, distance: Number): Position - -//external fun moveposition(position: Position, direction: direction, distance: Number): Position? - -external fun oppositedirection(direction: direction): direction - -external fun multiplystripes(count: Number, stripes: Array): Array - -external fun by_pixel(x: Number, y: Number): Position - -external fun by_pixel_hr(x: Number, y: Number): Position - -external fun add_shift(a: Any /* JsTuple */, b: Any /* JsTuple */): dynamic /* JsTuple */ - -external fun mul_shift(shift: Any /* JsTuple */, scale: Number?): dynamic /* JsTuple */ - -external fun format_number(amount: Number, append_suffix: Boolean = definedExternally): String - -external fun increment(t: Array, index: Number, v: Number = definedExternally) - -external fun merge(tables: Array): T - -external fun insert_safe(entity: LuaEntity?, item_dict: Record?) - -external fun remove_safe(entity: LuaEntity?, item_dict: Record?) - -external fun split_whitespace(string: String): Array - -external fun clamp(x: Number, lower: Number, upper: Number): Number - -external fun parse_energy(energy: String): Number - -external interface `T$97` { - var probability: Number -} - -external interface `T$98` { - var amount: Number -} - -external interface `T$99` { - var amount_min: Number - var amount_max: Number -} - -external fun product_amount(product: `T$97` /* `T$97` & dynamic */): Number - -external fun empty_sprite(): Any? - -external fun remove_from_list(list: Array, value: T): Boolean - -external fun list_to_map(list: Array): dynamic /* Record | LuaTable */ - -external fun list_to_map(list: T): LuaTable \ No newline at end of file diff --git a/modules/mod2/externals/CompilerOptions.module_typescript-to-lua.kt b/modules/mod2/externals/CompilerOptions.module_typescript-to-lua.kt deleted file mode 100644 index a6740d0..0000000 --- a/modules/mod2/externals/CompilerOptions.module_typescript-to-lua.kt +++ /dev/null @@ -1,75 +0,0 @@ -@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.CompilerOptions -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: OmitIndexSignature /* OmitIndexSignature & `T$0` */) -> Boolean - -external fun validateOptions(options: OmitIndexSignature /* OmitIndexSignature & `T$0` */): Array \ No newline at end of file diff --git a/modules/mod2/externals/LuaAST.module_typescript-to-lua.kt b/modules/mod2/externals/LuaAST.module_typescript-to-lua.kt deleted file mode 100644 index 079e37f..0000000 --- a/modules/mod2/externals/LuaAST.module_typescript-to-lua.kt +++ /dev/null @@ -1,485 +0,0 @@ -@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/modules/mod2/externals/LuaLib.module_typescript-to-lua.kt b/modules/mod2/externals/LuaLib.module_typescript-to-lua.kt deleted file mode 100644 index f00c242..0000000 --- a/modules/mod2/externals/LuaLib.module_typescript-to-lua.kt +++ /dev/null @@ -1,111 +0,0 @@ -@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/modules/mod2/externals/LuaPrinter.module_typescript-to-lua.kt b/modules/mod2/externals/LuaPrinter.module_typescript-to-lua.kt deleted file mode 100644 index 6428653..0000000 --- a/modules/mod2/externals/LuaPrinter.module_typescript-to-lua.kt +++ /dev/null @@ -1,101 +0,0 @@ -@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/modules/mod2/externals/context.module_typescript-to-lua.kt b/modules/mod2/externals/context.module_typescript-to-lua.kt deleted file mode 100644 index 3c6d078..0000000 --- a/modules/mod2/externals/context.module_typescript-to-lua.kt +++ /dev/null @@ -1,80 +0,0 @@ -@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 ts.CompilerOptions -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 var diagnostics: Array - open var checker: DiagnosticsProducingTypeChecker - open var resolver: EmitResolver - open var options: OmitIndexSignature /* OmitIndexSignature & `T$0` */ - open var luaTarget: LuaTarget - open var isModule: Boolean - open var 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/modules/mod2/externals/index.module_typescript-to-lua.kt b/modules/mod2/externals/index.module_typescript-to-lua.kt deleted file mode 100644 index 0de0447..0000000 --- a/modules/mod2/externals/index.module_typescript-to-lua.kt +++ /dev/null @@ -1,39 +0,0 @@ -@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.CompilerOptions -import ts.WriteFileCallback -import ts.Diagnostic -import tsstdlib.Record - -external fun transpileFiles(rootNames: Array, options: OmitIndexSignature /* OmitIndexSignature & `T$0` */ = definedExternally, writeFile: WriteFileCallback = definedExternally): EmitResult - -external fun transpileProject(configFileName: String, optionsToExtend: OmitIndexSignature /* OmitIndexSignature & `T$0` */ = definedExternally, writeFile: WriteFileCallback = definedExternally): EmitResult - -external interface TranspileVirtualProjectResult { - var diagnostics: Array - var transpiledFiles: Array -} - -external fun transpileVirtualProject(files: Record, options: OmitIndexSignature /* OmitIndexSignature & `T$0` */ = definedExternally): TranspileVirtualProjectResult - -external interface TranspileStringResult { - var diagnostics: Array - var file: TranspiledFile? - get() = definedExternally - set(value) = definedExternally -} - -external fun transpileString(main: String, options: OmitIndexSignature /* OmitIndexSignature & `T$0` */ = definedExternally): TranspileStringResult \ No newline at end of file diff --git a/modules/mod2/externals/lib.es2015.collection.kt b/modules/mod2/externals/lib.es2015.collection.kt deleted file mode 100644 index 8d138d8..0000000 --- a/modules/mod2/externals/lib.es2015.collection.kt +++ /dev/null @@ -1,49 +0,0 @@ -@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 */ - var size: Number -} - -external interface MapConstructor { - var 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 - var size: Number -} - -external interface SetConstructor { - var prototype: Set -} \ No newline at end of file diff --git a/modules/mod2/externals/lib.es2015.iterable.kt b/modules/mod2/externals/lib.es2015.iterable.kt deleted file mode 100644 index 57fb640..0000000 --- a/modules/mod2/externals/lib.es2015.iterable.kt +++ /dev/null @@ -1,54 +0,0 @@ -@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 { - var 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/modules/mod2/externals/lib.es5.Intl.module_dukat.kt b/modules/mod2/externals/lib.es5.Intl.module_dukat.kt deleted file mode 100644 index 62cbcc7..0000000 --- a/modules/mod2/externals/lib.es5.Intl.module_dukat.kt +++ /dev/null @@ -1,220 +0,0 @@ -@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/modules/mod2/externals/lib.es5.kt b/modules/mod2/externals/lib.es5.kt deleted file mode 100644 index a143da0..0000000 --- a/modules/mod2/externals/lib.es5.kt +++ /dev/null @@ -1,69 +0,0 @@ -@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 - var 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 { - var 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 - var prototype: Array -} - -external interface PromiseLike { - fun then(onfulfilled: ((value: T) -> Any?)? = definedExternally, onrejected: ((reason: Any) -> Any?)? = definedExternally): PromiseLike -} - -external interface ArrayLike { - var 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/modules/mod2/externals/lib.scripthost.kt b/modules/mod2/externals/lib.scripthost.kt deleted file mode 100644 index 809347e..0000000 --- a/modules/mod2/externals/lib.scripthost.kt +++ /dev/null @@ -1,20 +0,0 @@ -@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/modules/mod2/externals/nonDeclarations.ts.kt b/modules/mod2/externals/nonDeclarations.ts.kt deleted file mode 100644 index 3650dca..0000000 --- a/modules/mod2/externals/nonDeclarations.ts.kt +++ /dev/null @@ -1,114 +0,0 @@ -@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/modules/mod2/externals/output-collector.module_typescript-to-lua.kt b/modules/mod2/externals/output-collector.module_typescript-to-lua.kt deleted file mode 100644 index 0c57eac..0000000 --- a/modules/mod2/externals/output-collector.module_typescript-to-lua.kt +++ /dev/null @@ -1,33 +0,0 @@ -@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/modules/mod2/externals/parse.module_typescript-to-lua.kt b/modules/mod2/externals/parse.module_typescript-to-lua.kt deleted file mode 100644 index 052faf7..0000000 --- a/modules/mod2/externals/parse.module_typescript-to-lua.kt +++ /dev/null @@ -1,21 +0,0 @@ -@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 - -external fun updateParsedConfigFile(parsedConfigFile: ts.ParsedCommandLine): ParsedCommandLine - -external fun parseCommandLine(args: Array): ParsedCommandLine \ No newline at end of file diff --git a/modules/mod2/externals/plugins.module_typescript-to-lua.kt b/modules/mod2/externals/plugins.module_typescript-to-lua.kt deleted file mode 100644 index 24d3ea4..0000000 --- a/modules/mod2/externals/plugins.module_typescript-to-lua.kt +++ /dev/null @@ -1,24 +0,0 @@ -@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/modules/mod2/externals/report.module_typescript-to-lua.kt b/modules/mod2/externals/report.module_typescript-to-lua.kt deleted file mode 100644 index f1582a6..0000000 --- a/modules/mod2/externals/report.module_typescript-to-lua.kt +++ /dev/null @@ -1,48 +0,0 @@ -@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/modules/mod2/externals/source-map.module_source-map.kt b/modules/mod2/externals/source-map.module_source-map.kt deleted file mode 100644 index 6880a36..0000000 --- a/modules/mod2/externals/source-map.module_source-map.kt +++ /dev/null @@ -1,192 +0,0 @@ -@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/modules/mod2/externals/transpile.module_typescript-to-lua.kt b/modules/mod2/externals/transpile.module_typescript-to-lua.kt deleted file mode 100644 index 8681706..0000000 --- a/modules/mod2/externals/transpile.module_typescript-to-lua.kt +++ /dev/null @@ -1,40 +0,0 @@ -@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/modules/mod2/externals/transpiler.module_typescript-to-lua.kt b/modules/mod2/externals/transpiler.module_typescript-to-lua.kt deleted file mode 100644 index 16b18b0..0000000 --- a/modules/mod2/externals/transpiler.module_typescript-to-lua.kt +++ /dev/null @@ -1,55 +0,0 @@ -@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/modules/mod2/externals/tsconfig.module_typescript-to-lua.kt b/modules/mod2/externals/tsconfig.module_typescript-to-lua.kt deleted file mode 100644 index 8eadae2..0000000 --- a/modules/mod2/externals/tsconfig.module_typescript-to-lua.kt +++ /dev/null @@ -1,19 +0,0 @@ -@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.CompilerOptions -import ts.System - -external fun parseConfigFileWithSystem(configFileName: String, commandLineOptions: OmitIndexSignature /* OmitIndexSignature & `T$0` */ = definedExternally, system: System = definedExternally): ParsedCommandLine \ No newline at end of file diff --git a/modules/mod2/externals/typescript.module_typescript.kt b/modules/mod2/externals/typescript.module_typescript.kt deleted file mode 100644 index 83261af..0000000 --- a/modules/mod2/externals/typescript.module_typescript.kt +++ /dev/null @@ -1,19 +0,0 @@ -@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/modules/mod2/externals/typescript.ts.ScriptSnapshot.module_typescript.kt b/modules/mod2/externals/typescript.ts.ScriptSnapshot.module_typescript.kt deleted file mode 100644 index acab3da..0000000 --- a/modules/mod2/externals/typescript.ts.ScriptSnapshot.module_typescript.kt +++ /dev/null @@ -1,20 +0,0 @@ -@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/modules/mod2/externals/typescript.ts.module_typescript.kt b/modules/mod2/externals/typescript.ts.module_typescript.kt deleted file mode 100644 index 73cc27f..0000000 --- a/modules/mod2/externals/typescript.ts.module_typescript.kt +++ /dev/null @@ -1,8487 +0,0 @@ -@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 { - var 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 - -external interface ReadonlySet : ReadonlyCollection { - override fun has(value: T): Boolean - fun values(): Iterator - fun entries(): Iterator */> - fun forEach(action: (value: T, key: T) -> Unit) -} - -external interface Set : ReadonlySet, Collection { - fun add(value: T): Set /* this */ - override fun delete(value: T): Boolean -} - -external interface Iterator { - fun next(): dynamic /* `T$1` | `T$2` */ -} - -external interface Push { - fun push(vararg values: T) -} - -external interface TextRange { - var pos: Number - var end: Number -} - -external interface ReadonlyTextRange { - var pos: Number - var end: Number -} - -external enum class SyntaxKind { - Unknown /* = 0 */, - EndOfFileToken /* = 1 */, - SingleLineCommentTrivia /* = 2 */, - MultiLineCommentTrivia /* = 3 */, - NewLineTrivia /* = 4 */, - WhitespaceTrivia /* = 5 */, - ShebangTrivia /* = 6 */, - ConflictMarkerTrivia /* = 7 */, - NumericLiteral /* = 8 */, - BigIntLiteral /* = 9 */, - StringLiteral /* = 10 */, - JsxText /* = 11 */, - JsxTextAllWhiteSpaces /* = 12 */, - RegularExpressionLiteral /* = 13 */, - NoSubstitutionTemplateLiteral /* = 14 */, - TemplateHead /* = 15 */, - TemplateMiddle /* = 16 */, - TemplateTail /* = 17 */, - OpenBraceToken /* = 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 */, - GreaterThanToken /* = 31 */, - LessThanEqualsToken /* = 32 */, - GreaterThanEqualsToken /* = 33 */, - EqualsEqualsToken /* = 34 */, - ExclamationEqualsToken /* = 35 */, - EqualsEqualsEqualsToken /* = 36 */, - ExclamationEqualsEqualsToken /* = 37 */, - EqualsGreaterThanToken /* = 38 */, - PlusToken /* = 39 */, - MinusToken /* = 40 */, - AsteriskToken /* = 41 */, - AsteriskAsteriskToken /* = 42 */, - SlashToken /* = 43 */, - PercentToken /* = 44 */, - PlusPlusToken /* = 45 */, - MinusMinusToken /* = 46 */, - LessThanLessThanToken /* = 47 */, - GreaterThanGreaterThanToken /* = 48 */, - GreaterThanGreaterThanGreaterThanToken /* = 49 */, - AmpersandToken /* = 50 */, - BarToken /* = 51 */, - CaretToken /* = 52 */, - ExclamationToken /* = 53 */, - TildeToken /* = 54 */, - AmpersandAmpersandToken /* = 55 */, - BarBarToken /* = 56 */, - QuestionToken /* = 57 */, - ColonToken /* = 58 */, - AtToken /* = 59 */, - QuestionQuestionToken /* = 60 */, - BacktickToken /* = 61 */, - HashToken /* = 62 */, - EqualsToken /* = 63 */, - PlusEqualsToken /* = 64 */, - MinusEqualsToken /* = 65 */, - AsteriskEqualsToken /* = 66 */, - AsteriskAsteriskEqualsToken /* = 67 */, - SlashEqualsToken /* = 68 */, - PercentEqualsToken /* = 69 */, - LessThanLessThanEqualsToken /* = 70 */, - GreaterThanGreaterThanEqualsToken /* = 71 */, - GreaterThanGreaterThanGreaterThanEqualsToken /* = 72 */, - AmpersandEqualsToken /* = 73 */, - BarEqualsToken /* = 74 */, - BarBarEqualsToken /* = 75 */, - AmpersandAmpersandEqualsToken /* = 76 */, - QuestionQuestionEqualsToken /* = 77 */, - CaretEqualsToken /* = 78 */, - Identifier /* = 79 */, - PrivateIdentifier /* = 80 */, - BreakKeyword /* = 81 */, - CaseKeyword /* = 82 */, - CatchKeyword /* = 83 */, - ClassKeyword /* = 84 */, - ConstKeyword /* = 85 */, - ContinueKeyword /* = 86 */, - DebuggerKeyword /* = 87 */, - DefaultKeyword /* = 88 */, - DeleteKeyword /* = 89 */, - DoKeyword /* = 90 */, - ElseKeyword /* = 91 */, - EnumKeyword /* = 92 */, - ExportKeyword /* = 93 */, - ExtendsKeyword /* = 94 */, - FalseKeyword /* = 95 */, - FinallyKeyword /* = 96 */, - ForKeyword /* = 97 */, - FunctionKeyword /* = 98 */, - IfKeyword /* = 99 */, - ImportKeyword /* = 100 */, - InKeyword /* = 101 */, - InstanceOfKeyword /* = 102 */, - NewKeyword /* = 103 */, - NullKeyword /* = 104 */, - ReturnKeyword /* = 105 */, - SuperKeyword /* = 106 */, - SwitchKeyword /* = 107 */, - ThisKeyword /* = 108 */, - ThrowKeyword /* = 109 */, - TrueKeyword /* = 110 */, - TryKeyword /* = 111 */, - TypeOfKeyword /* = 112 */, - VarKeyword /* = 113 */, - VoidKeyword /* = 114 */, - WhileKeyword /* = 115 */, - WithKeyword /* = 116 */, - ImplementsKeyword /* = 117 */, - InterfaceKeyword /* = 118 */, - LetKeyword /* = 119 */, - PackageKeyword /* = 120 */, - PrivateKeyword /* = 121 */, - ProtectedKeyword /* = 122 */, - PublicKeyword /* = 123 */, - StaticKeyword /* = 124 */, - YieldKeyword /* = 125 */, - AbstractKeyword /* = 126 */, - AsKeyword /* = 127 */, - AssertsKeyword /* = 128 */, - AnyKeyword /* = 129 */, - AsyncKeyword /* = 130 */, - AwaitKeyword /* = 131 */, - BooleanKeyword /* = 132 */, - ConstructorKeyword /* = 133 */, - DeclareKeyword /* = 134 */, - GetKeyword /* = 135 */, - InferKeyword /* = 136 */, - IntrinsicKeyword /* = 137 */, - IsKeyword /* = 138 */, - KeyOfKeyword /* = 139 */, - ModuleKeyword /* = 140 */, - NamespaceKeyword /* = 141 */, - NeverKeyword /* = 142 */, - ReadonlyKeyword /* = 143 */, - RequireKeyword /* = 144 */, - NumberKeyword /* = 145 */, - ObjectKeyword /* = 146 */, - SetKeyword /* = 147 */, - StringKeyword /* = 148 */, - SymbolKeyword /* = 149 */, - TypeKeyword /* = 150 */, - UndefinedKeyword /* = 151 */, - UniqueKeyword /* = 152 */, - UnknownKeyword /* = 153 */, - FromKeyword /* = 154 */, - GlobalKeyword /* = 155 */, - BigIntKeyword /* = 156 */, - OverrideKeyword /* = 157 */, - OfKeyword /* = 158 */, - QualifiedName /* = 159 */, - ComputedPropertyName /* = 160 */, - TypeParameter /* = 161 */, - Parameter /* = 162 */, - Decorator /* = 163 */, - PropertySignature /* = 164 */, - PropertyDeclaration /* = 165 */, - MethodSignature /* = 166 */, - MethodDeclaration /* = 167 */, - ClassStaticBlockDeclaration /* = 168 */, - Constructor /* = 169 */, - GetAccessor /* = 170 */, - SetAccessor /* = 171 */, - CallSignature /* = 172 */, - ConstructSignature /* = 173 */, - IndexSignature /* = 174 */, - TypePredicate /* = 175 */, - TypeReference /* = 176 */, - FunctionType /* = 177 */, - ConstructorType /* = 178 */, - TypeQuery /* = 179 */, - TypeLiteral /* = 180 */, - ArrayType /* = 181 */, - TupleType /* = 182 */, - OptionalType /* = 183 */, - RestType /* = 184 */, - UnionType /* = 185 */, - IntersectionType /* = 186 */, - ConditionalType /* = 187 */, - InferType /* = 188 */, - ParenthesizedType /* = 189 */, - ThisType /* = 190 */, - TypeOperator /* = 191 */, - IndexedAccessType /* = 192 */, - MappedType /* = 193 */, - LiteralType /* = 194 */, - NamedTupleMember /* = 195 */, - TemplateLiteralType /* = 196 */, - TemplateLiteralTypeSpan /* = 197 */, - ImportType /* = 198 */, - ObjectBindingPattern /* = 199 */, - ArrayBindingPattern /* = 200 */, - BindingElement /* = 201 */, - ArrayLiteralExpression /* = 202 */, - ObjectLiteralExpression /* = 203 */, - PropertyAccessExpression /* = 204 */, - ElementAccessExpression /* = 205 */, - CallExpression /* = 206 */, - NewExpression /* = 207 */, - TaggedTemplateExpression /* = 208 */, - TypeAssertionExpression /* = 209 */, - ParenthesizedExpression /* = 210 */, - FunctionExpression /* = 211 */, - ArrowFunction /* = 212 */, - DeleteExpression /* = 213 */, - TypeOfExpression /* = 214 */, - VoidExpression /* = 215 */, - AwaitExpression /* = 216 */, - PrefixUnaryExpression /* = 217 */, - PostfixUnaryExpression /* = 218 */, - BinaryExpression /* = 219 */, - ConditionalExpression /* = 220 */, - TemplateExpression /* = 221 */, - YieldExpression /* = 222 */, - SpreadElement /* = 223 */, - ClassExpression /* = 224 */, - OmittedExpression /* = 225 */, - ExpressionWithTypeArguments /* = 226 */, - AsExpression /* = 227 */, - NonNullExpression /* = 228 */, - MetaProperty /* = 229 */, - SyntheticExpression /* = 230 */, - TemplateSpan /* = 231 */, - SemicolonClassElement /* = 232 */, - Block /* = 233 */, - EmptyStatement /* = 234 */, - VariableStatement /* = 235 */, - ExpressionStatement /* = 236 */, - IfStatement /* = 237 */, - DoStatement /* = 238 */, - WhileStatement /* = 239 */, - ForStatement /* = 240 */, - ForInStatement /* = 241 */, - ForOfStatement /* = 242 */, - ContinueStatement /* = 243 */, - BreakStatement /* = 244 */, - ReturnStatement /* = 245 */, - WithStatement /* = 246 */, - SwitchStatement /* = 247 */, - LabeledStatement /* = 248 */, - ThrowStatement /* = 249 */, - TryStatement /* = 250 */, - DebuggerStatement /* = 251 */, - VariableDeclaration /* = 252 */, - VariableDeclarationList /* = 253 */, - FunctionDeclaration /* = 254 */, - ClassDeclaration /* = 255 */, - InterfaceDeclaration /* = 256 */, - TypeAliasDeclaration /* = 257 */, - EnumDeclaration /* = 258 */, - ModuleDeclaration /* = 259 */, - ModuleBlock /* = 260 */, - CaseBlock /* = 261 */, - NamespaceExportDeclaration /* = 262 */, - ImportEqualsDeclaration /* = 263 */, - ImportDeclaration /* = 264 */, - ImportClause /* = 265 */, - NamespaceImport /* = 266 */, - NamedImports /* = 267 */, - ImportSpecifier /* = 268 */, - ExportAssignment /* = 269 */, - ExportDeclaration /* = 270 */, - NamedExports /* = 271 */, - NamespaceExport /* = 272 */, - ExportSpecifier /* = 273 */, - MissingDeclaration /* = 274 */, - ExternalModuleReference /* = 275 */, - JsxElement /* = 276 */, - JsxSelfClosingElement /* = 277 */, - JsxOpeningElement /* = 278 */, - JsxClosingElement /* = 279 */, - JsxFragment /* = 280 */, - JsxOpeningFragment /* = 281 */, - JsxClosingFragment /* = 282 */, - JsxAttribute /* = 283 */, - JsxAttributes /* = 284 */, - JsxSpreadAttribute /* = 285 */, - JsxExpression /* = 286 */, - CaseClause /* = 287 */, - DefaultClause /* = 288 */, - HeritageClause /* = 289 */, - CatchClause /* = 290 */, - PropertyAssignment /* = 291 */, - ShorthandPropertyAssignment /* = 292 */, - SpreadAssignment /* = 293 */, - EnumMember /* = 294 */, - UnparsedPrologue /* = 295 */, - UnparsedPrepend /* = 296 */, - UnparsedText /* = 297 */, - UnparsedInternalText /* = 298 */, - UnparsedSyntheticReference /* = 299 */, - SourceFile /* = 300 */, - Bundle /* = 301 */, - UnparsedSource /* = 302 */, - InputFiles /* = 303 */, - JSDocTypeExpression /* = 304 */, - JSDocNameReference /* = 305 */, - JSDocMemberName /* = 306 */, - JSDocAllType /* = 307 */, - JSDocUnknownType /* = 308 */, - JSDocNullableType /* = 309 */, - JSDocNonNullableType /* = 310 */, - JSDocOptionalType /* = 311 */, - JSDocFunctionType /* = 312 */, - JSDocVariadicType /* = 313 */, - JSDocNamepathType /* = 314 */, - JSDocComment /* = 315 */, - JSDocText /* = 316 */, - JSDocTypeLiteral /* = 317 */, - JSDocSignature /* = 318 */, - JSDocLink /* = 319 */, - JSDocLinkCode /* = 320 */, - JSDocLinkPlain /* = 321 */, - JSDocTag /* = 322 */, - JSDocAugmentsTag /* = 323 */, - JSDocImplementsTag /* = 324 */, - JSDocAuthorTag /* = 325 */, - JSDocDeprecatedTag /* = 326 */, - JSDocClassTag /* = 327 */, - JSDocPublicTag /* = 328 */, - JSDocPrivateTag /* = 329 */, - JSDocProtectedTag /* = 330 */, - JSDocReadonlyTag /* = 331 */, - JSDocOverrideTag /* = 332 */, - JSDocCallbackTag /* = 333 */, - JSDocEnumTag /* = 334 */, - JSDocParameterTag /* = 335 */, - JSDocReturnTag /* = 336 */, - JSDocThisTag /* = 337 */, - JSDocTypeTag /* = 338 */, - JSDocTemplateTag /* = 339 */, - JSDocTypedefTag /* = 340 */, - JSDocSeeTag /* = 341 */, - JSDocPropertyTag /* = 342 */, - SyntaxList /* = 343 */, - NotEmittedStatement /* = 344 */, - PartiallyEmittedExpression /* = 345 */, - CommaListExpression /* = 346 */, - MergeDeclarationMarker /* = 347 */, - EndOfDeclarationMarker /* = 348 */, - SyntheticReferenceExpression /* = 349 */, - Count /* = 350 */, - FirstAssignment /* = 63 */, - LastAssignment /* = 78 */, - FirstCompoundAssignment /* = 64 */, - LastCompoundAssignment /* = 78 */, - FirstReservedWord /* = 81 */, - LastReservedWord /* = 116 */, - FirstKeyword /* = 81 */, - LastKeyword /* = 158 */, - FirstFutureReservedWord /* = 117 */, - LastFutureReservedWord /* = 125 */, - FirstTypeNode /* = 175 */, - LastTypeNode /* = 198 */, - FirstPunctuation /* = 18 */, - LastPunctuation /* = 78 */, - FirstToken /* = 0 */, - LastToken /* = 158 */, - FirstTriviaToken /* = 2 */, - LastTriviaToken /* = 7 */, - FirstLiteralToken /* = 8 */, - LastLiteralToken /* = 14 */, - FirstTemplateToken /* = 14 */, - LastTemplateToken /* = 17 */, - FirstBinaryOperator /* = 29 */, - LastBinaryOperator /* = 78 */, - FirstStatement /* = 235 */, - LastStatement /* = 251 */, - FirstNode /* = 159 */, - FirstJSDocNode /* = 304 */, - LastJSDocNode /* = 342 */, - FirstJSDocTagNode /* = 322 */, - LastJSDocTagNode /* = 342 */ -} - -external enum class NodeFlags { - None /* = 0 */, - Let /* = 1 */, - Const /* = 2 */, - NestedNamespace /* = 4 */, - Synthesized /* = 8 */, - Namespace /* = 16 */, - OptionalChain /* = 32 */, - ExportContext /* = 64 */, - ContainsThis /* = 128 */, - HasImplicitReturn /* = 256 */, - HasExplicitReturn /* = 512 */, - GlobalAugmentation /* = 1024 */, - HasAsyncFunctions /* = 2048 */, - DisallowInContext /* = 4096 */, - YieldContext /* = 8192 */, - DecoratorContext /* = 16384 */, - AwaitContext /* = 32768 */, - ThisNodeHasError /* = 65536 */, - JavaScriptFile /* = 131072 */, - ThisNodeOrAnySubNodesHasError /* = 262144 */, - HasAggregatedChildData /* = 524288 */, - JSDoc /* = 4194304 */, - JsonFile /* = 33554432 */, - BlockScoped /* = 3 */, - ReachabilityCheckFlags /* = 768 */, - ReachabilityAndEmitFlags /* = 2816 */, - ContextFlags /* = 25358336 */, - TypeExcludesFlags /* = 40960 */ -} - -external enum class ModifierFlags { - None /* = 0 */, - Export /* = 1 */, - Ambient /* = 2 */, - Public /* = 4 */, - Private /* = 8 */, - Protected /* = 16 */, - Static /* = 32 */, - Readonly /* = 64 */, - Abstract /* = 128 */, - Async /* = 256 */, - Default /* = 512 */, - Const /* = 2048 */, - HasComputedJSDocModifiers /* = 4096 */, - Deprecated /* = 8192 */, - Override /* = 16384 */, - HasComputedFlags /* = 536870912 */, - AccessibilityModifier /* = 28 */, - ParameterPropertyModifier /* = 16476 */, - NonPublicAccessibilityModifier /* = 24 */, - TypeScriptModifier /* = 18654 */, - ExportDefault /* = 513 */, - All /* = 27647 */ -} - -external enum class JsxFlags { - None /* = 0 */, - IntrinsicNamedElement /* = 1 */, - IntrinsicIndexedElement /* = 2 */, - IntrinsicElement /* = 3 */ -} - -external interface Node : ReadonlyTextRange { - fun getSourceFile(): SourceFile - fun getChildCount(sourceFile: SourceFile = definedExternally): Number - fun getChildAt(index: Number, sourceFile: SourceFile = definedExternally): Node - fun getChildren(sourceFile: SourceFile = definedExternally): Array - fun getStart(sourceFile: SourceFile = definedExternally, includeJsDocComment: Boolean = definedExternally): Number - fun getFullStart(): Number - fun getEnd(): Number - fun getWidth(sourceFile: SourceFileLike = definedExternally): Number - fun getFullWidth(): Number - fun getLeadingTriviaWidth(sourceFile: SourceFile = definedExternally): Number - fun getFullText(sourceFile: SourceFile = definedExternally): String - fun getText(sourceFile: SourceFile = definedExternally): String - fun getFirstToken(sourceFile: SourceFile = definedExternally): Node? - fun getLastToken(sourceFile: SourceFile = definedExternally): Node? - fun forEachChild(cbNode: (node: Node) -> T?, cbNodeArray: (nodes: NodeArray) -> T? = definedExternally): T? - var kind: SyntaxKind - var flags: NodeFlags - var decorators: NodeArray? - get() = definedExternally - set(value) = definedExternally - var modifiers: ModifiersArray? - get() = definedExternally - set(value) = definedExternally - var parent: Node -} - -external interface JSDocContainer - -external interface Token : Node { - override var kind: TKind -} - -external interface PunctuationToken : Token - -external interface KeywordToken : Token - -external interface ModifierToken : KeywordToken - -external enum class GeneratedIdentifierFlags { - None /* = 0 */, - ReservedInNestedScopes /* = 8 */, - Optimistic /* = 16 */, - FileLevel /* = 32 */, - AllowNameSubstitution /* = 64 */ -} - -external interface Identifier : PrimaryExpression, Declaration { - var text: String - var escapedText: dynamic /* String & `T$8` | Unit & `T$8` | InternalSymbolName */ - get() = definedExternally - set(value) = definedExternally - var originalKeywordKind: SyntaxKind? - get() = definedExternally - set(value) = definedExternally - var isInJSDocNamespace: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TransientIdentifier : Identifier { - var resolvedSymbol: Symbol -} - -external interface QualifiedName : Node { - var left: dynamic /* Identifier | QualifiedName */ - get() = definedExternally - set(value) = definedExternally - var right: Identifier -} - -external interface Declaration : Node { - var _declarationBrand: Any -} - -external interface NamedDeclaration : Declaration { - var name: dynamic /* Identifier? | PrivateIdentifier? | StringLiteral? | NoSubstitutionTemplateLiteral? | NumericLiteral? | ComputedPropertyName? | ElementAccessExpression? | ObjectBindingPattern? | ArrayBindingPattern? | PropertyAccessEntityNameExpression? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface DeclarationStatement : NamedDeclaration, Statement { - override var name: dynamic /* Identifier? | StringLiteral? | NumericLiteral? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ComputedPropertyName : Node { - override var parent: Declaration - var expression: Expression -} - -external interface PrivateIdentifier : Node { - var text: String - var escapedText: dynamic /* String & `T$8` | Unit & `T$8` | InternalSymbolName */ - get() = definedExternally - set(value) = definedExternally -} - -external interface Decorator : Node { - override var parent: NamedDeclaration - var expression: LeftHandSideExpression -} - -external interface TypeParameterDeclaration : NamedDeclaration { - override var parent: dynamic /* CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction | ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag | InferTypeNode */ - get() = definedExternally - set(value) = definedExternally - override var name: Identifier - var constraint: TypeNode? - get() = definedExternally - set(value) = definedExternally - var default: TypeNode? - get() = definedExternally - set(value) = definedExternally - var expression: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface SignatureDeclarationBase : NamedDeclaration, JSDocContainer { - override var name: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */ - get() = definedExternally - set(value) = definedExternally - var typeParameters: NodeArray? - get() = definedExternally - set(value) = definedExternally - var parameters: NodeArray - var type: TypeNode? - get() = definedExternally - set(value) = definedExternally -} - -external interface CallSignatureDeclaration : SignatureDeclarationBase, TypeElement { - override var kind: Any - override var name: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ConstructSignatureDeclaration : SignatureDeclarationBase, TypeElement { - override var kind: Any - override var name: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface VariableDeclaration : NamedDeclaration, JSDocContainer { - override var parent: dynamic /* VariableDeclarationList | CatchClause */ - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | ObjectBindingPattern | ArrayBindingPattern */ - get() = definedExternally - set(value) = definedExternally - var exclamationToken: ExclamationToken? - get() = definedExternally - set(value) = definedExternally - var type: TypeNode? - get() = definedExternally - set(value) = definedExternally - var initializer: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface VariableDeclarationList : Node { - override var parent: dynamic /* VariableStatement | ForStatement | ForOfStatement | ForInStatement */ - get() = definedExternally - set(value) = definedExternally - var declarations: NodeArray -} - -external interface ParameterDeclaration : NamedDeclaration, JSDocContainer { - override var parent: dynamic /* CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction */ - get() = definedExternally - set(value) = definedExternally - var dotDotDotToken: DotDotDotToken? - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | ObjectBindingPattern | ArrayBindingPattern */ - get() = definedExternally - set(value) = definedExternally - var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally - var type: TypeNode? - get() = definedExternally - set(value) = definedExternally - var initializer: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface BindingElement : NamedDeclaration { - override var parent: dynamic /* ObjectBindingPattern | ArrayBindingPattern */ - get() = definedExternally - set(value) = definedExternally - var propertyName: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */ - get() = definedExternally - set(value) = definedExternally - var dotDotDotToken: DotDotDotToken? - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | ObjectBindingPattern | ArrayBindingPattern */ - get() = definedExternally - set(value) = definedExternally - var initializer: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface PropertySignature : TypeElement, JSDocContainer { - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally - override var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally - var type: TypeNode? - get() = definedExternally - set(value) = definedExternally - var initializer: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface PropertyDeclaration : ClassElement, JSDocContainer { - override var parent: dynamic /* ClassDeclaration | ClassExpression */ - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally - var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally - var exclamationToken: ExclamationToken? - get() = definedExternally - set(value) = definedExternally - var type: TypeNode? - get() = definedExternally - set(value) = definedExternally - var initializer: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface ObjectLiteralElement : NamedDeclaration { - var _objectLiteralBrand: Any - override var name: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface PropertyAssignment : ObjectLiteralElement, JSDocContainer { - override var parent: ObjectLiteralExpression - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally - var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally - var exclamationToken: ExclamationToken? - get() = definedExternally - set(value) = definedExternally - var initializer: Expression -} - -external interface ShorthandPropertyAssignment : ObjectLiteralElement, JSDocContainer { - override var parent: ObjectLiteralExpression - override var name: Identifier - var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally - var exclamationToken: ExclamationToken? - get() = definedExternally - set(value) = definedExternally - var equalsToken: EqualsToken? - get() = definedExternally - set(value) = definedExternally - var objectAssignmentInitializer: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface SpreadAssignment : ObjectLiteralElement, JSDocContainer { - override var parent: ObjectLiteralExpression - var expression: Expression -} - -external interface PropertyLikeDeclaration : NamedDeclaration { - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ObjectBindingPattern : Node { - override var parent: dynamic /* VariableDeclaration | ParameterDeclaration | BindingElement */ - get() = definedExternally - set(value) = definedExternally - var elements: NodeArray -} - -external interface ArrayBindingPattern : Node { - override var parent: dynamic /* VariableDeclaration | ParameterDeclaration | BindingElement */ - get() = definedExternally - set(value) = definedExternally - var elements: NodeArray -} - -external interface FunctionLikeDeclarationBase : SignatureDeclarationBase { - var _functionLikeDeclarationBrand: Any - var asteriskToken: AsteriskToken? - get() = definedExternally - set(value) = definedExternally - var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally - var exclamationToken: ExclamationToken? - get() = definedExternally - set(value) = definedExternally - var body: dynamic /* Block? | Expression? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FunctionDeclaration : FunctionLikeDeclarationBase, DeclarationStatement { - override var kind: Any - override var name: Identifier? - get() = definedExternally - set(value) = definedExternally - override var body: FunctionBody? - get() = definedExternally - set(value) = definedExternally -} - -external interface MethodSignature : SignatureDeclarationBase, TypeElement { - override var kind: Any - override var parent: dynamic /* ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode */ - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally -} - -external interface MethodDeclaration : FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { - override var kind: Any - override var parent: dynamic /* ClassDeclaration | ClassExpression | ObjectLiteralExpression */ - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally - override var body: FunctionBody? - get() = definedExternally - set(value) = definedExternally -} - -external interface ConstructorDeclaration : FunctionLikeDeclarationBase, ClassElement, JSDocContainer { - override var kind: Any - override var parent: dynamic /* ClassDeclaration | ClassExpression */ - get() = definedExternally - set(value) = definedExternally - override var body: FunctionBody? - get() = definedExternally - set(value) = definedExternally -} - -external interface SemicolonClassElement : ClassElement { - override var parent: dynamic /* ClassDeclaration | ClassExpression */ - get() = definedExternally - set(value) = definedExternally -} - -external interface GetAccessorDeclaration : FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer { - override var kind: Any - override var parent: dynamic /* ClassDeclaration | ClassExpression | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration */ - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally - override var body: FunctionBody? - get() = definedExternally - set(value) = definedExternally - override var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally -} - -external interface SetAccessorDeclaration : FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer { - override var kind: Any - override var parent: dynamic /* ClassDeclaration | ClassExpression | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration */ - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally - override var body: FunctionBody? - get() = definedExternally - set(value) = definedExternally - override var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally -} - -external interface IndexSignatureDeclaration : SignatureDeclarationBase, ClassElement, TypeElement { - override var kind: Any - override var parent: dynamic /* ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode */ - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ClassStaticBlockDeclaration : ClassElement, JSDocContainer { - override var parent: dynamic /* ClassDeclaration | ClassExpression */ - get() = definedExternally - set(value) = definedExternally - var body: Block -} - -external interface TypeNode : Node { - var _typeNodeBrand: Any -} - -external interface KeywordTypeNode : KeywordToken, TypeNode { - override var kind: TKind -} - -external interface ImportTypeNode : NodeWithTypeArguments { - var isTypeOf: Boolean - var argument: TypeNode - var qualifier: dynamic /* Identifier? | QualifiedName? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ThisTypeNode : TypeNode - -external interface FunctionOrConstructorTypeNodeBase : TypeNode, SignatureDeclarationBase { - override var kind: dynamic /* SyntaxKind.FunctionType | SyntaxKind.ConstructorType */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FunctionTypeNode : FunctionOrConstructorTypeNodeBase { - override var kind: Any -} - -external interface ConstructorTypeNode : FunctionOrConstructorTypeNodeBase { - override var kind: Any -} - -external interface NodeWithTypeArguments : TypeNode { - var typeArguments: NodeArray? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeReferenceNode : NodeWithTypeArguments { - var typeName: dynamic /* Identifier | QualifiedName */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TypePredicateNode : TypeNode { - override var parent: dynamic /* CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction | JSDocTypeExpression */ - get() = definedExternally - set(value) = definedExternally - var assertsModifier: AssertsToken? - get() = definedExternally - set(value) = definedExternally - var parameterName: dynamic /* Identifier | ThisTypeNode */ - get() = definedExternally - set(value) = definedExternally - var type: TypeNode? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeQueryNode : TypeNode { - var exprName: dynamic /* Identifier | QualifiedName */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeLiteralNode : TypeNode, Declaration { - var members: NodeArray -} - -external interface ArrayTypeNode : TypeNode { - var elementType: TypeNode -} - -external interface TupleTypeNode : TypeNode { - var elements: NodeArray -} - -external interface NamedTupleMember : TypeNode, JSDocContainer, Declaration { - var dotDotDotToken: Token? - get() = definedExternally - set(value) = definedExternally - var name: Identifier - var questionToken: Token? - get() = definedExternally - set(value) = definedExternally - var type: TypeNode -} - -external interface OptionalTypeNode : TypeNode { - var type: TypeNode -} - -external interface RestTypeNode : TypeNode { - var type: TypeNode -} - -external interface UnionTypeNode : TypeNode { - var types: NodeArray -} - -external interface IntersectionTypeNode : TypeNode { - var types: NodeArray -} - -external interface ConditionalTypeNode : TypeNode { - var checkType: TypeNode - var extendsType: TypeNode - var trueType: TypeNode - var falseType: TypeNode -} - -external interface InferTypeNode : TypeNode { - var typeParameter: TypeParameterDeclaration -} - -external interface ParenthesizedTypeNode : TypeNode { - var type: TypeNode -} - -external interface TypeOperatorNode : TypeNode { - var operator: dynamic /* SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword */ - get() = definedExternally - set(value) = definedExternally - var type: TypeNode -} - -external interface IndexedAccessTypeNode : TypeNode { - var objectType: TypeNode - var indexType: TypeNode -} - -external interface MappedTypeNode : TypeNode, Declaration { - var readonlyToken: dynamic /* ReadonlyToken? | PlusToken? | MinusToken? */ - get() = definedExternally - set(value) = definedExternally - var typeParameter: TypeParameterDeclaration - var nameType: TypeNode? - get() = definedExternally - set(value) = definedExternally - var questionToken: dynamic /* QuestionToken? | PlusToken? | MinusToken? */ - get() = definedExternally - set(value) = definedExternally - var type: TypeNode? - get() = definedExternally - set(value) = definedExternally -} - -external interface LiteralTypeNode : TypeNode { - var literal: dynamic /* NullLiteral | TrueLiteral | FalseLiteral | LiteralExpression | PrefixUnaryExpression */ - get() = definedExternally - set(value) = definedExternally -} - -external interface StringLiteral : LiteralExpression, Declaration - -external interface TemplateLiteralTypeNode : TypeNode { - var head: TemplateHead - var templateSpans: NodeArray -} - -external interface TemplateLiteralTypeSpan : TypeNode { - override var parent: TemplateLiteralTypeNode - var type: TypeNode - var literal: dynamic /* TemplateMiddle | TemplateTail */ - get() = definedExternally - set(value) = definedExternally -} - -external interface Expression : Node { - var _expressionBrand: Any -} - -external interface OmittedExpression : Expression - -external interface PartiallyEmittedExpression : LeftHandSideExpression { - var expression: Expression -} - -external interface UnaryExpression : Expression { - var _unaryExpressionBrand: Any -} - -external interface UpdateExpression : UnaryExpression { - var _updateExpressionBrand: Any -} - -external interface PrefixUnaryExpression : UpdateExpression { - var operator: dynamic /* SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken */ - get() = definedExternally - set(value) = definedExternally - var operand: UnaryExpression -} - -external interface PostfixUnaryExpression : UpdateExpression { - var operand: LeftHandSideExpression - var operator: dynamic /* SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken */ - get() = definedExternally - set(value) = definedExternally -} - -external interface LeftHandSideExpression : UpdateExpression { - var _leftHandSideExpressionBrand: Any -} - -external interface MemberExpression : LeftHandSideExpression { - var _memberExpressionBrand: Any -} - -external interface PrimaryExpression : MemberExpression { - var _primaryExpressionBrand: Any -} - -external interface NullLiteral : PrimaryExpression - -external interface TrueLiteral : PrimaryExpression - -external interface FalseLiteral : PrimaryExpression - -external interface ThisExpression : PrimaryExpression - -external interface SuperExpression : PrimaryExpression - -external interface ImportExpression : PrimaryExpression - -external interface DeleteExpression : UnaryExpression { - var expression: UnaryExpression -} - -external interface TypeOfExpression : UnaryExpression { - var expression: UnaryExpression -} - -external interface VoidExpression : UnaryExpression { - var expression: UnaryExpression -} - -external interface AwaitExpression : UnaryExpression { - var expression: UnaryExpression -} - -external interface YieldExpression : Expression { - var asteriskToken: AsteriskToken? - get() = definedExternally - set(value) = definedExternally - var expression: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface SyntheticExpression : Expression { - var isSpread: Boolean - var type: Type - var tupleNameSource: dynamic /* ParameterDeclaration? | NamedTupleMember? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface BinaryExpression : Expression, Declaration { - var left: Expression - var operatorToken: BinaryOperatorToken - var right: Expression -} - -external interface AssignmentExpression : BinaryExpression { - override var left: LeftHandSideExpression - override var operatorToken: TOperator -} - -external interface ObjectDestructuringAssignment : AssignmentExpression { - override var left: ObjectLiteralExpression -} - -external interface ArrayDestructuringAssignment : AssignmentExpression { - override var left: ArrayLiteralExpression -} - -external interface ConditionalExpression : Expression { - var condition: Expression - var questionToken: QuestionToken - var whenTrue: Expression - var colonToken: ColonToken - var whenFalse: Expression -} - -external interface FunctionExpression : PrimaryExpression, FunctionLikeDeclarationBase, JSDocContainer { - override var kind: Any - override var name: Identifier? - get() = definedExternally - set(value) = definedExternally - override var body: FunctionBody -} - -external interface ArrowFunction : Expression, FunctionLikeDeclarationBase, JSDocContainer { - override var kind: Any - var equalsGreaterThanToken: EqualsGreaterThanToken - override var body: dynamic /* FunctionBody | Expression */ - get() = definedExternally - set(value) = definedExternally - override var name: Any -} - -external interface LiteralLikeNode : Node { - var text: String - var isUnterminated: Boolean? - get() = definedExternally - set(value) = definedExternally - var hasExtendedUnicodeEscape: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TemplateLiteralLikeNode : LiteralLikeNode { - var rawText: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface LiteralExpression : LiteralLikeNode, PrimaryExpression { - var _literalExpressionBrand: Any -} - -external interface RegularExpressionLiteral : LiteralExpression - -external interface NoSubstitutionTemplateLiteral : LiteralExpression, TemplateLiteralLikeNode, Declaration - -external enum class TokenFlags { - None /* = 0 */, - Scientific /* = 16 */, - Octal /* = 32 */, - HexSpecifier /* = 64 */, - BinarySpecifier /* = 128 */, - OctalSpecifier /* = 256 */ -} - -external interface NumericLiteral : LiteralExpression, Declaration - -external interface BigIntLiteral : LiteralExpression - -external interface TemplateHead : TemplateLiteralLikeNode { - override var parent: dynamic /* TemplateExpression | TemplateLiteralTypeNode */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TemplateMiddle : TemplateLiteralLikeNode { - override var parent: dynamic /* TemplateSpan | TemplateLiteralTypeSpan */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TemplateTail : TemplateLiteralLikeNode { - override var parent: dynamic /* TemplateSpan | TemplateLiteralTypeSpan */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TemplateExpression : PrimaryExpression { - var head: TemplateHead - var templateSpans: NodeArray -} - -external interface TemplateSpan : Node { - override var parent: TemplateExpression - var expression: Expression - var literal: dynamic /* TemplateMiddle | TemplateTail */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ParenthesizedExpression : PrimaryExpression, JSDocContainer { - var expression: Expression -} - -external interface ArrayLiteralExpression : PrimaryExpression { - var elements: NodeArray -} - -external interface SpreadElement : Expression { - override var parent: dynamic /* ArrayLiteralExpression | CallExpression | NewExpression */ - get() = definedExternally - set(value) = definedExternally - var expression: Expression -} - -external interface ObjectLiteralExpressionBase : PrimaryExpression, Declaration { - var properties: NodeArray -} - -external interface ObjectLiteralExpression : ObjectLiteralExpressionBase - -external interface PropertyAccessExpression : MemberExpression, NamedDeclaration { - var expression: LeftHandSideExpression - var questionDotToken: QuestionDotToken? - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally -} - -external interface PropertyAccessChain : PropertyAccessExpression { - var _optionalChainBrand: Any - override var name: dynamic /* Identifier | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally -} - -external interface SuperPropertyAccessExpression : PropertyAccessExpression { - override var expression: SuperExpression -} - -external interface PropertyAccessEntityNameExpression : PropertyAccessExpression { - var _propertyAccessExpressionLikeQualifiedNameBrand: Any? - get() = definedExternally - set(value) = definedExternally - override var expression: dynamic /* Identifier | PropertyAccessEntityNameExpression */ - get() = definedExternally - set(value) = definedExternally - override var name: Identifier -} - -external interface ElementAccessExpression : MemberExpression { - var expression: LeftHandSideExpression - var questionDotToken: QuestionDotToken? - get() = definedExternally - set(value) = definedExternally - var argumentExpression: Expression -} - -external interface ElementAccessChain : ElementAccessExpression { - var _optionalChainBrand: Any -} - -external interface SuperElementAccessExpression : ElementAccessExpression { - override var expression: SuperExpression -} - -external interface CallExpression : LeftHandSideExpression, Declaration { - var expression: LeftHandSideExpression - var questionDotToken: QuestionDotToken? - get() = definedExternally - set(value) = definedExternally - var typeArguments: NodeArray? - get() = definedExternally - set(value) = definedExternally - var arguments: NodeArray -} - -external interface CallChain : CallExpression { - var _optionalChainBrand: Any -} - -external interface SuperCall : CallExpression { - override var expression: SuperExpression -} - -external interface ImportCall : CallExpression { - override var expression: ImportExpression -} - -external interface ExpressionWithTypeArguments : NodeWithTypeArguments { - override var parent: dynamic /* HeritageClause | JSDocAugmentsTag | JSDocImplementsTag */ - get() = definedExternally - set(value) = definedExternally - var expression: LeftHandSideExpression -} - -external interface NewExpression : PrimaryExpression, Declaration { - var expression: LeftHandSideExpression - var typeArguments: NodeArray? - get() = definedExternally - set(value) = definedExternally - var arguments: NodeArray? - get() = definedExternally - set(value) = definedExternally -} - -external interface TaggedTemplateExpression : MemberExpression { - var tag: LeftHandSideExpression - var typeArguments: NodeArray? - get() = definedExternally - set(value) = definedExternally - var template: dynamic /* TemplateExpression | NoSubstitutionTemplateLiteral */ - get() = definedExternally - set(value) = definedExternally -} - -external interface AsExpression : Expression { - var expression: Expression - var type: TypeNode -} - -external interface TypeAssertion : UnaryExpression { - var type: TypeNode - var expression: UnaryExpression -} - -external interface NonNullExpression : LeftHandSideExpression { - var expression: Expression -} - -external interface NonNullChain : NonNullExpression { - var _optionalChainBrand: Any -} - -external interface MetaProperty : PrimaryExpression { - var keywordToken: dynamic /* SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword */ - get() = definedExternally - set(value) = definedExternally - var name: Identifier -} - -external interface JsxElement : PrimaryExpression { - var openingElement: JsxOpeningElement - var children: NodeArray - var closingElement: JsxClosingElement -} - -external interface JsxTagNamePropertyAccess : PropertyAccessExpression { - override var expression: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JsxAttributes : ObjectLiteralExpressionBase { - override var parent: dynamic /* JsxSelfClosingElement | JsxOpeningElement */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JsxOpeningElement : Expression { - override var parent: JsxElement - var tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */ - get() = definedExternally - set(value) = definedExternally - var typeArguments: NodeArray? - get() = definedExternally - set(value) = definedExternally - var attributes: JsxAttributes -} - -external interface JsxSelfClosingElement : PrimaryExpression { - var tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */ - get() = definedExternally - set(value) = definedExternally - var typeArguments: NodeArray? - get() = definedExternally - set(value) = definedExternally - var attributes: JsxAttributes -} - -external interface JsxFragment : PrimaryExpression { - var openingFragment: JsxOpeningFragment - var children: NodeArray - var closingFragment: JsxClosingFragment -} - -external interface JsxOpeningFragment : Expression { - override var parent: JsxFragment -} - -external interface JsxClosingFragment : Expression { - override var parent: JsxFragment -} - -external interface JsxAttribute : ObjectLiteralElement { - override var parent: JsxAttributes - override var name: Identifier - var initializer: dynamic /* StringLiteral? | JsxExpression? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JsxSpreadAttribute : ObjectLiteralElement { - override var parent: JsxAttributes - var expression: Expression -} - -external interface JsxClosingElement : Node { - override var parent: JsxElement - var tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JsxExpression : Expression { - override var parent: dynamic /* JsxElement | JsxAttribute | JsxSpreadAttribute */ - get() = definedExternally - set(value) = definedExternally - var dotDotDotToken: Token? - get() = definedExternally - set(value) = definedExternally - var expression: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface JsxText : LiteralLikeNode { - override var parent: JsxElement - var containsOnlyTriviaWhiteSpaces: Boolean -} - -external interface Statement : Node, JSDocContainer { - var _statementBrand: Any -} - -external interface NotEmittedStatement : Statement - -external interface CommaListExpression : Expression { - var elements: NodeArray -} - -external interface EmptyStatement : Statement - -external interface DebuggerStatement : Statement - -external interface MissingDeclaration : DeclarationStatement { - override var name: Identifier? - get() = definedExternally - set(value) = definedExternally -} - -external interface Block : Statement { - var statements: NodeArray -} - -external interface VariableStatement : Statement { - var declarationList: VariableDeclarationList -} - -external interface ExpressionStatement : Statement { - var expression: Expression -} - -external interface IfStatement : Statement { - var expression: Expression - var thenStatement: Statement - var elseStatement: Statement? - get() = definedExternally - set(value) = definedExternally -} - -external interface IterationStatement : Statement { - var statement: Statement -} - -external interface DoStatement : IterationStatement { - var expression: Expression -} - -external interface WhileStatement : IterationStatement { - var expression: Expression -} - -external interface ForStatement : IterationStatement { - var initializer: dynamic /* VariableDeclarationList? | Expression? */ - get() = definedExternally - set(value) = definedExternally - var condition: Expression? - get() = definedExternally - set(value) = definedExternally - var incrementor: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface ForInStatement : IterationStatement { - var initializer: dynamic /* VariableDeclarationList | Expression */ - get() = definedExternally - set(value) = definedExternally - var expression: Expression -} - -external interface ForOfStatement : IterationStatement { - var awaitModifier: AwaitKeywordToken? - get() = definedExternally - set(value) = definedExternally - var initializer: dynamic /* VariableDeclarationList | Expression */ - get() = definedExternally - set(value) = definedExternally - var expression: Expression -} - -external interface BreakStatement : Statement { - var label: Identifier? - get() = definedExternally - set(value) = definedExternally -} - -external interface ContinueStatement : Statement { - var label: Identifier? - get() = definedExternally - set(value) = definedExternally -} - -external interface ReturnStatement : Statement { - var expression: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface WithStatement : Statement { - var expression: Expression - var statement: Statement -} - -external interface SwitchStatement : Statement { - var expression: Expression - var caseBlock: CaseBlock - var possiblyExhaustive: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface CaseBlock : Node { - override var parent: SwitchStatement - var clauses: NodeArray -} - -external interface CaseClause : Node { - override var parent: CaseBlock - var expression: Expression - var statements: NodeArray -} - -external interface DefaultClause : Node { - override var parent: CaseBlock - var statements: NodeArray -} - -external interface LabeledStatement : Statement { - var label: Identifier - var statement: Statement -} - -external interface ThrowStatement : Statement { - var expression: Expression -} - -external interface TryStatement : Statement { - var tryBlock: Block - var catchClause: CatchClause? - get() = definedExternally - set(value) = definedExternally - var finallyBlock: Block? - get() = definedExternally - set(value) = definedExternally -} - -external interface CatchClause : Node { - override var parent: TryStatement - var variableDeclaration: VariableDeclaration? - get() = definedExternally - set(value) = definedExternally - var block: Block -} - -external interface ClassLikeDeclarationBase : NamedDeclaration, JSDocContainer { - override var kind: dynamic /* SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression */ - get() = definedExternally - set(value) = definedExternally - override var name: Identifier? - get() = definedExternally - set(value) = definedExternally - var typeParameters: NodeArray? - get() = definedExternally - set(value) = definedExternally - var heritageClauses: NodeArray? - get() = definedExternally - set(value) = definedExternally - var members: NodeArray -} - -external interface ClassDeclaration : ClassLikeDeclarationBase, DeclarationStatement { - override var kind: Any - override var name: Identifier? - get() = definedExternally - set(value) = definedExternally -} - -external interface ClassExpression : ClassLikeDeclarationBase, PrimaryExpression { - override var kind: Any -} - -external interface ClassElement : NamedDeclaration { - var _classElementBrand: Any - override var name: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeElement : NamedDeclaration { - var _typeElementBrand: Any - override var name: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */ - get() = definedExternally - set(value) = definedExternally - var questionToken: QuestionToken? - get() = definedExternally - set(value) = definedExternally -} - -external interface InterfaceDeclaration : DeclarationStatement, JSDocContainer { - override var name: Identifier - var typeParameters: NodeArray? - get() = definedExternally - set(value) = definedExternally - var heritageClauses: NodeArray? - get() = definedExternally - set(value) = definedExternally - var members: NodeArray -} - -external interface HeritageClause : Node { - override var parent: dynamic /* InterfaceDeclaration | ClassDeclaration | ClassExpression */ - get() = definedExternally - set(value) = definedExternally - var token: dynamic /* SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword */ - get() = definedExternally - set(value) = definedExternally - var types: NodeArray -} - -external interface TypeAliasDeclaration : DeclarationStatement, JSDocContainer { - override var name: Identifier - var typeParameters: NodeArray? - get() = definedExternally - set(value) = definedExternally - var type: TypeNode -} - -external interface EnumMember : NamedDeclaration, JSDocContainer { - override var parent: EnumDeclaration - override var name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */ - get() = definedExternally - set(value) = definedExternally - var initializer: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface EnumDeclaration : DeclarationStatement, JSDocContainer { - override var name: Identifier - var members: NodeArray -} - -external interface ModuleDeclaration : DeclarationStatement, JSDocContainer { - override var parent: dynamic /* ModuleBlock | NamespaceDeclaration | Identifier | JSDocNamespaceDeclaration | SourceFile */ - get() = definedExternally - set(value) = definedExternally - override var name: dynamic /* Identifier | StringLiteral */ - get() = definedExternally - set(value) = definedExternally - var body: dynamic /* ModuleBlock? | NamespaceDeclaration? | Identifier? | JSDocNamespaceDeclaration? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface NamespaceDeclaration : ModuleDeclaration { - override var name: Identifier - override var body: dynamic /* ModuleBlock | NamespaceDeclaration */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocNamespaceDeclaration : ModuleDeclaration { - override var name: Identifier - override var body: dynamic /* Identifier? | JSDocNamespaceDeclaration? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ModuleBlock : Node, Statement { - override var parent: ModuleDeclaration - var statements: NodeArray -} - -external interface ImportEqualsDeclaration : DeclarationStatement, JSDocContainer { - override var parent: dynamic /* SourceFile | ModuleBlock */ - get() = definedExternally - set(value) = definedExternally - override var name: Identifier - var isTypeOnly: Boolean - var moduleReference: dynamic /* Identifier | QualifiedName | ExternalModuleReference */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ExternalModuleReference : Node { - override var parent: ImportEqualsDeclaration - var expression: Expression -} - -external interface ImportDeclaration : Statement { - override var parent: dynamic /* SourceFile | ModuleBlock */ - get() = definedExternally - set(value) = definedExternally - var importClause: ImportClause? - get() = definedExternally - set(value) = definedExternally - var moduleSpecifier: Expression -} - -external interface ImportClause : NamedDeclaration { - override var parent: ImportDeclaration - var isTypeOnly: Boolean - override var name: Identifier? - get() = definedExternally - set(value) = definedExternally - var namedBindings: dynamic /* NamespaceImport? | NamedImports? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface NamespaceImport : NamedDeclaration { - override var parent: ImportClause - override var name: Identifier -} - -external interface NamespaceExport : NamedDeclaration { - override var parent: ExportDeclaration - override var name: Identifier -} - -external interface NamespaceExportDeclaration : DeclarationStatement, JSDocContainer { - override var name: Identifier -} - -external interface ExportDeclaration : DeclarationStatement, JSDocContainer { - override var parent: dynamic /* SourceFile | ModuleBlock */ - get() = definedExternally - set(value) = definedExternally - var isTypeOnly: Boolean - var exportClause: dynamic /* NamespaceExport? | NamedExports? */ - get() = definedExternally - set(value) = definedExternally - var moduleSpecifier: Expression? - get() = definedExternally - set(value) = definedExternally -} - -external interface NamedImports : Node { - override var parent: ImportClause - var elements: NodeArray -} - -external interface NamedExports : Node { - override var parent: ExportDeclaration - var elements: NodeArray -} - -external interface ImportSpecifier : NamedDeclaration { - override var parent: NamedImports - var propertyName: Identifier? - get() = definedExternally - set(value) = definedExternally - override var name: Identifier -} - -external interface ExportSpecifier : NamedDeclaration { - override var parent: NamedExports - var propertyName: Identifier? - get() = definedExternally - set(value) = definedExternally - override var name: Identifier -} - -external interface ExportAssignment : DeclarationStatement, JSDocContainer { - override var parent: SourceFile - var isExportEquals: Boolean? - get() = definedExternally - set(value) = definedExternally - var expression: Expression -} - -external interface FileReference : TextRange { - var fileName: String -} - -external interface CheckJsDirective : TextRange { - var enabled: Boolean -} - -external interface CommentRange : TextRange { - var hasTrailingNewLine: Boolean? - get() = definedExternally - set(value) = definedExternally - var kind: dynamic /* SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia */ - get() = definedExternally - set(value) = definedExternally -} - -external interface SynthesizedComment : CommentRange { - var text: String - var hasLeadingNewline: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocTypeExpression : TypeNode { - var type: TypeNode -} - -external interface JSDocNameReference : Node { - var name: dynamic /* Identifier | QualifiedName | JSDocMemberName */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocMemberName : Node { - var left: dynamic /* Identifier | QualifiedName | JSDocMemberName */ - get() = definedExternally - set(value) = definedExternally - var right: Identifier -} - -external interface JSDocType : TypeNode { - var _jsDocTypeBrand: Any -} - -external interface JSDocAllType : JSDocType - -external interface JSDocUnknownType : JSDocType - -external interface JSDocNonNullableType : JSDocType { - var type: TypeNode -} - -external interface JSDocNullableType : JSDocType { - var type: TypeNode -} - -external interface JSDocOptionalType : JSDocType { - var type: TypeNode -} - -external interface JSDocFunctionType : JSDocType, SignatureDeclarationBase { - override var kind: Any -} - -external interface JSDocVariadicType : JSDocType { - var type: TypeNode -} - -external interface JSDocNamepathType : JSDocType { - var type: TypeNode -} - -external interface JSDoc : Node { - override var parent: dynamic /* ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | Token & JSDocContainer */ - get() = definedExternally - set(value) = definedExternally - var tags: NodeArray? - get() = definedExternally - set(value) = definedExternally - var comment: dynamic /* String? | NodeArray? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocTag : Node { - override var parent: dynamic /* JSDoc | JSDocTypeLiteral */ - get() = definedExternally - set(value) = definedExternally - var tagName: Identifier - var comment: dynamic /* String? | NodeArray? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocLink : Node { - var name: dynamic /* Identifier? | QualifiedName? | JSDocMemberName? */ - get() = definedExternally - set(value) = definedExternally - var text: String -} - -external interface JSDocLinkCode : Node { - var name: dynamic /* Identifier? | QualifiedName? | JSDocMemberName? */ - get() = definedExternally - set(value) = definedExternally - var text: String -} - -external interface JSDocLinkPlain : Node { - var name: dynamic /* Identifier? | QualifiedName? | JSDocMemberName? */ - get() = definedExternally - set(value) = definedExternally - var text: String -} - -external interface JSDocText : Node { - var text: String -} - -external interface JSDocUnknownTag : JSDocTag - -external interface `T$21` { - var expression: dynamic /* Identifier | PropertyAccessEntityNameExpression */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocAugmentsTag : JSDocTag { - var `class`: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */ -} - -external interface JSDocImplementsTag : JSDocTag { - var `class`: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */ -} - -external interface JSDocAuthorTag : JSDocTag - -external interface JSDocDeprecatedTag : JSDocTag - -external interface JSDocClassTag : JSDocTag - -external interface JSDocPublicTag : JSDocTag - -external interface JSDocPrivateTag : JSDocTag - -external interface JSDocProtectedTag : JSDocTag - -external interface JSDocReadonlyTag : JSDocTag - -external interface JSDocOverrideTag : JSDocTag - -external interface JSDocEnumTag : JSDocTag, Declaration { - override var parent: JSDoc - var typeExpression: JSDocTypeExpression -} - -external interface JSDocThisTag : JSDocTag { - var typeExpression: JSDocTypeExpression -} - -external interface JSDocTemplateTag : JSDocTag { - var constraint: JSDocTypeExpression? - var typeParameters: NodeArray -} - -external interface JSDocSeeTag : JSDocTag { - var name: JSDocNameReference? - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocReturnTag : JSDocTag { - var typeExpression: JSDocTypeExpression? - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocTypeTag : JSDocTag { - var typeExpression: JSDocTypeExpression -} - -external interface JSDocTypedefTag : JSDocTag, NamedDeclaration { - override var parent: JSDoc - var fullName: dynamic /* JSDocNamespaceDeclaration? | Identifier? */ - get() = definedExternally - set(value) = definedExternally - override var name: Identifier? - get() = definedExternally - set(value) = definedExternally - var typeExpression: dynamic /* JSDocTypeExpression? | JSDocTypeLiteral? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface JSDocCallbackTag : JSDocTag, NamedDeclaration { - override var parent: JSDoc - var fullName: dynamic /* JSDocNamespaceDeclaration? | Identifier? */ - get() = definedExternally - set(value) = definedExternally - override var name: Identifier? - get() = definedExternally - set(value) = definedExternally - var typeExpression: JSDocSignature -} - -external interface JSDocSignature : JSDocType, Declaration { - var typeParameters: Array? - get() = definedExternally - set(value) = definedExternally - var parameters: Array - var type: JSDocReturnTag? -} - -external interface JSDocPropertyLikeTag : JSDocTag, Declaration { - override var parent: JSDoc - var name: dynamic /* Identifier | QualifiedName */ - get() = definedExternally - set(value) = definedExternally - var typeExpression: JSDocTypeExpression? - get() = definedExternally - set(value) = definedExternally - var isNameFirst: Boolean - var isBracketed: Boolean -} - -external interface JSDocPropertyTag : JSDocPropertyLikeTag - -external interface JSDocParameterTag : JSDocPropertyLikeTag - -external interface JSDocTypeLiteral : JSDocType { - var jsDocPropertyTags: Array? - get() = definedExternally - set(value) = definedExternally - var isArrayType: Boolean -} - -external enum class FlowFlags { - Unreachable /* = 1 */, - Start /* = 2 */, - BranchLabel /* = 4 */, - LoopLabel /* = 8 */, - Assignment /* = 16 */, - TrueCondition /* = 32 */, - FalseCondition /* = 64 */, - SwitchClause /* = 128 */, - ArrayMutation /* = 256 */, - Call /* = 512 */, - ReduceLabel /* = 1024 */, - Referenced /* = 2048 */, - Shared /* = 4096 */, - Label /* = 12 */, - Condition /* = 96 */ -} - -external interface FlowNodeBase { - var flags: FlowFlags - var id: Number? - get() = definedExternally - set(value) = definedExternally -} - -external interface FlowStart : FlowNodeBase { - var node: dynamic /* FunctionExpression? | ArrowFunction? | MethodDeclaration? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FlowLabel : FlowNodeBase { - var antecedents: Array? -} - -external interface FlowAssignment : FlowNodeBase { - var node: dynamic /* Expression | VariableDeclaration | BindingElement */ - get() = definedExternally - set(value) = definedExternally - var antecedent: dynamic /* FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowReduceLabel */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FlowCall : FlowNodeBase { - var node: CallExpression - var antecedent: dynamic /* FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowReduceLabel */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FlowCondition : FlowNodeBase { - var node: Expression - var antecedent: dynamic /* FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowReduceLabel */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FlowSwitchClause : FlowNodeBase { - var switchStatement: SwitchStatement - var clauseStart: Number - var clauseEnd: Number - var antecedent: dynamic /* FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowReduceLabel */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FlowArrayMutation : FlowNodeBase { - var node: dynamic /* CallExpression | BinaryExpression */ - get() = definedExternally - set(value) = definedExternally - var antecedent: dynamic /* FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowReduceLabel */ - get() = definedExternally - set(value) = definedExternally -} - -external interface FlowReduceLabel : FlowNodeBase { - var target: FlowLabel - var antecedents: Array - var antecedent: dynamic /* FlowStart | FlowLabel | FlowAssignment | FlowCall | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowReduceLabel */ - get() = definedExternally - set(value) = definedExternally -} - -external interface IncompleteType { - var flags: TypeFlags - var type: Type -} - -external interface AmdDependency { - var path: String - var name: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface SourceFile : Declaration { - fun getLineAndCharacterOfPosition(pos: Number): LineAndCharacter - fun getLineEndOfPosition(pos: Number): Number - fun getLineStarts(): Array - fun getPositionOfLineAndCharacter(line: Number, character: Number): Number - fun update(newText: String, textChangeRange: TextChangeRange): SourceFile - var statements: NodeArray - var endOfFileToken: Token - var fileName: String - var text: String - var amdDependencies: Array - var moduleName: String? - get() = definedExternally - set(value) = definedExternally - var referencedFiles: Array - var typeReferenceDirectives: Array - var libReferenceDirectives: Array - var languageVariant: LanguageVariant - var isDeclarationFile: Boolean - var hasNoDefaultLib: Boolean - var languageVersion: ScriptTarget -} - -external interface Bundle : Node { - var prepends: Array - var sourceFiles: Array -} - -external interface InputFiles : Node { - var javascriptPath: String? - get() = definedExternally - set(value) = definedExternally - var javascriptText: String - var javascriptMapPath: String? - get() = definedExternally - set(value) = definedExternally - var javascriptMapText: String? - get() = definedExternally - set(value) = definedExternally - var declarationPath: String? - get() = definedExternally - set(value) = definedExternally - var declarationText: String - var declarationMapPath: String? - get() = definedExternally - set(value) = definedExternally - var declarationMapText: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface UnparsedSource : Node { - var fileName: String - var text: String - var prologues: Array - var helpers: Array? - var referencedFiles: Array - var typeReferenceDirectives: Array? - var libReferenceDirectives: Array - var hasNoDefaultLib: Boolean? - get() = definedExternally - set(value) = definedExternally - var sourceMapPath: String? - get() = definedExternally - set(value) = definedExternally - var sourceMapText: String? - get() = definedExternally - set(value) = definedExternally - var syntheticReferences: Array? - get() = definedExternally - set(value) = definedExternally - var texts: Array -} - -external interface UnparsedSection : Node { - override var kind: SyntaxKind - override var parent: UnparsedSource - var data: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface UnparsedPrologue : UnparsedSection { - override var parent: UnparsedSource -} - -external interface UnparsedPrepend : UnparsedSection { - override var parent: UnparsedSource - var texts: Array -} - -external interface UnparsedTextLike : UnparsedSection { - override var kind: dynamic /* SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText */ - get() = definedExternally - set(value) = definedExternally - override var parent: UnparsedSource -} - -external interface UnparsedSyntheticReference : UnparsedSection { - override var parent: UnparsedSource -} - -external interface JsonSourceFile : SourceFile { - override var statements: NodeArray -} - -external interface TsConfigSourceFile : JsonSourceFile { - var extendedSourceFiles: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface JsonMinusNumericLiteral : PrefixUnaryExpression { - override var kind: Any - override var operator: Any - override var operand: NumericLiteral -} - -external interface JsonObjectExpressionStatement : ExpressionStatement { - override var expression: dynamic /* ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | TrueLiteral | FalseLiteral | NullLiteral */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ScriptReferenceHost { - fun getCompilerOptions(): CompilerOptions - fun getSourceFile(fileName: String): SourceFile? - fun getSourceFileByPath(path: String /* String & `T$3` */): SourceFile? - fun getCurrentDirectory(): String -} - -external interface ParseConfigHost { - var useCaseSensitiveFileNames: Boolean - fun readDirectory(rootDir: String, extensions: Array, excludes: Array?, includes: Array, depth: Number = definedExternally): Array - fun fileExists(path: String): Boolean - fun readFile(path: String): String? - val trace: ((s: String) -> Unit)? -} - -external open class OperationCanceledException - -external interface CancellationToken { - fun isCancellationRequested(): Boolean - fun throwIfCancellationRequested() -} - -external interface Program : ScriptReferenceHost { - override fun getCurrentDirectory(): String - fun getRootFileNames(): Array - fun getSourceFiles(): Array - fun emit(targetSourceFile: SourceFile = definedExternally, writeFile: WriteFileCallback = definedExternally, cancellationToken: CancellationToken = definedExternally, emitOnlyDtsFiles: Boolean = definedExternally, customTransformers: CustomTransformers = definedExternally): EmitResult - fun getOptionsDiagnostics(cancellationToken: CancellationToken = definedExternally): Array - fun getGlobalDiagnostics(cancellationToken: CancellationToken = definedExternally): Array - fun getSyntacticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - fun getSemanticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - fun getDeclarationDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - fun getConfigFileParsingDiagnostics(): Array - fun getTypeChecker(): TypeChecker - fun getNodeCount(): Number - fun getIdentifierCount(): Number - fun getSymbolCount(): Number - fun getTypeCount(): Number - fun getInstantiationCount(): Number - fun getRelationCacheSizes(): `T$6` - fun isSourceFileFromExternalLibrary(file: SourceFile): Boolean - fun isSourceFileDefaultLibrary(file: SourceFile): Boolean - fun getProjectReferences(): Array? - fun getResolvedProjectReferences(): Array? -} - -external interface ResolvedProjectReference { - var commandLine: ParsedCommandLine - var sourceFile: SourceFile - var references: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface CustomTransformer { - fun transformSourceFile(node: SourceFile): SourceFile - fun transformBundle(node: Bundle): Bundle -} - -external interface CustomTransformers { - var before: Array | CustomTransformerFactory */>? - get() = definedExternally - set(value) = definedExternally - var after: Array | CustomTransformerFactory */>? - get() = definedExternally - set(value) = definedExternally - var afterDeclarations: Array | CustomTransformerFactory */>? - get() = definedExternally - set(value) = definedExternally -} - -external interface SourceMapSpan { - var emittedLine: Number - var emittedColumn: Number - var sourceLine: Number - var sourceColumn: Number - var nameIndex: Number? - get() = definedExternally - set(value) = definedExternally - var sourceIndex: Number -} - -external enum class ExitStatus { - Success /* = 0 */, - DiagnosticsPresent_OutputsSkipped /* = 1 */, - DiagnosticsPresent_OutputsGenerated /* = 2 */, - InvalidProject_OutputsSkipped /* = 3 */, - ProjectReferenceCycle_OutputsSkipped /* = 4 */, - ProjectReferenceCycle_OutputsSkupped /* = 4 */ -} - -external interface EmitResult { - var emitSkipped: Boolean - var diagnostics: Array - var emittedFiles: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface `T$22` { - var typeArguments: NodeArray? - get() = definedExternally - set(value) = definedExternally -} - -external interface TypeChecker { - fun getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type - fun getDeclaredTypeOfSymbol(symbol: Symbol): Type - fun getPropertiesOfType(type: Type): Array - fun getPropertyOfType(type: Type, propertyName: String): Symbol? - fun getPrivateIdentifierPropertyOfType(leftType: Type, name: String, location: Node): Symbol? - fun getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo? - fun getIndexInfosOfType(type: Type): Array - fun getSignaturesOfType(type: Type, kind: SignatureKind): Array - fun getIndexTypeOfType(type: Type, kind: IndexKind): Type? - fun getBaseTypes(type: InterfaceType): Array - fun getBaseTypeOfLiteralType(type: Type): Type - fun getWidenedType(type: Type): Type - fun getReturnTypeOfSignature(signature: Signature): Type - fun getNullableType(type: Type, flags: TypeFlags): Type - fun getNonNullableType(type: Type): Type - fun getTypeArguments(type: TypeReference): Array - fun typeToTypeNode(type: Type, enclosingDeclaration: Node?, flags: NodeBuilderFlags?): TypeNode? - fun signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration: Node?, flags: NodeBuilderFlags?): dynamic /* CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction */ - fun indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, enclosingDeclaration: Node?, flags: NodeBuilderFlags?): IndexSignatureDeclaration? - fun symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node?, flags: NodeBuilderFlags?): dynamic /* Identifier? | QualifiedName? */ - fun symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node?, flags: NodeBuilderFlags?): Expression? - fun symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration: Node?, flags: NodeBuilderFlags?): NodeArray? - fun symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration: Node?, flags: NodeBuilderFlags?): ParameterDeclaration? - fun typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration: Node?, flags: NodeBuilderFlags?): TypeParameterDeclaration? - fun getSymbolsInScope(location: Node, meaning: SymbolFlags): Array - fun getSymbolAtLocation(node: Node): Symbol? - fun getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: String): Array - fun getShorthandAssignmentValueSymbol(location: Node?): Symbol? - fun getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol? - fun getExportSpecifierLocalTargetSymbol(location: Identifier): Symbol? - fun getExportSymbolOfSymbol(symbol: Symbol): Symbol - fun getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol? - fun getTypeOfAssignmentPattern(pattern: ObjectLiteralExpression): Type - fun getTypeOfAssignmentPattern(pattern: ArrayLiteralExpression): Type - fun getTypeAtLocation(node: Node): Type - fun getTypeFromTypeNode(node: TypeNode): Type - fun signatureToString(signature: Signature, enclosingDeclaration: Node = definedExternally, flags: TypeFormatFlags = definedExternally, kind: SignatureKind = definedExternally): String - fun typeToString(type: Type, enclosingDeclaration: Node = definedExternally, flags: TypeFormatFlags = definedExternally): String - fun symbolToString(symbol: Symbol, enclosingDeclaration: Node = definedExternally, meaning: SymbolFlags = definedExternally, flags: SymbolFormatFlags = definedExternally): String - fun typePredicateToString(predicate: ThisTypePredicate, enclosingDeclaration: Node = definedExternally, flags: TypeFormatFlags = definedExternally): String - fun typePredicateToString(predicate: ThisTypePredicate): String - fun typePredicateToString(predicate: ThisTypePredicate, enclosingDeclaration: Node = definedExternally): String - fun typePredicateToString(predicate: IdentifierTypePredicate, enclosingDeclaration: Node = definedExternally, flags: TypeFormatFlags = definedExternally): String - fun typePredicateToString(predicate: IdentifierTypePredicate): String - fun typePredicateToString(predicate: IdentifierTypePredicate, enclosingDeclaration: Node = definedExternally): String - fun typePredicateToString(predicate: AssertsThisTypePredicate, enclosingDeclaration: Node = definedExternally, flags: TypeFormatFlags = definedExternally): String - fun typePredicateToString(predicate: AssertsThisTypePredicate): String - fun typePredicateToString(predicate: AssertsThisTypePredicate, enclosingDeclaration: Node = definedExternally): String - fun typePredicateToString(predicate: AssertsIdentifierTypePredicate, enclosingDeclaration: Node = definedExternally, flags: TypeFormatFlags = definedExternally): String - fun typePredicateToString(predicate: AssertsIdentifierTypePredicate): String - fun typePredicateToString(predicate: AssertsIdentifierTypePredicate, enclosingDeclaration: Node = definedExternally): String - fun getFullyQualifiedName(symbol: Symbol): String - fun getAugmentedPropertiesOfType(type: Type): Array - fun getRootSymbols(symbol: Symbol): Array - fun getSymbolOfExpando(node: Node, allowDeclaration: Boolean): Symbol? - fun getContextualType(node: Expression): Type? - fun getResolvedSignature(node: CallExpression, candidatesOutArray: Array = definedExternally, argumentCount: Number = definedExternally): Signature? - fun getResolvedSignature(node: CallExpression): Signature? - fun getResolvedSignature(node: CallExpression, candidatesOutArray: Array = definedExternally): Signature? - fun getResolvedSignature(node: NewExpression, candidatesOutArray: Array = definedExternally, argumentCount: Number = definedExternally): Signature? - fun getResolvedSignature(node: NewExpression): Signature? - fun getResolvedSignature(node: NewExpression, candidatesOutArray: Array = definedExternally): Signature? - fun getResolvedSignature(node: TaggedTemplateExpression, candidatesOutArray: Array = definedExternally, argumentCount: Number = definedExternally): Signature? - fun getResolvedSignature(node: TaggedTemplateExpression): Signature? - fun getResolvedSignature(node: TaggedTemplateExpression, candidatesOutArray: Array = definedExternally): Signature? - fun getResolvedSignature(node: Decorator, candidatesOutArray: Array = definedExternally, argumentCount: Number = definedExternally): Signature? - fun getResolvedSignature(node: Decorator): Signature? - fun getResolvedSignature(node: Decorator, candidatesOutArray: Array = definedExternally): Signature? - fun getResolvedSignature(node: JsxSelfClosingElement, candidatesOutArray: Array = definedExternally, argumentCount: Number = definedExternally): Signature? - fun getResolvedSignature(node: JsxSelfClosingElement): Signature? - fun getResolvedSignature(node: JsxSelfClosingElement, candidatesOutArray: Array = definedExternally): Signature? - fun getResolvedSignature(node: JsxOpeningElement, candidatesOutArray: Array = definedExternally, argumentCount: Number = definedExternally): Signature? - fun getResolvedSignature(node: JsxOpeningElement): Signature? - fun getResolvedSignature(node: JsxOpeningElement, candidatesOutArray: Array = definedExternally): Signature? - fun getSignatureFromDeclaration(declaration: CallSignatureDeclaration): Signature? - fun getSignatureFromDeclaration(declaration: ConstructSignatureDeclaration): Signature? - fun getSignatureFromDeclaration(declaration: MethodSignature): Signature? - fun getSignatureFromDeclaration(declaration: IndexSignatureDeclaration): Signature? - fun getSignatureFromDeclaration(declaration: FunctionTypeNode): Signature? - fun getSignatureFromDeclaration(declaration: ConstructorTypeNode): Signature? - fun getSignatureFromDeclaration(declaration: JSDocFunctionType): Signature? - fun getSignatureFromDeclaration(declaration: FunctionDeclaration): Signature? - fun getSignatureFromDeclaration(declaration: MethodDeclaration): Signature? - fun getSignatureFromDeclaration(declaration: ConstructorDeclaration): Signature? - fun getSignatureFromDeclaration(declaration: GetAccessorDeclaration): Signature? - fun getSignatureFromDeclaration(declaration: SetAccessorDeclaration): Signature? - fun getSignatureFromDeclaration(declaration: FunctionExpression): Signature? - fun getSignatureFromDeclaration(declaration: ArrowFunction): Signature? - fun isImplementationOfOverload(node: CallSignatureDeclaration): Boolean? - fun isImplementationOfOverload(node: ConstructSignatureDeclaration): Boolean? - fun isImplementationOfOverload(node: MethodSignature): Boolean? - fun isImplementationOfOverload(node: IndexSignatureDeclaration): Boolean? - fun isImplementationOfOverload(node: FunctionTypeNode): Boolean? - fun isImplementationOfOverload(node: ConstructorTypeNode): Boolean? - fun isImplementationOfOverload(node: JSDocFunctionType): Boolean? - fun isImplementationOfOverload(node: FunctionDeclaration): Boolean? - fun isImplementationOfOverload(node: MethodDeclaration): Boolean? - fun isImplementationOfOverload(node: ConstructorDeclaration): Boolean? - fun isImplementationOfOverload(node: GetAccessorDeclaration): Boolean? - fun isImplementationOfOverload(node: SetAccessorDeclaration): Boolean? - fun isImplementationOfOverload(node: FunctionExpression): Boolean? - fun isImplementationOfOverload(node: ArrowFunction): Boolean? - fun isUndefinedSymbol(symbol: Symbol): Boolean - fun isArgumentsSymbol(symbol: Symbol): Boolean - fun isUnknownSymbol(symbol: Symbol): Boolean - fun getConstantValue(node: EnumMember): dynamic /* String? | Number? */ - fun getConstantValue(node: PropertyAccessExpression): dynamic /* String? | Number? */ - fun getConstantValue(node: ElementAccessExpression): dynamic /* String? | Number? */ - fun isValidPropertyAccess(node: PropertyAccessExpression, propertyName: String): Boolean - fun isValidPropertyAccess(node: QualifiedName, propertyName: String): Boolean - fun isValidPropertyAccess(node: ImportTypeNode, propertyName: String): Boolean - fun getAliasedSymbol(symbol: Symbol): Symbol - fun getImmediateAliasedSymbol(symbol: Symbol): Symbol? - fun getExportsOfModule(moduleSymbol: Symbol): Array - fun getJsxIntrinsicTagNamesAt(location: Node): Array - fun isOptionalParameter(node: ParameterDeclaration): Boolean - fun getAmbientModules(): Array - fun tryGetMemberInModuleExports(memberName: String, moduleSymbol: Symbol): Symbol? - fun getApparentType(type: Type): Type - fun getBaseConstraintOfType(type: Type): Type? - fun getDefaultFromTypeParameter(type: Type): Type? - fun runWithCancellationToken(token: CancellationToken, cb: (checker: TypeChecker) -> T): T -} - -external enum class NodeBuilderFlags { - None /* = 0 */, - NoTruncation /* = 1 */, - WriteArrayAsGenericType /* = 2 */, - GenerateNamesForShadowedTypeParams /* = 4 */, - UseStructuralFallback /* = 8 */, - ForbidIndexedAccessSymbolReferences /* = 16 */, - WriteTypeArgumentsOfSignature /* = 32 */, - UseFullyQualifiedType /* = 64 */, - UseOnlyExternalAliasing /* = 128 */, - SuppressAnyReturnType /* = 256 */, - WriteTypeParametersInQualifiedName /* = 512 */, - MultilineObjectLiterals /* = 1024 */, - WriteClassExpressionAsTypeLiteral /* = 2048 */, - UseTypeOfFunction /* = 4096 */, - OmitParameterModifiers /* = 8192 */, - UseAliasDefinedOutsideCurrentScope /* = 16384 */, - UseSingleQuotesForStringLiteralType /* = 268435456 */, - NoTypeReduction /* = 536870912 */, - NoUndefinedOptionalParameterType /* = 1073741824 */, - AllowThisInObjectLiteral /* = 32768 */, - AllowQualifiedNameInPlaceOfIdentifier /* = 65536 */, - AllowQualifedNameInPlaceOfIdentifier /* = 65536 */, - AllowAnonymousIdentifier /* = 131072 */, - AllowEmptyUnionOrIntersection /* = 262144 */, - AllowEmptyTuple /* = 524288 */, - AllowUniqueESSymbolType /* = 1048576 */, - AllowEmptyIndexInfoType /* = 2097152 */, - AllowNodeModulesRelativePaths /* = 67108864 */, - IgnoreErrors /* = 70221824 */, - InObjectTypeLiteral /* = 4194304 */, - InTypeAlias /* = 8388608 */, - InInitialEntityName /* = 16777216 */ -} - -external enum class TypeFormatFlags { - None /* = 0 */, - NoTruncation /* = 1 */, - WriteArrayAsGenericType /* = 2 */, - UseStructuralFallback /* = 8 */, - WriteTypeArgumentsOfSignature /* = 32 */, - UseFullyQualifiedType /* = 64 */, - SuppressAnyReturnType /* = 256 */, - MultilineObjectLiterals /* = 1024 */, - WriteClassExpressionAsTypeLiteral /* = 2048 */, - UseTypeOfFunction /* = 4096 */, - OmitParameterModifiers /* = 8192 */, - UseAliasDefinedOutsideCurrentScope /* = 16384 */, - UseSingleQuotesForStringLiteralType /* = 268435456 */, - NoTypeReduction /* = 536870912 */, - AllowUniqueESSymbolType /* = 1048576 */, - AddUndefined /* = 131072 */, - WriteArrowStyleSignature /* = 262144 */, - InArrayType /* = 524288 */, - InElementType /* = 2097152 */, - InFirstTypeArgument /* = 4194304 */, - InTypeAlias /* = 8388608 */, - WriteOwnNameForAnyLike /* = 0 */, - NodeBuilderFlagsMask /* = 814775659 */ -} - -external enum class SymbolFormatFlags { - None /* = 0 */, - WriteTypeParametersOrArguments /* = 1 */, - UseOnlyExternalAliasing /* = 2 */, - AllowAnyNodeKind /* = 4 */, - UseAliasDefinedOutsideCurrentScope /* = 8 */ -} - -external enum class TypePredicateKind { - This /* = 0 */, - Identifier /* = 1 */, - AssertsThis /* = 2 */, - AssertsIdentifier /* = 3 */ -} - -external interface TypePredicateBase { - var kind: TypePredicateKind - var type: Type? -} - -external interface ThisTypePredicate : TypePredicateBase { - var parameterName: Any? - var parameterIndex: Any? -} - -external interface IdentifierTypePredicate : TypePredicateBase { - var parameterName: String - var parameterIndex: Number -} - -external interface AssertsThisTypePredicate : TypePredicateBase { - var parameterName: Any? - var parameterIndex: Any? - override var type: Type? -} - -external interface AssertsIdentifierTypePredicate : TypePredicateBase { - var parameterName: String - var parameterIndex: Number - override var type: Type? -} - -external enum class SymbolFlags { - None /* = 0 */, - FunctionScopedVariable /* = 1 */, - BlockScopedVariable /* = 2 */, - Property /* = 4 */, - EnumMember /* = 8 */, - Function /* = 16 */, - Class /* = 32 */, - Interface /* = 64 */, - ConstEnum /* = 128 */, - RegularEnum /* = 256 */, - ValueModule /* = 512 */, - NamespaceModule /* = 1024 */, - TypeLiteral /* = 2048 */, - ObjectLiteral /* = 4096 */, - Method /* = 8192 */, - Constructor /* = 16384 */, - GetAccessor /* = 32768 */, - SetAccessor /* = 65536 */, - Signature /* = 131072 */, - TypeParameter /* = 262144 */, - TypeAlias /* = 524288 */, - ExportValue /* = 1048576 */, - Alias /* = 2097152 */, - Prototype /* = 4194304 */, - ExportStar /* = 8388608 */, - Optional /* = 16777216 */, - Transient /* = 33554432 */, - Assignment /* = 67108864 */, - ModuleExports /* = 134217728 */, - Enum /* = 384 */, - Variable /* = 3 */, - Value /* = 111551 */, - Type /* = 788968 */, - Namespace /* = 1920 */, - Module /* = 1536 */, - Accessor /* = 98304 */, - FunctionScopedVariableExcludes /* = 111550 */, - BlockScopedVariableExcludes /* = 111551 */, - ParameterExcludes /* = 111551 */, - PropertyExcludes /* = 0 */, - EnumMemberExcludes /* = 900095 */, - FunctionExcludes /* = 110991 */, - ClassExcludes /* = 899503 */, - InterfaceExcludes /* = 788872 */, - RegularEnumExcludes /* = 899327 */, - ConstEnumExcludes /* = 899967 */, - ValueModuleExcludes /* = 110735 */, - NamespaceModuleExcludes /* = 0 */, - MethodExcludes /* = 103359 */, - GetAccessorExcludes /* = 46015 */, - SetAccessorExcludes /* = 78783 */, - TypeParameterExcludes /* = 526824 */, - TypeAliasExcludes /* = 788968 */, - AliasExcludes /* = 2097152 */, - ModuleMember /* = 2623475 */, - ExportHasLocal /* = 944 */, - BlockScoped /* = 418 */, - PropertyOrAccessor /* = 98308 */, - ClassMember /* = 106500 */ -} - -external interface Symbol { - var name: String - fun getFlags(): SymbolFlags - fun getEscapedName(): dynamic /* String & `T$8` | Unit & `T$8` | InternalSymbolName */ - fun getName(): String - fun getDeclarations(): Array? - fun getDocumentationComment(typeChecker: TypeChecker?): Array - fun getJsDocTags(checker: TypeChecker = definedExternally): Array - var flags: SymbolFlags - var escapedName: dynamic /* String & `T$8` | Unit & `T$8` | InternalSymbolName */ - get() = definedExternally - set(value) = definedExternally - var declarations: Array? - get() = definedExternally - set(value) = definedExternally - var valueDeclaration: Declaration? - get() = definedExternally - set(value) = definedExternally - var members: SymbolTable? - get() = definedExternally - set(value) = definedExternally - var exports: SymbolTable? - get() = definedExternally - set(value) = definedExternally - var globalExports: SymbolTable? - get() = definedExternally - set(value) = definedExternally -} - -external enum class InternalSymbolName { - Call /* = "__call" */, - Constructor /* = "__constructor" */, - New /* = "__new" */, - Index /* = "__index" */, - ExportStar /* = "__export" */, - Global /* = "__global" */, - Missing /* = "__missing" */, - Type /* = "__type" */, - Object /* = "__object" */, - JSXAttributes /* = "__jsxAttributes" */, - Class /* = "__class" */, - Function /* = "__function" */, - Computed /* = "__computed" */, - Resolving /* = "__resolving__" */, - ExportEquals /* = "export=" */, - Default /* = "default" */, - This /* = "this" */ -} - -external interface ReadonlyUnderscoreEscapedMap : ReadonlyESMap - -external interface UnderscoreEscapedMap : ESMap, ReadonlyUnderscoreEscapedMap - -external enum class TypeFlags { - Any /* = 1 */, - Unknown /* = 2 */, - String /* = 4 */, - Number /* = 8 */, - Boolean /* = 16 */, - Enum /* = 32 */, - BigInt /* = 64 */, - StringLiteral /* = 128 */, - NumberLiteral /* = 256 */, - BooleanLiteral /* = 512 */, - EnumLiteral /* = 1024 */, - BigIntLiteral /* = 2048 */, - ESSymbol /* = 4096 */, - UniqueESSymbol /* = 8192 */, - Void /* = 16384 */, - Undefined /* = 32768 */, - Null /* = 65536 */, - Never /* = 131072 */, - TypeParameter /* = 262144 */, - Object /* = 524288 */, - Union /* = 1048576 */, - Intersection /* = 2097152 */, - Index /* = 4194304 */, - IndexedAccess /* = 8388608 */, - Conditional /* = 16777216 */, - Substitution /* = 33554432 */, - NonPrimitive /* = 67108864 */, - TemplateLiteral /* = 134217728 */, - StringMapping /* = 268435456 */, - Literal /* = 2944 */, - Unit /* = 109440 */, - StringOrNumberLiteral /* = 384 */, - PossiblyFalsy /* = 117724 */, - StringLike /* = 402653316 */, - NumberLike /* = 296 */, - BigIntLike /* = 2112 */, - BooleanLike /* = 528 */, - EnumLike /* = 1056 */, - ESSymbolLike /* = 12288 */, - VoidLike /* = 49152 */, - UnionOrIntersection /* = 3145728 */, - StructuredType /* = 3670016 */, - TypeVariable /* = 8650752 */, - InstantiableNonPrimitive /* = 58982400 */, - InstantiablePrimitive /* = 406847488 */, - Instantiable /* = 465829888 */, - StructuredOrInstantiable /* = 469499904 */, - Narrowable /* = 536624127 */ -} - -external interface Type { - fun getFlags(): TypeFlags - fun getSymbol(): Symbol? - fun getProperties(): Array - fun getProperty(propertyName: String): Symbol? - fun getApparentProperties(): Array - fun getCallSignatures(): Array - fun getConstructSignatures(): Array - fun getStringIndexType(): Type? - fun getNumberIndexType(): Type? - fun getBaseTypes(): Array? - fun getNonNullableType(): Type - fun getConstraint(): Type? - fun getDefault(): Type? - fun isUnion(): Boolean - fun isIntersection(): Boolean - fun isUnionOrIntersection(): Boolean - fun isLiteral(): Boolean - fun isStringLiteral(): Boolean - fun isNumberLiteral(): Boolean - fun isTypeParameter(): Boolean - fun isClassOrInterface(): Boolean - fun isClass(): Boolean - var flags: TypeFlags - var symbol: Symbol - var pattern: dynamic /* ObjectBindingPattern? | ArrayBindingPattern? | ObjectLiteralExpression? | ArrayLiteralExpression? */ - get() = definedExternally - set(value) = definedExternally - var aliasSymbol: Symbol? - get() = definedExternally - set(value) = definedExternally - var aliasTypeArguments: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface LiteralType : Type { - var value: dynamic /* String | Number | PseudoBigInt */ - get() = definedExternally - set(value) = definedExternally - var freshType: LiteralType - var regularType: LiteralType -} - -external interface UniqueESSymbolType : Type { - override var symbol: Symbol - var escapedName: dynamic /* String & `T$8` | Unit & `T$8` | InternalSymbolName */ - get() = definedExternally - set(value) = definedExternally -} - -external interface StringLiteralType : LiteralType { - override var value: String -} - -external interface NumberLiteralType : LiteralType { - override var value: Number -} - -external interface BigIntLiteralType : LiteralType { - override var value: PseudoBigInt -} - -external interface EnumType : Type - -external enum class ObjectFlags { - Class /* = 1 */, - Interface /* = 2 */, - Reference /* = 4 */, - Tuple /* = 8 */, - Anonymous /* = 16 */, - Mapped /* = 32 */, - Instantiated /* = 64 */, - ObjectLiteral /* = 128 */, - EvolvingArray /* = 256 */, - ObjectLiteralPatternWithComputedProperties /* = 512 */, - ReverseMapped /* = 1024 */, - JsxAttributes /* = 2048 */, - MarkerType /* = 4096 */, - JSLiteral /* = 8192 */, - FreshLiteral /* = 16384 */, - ArrayLiteral /* = 32768 */, - ClassOrInterface /* = 3 */, - ContainsSpread /* = 4194304 */, - ObjectRestType /* = 8388608 */ -} - -external interface ObjectType : Type { - var objectFlags: ObjectFlags -} - -external interface InterfaceType : ObjectType { - var typeParameters: Array? - var outerTypeParameters: Array? - var localTypeParameters: Array? - var thisType: TypeParameter? -} - -external interface InterfaceTypeWithDeclaredMembers : InterfaceType { - var declaredProperties: Array - var declaredCallSignatures: Array - var declaredConstructSignatures: Array - var declaredIndexInfos: Array -} - -external interface TypeReference : ObjectType { - var typeArguments: Array? - get() = definedExternally - set(value) = definedExternally - var target: GenericType - var node: dynamic /* TypeReferenceNode? | ArrayTypeNode? | TupleTypeNode? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface DeferredTypeReference : TypeReference - -external interface GenericType : InterfaceType, TypeReference - -external enum class ElementFlags { - Required /* = 1 */, - Optional /* = 2 */, - Rest /* = 4 */, - Variadic /* = 8 */, - Fixed /* = 3 */, - Variable /* = 12 */, - NonRequired /* = 14 */, - NonRest /* = 11 */ -} - -external interface TupleType : GenericType { - var elementFlags: Array - var minLength: Number - var fixedLength: Number - var hasRestElement: Boolean - var combinedFlags: ElementFlags - var readonly: Boolean - var labeledElementDeclarations: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface TupleTypeReference : TypeReference { - override var target: TupleType -} - -external interface UnionOrIntersectionType : Type { - var types: Array -} - -external interface UnionType : UnionOrIntersectionType - -external interface IntersectionType : UnionOrIntersectionType - -external interface EvolvingArrayType : ObjectType { - var elementType: Type - var finalArrayType: Type? - get() = definedExternally - set(value) = definedExternally -} - -external interface InstantiableType : Type - -external interface TypeParameter : InstantiableType - -external interface IndexedAccessType : InstantiableType { - var objectType: Type - var indexType: Type - var constraint: Type? - get() = definedExternally - set(value) = definedExternally - var simplifiedForReading: Type? - get() = definedExternally - set(value) = definedExternally - var simplifiedForWriting: Type? - get() = definedExternally - set(value) = definedExternally -} - -external interface IndexType : InstantiableType { - var type: dynamic /* InstantiableType | UnionOrIntersectionType */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ConditionalRoot { - var node: ConditionalTypeNode - var checkType: Type - var extendsType: Type - var isDistributive: Boolean - var inferTypeParameters: Array? - get() = definedExternally - set(value) = definedExternally - var outerTypeParameters: Array? - get() = definedExternally - set(value) = definedExternally - var instantiations: Map? - get() = definedExternally - set(value) = definedExternally - var aliasSymbol: Symbol? - get() = definedExternally - set(value) = definedExternally - var aliasTypeArguments: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface ConditionalType : InstantiableType { - var root: ConditionalRoot - var checkType: Type - var extendsType: Type - var resolvedTrueType: Type - var resolvedFalseType: Type -} - -external interface TemplateLiteralType : InstantiableType { - var texts: Array - var types: Array -} - -external interface StringMappingType : InstantiableType { - override var symbol: Symbol - var type: Type -} - -external interface SubstitutionType : InstantiableType { - var objectFlags: ObjectFlags - var baseType: Type - var substitute: Type -} - -external enum class SignatureKind { - Call /* = 0 */, - Construct /* = 1 */ -} - -external interface Signature { - fun getDeclaration(): dynamic /* CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction */ - fun getTypeParameters(): Array? - fun getParameters(): Array - fun getReturnType(): Type - fun getDocumentationComment(typeChecker: TypeChecker?): Array - fun getJsDocTags(): Array - var declaration: dynamic /* CallSignatureDeclaration? | ConstructSignatureDeclaration? | MethodSignature? | IndexSignatureDeclaration? | FunctionTypeNode? | ConstructorTypeNode? | JSDocFunctionType? | FunctionDeclaration? | MethodDeclaration? | ConstructorDeclaration? | GetAccessorDeclaration? | SetAccessorDeclaration? | FunctionExpression? | ArrowFunction? | JSDocSignature? */ - get() = definedExternally - set(value) = definedExternally - var typeParameters: Array? - get() = definedExternally - set(value) = definedExternally - var parameters: Array -} - -external enum class IndexKind { - String /* = 0 */, - Number /* = 1 */ -} - -external interface IndexInfo { - var keyType: Type - var type: Type - var isReadonly: Boolean - var declaration: IndexSignatureDeclaration? - get() = definedExternally - set(value) = definedExternally -} - -external enum class InferencePriority { - NakedTypeVariable /* = 1 */, - SpeculativeTuple /* = 2 */, - SubstituteSource /* = 4 */, - HomomorphicMappedType /* = 8 */, - PartialHomomorphicMappedType /* = 16 */, - MappedTypeConstraint /* = 32 */, - ContravariantConditional /* = 64 */, - ReturnType /* = 128 */, - LiteralKeyof /* = 256 */, - NoConstraints /* = 512 */, - AlwaysStrict /* = 1024 */, - MaxValue /* = 2048 */, - PriorityImpliesCombination /* = 416 */, - Circularity /* = -1 */ -} - -external interface FileExtensionInfo { - var extension: String - var isMixedContent: Boolean - var scriptKind: ScriptKind? - get() = definedExternally - set(value) = definedExternally -} - -external interface DiagnosticMessage { - var key: String - var category: DiagnosticCategory - var code: Number - var message: String - var reportsUnnecessary: Any? - get() = definedExternally - set(value) = definedExternally - var reportsDeprecated: Any? - get() = definedExternally - set(value) = definedExternally -} - -external interface DiagnosticMessageChain { - var messageText: String - var category: DiagnosticCategory - var code: Number - var next: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface Diagnostic : DiagnosticRelatedInformation { - 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 -} - -external interface DiagnosticRelatedInformation { - var category: DiagnosticCategory - var code: Number - var file: SourceFile? - var start: Number? - var length: Number? - var messageText: dynamic /* String | DiagnosticMessageChain */ - get() = definedExternally - set(value) = definedExternally -} - -external interface DiagnosticWithLocation : Diagnostic - -external enum class DiagnosticCategory { - Warning /* = 0 */, - Error /* = 1 */, - Suggestion /* = 2 */, - Message /* = 3 */ -} - -external enum class ModuleResolutionKind { - Classic /* = 1 */, - NodeJs /* = 2 */ -} - -external interface PluginImport { - var name: String -} - -external interface ProjectReference { - var path: String - var originalPath: String? - get() = definedExternally - set(value) = definedExternally - var prepend: Boolean? - get() = definedExternally - set(value) = definedExternally - var circular: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external enum class WatchFileKind { - FixedPollingInterval /* = 0 */, - PriorityPollingInterval /* = 1 */, - DynamicPriorityPolling /* = 2 */, - FixedChunkSizePolling /* = 3 */, - UseFsEvents /* = 4 */, - UseFsEventsOnParentDirectory /* = 5 */ -} - -external enum class WatchDirectoryKind { - UseFsEvents /* = 0 */, - FixedPollingInterval /* = 1 */, - DynamicPriorityPolling /* = 2 */, - FixedChunkSizePolling /* = 3 */ -} - -external enum class PollingWatchKind { - FixedInterval /* = 0 */, - PriorityInterval /* = 1 */, - DynamicPriority /* = 2 */, - FixedChunkSize /* = 3 */ -} - -external interface CompilerOptions { - var allowJs: Boolean? - get() = definedExternally - set(value) = definedExternally - var allowSyntheticDefaultImports: Boolean? - get() = definedExternally - set(value) = definedExternally - var allowUmdGlobalAccess: Boolean? - get() = definedExternally - set(value) = definedExternally - var allowUnreachableCode: Boolean? - get() = definedExternally - set(value) = definedExternally - var allowUnusedLabels: Boolean? - get() = definedExternally - set(value) = definedExternally - var alwaysStrict: Boolean? - get() = definedExternally - set(value) = definedExternally - var baseUrl: String? - get() = definedExternally - set(value) = definedExternally - var charset: String? - get() = definedExternally - set(value) = definedExternally - var checkJs: Boolean? - get() = definedExternally - set(value) = definedExternally - var declaration: Boolean? - get() = definedExternally - set(value) = definedExternally - var declarationMap: Boolean? - get() = definedExternally - set(value) = definedExternally - var emitDeclarationOnly: Boolean? - get() = definedExternally - set(value) = definedExternally - var declarationDir: String? - get() = definedExternally - set(value) = definedExternally - var disableSizeLimit: Boolean? - get() = definedExternally - set(value) = definedExternally - var disableSourceOfProjectReferenceRedirect: Boolean? - get() = definedExternally - set(value) = definedExternally - var disableSolutionSearching: Boolean? - get() = definedExternally - set(value) = definedExternally - var disableReferencedProjectLoad: Boolean? - get() = definedExternally - set(value) = definedExternally - var downlevelIteration: Boolean? - get() = definedExternally - set(value) = definedExternally - var emitBOM: Boolean? - get() = definedExternally - set(value) = definedExternally - var emitDecoratorMetadata: Boolean? - get() = definedExternally - set(value) = definedExternally - var exactOptionalPropertyTypes: Boolean? - get() = definedExternally - set(value) = definedExternally - var experimentalDecorators: Boolean? - get() = definedExternally - set(value) = definedExternally - var forceConsistentCasingInFileNames: Boolean? - get() = definedExternally - set(value) = definedExternally - var importHelpers: Boolean? - get() = definedExternally - set(value) = definedExternally - var importsNotUsedAsValues: ImportsNotUsedAsValues? - get() = definedExternally - set(value) = definedExternally - var inlineSourceMap: Boolean? - get() = definedExternally - set(value) = definedExternally - var inlineSources: Boolean? - get() = definedExternally - set(value) = definedExternally - var isolatedModules: Boolean? - get() = definedExternally - set(value) = definedExternally - var jsx: JsxEmit? - get() = definedExternally - set(value) = definedExternally - var keyofStringsOnly: Boolean? - get() = definedExternally - set(value) = definedExternally - var lib: Array? - get() = definedExternally - set(value) = definedExternally - var locale: String? - get() = definedExternally - set(value) = definedExternally - var mapRoot: String? - get() = definedExternally - set(value) = definedExternally - var maxNodeModuleJsDepth: Number? - get() = definedExternally - set(value) = definedExternally - var module: ModuleKind? - get() = definedExternally - set(value) = definedExternally - var moduleResolution: ModuleResolutionKind? - get() = definedExternally - set(value) = definedExternally - var newLine: NewLineKind? - get() = definedExternally - set(value) = definedExternally - var noEmit: Boolean? - get() = definedExternally - set(value) = definedExternally - var noEmitHelpers: Boolean? - get() = definedExternally - set(value) = definedExternally - var noEmitOnError: Boolean? - get() = definedExternally - set(value) = definedExternally - var noErrorTruncation: Boolean? - get() = definedExternally - set(value) = definedExternally - var noFallthroughCasesInSwitch: Boolean? - get() = definedExternally - set(value) = definedExternally - var noImplicitAny: Boolean? - get() = definedExternally - set(value) = definedExternally - var noImplicitReturns: Boolean? - get() = definedExternally - set(value) = definedExternally - var noImplicitThis: Boolean? - get() = definedExternally - set(value) = definedExternally - var noStrictGenericChecks: Boolean? - get() = definedExternally - set(value) = definedExternally - var noUnusedLocals: Boolean? - get() = definedExternally - set(value) = definedExternally - var noUnusedParameters: Boolean? - get() = definedExternally - set(value) = definedExternally - var noImplicitUseStrict: Boolean? - get() = definedExternally - set(value) = definedExternally - var noPropertyAccessFromIndexSignature: Boolean? - get() = definedExternally - set(value) = definedExternally - var assumeChangesOnlyAffectDirectDependencies: Boolean? - get() = definedExternally - set(value) = definedExternally - var noLib: Boolean? - get() = definedExternally - set(value) = definedExternally - var noResolve: Boolean? - get() = definedExternally - set(value) = definedExternally - var noUncheckedIndexedAccess: Boolean? - get() = definedExternally - set(value) = definedExternally - var out: String? - get() = definedExternally - set(value) = definedExternally - var outDir: String? - get() = definedExternally - set(value) = definedExternally - var outFile: String? - get() = definedExternally - set(value) = definedExternally - var paths: MapLike>? - get() = definedExternally - set(value) = definedExternally - var preserveConstEnums: Boolean? - get() = definedExternally - set(value) = definedExternally - var noImplicitOverride: Boolean? - get() = definedExternally - set(value) = definedExternally - var preserveSymlinks: Boolean? - get() = definedExternally - set(value) = definedExternally - var project: String? - get() = definedExternally - set(value) = definedExternally - var reactNamespace: String? - get() = definedExternally - set(value) = definedExternally - var jsxFactory: String? - get() = definedExternally - set(value) = definedExternally - var jsxFragmentFactory: String? - get() = definedExternally - set(value) = definedExternally - var jsxImportSource: String? - get() = definedExternally - set(value) = definedExternally - var composite: Boolean? - get() = definedExternally - set(value) = definedExternally - var incremental: Boolean? - get() = definedExternally - set(value) = definedExternally - var tsBuildInfoFile: String? - get() = definedExternally - set(value) = definedExternally - var removeComments: Boolean? - get() = definedExternally - set(value) = definedExternally - var rootDir: String? - get() = definedExternally - set(value) = definedExternally - var rootDirs: Array? - get() = definedExternally - set(value) = definedExternally - var skipLibCheck: Boolean? - get() = definedExternally - set(value) = definedExternally - var skipDefaultLibCheck: Boolean? - get() = definedExternally - set(value) = definedExternally - var sourceMap: Boolean? - get() = definedExternally - set(value) = definedExternally - var sourceRoot: String? - get() = definedExternally - set(value) = definedExternally - var strict: Boolean? - get() = definedExternally - set(value) = definedExternally - var strictFunctionTypes: Boolean? - get() = definedExternally - set(value) = definedExternally - var strictBindCallApply: Boolean? - get() = definedExternally - set(value) = definedExternally - var strictNullChecks: Boolean? - get() = definedExternally - set(value) = definedExternally - var strictPropertyInitialization: Boolean? - get() = definedExternally - set(value) = definedExternally - var stripInternal: Boolean? - get() = definedExternally - set(value) = definedExternally - var suppressExcessPropertyErrors: Boolean? - get() = definedExternally - set(value) = definedExternally - var suppressImplicitAnyIndexErrors: Boolean? - get() = definedExternally - set(value) = definedExternally - var target: ScriptTarget? - get() = definedExternally - set(value) = definedExternally - var traceResolution: Boolean? - get() = definedExternally - set(value) = definedExternally - var useUnknownInCatchVariables: Boolean? - get() = definedExternally - set(value) = definedExternally - var resolveJsonModule: Boolean? - get() = definedExternally - set(value) = definedExternally - var types: Array? - get() = definedExternally - set(value) = definedExternally - var typeRoots: Array? - get() = definedExternally - set(value) = definedExternally - var esModuleInterop: Boolean? - get() = definedExternally - set(value) = definedExternally - var useDefineForClassFields: Boolean? - get() = definedExternally - set(value) = definedExternally - @nativeGetter - operator fun get(option: String): dynamic /* String? | Number? | Boolean? | Array? | Array? | MapLike>? | Array? | Array? | TsConfigSourceFile? */ - @nativeSetter - operator fun set(option: String, value: String?) - @nativeSetter - operator fun set(option: String, value: Number?) - @nativeSetter - operator fun set(option: String, value: Boolean?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: MapLike>?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: TsConfigSourceFile?) -} - -external interface WatchOptions { - var watchFile: WatchFileKind? - get() = definedExternally - set(value) = definedExternally - var watchDirectory: WatchDirectoryKind? - get() = definedExternally - set(value) = definedExternally - var fallbackPolling: PollingWatchKind? - get() = definedExternally - set(value) = definedExternally - var synchronousWatchDirectory: Boolean? - get() = definedExternally - set(value) = definedExternally - var excludeDirectories: Array? - get() = definedExternally - set(value) = definedExternally - var excludeFiles: Array? - get() = definedExternally - set(value) = definedExternally - @nativeGetter - operator fun get(option: String): dynamic /* String? | Number? | Boolean? | Array? | Array? | MapLike>? | Array? | Array? */ - @nativeSetter - operator fun set(option: String, value: String?) - @nativeSetter - operator fun set(option: String, value: Number?) - @nativeSetter - operator fun set(option: String, value: Boolean?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: MapLike>?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: Array?) -} - -external interface TypeAcquisition { - var enableAutoDiscovery: Boolean? - get() = definedExternally - set(value) = definedExternally - var enable: Boolean? - get() = definedExternally - set(value) = definedExternally - var include: Array? - get() = definedExternally - set(value) = definedExternally - var exclude: Array? - get() = definedExternally - set(value) = definedExternally - var disableFilenameBasedTypeAcquisition: Boolean? - get() = definedExternally - set(value) = definedExternally - @nativeGetter - operator fun get(option: String): dynamic /* String? | Number? | Boolean? | Array? | Array? | MapLike>? | Array? | Array? */ - @nativeSetter - operator fun set(option: String, value: String?) - @nativeSetter - operator fun set(option: String, value: Number?) - @nativeSetter - operator fun set(option: String, value: Boolean?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: MapLike>?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: Array?) -} - -external enum class ModuleKind { - None /* = 0 */, - CommonJS /* = 1 */, - AMD /* = 2 */, - UMD /* = 3 */, - System /* = 4 */, - ES2015 /* = 5 */, - ES2020 /* = 6 */, - ESNext /* = 99 */ -} - -external enum class JsxEmit { - None /* = 0 */, - Preserve /* = 1 */, - React /* = 2 */, - ReactNative /* = 3 */, - ReactJSX /* = 4 */, - ReactJSXDev /* = 5 */ -} - -external enum class ImportsNotUsedAsValues { - Remove /* = 0 */, - Preserve /* = 1 */, - Error /* = 2 */ -} - -external enum class NewLineKind { - CarriageReturnLineFeed /* = 0 */, - LineFeed /* = 1 */ -} - -external interface LineAndCharacter { - var line: Number - var character: Number -} - -external enum class ScriptKind { - Unknown /* = 0 */, - JS /* = 1 */, - JSX /* = 2 */, - TS /* = 3 */, - TSX /* = 4 */, - External /* = 5 */, - JSON /* = 6 */, - Deferred /* = 7 */ -} - -external enum class ScriptTarget { - ES3 /* = 0 */, - ES5 /* = 1 */, - ES2015 /* = 2 */, - ES2016 /* = 3 */, - ES2017 /* = 4 */, - ES2018 /* = 5 */, - ES2019 /* = 6 */, - ES2020 /* = 7 */, - ES2021 /* = 8 */, - ESNext /* = 99 */, - JSON /* = 100 */, - Latest /* = 99 */ -} - -external enum class LanguageVariant { - Standard /* = 0 */, - JSX /* = 1 */ -} - -external interface ParsedCommandLine { - var options: CompilerOptions - var typeAcquisition: TypeAcquisition? - get() = definedExternally - set(value) = definedExternally - var fileNames: Array - var projectReferences: Array? - get() = definedExternally - set(value) = definedExternally - var watchOptions: WatchOptions? - get() = definedExternally - set(value) = definedExternally - var raw: Any? - get() = definedExternally - set(value) = definedExternally - var errors: Array - var wildcardDirectories: MapLike? - get() = definedExternally - set(value) = definedExternally - var compileOnSave: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external enum class WatchDirectoryFlags { - None /* = 0 */, - Recursive /* = 1 */ -} - -external interface CreateProgramOptions { - var rootNames: Array - var options: CompilerOptions - var projectReferences: Array? - get() = definedExternally - set(value) = definedExternally - var host: CompilerHost? - get() = definedExternally - set(value) = definedExternally - var oldProgram: Program? - get() = definedExternally - set(value) = definedExternally - var configFileParsingDiagnostics: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface ModuleResolutionHost { - fun fileExists(fileName: String): Boolean - fun readFile(fileName: String): String? - val trace: ((s: String) -> Unit)? - val directoryExists: ((directoryName: String) -> Boolean)? - val realpath: ((path: String) -> String)? - val getCurrentDirectory: (() -> String)? - val getDirectories: ((path: String) -> Array)? -} - -external interface ResolvedModule { - var resolvedFileName: String - var isExternalLibraryImport: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface ResolvedModuleFull : ResolvedModule { - var extension: Extension - var packageId: PackageId? - get() = definedExternally - set(value) = definedExternally -} - -external interface PackageId { - var name: String - var subModuleName: String - var version: String -} - -external enum class Extension { - Ts /* = ".ts" */, - Tsx /* = ".tsx" */, - Dts /* = ".d.ts" */, - Js /* = ".js" */, - Jsx /* = ".jsx" */, - Json /* = ".json" */, - TsBuildInfo /* = ".tsbuildinfo" */ -} - -external interface ResolvedModuleWithFailedLookupLocations { - var resolvedModule: ResolvedModuleFull? -} - -external interface ResolvedTypeReferenceDirective { - var primary: Boolean - var resolvedFileName: String? - var packageId: PackageId? - get() = definedExternally - set(value) = definedExternally - var isExternalLibraryImport: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations { - var resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective? - var failedLookupLocations: Array -} - -external interface CompilerHost : ModuleResolutionHost { - fun getSourceFile(fileName: String, languageVersion: ScriptTarget, onError: (message: String) -> Unit = definedExternally, shouldCreateNewSourceFile: Boolean = definedExternally): SourceFile? - val getSourceFileByPath: ((fileName: String, path: String /* String & `T$3` */, languageVersion: ScriptTarget, onError: (message: String) -> Unit, shouldCreateNewSourceFile: Boolean) -> SourceFile?)? - val getCancellationToken: (() -> CancellationToken)? - fun getDefaultLibFileName(options: CompilerOptions): String - val getDefaultLibLocation: (() -> String)? - var writeFile: WriteFileCallback - override var getCurrentDirectory: () -> String - fun getCanonicalFileName(fileName: String): String - fun useCaseSensitiveFileNames(): Boolean - fun getNewLine(): String - val readDirectory: ((rootDir: String, extensions: Array, excludes: Array?, includes: Array, depth: Number) -> Array)? - val resolveModuleNames: ((moduleNames: Array, containingFile: String, reusedNames: Array?, redirectedReference: ResolvedProjectReference?, options: CompilerOptions) -> Array)? - val resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: Array, containingFile: String, redirectedReference: ResolvedProjectReference?, options: CompilerOptions) -> Array)? - val getEnvironmentVariable: ((name: String) -> String?)? - val createHash: ((data: String) -> String)? - val getParsedCommandLine: ((fileName: String) -> ParsedCommandLine?)? -} - -external interface SourceMapRange : TextRange { - var source: SourceMapSource? - get() = definedExternally - set(value) = definedExternally -} - -external interface SourceMapSource { - fun getLineAndCharacterOfPosition(pos: Number): LineAndCharacter - var fileName: String - var text: String - var skipTrivia: ((pos: Number) -> Number)? - get() = definedExternally - set(value) = definedExternally -} - -external enum class EmitFlags { - None /* = 0 */, - SingleLine /* = 1 */, - AdviseOnEmitNode /* = 2 */, - NoSubstitution /* = 4 */, - CapturesThis /* = 8 */, - NoLeadingSourceMap /* = 16 */, - NoTrailingSourceMap /* = 32 */, - NoSourceMap /* = 48 */, - NoNestedSourceMaps /* = 64 */, - NoTokenLeadingSourceMaps /* = 128 */, - NoTokenTrailingSourceMaps /* = 256 */, - NoTokenSourceMaps /* = 384 */, - NoLeadingComments /* = 512 */, - NoTrailingComments /* = 1024 */, - NoComments /* = 1536 */, - NoNestedComments /* = 2048 */, - HelperName /* = 4096 */, - ExportName /* = 8192 */, - LocalName /* = 16384 */, - InternalName /* = 32768 */, - Indented /* = 65536 */, - NoIndentation /* = 131072 */, - AsyncFunctionBody /* = 262144 */, - ReuseTempVariableScope /* = 524288 */, - CustomPrologue /* = 1048576 */, - NoHoisting /* = 2097152 */, - HasEndOfDeclarationMarker /* = 4194304 */, - Iterator /* = 8388608 */, - NoAsciiEscaping /* = 16777216 */ -} - -external interface EmitHelperBase { - var name: String - var scoped: Boolean - var text: dynamic /* String | (node: EmitHelperUniqueNameCallback) -> String */ - get() = definedExternally - set(value) = definedExternally - var priority: Number? - get() = definedExternally - set(value) = definedExternally - var dependencies: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface ScopedEmitHelper : EmitHelperBase { - override var scoped: Boolean -} - -external interface UnscopedEmitHelper : EmitHelperBase { - override var scoped: Boolean - override var text: String -} - -external enum class EmitHint { - SourceFile /* = 0 */, - Expression /* = 1 */, - IdentifierName /* = 2 */, - MappedTypeParameter /* = 3 */, - Unspecified /* = 4 */, - EmbeddedStatement /* = 5 */, - JsxAttributeValue /* = 6 */ -} - -external enum class OuterExpressionKinds { - Parentheses /* = 1 */, - TypeAssertions /* = 2 */, - NonNullAssertions /* = 4 */, - PartiallyEmittedExpressions /* = 8 */, - Assertions /* = 6 */, - All /* = 15 */ -} - -external interface NodeFactory { - fun createNodeArray(elements: Array = definedExternally, hasTrailingComma: Boolean = definedExternally): NodeArray - fun createNumericLiteral(value: String, numericLiteralFlags: TokenFlags = definedExternally): NumericLiteral - fun createNumericLiteral(value: String): NumericLiteral - fun createNumericLiteral(value: Number, numericLiteralFlags: TokenFlags = definedExternally): NumericLiteral - fun createNumericLiteral(value: Number): NumericLiteral - fun createBigIntLiteral(value: String): BigIntLiteral - fun createBigIntLiteral(value: PseudoBigInt): BigIntLiteral - fun createStringLiteral(text: String, isSingleQuote: Boolean = definedExternally): StringLiteral - fun createStringLiteralFromNode(sourceNode: Identifier, isSingleQuote: Boolean = definedExternally): StringLiteral - fun createStringLiteralFromNode(sourceNode: Identifier): StringLiteral - fun createStringLiteralFromNode(sourceNode: StringLiteral, isSingleQuote: Boolean = definedExternally): StringLiteral - fun createStringLiteralFromNode(sourceNode: StringLiteral): StringLiteral - fun createStringLiteralFromNode(sourceNode: NoSubstitutionTemplateLiteral, isSingleQuote: Boolean = definedExternally): StringLiteral - fun createStringLiteralFromNode(sourceNode: NoSubstitutionTemplateLiteral): StringLiteral - fun createStringLiteralFromNode(sourceNode: NumericLiteral, isSingleQuote: Boolean = definedExternally): StringLiteral - fun createStringLiteralFromNode(sourceNode: NumericLiteral): StringLiteral - fun createRegularExpressionLiteral(text: String): RegularExpressionLiteral - fun createIdentifier(text: String): Identifier - fun createTempVariable(recordTempVariable: ((node: Identifier) -> Unit)?, reservedInNestedScopes: Boolean = definedExternally): Identifier - fun createLoopVariable(reservedInNestedScopes: Boolean = definedExternally): Identifier - fun createUniqueName(text: String, flags: GeneratedIdentifierFlags = definedExternally): Identifier - fun getGeneratedNameForNode(node: Node?, flags: GeneratedIdentifierFlags = definedExternally): Identifier - fun createPrivateIdentifier(text: String): PrivateIdentifier - fun createToken(token: SyntaxKind.SuperKeyword): SuperExpression - fun createToken(token: SyntaxKind.ThisKeyword): ThisExpression - fun createToken(token: SyntaxKind.NullKeyword): NullLiteral - fun createToken(token: SyntaxKind.TrueKeyword): TrueLiteral - fun createToken(token: SyntaxKind.FalseKeyword): FalseLiteral - fun createToken(token: TKind): dynamic /* Token */ - fun createSuper(): SuperExpression - fun createThis(): ThisExpression - fun createNull(): NullLiteral - fun createTrue(): TrueLiteral - fun createFalse(): FalseLiteral - fun createModifier(kind: T): ModifierToken - fun createModifiersFromModifierFlags(flags: ModifierFlags): Array - fun createQualifiedName(left: Identifier, right: String): QualifiedName - fun createQualifiedName(left: Identifier, right: Identifier): QualifiedName - fun createQualifiedName(left: QualifiedName, right: String): QualifiedName - fun createQualifiedName(left: QualifiedName, right: Identifier): QualifiedName - fun updateQualifiedName(node: QualifiedName, left: Identifier, right: Identifier): QualifiedName - fun updateQualifiedName(node: QualifiedName, left: QualifiedName, right: Identifier): QualifiedName - fun createComputedPropertyName(expression: Expression): ComputedPropertyName - fun updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName - fun createTypeParameterDeclaration(name: String, constraint: TypeNode = definedExternally, defaultType: TypeNode = definedExternally): TypeParameterDeclaration - fun createTypeParameterDeclaration(name: String): TypeParameterDeclaration - fun createTypeParameterDeclaration(name: String, constraint: TypeNode = definedExternally): TypeParameterDeclaration - fun createTypeParameterDeclaration(name: Identifier, constraint: TypeNode = definedExternally, defaultType: TypeNode = definedExternally): TypeParameterDeclaration - fun createTypeParameterDeclaration(name: Identifier): TypeParameterDeclaration - fun createTypeParameterDeclaration(name: Identifier, constraint: TypeNode = definedExternally): TypeParameterDeclaration - fun updateTypeParameterDeclaration(node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode?, defaultType: TypeNode?): TypeParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: String, questionToken: QuestionToken = definedExternally, type: TypeNode = definedExternally, initializer: Expression = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: String): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: String, questionToken: QuestionToken = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: String, questionToken: QuestionToken = definedExternally, type: TypeNode = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: Identifier, questionToken: QuestionToken = definedExternally, type: TypeNode = definedExternally, initializer: Expression = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: Identifier): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: Identifier, questionToken: QuestionToken = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: Identifier, questionToken: QuestionToken = definedExternally, type: TypeNode = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ObjectBindingPattern, questionToken: QuestionToken = definedExternally, type: TypeNode = definedExternally, initializer: Expression = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ObjectBindingPattern): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ObjectBindingPattern, questionToken: QuestionToken = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ObjectBindingPattern, questionToken: QuestionToken = definedExternally, type: TypeNode = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ArrayBindingPattern, questionToken: QuestionToken = definedExternally, type: TypeNode = definedExternally, initializer: Expression = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ArrayBindingPattern): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ArrayBindingPattern, questionToken: QuestionToken = definedExternally): ParameterDeclaration - fun createParameterDeclaration(decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ArrayBindingPattern, questionToken: QuestionToken = definedExternally, type: TypeNode = definedExternally): ParameterDeclaration - fun updateParameterDeclaration(node: ParameterDeclaration, decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: String, questionToken: QuestionToken?, type: TypeNode?, initializer: Expression?): ParameterDeclaration - fun updateParameterDeclaration(node: ParameterDeclaration, decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: Identifier, questionToken: QuestionToken?, type: TypeNode?, initializer: Expression?): ParameterDeclaration - fun updateParameterDeclaration(node: ParameterDeclaration, decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ObjectBindingPattern, questionToken: QuestionToken?, type: TypeNode?, initializer: Expression?): ParameterDeclaration - fun updateParameterDeclaration(node: ParameterDeclaration, decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: ArrayBindingPattern, questionToken: QuestionToken?, type: TypeNode?, initializer: Expression?): ParameterDeclaration - fun createDecorator(expression: Expression): Decorator - fun updateDecorator(node: Decorator, expression: Expression): Decorator - fun createPropertySignature(modifiers: Array?, name: Identifier, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun createPropertySignature(modifiers: Array?, name: StringLiteral, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun createPropertySignature(modifiers: Array?, name: NumericLiteral, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun createPropertySignature(modifiers: Array?, name: ComputedPropertyName, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun createPropertySignature(modifiers: Array?, name: PrivateIdentifier, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun createPropertySignature(modifiers: Array?, name: String, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun updatePropertySignature(node: PropertySignature, modifiers: Array?, name: Identifier, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun updatePropertySignature(node: PropertySignature, modifiers: Array?, name: StringLiteral, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun updatePropertySignature(node: PropertySignature, modifiers: Array?, name: NumericLiteral, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun updatePropertySignature(node: PropertySignature, modifiers: Array?, name: ComputedPropertyName, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun updatePropertySignature(node: PropertySignature, modifiers: Array?, name: PrivateIdentifier, questionToken: QuestionToken?, type: TypeNode?): PropertySignature - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: String, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: String, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: NumericLiteral, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: NumericLiteral, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: ComputedPropertyName, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: ComputedPropertyName, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: PrivateIdentifier, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createPropertyDeclaration(decorators: Array?, modifiers: Array?, name: PrivateIdentifier, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: String, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: String, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: StringLiteral, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: StringLiteral, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: NumericLiteral, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: NumericLiteral, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: ComputedPropertyName, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: ComputedPropertyName, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: PrivateIdentifier, questionOrExclamationToken: QuestionToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun updatePropertyDeclaration(node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: PrivateIdentifier, questionOrExclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): PropertyDeclaration - fun createMethodSignature(modifiers: Array?, name: String, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?): MethodSignature - fun createMethodSignature(modifiers: Array?, name: Identifier, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?): MethodSignature - fun createMethodSignature(modifiers: Array?, name: StringLiteral, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?): MethodSignature - fun createMethodSignature(modifiers: Array?, name: NumericLiteral, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?): MethodSignature - fun createMethodSignature(modifiers: Array?, name: ComputedPropertyName, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?): MethodSignature - fun createMethodSignature(modifiers: Array?, name: PrivateIdentifier, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?): MethodSignature - fun updateMethodSignature(node: MethodSignature, modifiers: Array?, name: Identifier, questionToken: QuestionToken?, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?): MethodSignature - fun updateMethodSignature(node: MethodSignature, modifiers: Array?, name: StringLiteral, questionToken: QuestionToken?, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?): MethodSignature - fun updateMethodSignature(node: MethodSignature, modifiers: Array?, name: NumericLiteral, questionToken: QuestionToken?, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?): MethodSignature - fun updateMethodSignature(node: MethodSignature, modifiers: Array?, name: ComputedPropertyName, questionToken: QuestionToken?, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?): MethodSignature - fun updateMethodSignature(node: MethodSignature, modifiers: Array?, name: PrivateIdentifier, questionToken: QuestionToken?, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?): MethodSignature - fun createMethodDeclaration(decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: String, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun createMethodDeclaration(decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: Identifier, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun createMethodDeclaration(decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: StringLiteral, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun createMethodDeclaration(decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: NumericLiteral, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun createMethodDeclaration(decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: ComputedPropertyName, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun createMethodDeclaration(decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: PrivateIdentifier, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun updateMethodDeclaration(node: MethodDeclaration, decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: Identifier, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun updateMethodDeclaration(node: MethodDeclaration, decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: StringLiteral, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun updateMethodDeclaration(node: MethodDeclaration, decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: NumericLiteral, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun updateMethodDeclaration(node: MethodDeclaration, decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: ComputedPropertyName, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun updateMethodDeclaration(node: MethodDeclaration, decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: PrivateIdentifier, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): MethodDeclaration - fun createConstructorDeclaration(decorators: Array?, modifiers: Array?, parameters: Array, body: Block?): ConstructorDeclaration - fun updateConstructorDeclaration(node: ConstructorDeclaration, decorators: Array?, modifiers: Array?, parameters: Array, body: Block?): ConstructorDeclaration - fun createGetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: String, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun createGetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun createGetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun createGetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: NumericLiteral, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun createGetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: ComputedPropertyName, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun createGetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: PrivateIdentifier, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: StringLiteral, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: NumericLiteral, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: ComputedPropertyName, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun updateGetAccessorDeclaration(node: GetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: PrivateIdentifier, parameters: Array, type: TypeNode?, body: Block?): GetAccessorDeclaration - fun createSetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: String, parameters: Array, body: Block?): SetAccessorDeclaration - fun createSetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, parameters: Array, body: Block?): SetAccessorDeclaration - fun createSetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, parameters: Array, body: Block?): SetAccessorDeclaration - fun createSetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: NumericLiteral, parameters: Array, body: Block?): SetAccessorDeclaration - fun createSetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: ComputedPropertyName, parameters: Array, body: Block?): SetAccessorDeclaration - fun createSetAccessorDeclaration(decorators: Array?, modifiers: Array?, name: PrivateIdentifier, parameters: Array, body: Block?): SetAccessorDeclaration - fun updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, parameters: Array, body: Block?): SetAccessorDeclaration - fun updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: StringLiteral, parameters: Array, body: Block?): SetAccessorDeclaration - fun updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: NumericLiteral, parameters: Array, body: Block?): SetAccessorDeclaration - fun updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: ComputedPropertyName, parameters: Array, body: Block?): SetAccessorDeclaration - fun updateSetAccessorDeclaration(node: SetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: PrivateIdentifier, parameters: Array, body: Block?): SetAccessorDeclaration - fun createCallSignature(typeParameters: Array?, parameters: Array, type: TypeNode?): CallSignatureDeclaration - fun updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?): CallSignatureDeclaration - fun createConstructSignature(typeParameters: Array?, parameters: Array, type: TypeNode?): ConstructSignatureDeclaration - fun updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?): ConstructSignatureDeclaration - fun createIndexSignature(decorators: Array?, modifiers: Array?, parameters: Array, type: TypeNode): IndexSignatureDeclaration - fun updateIndexSignature(node: IndexSignatureDeclaration, decorators: Array?, modifiers: Array?, parameters: Array, type: TypeNode): IndexSignatureDeclaration - fun createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle): TemplateLiteralTypeSpan - fun createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateTail): TemplateLiteralTypeSpan - fun updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle): TemplateLiteralTypeSpan - fun updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateTail): TemplateLiteralTypeSpan - fun createClassStaticBlockDeclaration(decorators: Array?, modifiers: Array?, body: Block): ClassStaticBlockDeclaration - fun updateClassStaticBlockDeclaration(node: ClassStaticBlockDeclaration, decorators: Array?, modifiers: Array?, body: Block): ClassStaticBlockDeclaration - fun createKeywordTypeNode(kind: TKind): KeywordTypeNode - fun createTypePredicateNode(assertsModifier: AssertsKeyword?, parameterName: Identifier, type: TypeNode?): TypePredicateNode - fun createTypePredicateNode(assertsModifier: AssertsKeyword?, parameterName: ThisTypeNode, type: TypeNode?): TypePredicateNode - fun createTypePredicateNode(assertsModifier: AssertsKeyword?, parameterName: String, type: TypeNode?): TypePredicateNode - fun updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword?, parameterName: Identifier, type: TypeNode?): TypePredicateNode - fun updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword?, parameterName: ThisTypeNode, type: TypeNode?): TypePredicateNode - fun createTypeReferenceNode(typeName: String, typeArguments: Array = definedExternally): TypeReferenceNode - fun createTypeReferenceNode(typeName: String): TypeReferenceNode - fun createTypeReferenceNode(typeName: Identifier, typeArguments: Array = definedExternally): TypeReferenceNode - fun createTypeReferenceNode(typeName: Identifier): TypeReferenceNode - fun createTypeReferenceNode(typeName: QualifiedName, typeArguments: Array = definedExternally): TypeReferenceNode - fun createTypeReferenceNode(typeName: QualifiedName): TypeReferenceNode - fun updateTypeReferenceNode(node: TypeReferenceNode, typeName: Identifier, typeArguments: NodeArray?): TypeReferenceNode - fun updateTypeReferenceNode(node: TypeReferenceNode, typeName: QualifiedName, typeArguments: NodeArray?): TypeReferenceNode - fun createFunctionTypeNode(typeParameters: Array?, parameters: Array, type: TypeNode): FunctionTypeNode - fun updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode): FunctionTypeNode - fun createConstructorTypeNode(modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode): ConstructorTypeNode - fun createConstructorTypeNode(typeParameters: Array?, parameters: Array, type: TypeNode): ConstructorTypeNode - fun updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: Array?, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode): ConstructorTypeNode - fun updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode): ConstructorTypeNode - fun createTypeQueryNode(exprName: Identifier): TypeQueryNode - fun createTypeQueryNode(exprName: QualifiedName): TypeQueryNode - fun updateTypeQueryNode(node: TypeQueryNode, exprName: Identifier): TypeQueryNode - fun updateTypeQueryNode(node: TypeQueryNode, exprName: QualifiedName): TypeQueryNode - fun createTypeLiteralNode(members: Array?): TypeLiteralNode - fun updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray): TypeLiteralNode - fun createArrayTypeNode(elementType: TypeNode): ArrayTypeNode - fun updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode - fun createTupleTypeNode(elements: Array): TupleTypeNode - fun updateTupleTypeNode(node: TupleTypeNode, elements: Array): TupleTypeNode - fun createNamedTupleMember(dotDotDotToken: DotDotDotToken?, name: Identifier, questionToken: QuestionToken?, type: TypeNode): NamedTupleMember - fun updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken?, name: Identifier, questionToken: QuestionToken?, type: TypeNode): NamedTupleMember - fun createOptionalTypeNode(type: TypeNode): OptionalTypeNode - fun updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode - fun createRestTypeNode(type: TypeNode): RestTypeNode - fun updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode - fun createUnionTypeNode(types: Array): UnionTypeNode - fun updateUnionTypeNode(node: UnionTypeNode, types: NodeArray): UnionTypeNode - fun createIntersectionTypeNode(types: Array): IntersectionTypeNode - fun updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray): IntersectionTypeNode - fun createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode - fun updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode - fun createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode - fun updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode - fun createImportTypeNode(argument: TypeNode, qualifier: Identifier = definedExternally, typeArguments: Array = definedExternally, isTypeOf: Boolean = definedExternally): ImportTypeNode - fun createImportTypeNode(argument: TypeNode): ImportTypeNode - fun createImportTypeNode(argument: TypeNode, qualifier: Identifier = definedExternally): ImportTypeNode - fun createImportTypeNode(argument: TypeNode, qualifier: Identifier = definedExternally, typeArguments: Array = definedExternally): ImportTypeNode - fun createImportTypeNode(argument: TypeNode, qualifier: QualifiedName = definedExternally, typeArguments: Array = definedExternally, isTypeOf: Boolean = definedExternally): ImportTypeNode - fun createImportTypeNode(argument: TypeNode, qualifier: QualifiedName = definedExternally): ImportTypeNode - fun createImportTypeNode(argument: TypeNode, qualifier: QualifiedName = definedExternally, typeArguments: Array = definedExternally): ImportTypeNode - fun updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: Identifier?, typeArguments: Array?, isTypeOf: Boolean = definedExternally): ImportTypeNode - fun updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: Identifier?, typeArguments: Array?): ImportTypeNode - fun updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: QualifiedName?, typeArguments: Array?, isTypeOf: Boolean = definedExternally): ImportTypeNode - fun updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier: QualifiedName?, typeArguments: Array?): ImportTypeNode - fun createParenthesizedType(type: TypeNode): ParenthesizedTypeNode - fun updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode - fun createThisTypeNode(): ThisTypeNode - fun createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword, type: TypeNode): TypeOperatorNode - fun createTypeOperatorNode(operator: SyntaxKind.UniqueKeyword, type: TypeNode): TypeOperatorNode - fun createTypeOperatorNode(operator: SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode - fun updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode - fun createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode - fun updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode - fun createMappedTypeNode(readonlyToken: ReadonlyKeyword?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: QuestionToken?, type: TypeNode?): MappedTypeNode - fun createMappedTypeNode(readonlyToken: ReadonlyKeyword?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: PlusToken?, type: TypeNode?): MappedTypeNode - fun createMappedTypeNode(readonlyToken: ReadonlyKeyword?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: MinusToken?, type: TypeNode?): MappedTypeNode - fun createMappedTypeNode(readonlyToken: PlusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: QuestionToken?, type: TypeNode?): MappedTypeNode - fun createMappedTypeNode(readonlyToken: PlusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: PlusToken?, type: TypeNode?): MappedTypeNode - fun createMappedTypeNode(readonlyToken: PlusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: MinusToken?, type: TypeNode?): MappedTypeNode - fun createMappedTypeNode(readonlyToken: MinusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: QuestionToken?, type: TypeNode?): MappedTypeNode - fun createMappedTypeNode(readonlyToken: MinusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: PlusToken?, type: TypeNode?): MappedTypeNode - fun createMappedTypeNode(readonlyToken: MinusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: MinusToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: QuestionToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: PlusToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: MinusToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: PlusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: QuestionToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: PlusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: PlusToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: PlusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: MinusToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: MinusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: QuestionToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: MinusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: PlusToken?, type: TypeNode?): MappedTypeNode - fun updateMappedTypeNode(node: MappedTypeNode, readonlyToken: MinusToken?, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: MinusToken?, type: TypeNode?): MappedTypeNode - fun createLiteralTypeNode(literal: NullLiteral): LiteralTypeNode - fun createLiteralTypeNode(literal: TrueLiteral): LiteralTypeNode - fun createLiteralTypeNode(literal: FalseLiteral): LiteralTypeNode - fun createLiteralTypeNode(literal: LiteralExpression): LiteralTypeNode - fun createLiteralTypeNode(literal: PrefixUnaryExpression): LiteralTypeNode - fun updateLiteralTypeNode(node: LiteralTypeNode, literal: NullLiteral): LiteralTypeNode - fun updateLiteralTypeNode(node: LiteralTypeNode, literal: TrueLiteral): LiteralTypeNode - fun updateLiteralTypeNode(node: LiteralTypeNode, literal: FalseLiteral): LiteralTypeNode - fun updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralExpression): LiteralTypeNode - fun updateLiteralTypeNode(node: LiteralTypeNode, literal: PrefixUnaryExpression): LiteralTypeNode - fun createTemplateLiteralType(head: TemplateHead, templateSpans: Array): TemplateLiteralTypeNode - fun updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: Array): TemplateLiteralTypeNode - fun createObjectBindingPattern(elements: Array): ObjectBindingPattern - fun updateObjectBindingPattern(node: ObjectBindingPattern, elements: Array): ObjectBindingPattern - fun createArrayBindingPattern(elements: Array): ArrayBindingPattern - fun updateArrayBindingPattern(node: ArrayBindingPattern, elements: Array): ArrayBindingPattern - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: String?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, initializer: Expression = definedExternally): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: String?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: Identifier?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, initializer: Expression = definedExternally): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: Identifier?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: StringLiteral?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, initializer: Expression = definedExternally): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: StringLiteral?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: NumericLiteral?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, initializer: Expression = definedExternally): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: NumericLiteral?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: ComputedPropertyName?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, initializer: Expression = definedExternally): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: ComputedPropertyName?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: PrivateIdentifier?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, initializer: Expression = definedExternally): BindingElement - fun createBindingElement(dotDotDotToken: DotDotDotToken?, propertyName: PrivateIdentifier?, name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: Identifier?, name: Identifier, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: Identifier?, name: ObjectBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: Identifier?, name: ArrayBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: StringLiteral?, name: Identifier, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: StringLiteral?, name: ObjectBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: StringLiteral?, name: ArrayBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: NumericLiteral?, name: Identifier, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: NumericLiteral?, name: ObjectBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: NumericLiteral?, name: ArrayBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: ComputedPropertyName?, name: Identifier, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: ComputedPropertyName?, name: ObjectBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: ComputedPropertyName?, name: ArrayBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: PrivateIdentifier?, name: Identifier, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: PrivateIdentifier?, name: ObjectBindingPattern, initializer: Expression?): BindingElement - fun updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: PrivateIdentifier?, name: ArrayBindingPattern, initializer: Expression?): BindingElement - fun createArrayLiteralExpression(elements: Array = definedExternally, multiLine: Boolean = definedExternally): ArrayLiteralExpression - fun updateArrayLiteralExpression(node: ArrayLiteralExpression, elements: Array): ArrayLiteralExpression - fun createObjectLiteralExpression(properties: Array = definedExternally, multiLine: Boolean = definedExternally): ObjectLiteralExpression - fun updateObjectLiteralExpression(node: ObjectLiteralExpression, properties: Array): ObjectLiteralExpression - fun createPropertyAccessExpression(expression: Expression, name: String): PropertyAccessExpression - fun createPropertyAccessExpression(expression: Expression, name: Identifier): PropertyAccessExpression - fun createPropertyAccessExpression(expression: Expression, name: PrivateIdentifier): PropertyAccessExpression - fun updatePropertyAccessExpression(node: PropertyAccessExpression, expression: Expression, name: Identifier): PropertyAccessExpression - fun updatePropertyAccessExpression(node: PropertyAccessExpression, expression: Expression, name: PrivateIdentifier): PropertyAccessExpression - fun createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken?, name: String): PropertyAccessChain - fun createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken?, name: Identifier): PropertyAccessChain - fun createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken?, name: PrivateIdentifier): PropertyAccessChain - fun updatePropertyAccessChain(node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken?, name: Identifier): PropertyAccessChain - fun updatePropertyAccessChain(node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken?, name: PrivateIdentifier): PropertyAccessChain - fun createElementAccessExpression(expression: Expression, index: Number): ElementAccessExpression - fun createElementAccessExpression(expression: Expression, index: Expression): ElementAccessExpression - fun updateElementAccessExpression(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression - fun createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken?, index: Number): ElementAccessChain - fun createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken?, index: Expression): ElementAccessChain - fun updateElementAccessChain(node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken?, argumentExpression: Expression): ElementAccessChain - fun createCallExpression(expression: Expression, typeArguments: Array?, argumentsArray: Array?): CallExpression - fun updateCallExpression(node: CallExpression, expression: Expression, typeArguments: Array?, argumentsArray: Array): CallExpression - fun createCallChain(expression: Expression, questionDotToken: QuestionDotToken?, typeArguments: Array?, argumentsArray: Array?): CallChain - fun updateCallChain(node: CallChain, expression: Expression, questionDotToken: QuestionDotToken?, typeArguments: Array?, argumentsArray: Array): CallChain - fun createNewExpression(expression: Expression, typeArguments: Array?, argumentsArray: Array?): NewExpression - fun updateNewExpression(node: NewExpression, expression: Expression, typeArguments: Array?, argumentsArray: Array?): NewExpression - fun createTaggedTemplateExpression(tag: Expression, typeArguments: Array?, template: TemplateExpression): TaggedTemplateExpression - fun createTaggedTemplateExpression(tag: Expression, typeArguments: Array?, template: NoSubstitutionTemplateLiteral): TaggedTemplateExpression - fun updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: Expression, typeArguments: Array?, template: TemplateExpression): TaggedTemplateExpression - fun updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: Expression, typeArguments: Array?, template: NoSubstitutionTemplateLiteral): TaggedTemplateExpression - fun createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion - fun updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion - fun createParenthesizedExpression(expression: Expression): ParenthesizedExpression - fun updateParenthesizedExpression(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression - fun createFunctionExpression(modifiers: Array?, asteriskToken: AsteriskToken?, name: String?, typeParameters: Array?, parameters: Array?, type: TypeNode?, body: Block): FunctionExpression - fun createFunctionExpression(modifiers: Array?, asteriskToken: AsteriskToken?, name: Identifier?, typeParameters: Array?, parameters: Array?, type: TypeNode?, body: Block): FunctionExpression - fun updateFunctionExpression(node: FunctionExpression, modifiers: Array?, asteriskToken: AsteriskToken?, name: Identifier?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block): FunctionExpression - fun createArrowFunction(modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode?, equalsGreaterThanToken: EqualsGreaterThanToken?, body: FunctionBody): ArrowFunction - fun createArrowFunction(modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode?, equalsGreaterThanToken: EqualsGreaterThanToken?, body: Expression): ArrowFunction - fun updateArrowFunction(node: ArrowFunction, modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode?, equalsGreaterThanToken: EqualsGreaterThanToken, body: FunctionBody): ArrowFunction - fun updateArrowFunction(node: ArrowFunction, modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode?, equalsGreaterThanToken: EqualsGreaterThanToken, body: Expression): ArrowFunction - fun createDeleteExpression(expression: Expression): DeleteExpression - fun updateDeleteExpression(node: DeleteExpression, expression: Expression): DeleteExpression - fun createTypeOfExpression(expression: Expression): TypeOfExpression - fun updateTypeOfExpression(node: TypeOfExpression, expression: Expression): TypeOfExpression - fun createVoidExpression(expression: Expression): VoidExpression - fun updateVoidExpression(node: VoidExpression, expression: Expression): VoidExpression - fun createAwaitExpression(expression: Expression): AwaitExpression - fun updateAwaitExpression(node: AwaitExpression, expression: Expression): AwaitExpression - fun createPrefixUnaryExpression(operator: SyntaxKind.PlusPlusToken, operand: Expression): PrefixUnaryExpression - fun createPrefixUnaryExpression(operator: SyntaxKind.MinusMinusToken, operand: Expression): PrefixUnaryExpression - fun createPrefixUnaryExpression(operator: SyntaxKind.PlusToken, operand: Expression): PrefixUnaryExpression - fun createPrefixUnaryExpression(operator: SyntaxKind.MinusToken, operand: Expression): PrefixUnaryExpression - fun createPrefixUnaryExpression(operator: SyntaxKind.TildeToken, operand: Expression): PrefixUnaryExpression - fun createPrefixUnaryExpression(operator: SyntaxKind.ExclamationToken, operand: Expression): PrefixUnaryExpression - fun updatePrefixUnaryExpression(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression - fun createPostfixUnaryExpression(operand: Expression, operator: SyntaxKind.PlusPlusToken): PostfixUnaryExpression - fun createPostfixUnaryExpression(operand: Expression, operator: SyntaxKind.MinusMinusToken): PostfixUnaryExpression - fun updatePostfixUnaryExpression(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression - fun createBinaryExpression(left: Expression, operator: Any /* SyntaxKind.QuestionQuestionToken | ExponentiationOperator | SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword | SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.CommaToken | BinaryOperatorToken */, right: Expression): BinaryExpression - fun updateBinaryExpression(node: BinaryExpression, left: Expression, operator: Any /* SyntaxKind.QuestionQuestionToken | ExponentiationOperator | SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword | SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.CommaToken | BinaryOperatorToken */, right: Expression): BinaryExpression - fun createConditionalExpression(condition: Expression, questionToken: QuestionToken?, whenTrue: Expression, colonToken: ColonToken?, whenFalse: Expression): ConditionalExpression - fun updateConditionalExpression(node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression - fun createTemplateExpression(head: TemplateHead, templateSpans: Array): TemplateExpression - fun updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: Array): TemplateExpression - fun createTemplateHead(text: String, rawText: String = definedExternally, templateFlags: TokenFlags = definedExternally): TemplateHead - fun createTemplateHead(text: String): TemplateHead - fun createTemplateHead(text: String, rawText: String = definedExternally): TemplateHead - fun createTemplateHead(text: String?, rawText: String, templateFlags: TokenFlags = definedExternally): TemplateHead - fun createTemplateHead(text: String?, rawText: String): TemplateHead - fun createTemplateMiddle(text: String, rawText: String = definedExternally, templateFlags: TokenFlags = definedExternally): TemplateMiddle - fun createTemplateMiddle(text: String): TemplateMiddle - fun createTemplateMiddle(text: String, rawText: String = definedExternally): TemplateMiddle - fun createTemplateMiddle(text: String?, rawText: String, templateFlags: TokenFlags = definedExternally): TemplateMiddle - fun createTemplateMiddle(text: String?, rawText: String): TemplateMiddle - fun createTemplateTail(text: String, rawText: String = definedExternally, templateFlags: TokenFlags = definedExternally): TemplateTail - fun createTemplateTail(text: String): TemplateTail - fun createTemplateTail(text: String, rawText: String = definedExternally): TemplateTail - fun createTemplateTail(text: String?, rawText: String, templateFlags: TokenFlags = definedExternally): TemplateTail - fun createTemplateTail(text: String?, rawText: String): TemplateTail - fun createNoSubstitutionTemplateLiteral(text: String, rawText: String = definedExternally): NoSubstitutionTemplateLiteral - fun createNoSubstitutionTemplateLiteral(text: String): NoSubstitutionTemplateLiteral - fun createNoSubstitutionTemplateLiteral(text: String?, rawText: String): NoSubstitutionTemplateLiteral - fun createYieldExpression(asteriskToken: AsteriskToken, expression: Expression): YieldExpression - fun createYieldExpression(asteriskToken: Nothing?, expression: Expression?): YieldExpression - fun updateYieldExpression(node: YieldExpression, asteriskToken: AsteriskToken?, expression: Expression?): YieldExpression - fun createSpreadElement(expression: Expression): SpreadElement - fun updateSpreadElement(node: SpreadElement, expression: Expression): SpreadElement - fun createClassExpression(decorators: Array?, modifiers: Array?, name: String?, typeParameters: Array?, heritageClauses: Array?, members: Array): ClassExpression - fun createClassExpression(decorators: Array?, modifiers: Array?, name: Identifier?, typeParameters: Array?, heritageClauses: Array?, members: Array): ClassExpression - fun updateClassExpression(node: ClassExpression, decorators: Array?, modifiers: Array?, name: Identifier?, typeParameters: Array?, heritageClauses: Array?, members: Array): ClassExpression - fun createOmittedExpression(): OmittedExpression - fun createExpressionWithTypeArguments(expression: Expression, typeArguments: Array?): ExpressionWithTypeArguments - fun updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: Expression, typeArguments: Array?): ExpressionWithTypeArguments - fun createAsExpression(expression: Expression, type: TypeNode): AsExpression - fun updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression - fun createNonNullExpression(expression: Expression): NonNullExpression - fun updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression - fun createNonNullChain(expression: Expression): NonNullChain - fun updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain - fun createMetaProperty(keywordToken: SyntaxKind.NewKeyword, name: Identifier): MetaProperty - fun createMetaProperty(keywordToken: SyntaxKind.ImportKeyword, name: Identifier): MetaProperty - fun updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty - fun createTemplateSpan(expression: Expression, literal: TemplateMiddle): TemplateSpan - fun createTemplateSpan(expression: Expression, literal: TemplateTail): TemplateSpan - fun updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle): TemplateSpan - fun updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateTail): TemplateSpan - fun createSemicolonClassElement(): SemicolonClassElement - fun createBlock(statements: Array, multiLine: Boolean = definedExternally): Block - fun updateBlock(node: Block, statements: Array): Block - fun createVariableStatement(modifiers: Array?, declarationList: VariableDeclarationList): VariableStatement - fun createVariableStatement(modifiers: Array?, declarationList: Array): VariableStatement - fun updateVariableStatement(node: VariableStatement, modifiers: Array?, declarationList: VariableDeclarationList): VariableStatement - fun createEmptyStatement(): EmptyStatement - fun createExpressionStatement(expression: Expression): ExpressionStatement - fun updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement - fun createIfStatement(expression: Expression, thenStatement: Statement, elseStatement: Statement = definedExternally): IfStatement - fun updateIfStatement(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement?): IfStatement - fun createDoStatement(statement: Statement, expression: Expression): DoStatement - fun updateDoStatement(node: DoStatement, statement: Statement, expression: Expression): DoStatement - fun createWhileStatement(expression: Expression, statement: Statement): WhileStatement - fun updateWhileStatement(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement - fun createForStatement(initializer: VariableDeclarationList?, condition: Expression?, incrementor: Expression?, statement: Statement): ForStatement - fun createForStatement(initializer: Expression?, condition: Expression?, incrementor: Expression?, statement: Statement): ForStatement - fun updateForStatement(node: ForStatement, initializer: VariableDeclarationList?, condition: Expression?, incrementor: Expression?, statement: Statement): ForStatement - fun updateForStatement(node: ForStatement, initializer: Expression?, condition: Expression?, incrementor: Expression?, statement: Statement): ForStatement - fun createForInStatement(initializer: VariableDeclarationList, expression: Expression, statement: Statement): ForInStatement - fun createForInStatement(initializer: Expression, expression: Expression, statement: Statement): ForInStatement - fun updateForInStatement(node: ForInStatement, initializer: VariableDeclarationList, expression: Expression, statement: Statement): ForInStatement - fun updateForInStatement(node: ForInStatement, initializer: Expression, expression: Expression, statement: Statement): ForInStatement - fun createForOfStatement(awaitModifier: AwaitKeyword?, initializer: VariableDeclarationList, expression: Expression, statement: Statement): ForOfStatement - fun createForOfStatement(awaitModifier: AwaitKeyword?, initializer: Expression, expression: Expression, statement: Statement): ForOfStatement - fun updateForOfStatement(node: ForOfStatement, awaitModifier: AwaitKeyword?, initializer: VariableDeclarationList, expression: Expression, statement: Statement): ForOfStatement - fun updateForOfStatement(node: ForOfStatement, awaitModifier: AwaitKeyword?, initializer: Expression, expression: Expression, statement: Statement): ForOfStatement - fun createContinueStatement(label: String = definedExternally): ContinueStatement - fun createContinueStatement(): ContinueStatement - fun createContinueStatement(label: Identifier = definedExternally): ContinueStatement - fun updateContinueStatement(node: ContinueStatement, label: Identifier?): ContinueStatement - fun createBreakStatement(label: String = definedExternally): BreakStatement - fun createBreakStatement(): BreakStatement - fun createBreakStatement(label: Identifier = definedExternally): BreakStatement - fun updateBreakStatement(node: BreakStatement, label: Identifier?): BreakStatement - fun createReturnStatement(expression: Expression = definedExternally): ReturnStatement - fun updateReturnStatement(node: ReturnStatement, expression: Expression?): ReturnStatement - fun createWithStatement(expression: Expression, statement: Statement): WithStatement - fun updateWithStatement(node: WithStatement, expression: Expression, statement: Statement): WithStatement - fun createSwitchStatement(expression: Expression, caseBlock: CaseBlock): SwitchStatement - fun updateSwitchStatement(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement - fun createLabeledStatement(label: String, statement: Statement): LabeledStatement - fun createLabeledStatement(label: Identifier, statement: Statement): LabeledStatement - fun updateLabeledStatement(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement - fun createThrowStatement(expression: Expression): ThrowStatement - fun updateThrowStatement(node: ThrowStatement, expression: Expression): ThrowStatement - fun createTryStatement(tryBlock: Block, catchClause: CatchClause?, finallyBlock: Block?): TryStatement - fun updateTryStatement(node: TryStatement, tryBlock: Block, catchClause: CatchClause?, finallyBlock: Block?): TryStatement - fun createDebuggerStatement(): DebuggerStatement - fun createVariableDeclaration(name: String, exclamationToken: ExclamationToken = definedExternally, type: TypeNode = definedExternally, initializer: Expression = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: String): VariableDeclaration - fun createVariableDeclaration(name: String, exclamationToken: ExclamationToken = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: String, exclamationToken: ExclamationToken = definedExternally, type: TypeNode = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: Identifier, exclamationToken: ExclamationToken = definedExternally, type: TypeNode = definedExternally, initializer: Expression = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: Identifier): VariableDeclaration - fun createVariableDeclaration(name: Identifier, exclamationToken: ExclamationToken = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: Identifier, exclamationToken: ExclamationToken = definedExternally, type: TypeNode = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: ObjectBindingPattern, exclamationToken: ExclamationToken = definedExternally, type: TypeNode = definedExternally, initializer: Expression = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: ObjectBindingPattern): VariableDeclaration - fun createVariableDeclaration(name: ObjectBindingPattern, exclamationToken: ExclamationToken = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: ObjectBindingPattern, exclamationToken: ExclamationToken = definedExternally, type: TypeNode = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: ArrayBindingPattern, exclamationToken: ExclamationToken = definedExternally, type: TypeNode = definedExternally, initializer: Expression = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: ArrayBindingPattern): VariableDeclaration - fun createVariableDeclaration(name: ArrayBindingPattern, exclamationToken: ExclamationToken = definedExternally): VariableDeclaration - fun createVariableDeclaration(name: ArrayBindingPattern, exclamationToken: ExclamationToken = definedExternally, type: TypeNode = definedExternally): VariableDeclaration - fun updateVariableDeclaration(node: VariableDeclaration, name: Identifier, exclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): VariableDeclaration - fun updateVariableDeclaration(node: VariableDeclaration, name: ObjectBindingPattern, exclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): VariableDeclaration - fun updateVariableDeclaration(node: VariableDeclaration, name: ArrayBindingPattern, exclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): VariableDeclaration - fun createVariableDeclarationList(declarations: Array, flags: NodeFlags = definedExternally): VariableDeclarationList - fun updateVariableDeclarationList(node: VariableDeclarationList, declarations: Array): VariableDeclarationList - fun createFunctionDeclaration(decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: String?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): FunctionDeclaration - fun createFunctionDeclaration(decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: Identifier?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): FunctionDeclaration - fun updateFunctionDeclaration(node: FunctionDeclaration, decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: Identifier?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?): FunctionDeclaration - fun createClassDeclaration(decorators: Array?, modifiers: Array?, name: String?, typeParameters: Array?, heritageClauses: Array?, members: Array): ClassDeclaration - fun createClassDeclaration(decorators: Array?, modifiers: Array?, name: Identifier?, typeParameters: Array?, heritageClauses: Array?, members: Array): ClassDeclaration - fun updateClassDeclaration(node: ClassDeclaration, decorators: Array?, modifiers: Array?, name: Identifier?, typeParameters: Array?, heritageClauses: Array?, members: Array): ClassDeclaration - fun createInterfaceDeclaration(decorators: Array?, modifiers: Array?, name: String, typeParameters: Array?, heritageClauses: Array?, members: Array): InterfaceDeclaration - fun createInterfaceDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, typeParameters: Array?, heritageClauses: Array?, members: Array): InterfaceDeclaration - fun updateInterfaceDeclaration(node: InterfaceDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, typeParameters: Array?, heritageClauses: Array?, members: Array): InterfaceDeclaration - fun createTypeAliasDeclaration(decorators: Array?, modifiers: Array?, name: String, typeParameters: Array?, type: TypeNode): TypeAliasDeclaration - fun createTypeAliasDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, typeParameters: Array?, type: TypeNode): TypeAliasDeclaration - fun updateTypeAliasDeclaration(node: TypeAliasDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, typeParameters: Array?, type: TypeNode): TypeAliasDeclaration - fun createEnumDeclaration(decorators: Array?, modifiers: Array?, name: String, members: Array): EnumDeclaration - fun createEnumDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, members: Array): EnumDeclaration - fun updateEnumDeclaration(node: EnumDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, members: Array): EnumDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, body: ModuleBlock?, flags: NodeFlags = definedExternally): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, body: ModuleBlock?): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, body: NamespaceDeclaration?, flags: NodeFlags = definedExternally): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, body: NamespaceDeclaration?): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, body: Identifier?, flags: NodeFlags = definedExternally): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, body: Identifier?): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, body: JSDocNamespaceDeclaration?, flags: NodeFlags = definedExternally): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: Identifier, body: JSDocNamespaceDeclaration?): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, body: ModuleBlock?, flags: NodeFlags = definedExternally): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, body: ModuleBlock?): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, body: NamespaceDeclaration?, flags: NodeFlags = definedExternally): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, body: NamespaceDeclaration?): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, body: Identifier?, flags: NodeFlags = definedExternally): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, body: Identifier?): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, body: JSDocNamespaceDeclaration?, flags: NodeFlags = definedExternally): ModuleDeclaration - fun createModuleDeclaration(decorators: Array?, modifiers: Array?, name: StringLiteral, body: JSDocNamespaceDeclaration?): ModuleDeclaration - fun updateModuleDeclaration(node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, body: ModuleBlock?): ModuleDeclaration - fun updateModuleDeclaration(node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, body: NamespaceDeclaration?): ModuleDeclaration - fun updateModuleDeclaration(node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, body: Identifier?): ModuleDeclaration - fun updateModuleDeclaration(node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, body: JSDocNamespaceDeclaration?): ModuleDeclaration - fun updateModuleDeclaration(node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: StringLiteral, body: ModuleBlock?): ModuleDeclaration - fun updateModuleDeclaration(node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: StringLiteral, body: NamespaceDeclaration?): ModuleDeclaration - fun updateModuleDeclaration(node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: StringLiteral, body: Identifier?): ModuleDeclaration - fun updateModuleDeclaration(node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: StringLiteral, body: JSDocNamespaceDeclaration?): ModuleDeclaration - fun createModuleBlock(statements: Array): ModuleBlock - fun updateModuleBlock(node: ModuleBlock, statements: Array): ModuleBlock - fun createCaseBlock(clauses: Array): CaseBlock - fun updateCaseBlock(node: CaseBlock, clauses: Array): CaseBlock - fun createNamespaceExportDeclaration(name: String): NamespaceExportDeclaration - fun createNamespaceExportDeclaration(name: Identifier): NamespaceExportDeclaration - fun updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration - fun createImportEqualsDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: String, moduleReference: Identifier): ImportEqualsDeclaration - fun createImportEqualsDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: String, moduleReference: QualifiedName): ImportEqualsDeclaration - fun createImportEqualsDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: String, moduleReference: ExternalModuleReference): ImportEqualsDeclaration - fun createImportEqualsDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: Identifier, moduleReference: Identifier): ImportEqualsDeclaration - fun createImportEqualsDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: Identifier, moduleReference: QualifiedName): ImportEqualsDeclaration - fun createImportEqualsDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: Identifier, moduleReference: ExternalModuleReference): ImportEqualsDeclaration - fun updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: Identifier, moduleReference: Identifier): ImportEqualsDeclaration - fun updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: Identifier, moduleReference: QualifiedName): ImportEqualsDeclaration - fun updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: Identifier, moduleReference: ExternalModuleReference): ImportEqualsDeclaration - fun createImportDeclaration(decorators: Array?, modifiers: Array?, importClause: ImportClause?, moduleSpecifier: Expression): ImportDeclaration - fun updateImportDeclaration(node: ImportDeclaration, decorators: Array?, modifiers: Array?, importClause: ImportClause?, moduleSpecifier: Expression): ImportDeclaration - fun createImportClause(isTypeOnly: Boolean, name: Identifier?, namedBindings: NamespaceImport?): ImportClause - fun createImportClause(isTypeOnly: Boolean, name: Identifier?, namedBindings: NamedImports?): ImportClause - fun updateImportClause(node: ImportClause, isTypeOnly: Boolean, name: Identifier?, namedBindings: NamespaceImport?): ImportClause - fun updateImportClause(node: ImportClause, isTypeOnly: Boolean, name: Identifier?, namedBindings: NamedImports?): ImportClause - fun createNamespaceImport(name: Identifier): NamespaceImport - fun updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport - fun createNamespaceExport(name: Identifier): NamespaceExport - fun updateNamespaceExport(node: NamespaceExport, name: Identifier): NamespaceExport - fun createNamedImports(elements: Array): NamedImports - fun updateNamedImports(node: NamedImports, elements: Array): NamedImports - fun createImportSpecifier(propertyName: Identifier?, name: Identifier): ImportSpecifier - fun updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier?, name: Identifier): ImportSpecifier - fun createExportAssignment(decorators: Array?, modifiers: Array?, isExportEquals: Boolean?, expression: Expression): ExportAssignment - fun updateExportAssignment(node: ExportAssignment, decorators: Array?, modifiers: Array?, expression: Expression): ExportAssignment - fun createExportDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, exportClause: NamespaceExport?, moduleSpecifier: Expression = definedExternally): ExportDeclaration - fun createExportDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, exportClause: NamespaceExport?): ExportDeclaration - fun createExportDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, exportClause: NamedExports?, moduleSpecifier: Expression = definedExternally): ExportDeclaration - fun createExportDeclaration(decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, exportClause: NamedExports?): ExportDeclaration - fun updateExportDeclaration(node: ExportDeclaration, decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, exportClause: NamespaceExport?, moduleSpecifier: Expression?): ExportDeclaration - fun updateExportDeclaration(node: ExportDeclaration, decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, exportClause: NamedExports?, moduleSpecifier: Expression?): ExportDeclaration - fun createNamedExports(elements: Array): NamedExports - fun updateNamedExports(node: NamedExports, elements: Array): NamedExports - fun createExportSpecifier(propertyName: String?, name: String): ExportSpecifier - fun createExportSpecifier(propertyName: String?, name: Identifier): ExportSpecifier - fun createExportSpecifier(propertyName: Identifier?, name: String): ExportSpecifier - fun createExportSpecifier(propertyName: Identifier?, name: Identifier): ExportSpecifier - fun updateExportSpecifier(node: ExportSpecifier, propertyName: Identifier?, name: Identifier): ExportSpecifier - fun createExternalModuleReference(expression: Expression): ExternalModuleReference - fun updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference - fun createJSDocAllType(): JSDocAllType - fun createJSDocUnknownType(): JSDocUnknownType - fun createJSDocNonNullableType(type: TypeNode): JSDocNonNullableType - fun updateJSDocNonNullableType(node: JSDocNonNullableType, type: TypeNode): JSDocNonNullableType - fun createJSDocNullableType(type: TypeNode): JSDocNullableType - fun updateJSDocNullableType(node: JSDocNullableType, type: TypeNode): JSDocNullableType - fun createJSDocOptionalType(type: TypeNode): JSDocOptionalType - fun updateJSDocOptionalType(node: JSDocOptionalType, type: TypeNode): JSDocOptionalType - fun createJSDocFunctionType(parameters: Array, type: TypeNode?): JSDocFunctionType - fun updateJSDocFunctionType(node: JSDocFunctionType, parameters: Array, type: TypeNode?): JSDocFunctionType - fun createJSDocVariadicType(type: TypeNode): JSDocVariadicType - fun updateJSDocVariadicType(node: JSDocVariadicType, type: TypeNode): JSDocVariadicType - fun createJSDocNamepathType(type: TypeNode): JSDocNamepathType - fun updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType - fun createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression - fun updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression - fun createJSDocNameReference(name: Identifier): JSDocNameReference - fun createJSDocNameReference(name: QualifiedName): JSDocNameReference - fun createJSDocNameReference(name: JSDocMemberName): JSDocNameReference - fun updateJSDocNameReference(node: JSDocNameReference, name: Identifier): JSDocNameReference - fun updateJSDocNameReference(node: JSDocNameReference, name: QualifiedName): JSDocNameReference - fun updateJSDocNameReference(node: JSDocNameReference, name: JSDocMemberName): JSDocNameReference - fun createJSDocMemberName(left: Identifier, right: Identifier): JSDocMemberName - fun createJSDocMemberName(left: QualifiedName, right: Identifier): JSDocMemberName - fun createJSDocMemberName(left: JSDocMemberName, right: Identifier): JSDocMemberName - fun updateJSDocMemberName(node: JSDocMemberName, left: Identifier, right: Identifier): JSDocMemberName - fun updateJSDocMemberName(node: JSDocMemberName, left: QualifiedName, right: Identifier): JSDocMemberName - fun updateJSDocMemberName(node: JSDocMemberName, left: JSDocMemberName, right: Identifier): JSDocMemberName - fun createJSDocLink(name: Identifier?, text: String): JSDocLink - fun createJSDocLink(name: QualifiedName?, text: String): JSDocLink - fun createJSDocLink(name: JSDocMemberName?, text: String): JSDocLink - fun updateJSDocLink(node: JSDocLink, name: Identifier?, text: String): JSDocLink - fun updateJSDocLink(node: JSDocLink, name: QualifiedName?, text: String): JSDocLink - fun updateJSDocLink(node: JSDocLink, name: JSDocMemberName?, text: String): JSDocLink - fun createJSDocLinkCode(name: Identifier?, text: String): JSDocLinkCode - fun createJSDocLinkCode(name: QualifiedName?, text: String): JSDocLinkCode - fun createJSDocLinkCode(name: JSDocMemberName?, text: String): JSDocLinkCode - fun updateJSDocLinkCode(node: JSDocLinkCode, name: Identifier?, text: String): JSDocLinkCode - fun updateJSDocLinkCode(node: JSDocLinkCode, name: QualifiedName?, text: String): JSDocLinkCode - fun updateJSDocLinkCode(node: JSDocLinkCode, name: JSDocMemberName?, text: String): JSDocLinkCode - fun createJSDocLinkPlain(name: Identifier?, text: String): JSDocLinkPlain - fun createJSDocLinkPlain(name: QualifiedName?, text: String): JSDocLinkPlain - fun createJSDocLinkPlain(name: JSDocMemberName?, text: String): JSDocLinkPlain - fun updateJSDocLinkPlain(node: JSDocLinkPlain, name: Identifier?, text: String): JSDocLinkPlain - fun updateJSDocLinkPlain(node: JSDocLinkPlain, name: QualifiedName?, text: String): JSDocLinkPlain - fun updateJSDocLinkPlain(node: JSDocLinkPlain, name: JSDocMemberName?, text: String): JSDocLinkPlain - fun createJSDocTypeLiteral(jsDocPropertyTags: Array = definedExternally, isArrayType: Boolean = definedExternally): JSDocTypeLiteral - fun updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: Array?, isArrayType: Boolean?): JSDocTypeLiteral - fun createJSDocSignature(typeParameters: Array?, parameters: Array, type: JSDocReturnTag = definedExternally): JSDocSignature - fun updateJSDocSignature(node: JSDocSignature, typeParameters: Array?, parameters: Array, type: JSDocReturnTag?): JSDocSignature - fun createJSDocTemplateTag(tagName: Identifier?, constraint: JSDocTypeExpression?, typeParameters: Array, comment: String = definedExternally): JSDocTemplateTag - fun createJSDocTemplateTag(tagName: Identifier?, constraint: JSDocTypeExpression?, typeParameters: Array): JSDocTemplateTag - fun createJSDocTemplateTag(tagName: Identifier?, constraint: JSDocTypeExpression?, typeParameters: Array, comment: NodeArray = definedExternally): JSDocTemplateTag - fun updateJSDocTemplateTag(node: JSDocTemplateTag, tagName: Identifier?, constraint: JSDocTypeExpression?, typeParameters: Array, comment: String?): JSDocTemplateTag - fun updateJSDocTemplateTag(node: JSDocTemplateTag, tagName: Identifier?, constraint: JSDocTypeExpression?, typeParameters: Array, comment: NodeArray?): JSDocTemplateTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally, fullName: Identifier = definedExternally, comment: String = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally, fullName: Identifier = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally, fullName: Identifier = definedExternally, comment: NodeArray = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally, fullName: JSDocNamespaceDeclaration = definedExternally, comment: String = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally, fullName: JSDocNamespaceDeclaration = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally, fullName: JSDocNamespaceDeclaration = definedExternally, comment: NodeArray = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeLiteral = definedExternally, fullName: Identifier = definedExternally, comment: String = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeLiteral = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeLiteral = definedExternally, fullName: Identifier = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeLiteral = definedExternally, fullName: Identifier = definedExternally, comment: NodeArray = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeLiteral = definedExternally, fullName: JSDocNamespaceDeclaration = definedExternally, comment: String = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeLiteral = definedExternally, fullName: JSDocNamespaceDeclaration = definedExternally): JSDocTypedefTag - fun createJSDocTypedefTag(tagName: Identifier?, typeExpression: JSDocTypeLiteral = definedExternally, fullName: JSDocNamespaceDeclaration = definedExternally, comment: NodeArray = definedExternally): JSDocTypedefTag - fun updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier?, typeExpression: JSDocTypeExpression?, fullName: Identifier?, comment: String?): JSDocTypedefTag - fun updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier?, typeExpression: JSDocTypeExpression?, fullName: Identifier?, comment: NodeArray?): JSDocTypedefTag - fun updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier?, typeExpression: JSDocTypeExpression?, fullName: JSDocNamespaceDeclaration?, comment: String?): JSDocTypedefTag - fun updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier?, typeExpression: JSDocTypeExpression?, fullName: JSDocNamespaceDeclaration?, comment: NodeArray?): JSDocTypedefTag - fun updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier?, typeExpression: JSDocTypeLiteral?, fullName: Identifier?, comment: String?): JSDocTypedefTag - fun updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier?, typeExpression: JSDocTypeLiteral?, fullName: Identifier?, comment: NodeArray?): JSDocTypedefTag - fun updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier?, typeExpression: JSDocTypeLiteral?, fullName: JSDocNamespaceDeclaration?, comment: String?): JSDocTypedefTag - fun updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier?, typeExpression: JSDocTypeLiteral?, fullName: JSDocNamespaceDeclaration?, comment: NodeArray?): JSDocTypedefTag - fun createJSDocParameterTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally, comment: String = definedExternally): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally, comment: NodeArray = definedExternally): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally, comment: String = definedExternally): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally): JSDocParameterTag - fun createJSDocParameterTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally, comment: NodeArray = definedExternally): JSDocParameterTag - fun updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean, comment: String?): JSDocParameterTag - fun updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean, comment: NodeArray?): JSDocParameterTag - fun updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean, comment: String?): JSDocParameterTag - fun updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean, comment: NodeArray?): JSDocParameterTag - fun createJSDocPropertyTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally, comment: String = definedExternally): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally, comment: NodeArray = definedExternally): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally, comment: String = definedExternally): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally): JSDocPropertyTag - fun createJSDocPropertyTag(tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression = definedExternally, isNameFirst: Boolean = definedExternally, comment: NodeArray = definedExternally): JSDocPropertyTag - fun updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean, comment: String?): JSDocPropertyTag - fun updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier?, name: Identifier, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean, comment: NodeArray?): JSDocPropertyTag - fun updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean, comment: String?): JSDocPropertyTag - fun updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier?, name: QualifiedName, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean, comment: NodeArray?): JSDocPropertyTag - fun createJSDocTypeTag(tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: String = definedExternally): JSDocTypeTag - fun createJSDocTypeTag(tagName: Identifier?, typeExpression: JSDocTypeExpression): JSDocTypeTag - fun createJSDocTypeTag(tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: NodeArray = definedExternally): JSDocTypeTag - fun updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: String?): JSDocTypeTag - fun updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: NodeArray?): JSDocTypeTag - fun createJSDocSeeTag(tagName: Identifier?, nameExpression: JSDocNameReference?, comment: String = definedExternally): JSDocSeeTag - fun createJSDocSeeTag(tagName: Identifier?, nameExpression: JSDocNameReference?): JSDocSeeTag - fun createJSDocSeeTag(tagName: Identifier?, nameExpression: JSDocNameReference?, comment: NodeArray = definedExternally): JSDocSeeTag - fun updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier?, nameExpression: JSDocNameReference?, comment: String = definedExternally): JSDocSeeTag - fun updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier?, nameExpression: JSDocNameReference?): JSDocSeeTag - fun updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier?, nameExpression: JSDocNameReference?, comment: NodeArray = definedExternally): JSDocSeeTag - fun createJSDocReturnTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally, comment: String = definedExternally): JSDocReturnTag - fun createJSDocReturnTag(tagName: Identifier?): JSDocReturnTag - fun createJSDocReturnTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally): JSDocReturnTag - fun createJSDocReturnTag(tagName: Identifier?, typeExpression: JSDocTypeExpression = definedExternally, comment: NodeArray = definedExternally): JSDocReturnTag - fun updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier?, typeExpression: JSDocTypeExpression?, comment: String?): JSDocReturnTag - fun updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier?, typeExpression: JSDocTypeExpression?, comment: NodeArray?): JSDocReturnTag - fun createJSDocThisTag(tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: String = definedExternally): JSDocThisTag - fun createJSDocThisTag(tagName: Identifier?, typeExpression: JSDocTypeExpression): JSDocThisTag - fun createJSDocThisTag(tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: NodeArray = definedExternally): JSDocThisTag - fun updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier?, typeExpression: JSDocTypeExpression?, comment: String?): JSDocThisTag - fun updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier?, typeExpression: JSDocTypeExpression?, comment: NodeArray?): JSDocThisTag - fun createJSDocEnumTag(tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: String = definedExternally): JSDocEnumTag - fun createJSDocEnumTag(tagName: Identifier?, typeExpression: JSDocTypeExpression): JSDocEnumTag - fun createJSDocEnumTag(tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: NodeArray = definedExternally): JSDocEnumTag - fun updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: String?): JSDocEnumTag - fun updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: NodeArray?): JSDocEnumTag - fun createJSDocCallbackTag(tagName: Identifier?, typeExpression: JSDocSignature, fullName: Identifier = definedExternally, comment: String = definedExternally): JSDocCallbackTag - fun createJSDocCallbackTag(tagName: Identifier?, typeExpression: JSDocSignature): JSDocCallbackTag - fun createJSDocCallbackTag(tagName: Identifier?, typeExpression: JSDocSignature, fullName: Identifier = definedExternally): JSDocCallbackTag - fun createJSDocCallbackTag(tagName: Identifier?, typeExpression: JSDocSignature, fullName: Identifier = definedExternally, comment: NodeArray = definedExternally): JSDocCallbackTag - fun createJSDocCallbackTag(tagName: Identifier?, typeExpression: JSDocSignature, fullName: JSDocNamespaceDeclaration = definedExternally, comment: String = definedExternally): JSDocCallbackTag - fun createJSDocCallbackTag(tagName: Identifier?, typeExpression: JSDocSignature, fullName: JSDocNamespaceDeclaration = definedExternally): JSDocCallbackTag - fun createJSDocCallbackTag(tagName: Identifier?, typeExpression: JSDocSignature, fullName: JSDocNamespaceDeclaration = definedExternally, comment: NodeArray = definedExternally): JSDocCallbackTag - fun updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier?, typeExpression: JSDocSignature, fullName: Identifier?, comment: String?): JSDocCallbackTag - fun updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier?, typeExpression: JSDocSignature, fullName: Identifier?, comment: NodeArray?): JSDocCallbackTag - fun updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier?, typeExpression: JSDocSignature, fullName: JSDocNamespaceDeclaration?, comment: String?): JSDocCallbackTag - fun updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier?, typeExpression: JSDocSignature, fullName: JSDocNamespaceDeclaration?, comment: NodeArray?): JSDocCallbackTag - fun createJSDocAugmentsTag(tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: String = definedExternally): JSDocAugmentsTag - fun createJSDocAugmentsTag(tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */): JSDocAugmentsTag - fun createJSDocAugmentsTag(tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: NodeArray = definedExternally): JSDocAugmentsTag - fun updateJSDocAugmentsTag(node: JSDocAugmentsTag, tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: String?): JSDocAugmentsTag - fun updateJSDocAugmentsTag(node: JSDocAugmentsTag, tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: NodeArray?): JSDocAugmentsTag - fun createJSDocImplementsTag(tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: String = definedExternally): JSDocImplementsTag - fun createJSDocImplementsTag(tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */): JSDocImplementsTag - fun createJSDocImplementsTag(tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: NodeArray = definedExternally): JSDocImplementsTag - fun updateJSDocImplementsTag(node: JSDocImplementsTag, tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: String?): JSDocImplementsTag - fun updateJSDocImplementsTag(node: JSDocImplementsTag, tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: NodeArray?): JSDocImplementsTag - fun createJSDocAuthorTag(tagName: Identifier?, comment: String = definedExternally): JSDocAuthorTag - fun createJSDocAuthorTag(tagName: Identifier?): JSDocAuthorTag - fun createJSDocAuthorTag(tagName: Identifier?, comment: NodeArray = definedExternally): JSDocAuthorTag - fun updateJSDocAuthorTag(node: JSDocAuthorTag, tagName: Identifier?, comment: String?): JSDocAuthorTag - fun updateJSDocAuthorTag(node: JSDocAuthorTag, tagName: Identifier?, comment: NodeArray?): JSDocAuthorTag - fun createJSDocClassTag(tagName: Identifier?, comment: String = definedExternally): JSDocClassTag - fun createJSDocClassTag(tagName: Identifier?): JSDocClassTag - fun createJSDocClassTag(tagName: Identifier?, comment: NodeArray = definedExternally): JSDocClassTag - fun updateJSDocClassTag(node: JSDocClassTag, tagName: Identifier?, comment: String?): JSDocClassTag - fun updateJSDocClassTag(node: JSDocClassTag, tagName: Identifier?, comment: NodeArray?): JSDocClassTag - fun createJSDocPublicTag(tagName: Identifier?, comment: String = definedExternally): JSDocPublicTag - fun createJSDocPublicTag(tagName: Identifier?): JSDocPublicTag - fun createJSDocPublicTag(tagName: Identifier?, comment: NodeArray = definedExternally): JSDocPublicTag - fun updateJSDocPublicTag(node: JSDocPublicTag, tagName: Identifier?, comment: String?): JSDocPublicTag - fun updateJSDocPublicTag(node: JSDocPublicTag, tagName: Identifier?, comment: NodeArray?): JSDocPublicTag - fun createJSDocPrivateTag(tagName: Identifier?, comment: String = definedExternally): JSDocPrivateTag - fun createJSDocPrivateTag(tagName: Identifier?): JSDocPrivateTag - fun createJSDocPrivateTag(tagName: Identifier?, comment: NodeArray = definedExternally): JSDocPrivateTag - fun updateJSDocPrivateTag(node: JSDocPrivateTag, tagName: Identifier?, comment: String?): JSDocPrivateTag - fun updateJSDocPrivateTag(node: JSDocPrivateTag, tagName: Identifier?, comment: NodeArray?): JSDocPrivateTag - fun createJSDocProtectedTag(tagName: Identifier?, comment: String = definedExternally): JSDocProtectedTag - fun createJSDocProtectedTag(tagName: Identifier?): JSDocProtectedTag - fun createJSDocProtectedTag(tagName: Identifier?, comment: NodeArray = definedExternally): JSDocProtectedTag - fun updateJSDocProtectedTag(node: JSDocProtectedTag, tagName: Identifier?, comment: String?): JSDocProtectedTag - fun updateJSDocProtectedTag(node: JSDocProtectedTag, tagName: Identifier?, comment: NodeArray?): JSDocProtectedTag - fun createJSDocReadonlyTag(tagName: Identifier?, comment: String = definedExternally): JSDocReadonlyTag - fun createJSDocReadonlyTag(tagName: Identifier?): JSDocReadonlyTag - fun createJSDocReadonlyTag(tagName: Identifier?, comment: NodeArray = definedExternally): JSDocReadonlyTag - fun updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier?, comment: String?): JSDocReadonlyTag - fun updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier?, comment: NodeArray?): JSDocReadonlyTag - fun createJSDocUnknownTag(tagName: Identifier, comment: String = definedExternally): JSDocUnknownTag - fun createJSDocUnknownTag(tagName: Identifier): JSDocUnknownTag - fun createJSDocUnknownTag(tagName: Identifier, comment: NodeArray = definedExternally): JSDocUnknownTag - fun updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: String?): JSDocUnknownTag - fun updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: NodeArray?): JSDocUnknownTag - fun createJSDocDeprecatedTag(tagName: Identifier, comment: String = definedExternally): JSDocDeprecatedTag - fun createJSDocDeprecatedTag(tagName: Identifier): JSDocDeprecatedTag - fun createJSDocDeprecatedTag(tagName: Identifier, comment: NodeArray = definedExternally): JSDocDeprecatedTag - fun updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment: String = definedExternally): JSDocDeprecatedTag - fun updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier): JSDocDeprecatedTag - fun updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment: NodeArray = definedExternally): JSDocDeprecatedTag - fun createJSDocOverrideTag(tagName: Identifier, comment: String = definedExternally): JSDocOverrideTag - fun createJSDocOverrideTag(tagName: Identifier): JSDocOverrideTag - fun createJSDocOverrideTag(tagName: Identifier, comment: NodeArray = definedExternally): JSDocOverrideTag - fun updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment: String = definedExternally): JSDocOverrideTag - fun updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier): JSDocOverrideTag - fun updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment: NodeArray = definedExternally): JSDocOverrideTag - fun createJSDocText(text: String): JSDocText - fun updateJSDocText(node: JSDocText, text: String): JSDocText - fun createJSDocComment(comment: String? = definedExternally, tags: Array? = definedExternally): JSDoc - fun createJSDocComment(): JSDoc - fun createJSDocComment(comment: String? = definedExternally): JSDoc - fun createJSDocComment(comment: NodeArray? = definedExternally, tags: Array? = definedExternally): JSDoc - fun createJSDocComment(comment: NodeArray? = definedExternally): JSDoc - fun updateJSDocComment(node: JSDoc, comment: String?, tags: Array?): JSDoc - fun updateJSDocComment(node: JSDoc, comment: NodeArray?, tags: Array?): JSDoc - fun createJsxElement(openingElement: JsxOpeningElement, children: Array, closingElement: JsxClosingElement): JsxElement - fun updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: Array, closingElement: JsxClosingElement): JsxElement - fun createJsxSelfClosingElement(tagName: Identifier, typeArguments: Array?, attributes: JsxAttributes): JsxSelfClosingElement - fun createJsxSelfClosingElement(tagName: ThisExpression, typeArguments: Array?, attributes: JsxAttributes): JsxSelfClosingElement - fun createJsxSelfClosingElement(tagName: JsxTagNamePropertyAccess, typeArguments: Array?, attributes: JsxAttributes): JsxSelfClosingElement - fun updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: Identifier, typeArguments: Array?, attributes: JsxAttributes): JsxSelfClosingElement - fun updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: ThisExpression, typeArguments: Array?, attributes: JsxAttributes): JsxSelfClosingElement - fun updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNamePropertyAccess, typeArguments: Array?, attributes: JsxAttributes): JsxSelfClosingElement - fun createJsxOpeningElement(tagName: Identifier, typeArguments: Array?, attributes: JsxAttributes): JsxOpeningElement - fun createJsxOpeningElement(tagName: ThisExpression, typeArguments: Array?, attributes: JsxAttributes): JsxOpeningElement - fun createJsxOpeningElement(tagName: JsxTagNamePropertyAccess, typeArguments: Array?, attributes: JsxAttributes): JsxOpeningElement - fun updateJsxOpeningElement(node: JsxOpeningElement, tagName: Identifier, typeArguments: Array?, attributes: JsxAttributes): JsxOpeningElement - fun updateJsxOpeningElement(node: JsxOpeningElement, tagName: ThisExpression, typeArguments: Array?, attributes: JsxAttributes): JsxOpeningElement - fun updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNamePropertyAccess, typeArguments: Array?, attributes: JsxAttributes): JsxOpeningElement - fun createJsxClosingElement(tagName: Identifier): JsxClosingElement - fun createJsxClosingElement(tagName: ThisExpression): JsxClosingElement - fun createJsxClosingElement(tagName: JsxTagNamePropertyAccess): JsxClosingElement - fun updateJsxClosingElement(node: JsxClosingElement, tagName: Identifier): JsxClosingElement - fun updateJsxClosingElement(node: JsxClosingElement, tagName: ThisExpression): JsxClosingElement - fun updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNamePropertyAccess): JsxClosingElement - fun createJsxFragment(openingFragment: JsxOpeningFragment, children: Array, closingFragment: JsxClosingFragment): JsxFragment - fun createJsxText(text: String, containsOnlyTriviaWhiteSpaces: Boolean = definedExternally): JsxText - fun updateJsxText(node: JsxText, text: String, containsOnlyTriviaWhiteSpaces: Boolean = definedExternally): JsxText - fun createJsxOpeningFragment(): JsxOpeningFragment - fun createJsxJsxClosingFragment(): JsxClosingFragment - fun updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: Array, closingFragment: JsxClosingFragment): JsxFragment - fun createJsxAttribute(name: Identifier, initializer: StringLiteral?): JsxAttribute - fun createJsxAttribute(name: Identifier, initializer: JsxExpression?): JsxAttribute - fun updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: StringLiteral?): JsxAttribute - fun updateJsxAttribute(node: JsxAttribute, name: Identifier, initializer: JsxExpression?): JsxAttribute - fun createJsxAttributes(properties: Array): JsxAttributes - fun updateJsxAttributes(node: JsxAttributes, properties: Array): JsxAttributes - fun createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute - fun updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute - fun createJsxExpression(dotDotDotToken: DotDotDotToken?, expression: Expression?): JsxExpression - fun updateJsxExpression(node: JsxExpression, expression: Expression?): JsxExpression - fun createCaseClause(expression: Expression, statements: Array): CaseClause - fun updateCaseClause(node: CaseClause, expression: Expression, statements: Array): CaseClause - fun createDefaultClause(statements: Array): DefaultClause - fun updateDefaultClause(node: DefaultClause, statements: Array): DefaultClause - fun createHeritageClause(token: SyntaxKind.ExtendsKeyword, types: Array): HeritageClause - fun createHeritageClause(token: SyntaxKind.ImplementsKeyword, types: Array): HeritageClause - fun updateHeritageClause(node: HeritageClause, types: Array): HeritageClause - fun createCatchClause(variableDeclaration: String?, block: Block): CatchClause - fun createCatchClause(variableDeclaration: VariableDeclaration?, block: Block): CatchClause - fun updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration?, block: Block): CatchClause - fun createPropertyAssignment(name: String, initializer: Expression): PropertyAssignment - fun createPropertyAssignment(name: Identifier, initializer: Expression): PropertyAssignment - fun createPropertyAssignment(name: StringLiteral, initializer: Expression): PropertyAssignment - fun createPropertyAssignment(name: NumericLiteral, initializer: Expression): PropertyAssignment - fun createPropertyAssignment(name: ComputedPropertyName, initializer: Expression): PropertyAssignment - fun createPropertyAssignment(name: PrivateIdentifier, initializer: Expression): PropertyAssignment - fun updatePropertyAssignment(node: PropertyAssignment, name: Identifier, initializer: Expression): PropertyAssignment - fun updatePropertyAssignment(node: PropertyAssignment, name: StringLiteral, initializer: Expression): PropertyAssignment - fun updatePropertyAssignment(node: PropertyAssignment, name: NumericLiteral, initializer: Expression): PropertyAssignment - fun updatePropertyAssignment(node: PropertyAssignment, name: ComputedPropertyName, initializer: Expression): PropertyAssignment - fun updatePropertyAssignment(node: PropertyAssignment, name: PrivateIdentifier, initializer: Expression): PropertyAssignment - fun createShorthandPropertyAssignment(name: String, objectAssignmentInitializer: Expression = definedExternally): ShorthandPropertyAssignment - fun createShorthandPropertyAssignment(name: String): ShorthandPropertyAssignment - fun createShorthandPropertyAssignment(name: Identifier, objectAssignmentInitializer: Expression = definedExternally): ShorthandPropertyAssignment - fun createShorthandPropertyAssignment(name: Identifier): ShorthandPropertyAssignment - fun updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression?): ShorthandPropertyAssignment - fun createSpreadAssignment(expression: Expression): SpreadAssignment - fun updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment - fun createEnumMember(name: String, initializer: Expression = definedExternally): EnumMember - fun createEnumMember(name: String): EnumMember - fun createEnumMember(name: Identifier, initializer: Expression = definedExternally): EnumMember - fun createEnumMember(name: Identifier): EnumMember - fun createEnumMember(name: StringLiteral, initializer: Expression = definedExternally): EnumMember - fun createEnumMember(name: StringLiteral): EnumMember - fun createEnumMember(name: NumericLiteral, initializer: Expression = definedExternally): EnumMember - fun createEnumMember(name: NumericLiteral): EnumMember - fun createEnumMember(name: ComputedPropertyName, initializer: Expression = definedExternally): EnumMember - fun createEnumMember(name: ComputedPropertyName): EnumMember - fun createEnumMember(name: PrivateIdentifier, initializer: Expression = definedExternally): EnumMember - fun createEnumMember(name: PrivateIdentifier): EnumMember - fun updateEnumMember(node: EnumMember, name: Identifier, initializer: Expression?): EnumMember - fun updateEnumMember(node: EnumMember, name: StringLiteral, initializer: Expression?): EnumMember - fun updateEnumMember(node: EnumMember, name: NumericLiteral, initializer: Expression?): EnumMember - fun updateEnumMember(node: EnumMember, name: ComputedPropertyName, initializer: Expression?): EnumMember - fun updateEnumMember(node: EnumMember, name: PrivateIdentifier, initializer: Expression?): EnumMember - fun createSourceFile(statements: Array, endOfFileToken: Token /* Token & JSDocContainer */, flags: NodeFlags): SourceFile - fun updateSourceFile(node: SourceFile, statements: Array, isDeclarationFile: Boolean = definedExternally, referencedFiles: Array = definedExternally, typeReferences: Array = definedExternally, hasNoDefaultLib: Boolean = definedExternally, libReferences: Array = definedExternally): SourceFile - fun createNotEmittedStatement(original: Node): NotEmittedStatement - fun createPartiallyEmittedExpression(expression: Expression, original: Node = definedExternally): PartiallyEmittedExpression - fun updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression - fun createCommaListExpression(elements: Array): CommaListExpression - fun updateCommaListExpression(node: CommaListExpression, elements: Array): CommaListExpression - fun createBundle(sourceFiles: Array, prepends: Array = definedExternally): Bundle - fun updateBundle(node: Bundle, sourceFiles: Array, prepends: Array = definedExternally): Bundle - fun createComma(left: Expression, right: Expression): BinaryExpression - fun createAssignment(left: ObjectLiteralExpression, right: Expression): dynamic /* ObjectDestructuringAssignment | ArrayDestructuringAssignment */ - fun createAssignment(left: ArrayLiteralExpression, right: Expression): dynamic /* ObjectDestructuringAssignment | ArrayDestructuringAssignment */ - fun createAssignment(left: Expression, right: Expression): AssignmentExpression - fun createLogicalOr(left: Expression, right: Expression): BinaryExpression - fun createLogicalAnd(left: Expression, right: Expression): BinaryExpression - fun createBitwiseOr(left: Expression, right: Expression): BinaryExpression - fun createBitwiseXor(left: Expression, right: Expression): BinaryExpression - fun createBitwiseAnd(left: Expression, right: Expression): BinaryExpression - fun createStrictEquality(left: Expression, right: Expression): BinaryExpression - fun createStrictInequality(left: Expression, right: Expression): BinaryExpression - fun createEquality(left: Expression, right: Expression): BinaryExpression - fun createInequality(left: Expression, right: Expression): BinaryExpression - fun createLessThan(left: Expression, right: Expression): BinaryExpression - fun createLessThanEquals(left: Expression, right: Expression): BinaryExpression - fun createGreaterThan(left: Expression, right: Expression): BinaryExpression - fun createGreaterThanEquals(left: Expression, right: Expression): BinaryExpression - fun createLeftShift(left: Expression, right: Expression): BinaryExpression - fun createRightShift(left: Expression, right: Expression): BinaryExpression - fun createUnsignedRightShift(left: Expression, right: Expression): BinaryExpression - fun createAdd(left: Expression, right: Expression): BinaryExpression - fun createSubtract(left: Expression, right: Expression): BinaryExpression - fun createMultiply(left: Expression, right: Expression): BinaryExpression - fun createDivide(left: Expression, right: Expression): BinaryExpression - fun createModulo(left: Expression, right: Expression): BinaryExpression - fun createExponent(left: Expression, right: Expression): BinaryExpression - fun createPrefixPlus(operand: Expression): PrefixUnaryExpression - fun createPrefixMinus(operand: Expression): PrefixUnaryExpression - fun createPrefixIncrement(operand: Expression): PrefixUnaryExpression - fun createPrefixDecrement(operand: Expression): PrefixUnaryExpression - fun createBitwiseNot(operand: Expression): PrefixUnaryExpression - fun createLogicalNot(operand: Expression): PrefixUnaryExpression - fun createPostfixIncrement(operand: Expression): PostfixUnaryExpression - fun createPostfixDecrement(operand: Expression): PostfixUnaryExpression - fun createImmediatelyInvokedFunctionExpression(statements: Array): CallExpression - fun createImmediatelyInvokedFunctionExpression(statements: Array, param: ParameterDeclaration, paramValue: Expression): CallExpression - fun createImmediatelyInvokedArrowFunction(statements: Array): CallExpression - fun createImmediatelyInvokedArrowFunction(statements: Array, param: ParameterDeclaration, paramValue: Expression): CallExpression - fun createVoidZero(): VoidExpression - fun createExportDefault(expression: Expression): ExportAssignment - fun createExternalModuleExport(exportName: Identifier): ExportDeclaration - fun restoreOuterExpressions(outerExpression: Expression?, innerExpression: Expression, kinds: OuterExpressionKinds = definedExternally): Expression -} - -external interface CoreTransformationContext { - var factory: NodeFactory - fun getCompilerOptions(): CompilerOptions - fun startLexicalEnvironment() - fun suspendLexicalEnvironment() - fun resumeLexicalEnvironment() - fun endLexicalEnvironment(): Array? - fun hoistFunctionDeclaration(node: FunctionDeclaration) - fun hoistVariableDeclaration(node: Identifier) -} - -external interface TransformationContext : CoreTransformationContext { - fun requestEmitHelper(helper: ScopedEmitHelper) - fun requestEmitHelper(helper: UnscopedEmitHelper) - fun readEmitHelpers(): Array? - fun enableSubstitution(kind: SyntaxKind) - fun isSubstitutionEnabled(node: Node): Boolean - var onSubstituteNode: (hint: EmitHint, node: Node) -> Node - fun enableEmitNotification(kind: SyntaxKind) - fun isEmitNotificationEnabled(node: Node): Boolean - var onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) -> Unit) -> Unit -} - -external interface TransformationResult { - var transformed: Array - var diagnostics: Array? - get() = definedExternally - set(value) = definedExternally - fun substituteNode(hint: EmitHint, node: Node): Node - fun emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) -> Unit) - val isEmitNotificationEnabled: ((node: Node) -> Boolean)? - fun dispose() -} - -external interface NodeVisitor { - @nativeInvoke - operator fun invoke(nodes: T, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, lift: (node: Array) -> T = definedExternally): T - @nativeInvoke - operator fun invoke(nodes: T, visitor: Visitor?): T - @nativeInvoke - operator fun invoke(nodes: T, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally): T - @nativeInvoke - operator fun invoke(nodes: T?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, lift: (node: Array) -> T = definedExternally): T? - @nativeInvoke - operator fun invoke(nodes: T?, visitor: Visitor?): T? - @nativeInvoke - operator fun invoke(nodes: T?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally): T? -} - -external interface NodesVisitor { - @nativeInvoke - operator fun invoke(nodes: NodeArray, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, start: Number = definedExternally, count: Number = definedExternally): NodeArray - @nativeInvoke - operator fun invoke(nodes: NodeArray, visitor: Visitor?): NodeArray - @nativeInvoke - operator fun invoke(nodes: NodeArray, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally): NodeArray - @nativeInvoke - operator fun invoke(nodes: NodeArray, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, start: Number = definedExternally): NodeArray - @nativeInvoke - operator fun invoke(nodes: NodeArray?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, start: Number = definedExternally, count: Number = definedExternally): NodeArray? - @nativeInvoke - operator fun invoke(nodes: NodeArray?, visitor: Visitor?): NodeArray? - @nativeInvoke - operator fun invoke(nodes: NodeArray?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally): NodeArray? - @nativeInvoke - operator fun invoke(nodes: NodeArray?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, start: Number = definedExternally): NodeArray? -} - -external interface Printer { - fun printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): String - fun printList(format: ListFormat, list: NodeArray, sourceFile: SourceFile): String - fun printFile(sourceFile: SourceFile): String - fun printBundle(bundle: Bundle): String -} - -external interface PrintHandlers { - val hasGlobalName: ((name: String) -> Boolean)? - val onEmitNode: ((hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) -> Unit) -> Unit)? - val isEmitNotificationEnabled: ((node: Node) -> Boolean)? - val substituteNode: ((hint: EmitHint, node: Node) -> Node)? -} - -external interface PrinterOptions { - var removeComments: Boolean? - get() = definedExternally - set(value) = definedExternally - var newLine: NewLineKind? - get() = definedExternally - set(value) = definedExternally - var omitTrailingSemicolon: Boolean? - get() = definedExternally - set(value) = definedExternally - var noEmitHelpers: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface GetEffectiveTypeRootsHost { - val directoryExists: ((directoryName: String) -> Boolean)? - val getCurrentDirectory: (() -> String)? -} - -external interface TextSpan { - var start: Number - var length: Number -} - -external interface TextChangeRange { - var span: TextSpan - var newLength: Number -} - -external interface SyntaxList : Node { - var _children: Array -} - -external enum class ListFormat { - None /* = 0 */, - SingleLine /* = 0 */, - MultiLine /* = 1 */, - PreserveLines /* = 2 */, - LinesMask /* = 3 */, - NotDelimited /* = 0 */, - BarDelimited /* = 4 */, - AmpersandDelimited /* = 8 */, - CommaDelimited /* = 16 */, - AsteriskDelimited /* = 32 */, - DelimitersMask /* = 60 */, - AllowTrailingComma /* = 64 */, - Indented /* = 128 */, - SpaceBetweenBraces /* = 256 */, - SpaceBetweenSiblings /* = 512 */, - Braces /* = 1024 */, - Parenthesis /* = 2048 */, - AngleBrackets /* = 4096 */, - SquareBrackets /* = 8192 */, - BracketsMask /* = 15360 */, - OptionalIfUndefined /* = 16384 */, - OptionalIfEmpty /* = 32768 */, - Optional /* = 49152 */, - PreferNewLine /* = 65536 */, - NoTrailingNewLine /* = 131072 */, - NoInterveningComments /* = 262144 */, - NoSpaceIfEmpty /* = 524288 */, - SingleElement /* = 1048576 */, - SpaceAfterList /* = 2097152 */, - Modifiers /* = 262656 */, - HeritageClauses /* = 512 */, - SingleLineTypeLiteralMembers /* = 768 */, - MultiLineTypeLiteralMembers /* = 32897 */, - SingleLineTupleTypeElements /* = 528 */, - MultiLineTupleTypeElements /* = 657 */, - UnionTypeConstituents /* = 516 */, - IntersectionTypeConstituents /* = 520 */, - ObjectBindingPatternElements /* = 525136 */, - ArrayBindingPatternElements /* = 524880 */, - ObjectLiteralExpressionProperties /* = 526226 */, - ArrayLiteralExpressionElements /* = 8914 */, - CommaListElements /* = 528 */, - CallExpressionArguments /* = 2576 */, - NewExpressionArguments /* = 18960 */, - TemplateExpressionSpans /* = 262144 */, - SingleLineBlockStatements /* = 768 */, - MultiLineBlockStatements /* = 129 */, - VariableDeclarationList /* = 528 */, - SingleLineFunctionBodyStatements /* = 768 */, - MultiLineFunctionBodyStatements /* = 1 */, - ClassHeritageClauses /* = 0 */, - ClassMembers /* = 129 */, - InterfaceMembers /* = 129 */, - EnumMembers /* = 145 */, - CaseBlockClauses /* = 129 */, - NamedImportsOrExportsElements /* = 525136 */, - JsxElementOrFragmentChildren /* = 262144 */, - JsxElementAttributes /* = 262656 */, - CaseOrDefaultClauseStatements /* = 163969 */, - HeritageClauseTypes /* = 528 */, - SourceFileStatements /* = 131073 */, - Decorators /* = 2146305 */, - TypeArguments /* = 53776 */, - TypeParameters /* = 53776 */, - Parameters /* = 2576 */, - IndexSignatureParameters /* = 8848 */, - JSDocComment /* = 33 */ -} - -external interface UserPreferences { - var disableSuggestions: Boolean? - get() = definedExternally - set(value) = definedExternally - var quotePreference: String? /* "auto" | "double" | "single" */ - get() = definedExternally - set(value) = definedExternally - var includeCompletionsForModuleExports: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeCompletionsForImportStatements: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeCompletionsWithSnippetText: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeAutomaticOptionalChainCompletions: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeCompletionsWithInsertText: Boolean? - get() = definedExternally - set(value) = definedExternally - var allowIncompleteCompletions: Boolean? - get() = definedExternally - set(value) = definedExternally - var importModuleSpecifierPreference: String? /* "shortest" | "project-relative" | "relative" | "non-relative" */ - get() = definedExternally - set(value) = definedExternally - var importModuleSpecifierEnding: String? /* "auto" | "minimal" | "index" | "js" */ - get() = definedExternally - set(value) = definedExternally - var allowTextChangesInNewFiles: Boolean? - get() = definedExternally - set(value) = definedExternally - var providePrefixAndSuffixTextForRename: Boolean? - get() = definedExternally - set(value) = definedExternally - var includePackageJsonAutoImports: String? /* "auto" | "on" | "off" */ - get() = definedExternally - set(value) = definedExternally - var provideRefactorNotApplicableReason: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface PseudoBigInt { - var negative: Boolean - var base10Value: String -} - -external enum class FileWatcherEventKind { - Created /* = 0 */, - Changed /* = 1 */, - Deleted /* = 2 */ -} - -external interface System { - var args: Array - var newLine: String - var useCaseSensitiveFileNames: Boolean - fun write(s: String) - val writeOutputIsTTY: (() -> Boolean)? - val getWidthOfTerminal: (() -> Number)? - fun readFile(path: String, encoding: String = definedExternally): String? - val getFileSize: ((path: String) -> Number)? - fun writeFile(path: String, data: String, writeByteOrderMark: Boolean = definedExternally) - val watchFile: ((path: String, callback: FileWatcherCallback, pollingInterval: Number, options: WatchOptions) -> FileWatcher)? - val watchDirectory: ((path: String, callback: DirectoryWatcherCallback, recursive: Boolean, options: WatchOptions) -> FileWatcher)? - fun resolvePath(path: String): String - fun fileExists(path: String): Boolean - fun directoryExists(path: String): Boolean - fun createDirectory(path: String) - fun getExecutingFilePath(): String - fun getCurrentDirectory(): String - fun getDirectories(path: String): Array - fun readDirectory(path: String, extensions: Array = definedExternally, exclude: Array = definedExternally, include: Array = definedExternally, depth: Number = definedExternally): Array - val getModifiedTime: ((path: String) -> Date?)? - val setModifiedTime: ((path: String, time: Date) -> Unit)? - val deleteFile: ((path: String) -> Unit)? - val createHash: ((data: String) -> String)? - val createSHA256Hash: ((data: String) -> String)? - val getMemoryUsage: (() -> Number)? - fun exit(exitCode: Number = definedExternally) - val realpath: ((path: String) -> String)? - val setTimeout: ((callback: (args: Any) -> Unit, ms: Number, args: Any) -> Any)? - val clearTimeout: ((timeoutId: Any) -> Unit)? - val clearScreen: (() -> Unit)? - val base64decode: ((input: String) -> String)? - val base64encode: ((input: String) -> String)? -} - -external interface FileWatcher { - fun close() -} - -external fun getNodeMajorVersion(): Number? - -external var sys: System - -external interface Scanner { - fun getStartPos(): Number - fun getToken(): SyntaxKind - fun getTextPos(): Number - fun getTokenPos(): Number - fun getTokenText(): String - fun getTokenValue(): String - fun hasUnicodeEscape(): Boolean - fun hasExtendedUnicodeEscape(): Boolean - fun hasPrecedingLineBreak(): Boolean - fun isIdentifier(): Boolean - fun isReservedWord(): Boolean - fun isUnterminated(): Boolean - fun reScanGreaterToken(): SyntaxKind - fun reScanSlashToken(): SyntaxKind - fun reScanAsteriskEqualsToken(): SyntaxKind - fun reScanTemplateToken(isTaggedTemplate: Boolean): SyntaxKind - fun reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind - fun scanJsxIdentifier(): SyntaxKind - fun scanJsxAttributeValue(): SyntaxKind - fun reScanJsxAttributeValue(): SyntaxKind - fun reScanJsxToken(allowMultilineJsxText: Boolean = definedExternally): dynamic /* SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken */ - fun reScanLessThanToken(): SyntaxKind - fun reScanHashToken(): SyntaxKind - fun reScanQuestionToken(): SyntaxKind - fun reScanInvalidIdentifier(): SyntaxKind - fun scanJsxToken(): dynamic /* SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken */ - fun scanJsDocToken(): dynamic /* SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword */ - fun scan(): SyntaxKind - fun getText(): String - fun setText(text: String?, start: Number = definedExternally, length: Number = definedExternally) - fun setOnError(onError: ErrorCallback?) - fun setScriptTarget(scriptTarget: ScriptTarget) - fun setLanguageVariant(variant: LanguageVariant) - fun setTextPos(textPos: Number) - fun lookAhead(callback: () -> T): T - fun scanRange(start: Number, length: Number, callback: () -> T): T - fun tryScan(callback: () -> T): T -} - -external fun tokenToString(t: SyntaxKind): String? - -external fun getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: Number, character: Number): Number - -external fun getLineAndCharacterOfPosition(sourceFile: SourceFileLike, position: Number): LineAndCharacter - -external fun isWhiteSpaceLike(ch: Number): Boolean - -external fun isWhiteSpaceSingleLine(ch: Number): Boolean - -external fun isLineBreak(ch: Number): Boolean - -external fun couldStartTrivia(text: String, pos: Number): Boolean - -external fun forEachLeadingCommentRange(text: String, pos: Number, cb: (pos: Number, end: Number, kind: Any /* SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia */, hasTrailingNewLine: Boolean) -> U): U? - -external fun forEachLeadingCommentRange(text: String, pos: Number, cb: (pos: Number, end: Number, kind: Any /* SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia */, hasTrailingNewLine: Boolean, state: T) -> U, state: T): U? - -external fun forEachTrailingCommentRange(text: String, pos: Number, cb: (pos: Number, end: Number, kind: Any /* SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia */, hasTrailingNewLine: Boolean) -> U): U? - -external fun forEachTrailingCommentRange(text: String, pos: Number, cb: (pos: Number, end: Number, kind: Any /* SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia */, hasTrailingNewLine: Boolean, state: T) -> U, state: T): U? - -external fun reduceEachLeadingCommentRange(text: String, pos: Number, cb: (pos: Number, end: Number, kind: Any /* SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia */, hasTrailingNewLine: Boolean, state: T, memo: U) -> U, state: T, initial: U): U? - -external fun reduceEachTrailingCommentRange(text: String, pos: Number, cb: (pos: Number, end: Number, kind: Any /* SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia */, hasTrailingNewLine: Boolean, state: T, memo: U) -> U, state: T, initial: U): U? - -external fun getLeadingCommentRanges(text: String, pos: Number): Array? - -external fun getTrailingCommentRanges(text: String, pos: Number): Array? - -external fun getShebang(text: String): String? - -external fun isIdentifierStart(ch: Number, languageVersion: ScriptTarget?): Boolean - -external fun isIdentifierPart(ch: Number, languageVersion: ScriptTarget?, identifierVariant: LanguageVariant = definedExternally): Boolean - -external fun createScanner(languageVersion: ScriptTarget, skipTrivia: Boolean, languageVariant: LanguageVariant = definedExternally, textInitial: String = definedExternally, onError: ErrorCallback = definedExternally, start: Number = definedExternally, length: Number = definedExternally): Scanner - -external fun isExternalModuleNameRelative(moduleName: String): Boolean - -external fun sortAndDeduplicateDiagnostics(diagnostics: Array): SortedReadonlyArray - -external fun getDefaultLibFileName(options: CompilerOptions): String - -external fun textSpanEnd(span: TextSpan): Number - -external fun textSpanIsEmpty(span: TextSpan): Boolean - -external fun textSpanContainsPosition(span: TextSpan, position: Number): Boolean - -external fun textSpanContainsTextSpan(span: TextSpan, other: TextSpan): Boolean - -external fun textSpanOverlapsWith(span: TextSpan, other: TextSpan): Boolean - -external fun textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan? - -external fun textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): Boolean - -external fun textSpanIntersectsWith(span: TextSpan, start: Number, length: Number): Boolean - -external fun decodedTextSpanIntersectsWith(start1: Number, length1: Number, start2: Number, length2: Number): Boolean - -external fun textSpanIntersectsWithPosition(span: TextSpan, position: Number): Boolean - -external fun textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan? - -external fun createTextSpan(start: Number, length: Number): TextSpan - -external fun createTextSpanFromBounds(start: Number, end: Number): TextSpan - -external fun textChangeRangeNewSpan(range: TextChangeRange): TextSpan - -external fun textChangeRangeIsUnchanged(range: TextChangeRange): Boolean - -external fun createTextChangeRange(span: TextSpan, newLength: Number): TextChangeRange - -external var unchangedTextChangeRange: TextChangeRange - -external fun collapseTextChangeRangesAcrossMultipleVersions(changes: Array): TextChangeRange - -external fun getTypeParameterOwner(d: Declaration): Declaration? - -external interface `T$23` { - var parent: ConstructorDeclaration - var name: Identifier -} - -external fun isParameterPropertyDeclaration(node: Node, parent: Node): Boolean - -external fun isEmptyBindingPattern(node: Identifier): Boolean - -external fun isEmptyBindingPattern(node: ObjectBindingPattern): Boolean - -external fun isEmptyBindingPattern(node: ArrayBindingPattern): Boolean - -external fun isEmptyBindingElement(node: BindingElement): Boolean - -external fun walkUpBindingElementsAndPatterns(binding: BindingElement): dynamic /* VariableDeclaration | ParameterDeclaration */ - -external fun getCombinedModifierFlags(node: Declaration): ModifierFlags - -external fun getCombinedNodeFlags(node: Node): NodeFlags - -external interface `T$24` { - fun getExecutingFilePath(): String - fun resolvePath(path: String): String - fun fileExists(fileName: String): Boolean - fun readFile(fileName: String): String? -} - -external fun validateLocaleAndSetLanguage(locale: String, sys: `T$24`, errors: Push = definedExternally) - -external fun getOriginalNode(node: Node): Node - -external fun getOriginalNode(node: Node, nodeTest: (node: Node) -> Boolean): T - -external fun getOriginalNode(node: Node?): Node? - -external fun getOriginalNode(node: Node?, nodeTest: (node: Node?) -> Boolean): T? - -external fun findAncestor(node: Node?, callback: (element: Node) -> Boolean): T? - -external fun findAncestor(node: Node?, callback: (element: Node) -> Any): Node? - -external fun isParseTreeNode(node: Node): Boolean - -external fun getParseTreeNode(node: Node?): Node? - -external fun getParseTreeNode(node: T?, nodeTest: (node: Node) -> Boolean = definedExternally): T? - -external fun getParseTreeNode(node: T?): T? - -external fun escapeLeadingUnderscores(identifier: String): dynamic /* String & `T$8` | Unit & `T$8` | InternalSymbolName */ - -external fun unescapeLeadingUnderscores(identifier: String /* String & `T$8` */): String - -external fun unescapeLeadingUnderscores(identifier: Unit /* Unit & `T$8` */): String - -external fun unescapeLeadingUnderscores(identifier: InternalSymbolName): String - -external fun idText(identifierOrPrivateName: Identifier): String - -external fun idText(identifierOrPrivateName: PrivateIdentifier): String - -external fun symbolName(symbol: Symbol): String - -external fun getNameOfJSDocTypedef(declaration: JSDocTypedefTag): dynamic /* Identifier? | PrivateIdentifier? */ - -external fun getNameOfDeclaration(declaration: Declaration?): dynamic /* Identifier? | PrivateIdentifier? | StringLiteral? | NoSubstitutionTemplateLiteral? | NumericLiteral? | ComputedPropertyName? | ElementAccessExpression? | ObjectBindingPattern? | ArrayBindingPattern? | PropertyAccessEntityNameExpression? */ - -external fun getNameOfDeclaration(declaration: Expression?): dynamic /* Identifier? | PrivateIdentifier? | StringLiteral? | NoSubstitutionTemplateLiteral? | NumericLiteral? | ComputedPropertyName? | ElementAccessExpression? | ObjectBindingPattern? | ArrayBindingPattern? | PropertyAccessEntityNameExpression? */ - -external fun getJSDocParameterTags(param: ParameterDeclaration): Array - -external fun getJSDocTypeParameterTags(param: TypeParameterDeclaration): Array - -external fun hasJSDocParameterTags(node: FunctionDeclaration): Boolean - -external fun hasJSDocParameterTags(node: MethodDeclaration): Boolean - -external fun hasJSDocParameterTags(node: GetAccessorDeclaration): Boolean - -external fun hasJSDocParameterTags(node: SetAccessorDeclaration): Boolean - -external fun hasJSDocParameterTags(node: ConstructorDeclaration): Boolean - -external fun hasJSDocParameterTags(node: FunctionExpression): Boolean - -external fun hasJSDocParameterTags(node: ArrowFunction): Boolean - -external fun hasJSDocParameterTags(node: CallSignatureDeclaration): Boolean - -external fun hasJSDocParameterTags(node: ConstructSignatureDeclaration): Boolean - -external fun hasJSDocParameterTags(node: MethodSignature): Boolean - -external fun hasJSDocParameterTags(node: IndexSignatureDeclaration): Boolean - -external fun hasJSDocParameterTags(node: FunctionTypeNode): Boolean - -external fun hasJSDocParameterTags(node: ConstructorTypeNode): Boolean - -external fun hasJSDocParameterTags(node: JSDocFunctionType): Boolean - -external fun getJSDocAugmentsTag(node: Node): JSDocAugmentsTag? - -external fun getJSDocImplementsTags(node: Node): Array - -external fun getJSDocClassTag(node: Node): JSDocClassTag? - -external fun getJSDocPublicTag(node: Node): JSDocPublicTag? - -external fun getJSDocPrivateTag(node: Node): JSDocPrivateTag? - -external fun getJSDocProtectedTag(node: Node): JSDocProtectedTag? - -external fun getJSDocReadonlyTag(node: Node): JSDocReadonlyTag? - -external fun getJSDocOverrideTagNoCache(node: Node): JSDocOverrideTag? - -external fun getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag? - -external fun getJSDocEnumTag(node: Node): JSDocEnumTag? - -external fun getJSDocThisTag(node: Node): JSDocThisTag? - -external fun getJSDocReturnTag(node: Node): JSDocReturnTag? - -external fun getJSDocTemplateTag(node: Node): JSDocTemplateTag? - -external fun getJSDocTypeTag(node: Node): JSDocTypeTag? - -external fun getJSDocType(node: Node): TypeNode? - -external fun getJSDocReturnType(node: Node): TypeNode? - -external fun getJSDocTags(node: Node): Array - -external fun getAllJSDocTags(node: Node, predicate: (tag: JSDocTag) -> Boolean): Array - -external fun getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): Array - -external fun getTextOfJSDocComment(comment: String = definedExternally): String? - -external fun getTextOfJSDocComment(): String? - -external fun getTextOfJSDocComment(comment: NodeArray = definedExternally): String? - -external fun getEffectiveTypeParameterDeclarations(node: Any /* CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction | ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature */): Array - -external fun getEffectiveConstraintOfTypeParameter(node: TypeParameterDeclaration): TypeNode? - -external fun isMemberName(node: Node): Boolean - -external fun isPropertyAccessChain(node: Node): Boolean - -external fun isElementAccessChain(node: Node): Boolean - -external fun isCallChain(node: Node): Boolean - -external fun isOptionalChain(node: Node): Boolean - -external fun isNullishCoalesce(node: Node): Boolean - -external fun isConstTypeReference(node: Node): Boolean - -external fun skipPartiallyEmittedExpressions(node: Expression): Expression - -external fun skipPartiallyEmittedExpressions(node: Node): Node - -external fun isNonNullChain(node: Node): Boolean - -external fun isBreakOrContinueStatement(node: Node): Boolean - -external fun isNamedExportBindings(node: Node): Boolean - -external fun isUnparsedTextLike(node: Node): Boolean - -external fun isUnparsedNode(node: Node): Boolean - -external fun isJSDocPropertyLikeTag(node: Node): Boolean - -external fun isTokenKind(kind: SyntaxKind): Boolean - -external fun isToken(n: Node): Boolean - -external fun isLiteralExpression(node: Node): Boolean - -external fun isTemplateLiteralToken(node: Node): Boolean - -external fun isTemplateMiddleOrTemplateTail(node: Node): Boolean - -external fun isImportOrExportSpecifier(node: Node): Boolean - -external fun isTypeOnlyImportOrExportDeclaration(node: Node): Boolean - -external fun isStringTextContainingNode(node: Node): Boolean - -external fun isModifier(node: Node): Boolean - -external fun isEntityName(node: Node): Boolean - -external fun isPropertyName(node: Node): Boolean - -external fun isBindingName(node: Node): Boolean - -external fun isFunctionLike(node: Node?): Boolean - -external fun isClassElement(node: Node): Boolean - -external fun isClassLike(node: Node): Boolean - -external fun isAccessor(node: Node): Boolean - -external fun isTypeElement(node: Node): Boolean - -external fun isClassOrTypeElement(node: Node): Boolean - -external fun isObjectLiteralElementLike(node: Node): Boolean - -external fun isTypeNode(node: Node): Boolean - -external fun isFunctionOrConstructorTypeNode(node: Node): Boolean - -external fun isPropertyAccessOrQualifiedName(node: Node): Boolean - -external fun isCallLikeExpression(node: Node): Boolean - -external fun isCallOrNewExpression(node: Node): Boolean - -external fun isTemplateLiteral(node: Node): Boolean - -external fun isAssertionExpression(node: Node): Boolean - -external fun isIterationStatement(node: Node, lookInLabeledStatements: Boolean): Boolean - -external fun isJsxOpeningLikeElement(node: Node): Boolean - -external fun isCaseOrDefaultClause(node: Node): Boolean - -external fun isJSDocCommentContainingNode(node: Node): Boolean - -external fun isSetAccessor(node: Node): Boolean - -external fun isGetAccessor(node: Node): Boolean - -external fun hasOnlyExpressionInitializer(node: Node): Boolean - -external fun isObjectLiteralElement(node: Node): Boolean - -external fun isStringLiteralLike(node: Node): Boolean - -external fun isJSDocLinkLike(node: Node): Boolean - -external var factory: NodeFactory - -external fun createUnparsedSourceFile(text: String): UnparsedSource - -external fun createUnparsedSourceFile(inputFile: InputFiles, type: String /* "js" | "dts" */, stripInternal: Boolean = definedExternally): UnparsedSource - -external fun createUnparsedSourceFile(inputFile: InputFiles, type: String /* "js" | "dts" */): UnparsedSource - -external fun createUnparsedSourceFile(text: String, mapPath: String?, map: String?): UnparsedSource - -external fun createInputFiles(javascriptText: String, declarationText: String): InputFiles - -external fun createInputFiles(readFileText: (path: String) -> String?, javascriptPath: String, javascriptMapPath: String?, declarationPath: String, declarationMapPath: String?, buildInfoPath: String?): InputFiles - -external fun createInputFiles(javascriptText: String, declarationText: String, javascriptMapPath: String?, javascriptMapText: String?, declarationMapPath: String?, declarationMapText: String?): InputFiles - -external fun createSourceMapSource(fileName: String, text: String, skipTrivia: (pos: Number) -> Number = definedExternally): SourceMapSource - -external fun setOriginalNode(node: T, original: Node?): T - -external fun disposeEmitNodes(sourceFile: SourceFile?) - -external fun setEmitFlags(node: T, emitFlags: EmitFlags): T - -external fun getSourceMapRange(node: Node): SourceMapRange - -external fun setSourceMapRange(node: T, range: SourceMapRange?): T - -external fun getTokenSourceMapRange(node: Node, token: SyntaxKind): SourceMapRange? - -external fun setTokenSourceMapRange(node: T, token: SyntaxKind, range: SourceMapRange?): T - -external fun getCommentRange(node: Node): TextRange - -external fun setCommentRange(node: T, range: TextRange): T - -external fun getSyntheticLeadingComments(node: Node): Array? - -external fun setSyntheticLeadingComments(node: T, comments: Array?): T - -external fun addSyntheticLeadingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia, text: String, hasTrailingNewLine: Boolean = definedExternally): T - -external fun addSyntheticLeadingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia, text: String): T - -external fun addSyntheticLeadingComment(node: T, kind: SyntaxKind.MultiLineCommentTrivia, text: String, hasTrailingNewLine: Boolean = definedExternally): T - -external fun addSyntheticLeadingComment(node: T, kind: SyntaxKind.MultiLineCommentTrivia, text: String): T - -external fun getSyntheticTrailingComments(node: Node): Array? - -external fun setSyntheticTrailingComments(node: T, comments: Array?): T - -external fun addSyntheticTrailingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia, text: String, hasTrailingNewLine: Boolean = definedExternally): T - -external fun addSyntheticTrailingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia, text: String): T - -external fun addSyntheticTrailingComment(node: T, kind: SyntaxKind.MultiLineCommentTrivia, text: String, hasTrailingNewLine: Boolean = definedExternally): T - -external fun addSyntheticTrailingComment(node: T, kind: SyntaxKind.MultiLineCommentTrivia, text: String): T - -external fun moveSyntheticComments(node: T, original: Node): T - -external fun getConstantValue(node: PropertyAccessExpression): dynamic /* String? | Number? */ - -external fun getConstantValue(node: ElementAccessExpression): dynamic /* String? | Number? */ - -external fun setConstantValue(node: PropertyAccessExpression, value: String): dynamic /* PropertyAccessExpression | ElementAccessExpression */ - -external fun setConstantValue(node: PropertyAccessExpression, value: Number): dynamic /* PropertyAccessExpression | ElementAccessExpression */ - -external fun setConstantValue(node: ElementAccessExpression, value: String): dynamic /* PropertyAccessExpression | ElementAccessExpression */ - -external fun setConstantValue(node: ElementAccessExpression, value: Number): dynamic /* PropertyAccessExpression | ElementAccessExpression */ - -external fun addEmitHelper(node: T, helper: ScopedEmitHelper): T - -external fun addEmitHelper(node: T, helper: UnscopedEmitHelper): T - -external fun addEmitHelpers(node: T, helpers: Array?): T - -external fun removeEmitHelper(node: Node, helper: ScopedEmitHelper): Boolean - -external fun removeEmitHelper(node: Node, helper: UnscopedEmitHelper): Boolean - -external fun getEmitHelpers(node: Node): Array? - -external fun moveEmitHelpers(source: Node, target: Node, predicate: (helper: Any /* ScopedEmitHelper | UnscopedEmitHelper */) -> Boolean) - -external fun isNumericLiteral(node: Node): Boolean - -external fun isBigIntLiteral(node: Node): Boolean - -external fun isStringLiteral(node: Node): Boolean - -external fun isJsxText(node: Node): Boolean - -external fun isRegularExpressionLiteral(node: Node): Boolean - -external fun isNoSubstitutionTemplateLiteral(node: Node): Boolean - -external fun isTemplateHead(node: Node): Boolean - -external fun isTemplateMiddle(node: Node): Boolean - -external fun isTemplateTail(node: Node): Boolean - -external fun isDotDotDotToken(node: Node): Boolean - -external fun isPlusToken(node: Node): Boolean - -external fun isMinusToken(node: Node): Boolean - -external fun isAsteriskToken(node: Node): Boolean - -external fun isIdentifier(node: Node): Boolean - -external fun isPrivateIdentifier(node: Node): Boolean - -external fun isQualifiedName(node: Node): Boolean - -external fun isComputedPropertyName(node: Node): Boolean - -external fun isTypeParameterDeclaration(node: Node): Boolean - -external fun isParameter(node: Node): Boolean - -external fun isDecorator(node: Node): Boolean - -external fun isPropertySignature(node: Node): Boolean - -external fun isPropertyDeclaration(node: Node): Boolean - -external fun isMethodSignature(node: Node): Boolean - -external fun isMethodDeclaration(node: Node): Boolean - -external fun isClassStaticBlockDeclaration(node: Node): Boolean - -external fun isConstructorDeclaration(node: Node): Boolean - -external fun isGetAccessorDeclaration(node: Node): Boolean - -external fun isSetAccessorDeclaration(node: Node): Boolean - -external fun isCallSignatureDeclaration(node: Node): Boolean - -external fun isConstructSignatureDeclaration(node: Node): Boolean - -external fun isIndexSignatureDeclaration(node: Node): Boolean - -external fun isTypePredicateNode(node: Node): Boolean - -external fun isTypeReferenceNode(node: Node): Boolean - -external fun isFunctionTypeNode(node: Node): Boolean - -external fun isConstructorTypeNode(node: Node): Boolean - -external fun isTypeQueryNode(node: Node): Boolean - -external fun isTypeLiteralNode(node: Node): Boolean - -external fun isArrayTypeNode(node: Node): Boolean - -external fun isTupleTypeNode(node: Node): Boolean - -external fun isNamedTupleMember(node: Node): Boolean - -external fun isOptionalTypeNode(node: Node): Boolean - -external fun isRestTypeNode(node: Node): Boolean - -external fun isUnionTypeNode(node: Node): Boolean - -external fun isIntersectionTypeNode(node: Node): Boolean - -external fun isConditionalTypeNode(node: Node): Boolean - -external fun isInferTypeNode(node: Node): Boolean - -external fun isParenthesizedTypeNode(node: Node): Boolean - -external fun isThisTypeNode(node: Node): Boolean - -external fun isTypeOperatorNode(node: Node): Boolean - -external fun isIndexedAccessTypeNode(node: Node): Boolean - -external fun isMappedTypeNode(node: Node): Boolean - -external fun isLiteralTypeNode(node: Node): Boolean - -external fun isImportTypeNode(node: Node): Boolean - -external fun isTemplateLiteralTypeSpan(node: Node): Boolean - -external fun isTemplateLiteralTypeNode(node: Node): Boolean - -external fun isObjectBindingPattern(node: Node): Boolean - -external fun isArrayBindingPattern(node: Node): Boolean - -external fun isBindingElement(node: Node): Boolean - -external fun isArrayLiteralExpression(node: Node): Boolean - -external fun isObjectLiteralExpression(node: Node): Boolean - -external fun isPropertyAccessExpression(node: Node): Boolean - -external fun isElementAccessExpression(node: Node): Boolean - -external fun isCallExpression(node: Node): Boolean - -external fun isNewExpression(node: Node): Boolean - -external fun isTaggedTemplateExpression(node: Node): Boolean - -external fun isTypeAssertionExpression(node: Node): Boolean - -external fun isParenthesizedExpression(node: Node): Boolean - -external fun isFunctionExpression(node: Node): Boolean - -external fun isArrowFunction(node: Node): Boolean - -external fun isDeleteExpression(node: Node): Boolean - -external fun isTypeOfExpression(node: Node): Boolean - -external fun isVoidExpression(node: Node): Boolean - -external fun isAwaitExpression(node: Node): Boolean - -external fun isPrefixUnaryExpression(node: Node): Boolean - -external fun isPostfixUnaryExpression(node: Node): Boolean - -external fun isBinaryExpression(node: Node): Boolean - -external fun isConditionalExpression(node: Node): Boolean - -external fun isTemplateExpression(node: Node): Boolean - -external fun isYieldExpression(node: Node): Boolean - -external fun isSpreadElement(node: Node): Boolean - -external fun isClassExpression(node: Node): Boolean - -external fun isOmittedExpression(node: Node): Boolean - -external fun isExpressionWithTypeArguments(node: Node): Boolean - -external fun isAsExpression(node: Node): Boolean - -external fun isNonNullExpression(node: Node): Boolean - -external fun isMetaProperty(node: Node): Boolean - -external fun isSyntheticExpression(node: Node): Boolean - -external fun isPartiallyEmittedExpression(node: Node): Boolean - -external fun isCommaListExpression(node: Node): Boolean - -external fun isTemplateSpan(node: Node): Boolean - -external fun isSemicolonClassElement(node: Node): Boolean - -external fun isBlock(node: Node): Boolean - -external fun isVariableStatement(node: Node): Boolean - -external fun isEmptyStatement(node: Node): Boolean - -external fun isExpressionStatement(node: Node): Boolean - -external fun isIfStatement(node: Node): Boolean - -external fun isDoStatement(node: Node): Boolean - -external fun isWhileStatement(node: Node): Boolean - -external fun isForStatement(node: Node): Boolean - -external fun isForInStatement(node: Node): Boolean - -external fun isForOfStatement(node: Node): Boolean - -external fun isContinueStatement(node: Node): Boolean - -external fun isBreakStatement(node: Node): Boolean - -external fun isReturnStatement(node: Node): Boolean - -external fun isWithStatement(node: Node): Boolean - -external fun isSwitchStatement(node: Node): Boolean - -external fun isLabeledStatement(node: Node): Boolean - -external fun isThrowStatement(node: Node): Boolean - -external fun isTryStatement(node: Node): Boolean - -external fun isDebuggerStatement(node: Node): Boolean - -external fun isVariableDeclaration(node: Node): Boolean - -external fun isVariableDeclarationList(node: Node): Boolean - -external fun isFunctionDeclaration(node: Node): Boolean - -external fun isClassDeclaration(node: Node): Boolean - -external fun isInterfaceDeclaration(node: Node): Boolean - -external fun isTypeAliasDeclaration(node: Node): Boolean - -external fun isEnumDeclaration(node: Node): Boolean - -external fun isModuleDeclaration(node: Node): Boolean - -external fun isModuleBlock(node: Node): Boolean - -external fun isCaseBlock(node: Node): Boolean - -external fun isNamespaceExportDeclaration(node: Node): Boolean - -external fun isImportEqualsDeclaration(node: Node): Boolean - -external fun isImportDeclaration(node: Node): Boolean - -external fun isImportClause(node: Node): Boolean - -external fun isNamespaceImport(node: Node): Boolean - -external fun isNamespaceExport(node: Node): Boolean - -external fun isNamedImports(node: Node): Boolean - -external fun isImportSpecifier(node: Node): Boolean - -external fun isExportAssignment(node: Node): Boolean - -external fun isExportDeclaration(node: Node): Boolean - -external fun isNamedExports(node: Node): Boolean - -external fun isExportSpecifier(node: Node): Boolean - -external fun isMissingDeclaration(node: Node): Boolean - -external fun isNotEmittedStatement(node: Node): Boolean - -external fun isExternalModuleReference(node: Node): Boolean - -external fun isJsxElement(node: Node): Boolean - -external fun isJsxSelfClosingElement(node: Node): Boolean - -external fun isJsxOpeningElement(node: Node): Boolean - -external fun isJsxClosingElement(node: Node): Boolean - -external fun isJsxFragment(node: Node): Boolean - -external fun isJsxOpeningFragment(node: Node): Boolean - -external fun isJsxClosingFragment(node: Node): Boolean - -external fun isJsxAttribute(node: Node): Boolean - -external fun isJsxAttributes(node: Node): Boolean - -external fun isJsxSpreadAttribute(node: Node): Boolean - -external fun isJsxExpression(node: Node): Boolean - -external fun isCaseClause(node: Node): Boolean - -external fun isDefaultClause(node: Node): Boolean - -external fun isHeritageClause(node: Node): Boolean - -external fun isCatchClause(node: Node): Boolean - -external fun isPropertyAssignment(node: Node): Boolean - -external fun isShorthandPropertyAssignment(node: Node): Boolean - -external fun isSpreadAssignment(node: Node): Boolean - -external fun isEnumMember(node: Node): Boolean - -external fun isUnparsedPrepend(node: Node): Boolean - -external fun isSourceFile(node: Node): Boolean - -external fun isBundle(node: Node): Boolean - -external fun isUnparsedSource(node: Node): Boolean - -external fun isJSDocTypeExpression(node: Node): Boolean - -external fun isJSDocNameReference(node: Node): Boolean - -external fun isJSDocMemberName(node: Node): Boolean - -external fun isJSDocLink(node: Node): Boolean - -external fun isJSDocLinkCode(node: Node): Boolean - -external fun isJSDocLinkPlain(node: Node): Boolean - -external fun isJSDocAllType(node: Node): Boolean - -external fun isJSDocUnknownType(node: Node): Boolean - -external fun isJSDocNullableType(node: Node): Boolean - -external fun isJSDocNonNullableType(node: Node): Boolean - -external fun isJSDocOptionalType(node: Node): Boolean - -external fun isJSDocFunctionType(node: Node): Boolean - -external fun isJSDocVariadicType(node: Node): Boolean - -external fun isJSDocNamepathType(node: Node): Boolean - -external fun isJSDoc(node: Node): Boolean - -external fun isJSDocTypeLiteral(node: Node): Boolean - -external fun isJSDocSignature(node: Node): Boolean - -external fun isJSDocAugmentsTag(node: Node): Boolean - -external fun isJSDocAuthorTag(node: Node): Boolean - -external fun isJSDocClassTag(node: Node): Boolean - -external fun isJSDocCallbackTag(node: Node): Boolean - -external fun isJSDocPublicTag(node: Node): Boolean - -external fun isJSDocPrivateTag(node: Node): Boolean - -external fun isJSDocProtectedTag(node: Node): Boolean - -external fun isJSDocReadonlyTag(node: Node): Boolean - -external fun isJSDocOverrideTag(node: Node): Boolean - -external fun isJSDocDeprecatedTag(node: Node): Boolean - -external fun isJSDocSeeTag(node: Node): Boolean - -external fun isJSDocEnumTag(node: Node): Boolean - -external fun isJSDocParameterTag(node: Node): Boolean - -external fun isJSDocReturnTag(node: Node): Boolean - -external fun isJSDocThisTag(node: Node): Boolean - -external fun isJSDocTypeTag(node: Node): Boolean - -external fun isJSDocTemplateTag(node: Node): Boolean - -external fun isJSDocTypedefTag(node: Node): Boolean - -external fun isJSDocUnknownTag(node: Node): Boolean - -external fun isJSDocPropertyTag(node: Node): Boolean - -external fun isJSDocImplementsTag(node: Node): Boolean - -external fun setTextRange(range: T, location: TextRange?): T - -external fun forEachChild(node: Node, cbNode: (node: Node) -> T?, cbNodes: (nodes: NodeArray) -> T? = definedExternally): T? - -external fun createSourceFile(fileName: String, sourceText: String, languageVersion: ScriptTarget, setParentNodes: Boolean = definedExternally, scriptKind: ScriptKind = definedExternally): SourceFile - -external fun parseIsolatedEntityName(text: String, languageVersion: ScriptTarget): dynamic /* Identifier? | QualifiedName? */ - -external fun parseJsonText(fileName: String, sourceText: String): JsonSourceFile - -external fun isExternalModule(file: SourceFile): Boolean - -external fun updateSourceFile(sourceFile: SourceFile, newText: String, textChangeRange: TextChangeRange, aggressiveChecks: Boolean = definedExternally): SourceFile - -external fun parseCommandLine(commandLine: Array, readFile: (path: String) -> String? = definedExternally): ParsedCommandLine - -external interface ConfigFileDiagnosticsReporter { - var onUnRecoverableConfigFileDiagnostic: DiagnosticReporter -} - -external interface ParseConfigFileHost : ParseConfigHost, ConfigFileDiagnosticsReporter { - fun getCurrentDirectory(): String -} - -external fun getParsedCommandLineOfConfigFile(configFileName: String, optionsToExtend: CompilerOptions?, host: ParseConfigFileHost, extendedConfigCache: Map = definedExternally, watchOptionsToExtend: WatchOptions = definedExternally, extraFileExtensions: Array = definedExternally): ParsedCommandLine? - -external interface `T$25` { - var config: Any? - get() = definedExternally - set(value) = definedExternally - var error: Diagnostic? - get() = definedExternally - set(value) = definedExternally -} - -external fun readConfigFile(fileName: String, readFile: (path: String) -> String?): `T$25` - -external fun parseConfigFileTextToJson(fileName: String, jsonText: String): `T$25` - -external fun readJsonConfigFile(fileName: String, readFile: (path: String) -> String?): TsConfigSourceFile - -external fun convertToObject(sourceFile: JsonSourceFile, errors: Push): Any - -external fun parseJsonConfigFileContent(json: Any, host: ParseConfigHost, basePath: String, existingOptions: CompilerOptions = definedExternally, configFileName: String = definedExternally, resolutionStack: Array = definedExternally, extraFileExtensions: Array = definedExternally, extendedConfigCache: Map = definedExternally, existingWatchOptions: WatchOptions = definedExternally): ParsedCommandLine - -external fun parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: String, existingOptions: CompilerOptions = definedExternally, configFileName: String = definedExternally, resolutionStack: Array = definedExternally, extraFileExtensions: Array = definedExternally, extendedConfigCache: Map = definedExternally, existingWatchOptions: WatchOptions = definedExternally): ParsedCommandLine - -external interface ParsedTsconfig { - var raw: Any - var options: CompilerOptions? - get() = definedExternally - set(value) = definedExternally - var watchOptions: WatchOptions? - get() = definedExternally - set(value) = definedExternally - var typeAcquisition: TypeAcquisition? - get() = definedExternally - set(value) = definedExternally - var extendedConfigPath: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface ExtendedConfigCacheEntry { - var extendedResult: TsConfigSourceFile - var extendedConfig: ParsedTsconfig? -} - -external interface `T$26` { - var options: CompilerOptions - var errors: Array -} - -external fun convertCompilerOptionsFromJson(jsonOptions: Any, basePath: String, configFileName: String = definedExternally): `T$26` - -external interface `T$27` { - var options: TypeAcquisition - var errors: Array -} - -external fun convertTypeAcquisitionFromJson(jsonOptions: Any, basePath: String, configFileName: String = definedExternally): `T$27` - -external fun getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): Array? - -external fun resolveTypeReferenceDirective(typeReferenceDirectiveName: String, containingFile: String?, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference: ResolvedProjectReference = definedExternally, cache: TypeReferenceDirectiveResolutionCache = definedExternally): ResolvedTypeReferenceDirectiveWithFailedLookupLocations - -external fun getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): Array - -external interface TypeReferenceDirectiveResolutionCache : PerDirectoryResolutionCache, PackageJsonInfoCache - -external interface PerDirectoryResolutionCache { - fun getOrCreateCacheForDirectory(directoryName: String, redirectedReference: ResolvedProjectReference = definedExternally): Map - fun clear() - fun update(options: CompilerOptions) -} - -external interface ModuleResolutionCache : PerDirectoryResolutionCache, NonRelativeModuleNameResolutionCache, PackageJsonInfoCache { - fun getPackageJsonInfoCache(): PackageJsonInfoCache -} - -external interface NonRelativeModuleNameResolutionCache : PackageJsonInfoCache { - fun getOrCreateCacheForModuleName(nonRelativeModuleName: String, redirectedReference: ResolvedProjectReference = definedExternally): PerModuleNameCache -} - -external interface PackageJsonInfoCache { - fun clear() -} - -external interface PerModuleNameCache { - fun get(directory: String): ResolvedModuleWithFailedLookupLocations? - fun set(directory: String, result: ResolvedModuleWithFailedLookupLocations) -} - -external fun createModuleResolutionCache(currentDirectory: String, getCanonicalFileName: (s: String) -> String, options: CompilerOptions = definedExternally): ModuleResolutionCache - -external fun createTypeReferenceDirectiveResolutionCache(currentDirectory: String, getCanonicalFileName: (s: String) -> String, options: CompilerOptions = definedExternally, packageJsonInfoCache: PackageJsonInfoCache = definedExternally): TypeReferenceDirectiveResolutionCache - -external fun resolveModuleNameFromCache(moduleName: String, containingFile: String, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations? - -external fun resolveModuleName(moduleName: String, containingFile: String, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: ModuleResolutionCache = definedExternally, redirectedReference: ResolvedProjectReference = definedExternally): ResolvedModuleWithFailedLookupLocations - -external fun nodeModuleNameResolver(moduleName: String, containingFile: String, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: ModuleResolutionCache = definedExternally, redirectedReference: ResolvedProjectReference = definedExternally): ResolvedModuleWithFailedLookupLocations - -external fun classicNameResolver(moduleName: String, containingFile: String, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: NonRelativeModuleNameResolutionCache = definedExternally, redirectedReference: ResolvedProjectReference = definedExternally): ResolvedModuleWithFailedLookupLocations - -external fun visitNode(node: T, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, lift: (node: Array) -> T = definedExternally): T - -external fun visitNode(node: T, visitor: Visitor?): T - -external fun visitNode(node: T, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally): T - -external fun visitNode(node: T?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, lift: (node: Array) -> T = definedExternally): T? - -external fun visitNode(node: T?, visitor: Visitor?): T? - -external fun visitNode(node: T?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally): T? - -external fun visitNodes(nodes: NodeArray, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, start: Number = definedExternally, count: Number = definedExternally): NodeArray - -external fun visitNodes(nodes: NodeArray, visitor: Visitor?): NodeArray - -external fun visitNodes(nodes: NodeArray, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally): NodeArray - -external fun visitNodes(nodes: NodeArray, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, start: Number = definedExternally): NodeArray - -external fun visitNodes(nodes: NodeArray?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, start: Number = definedExternally, count: Number = definedExternally): NodeArray? - -external fun visitNodes(nodes: NodeArray?, visitor: Visitor?): NodeArray? - -external fun visitNodes(nodes: NodeArray?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally): NodeArray? - -external fun visitNodes(nodes: NodeArray?, visitor: Visitor?, test: (node: Node) -> Boolean = definedExternally, start: Number = definedExternally): NodeArray? - -external fun visitLexicalEnvironment(statements: NodeArray, visitor: Visitor, context: TransformationContext, start: Number = definedExternally, ensureUseStrict: Boolean = definedExternally, nodesVisitor: NodesVisitor = definedExternally): NodeArray - -external fun visitParameterList(nodes: NodeArray, visitor: Visitor, context: TransformationContext, nodesVisitor: NodesVisitor = definedExternally): NodeArray - -external fun visitParameterList(nodes: NodeArray, visitor: Visitor, context: TransformationContext): NodeArray - -external fun visitParameterList(nodes: NodeArray?, visitor: Visitor, context: TransformationContext, nodesVisitor: NodesVisitor = definedExternally): NodeArray? - -external fun visitParameterList(nodes: NodeArray?, visitor: Visitor, context: TransformationContext): NodeArray? - -external fun visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): dynamic /* FunctionBody */ - -external fun visitFunctionBody(node: Expression, visitor: Visitor, context: TransformationContext): dynamic /* FunctionBody | Expression */ - -external fun visitIterationBody(body: Statement, visitor: Visitor, context: TransformationContext): Statement - -external fun visitEachChild(node: T, visitor: Visitor, context: TransformationContext): T - -external fun visitEachChild(node: T?, visitor: Visitor, context: TransformationContext, nodesVisitor: Any = definedExternally, tokenVisitor: Visitor = definedExternally): T? - -external fun visitEachChild(node: T?, visitor: Visitor, context: TransformationContext): T? - -external fun visitEachChild(node: T?, visitor: Visitor, context: TransformationContext, nodesVisitor: Any = definedExternally): T? - -external fun getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): String? - -external fun getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: String, ignoreCase: Boolean): Array - -external fun createPrinter(printerOptions: PrinterOptions = definedExternally, handlers: PrintHandlers = definedExternally): Printer - -external fun findConfigFile(searchPath: String, fileExists: (fileName: String) -> Boolean, configName: String = definedExternally): String? - -external fun resolveTripleslashReference(moduleName: String, containingFile: String): String - -external fun createCompilerHost(options: CompilerOptions, setParentNodes: Boolean = definedExternally): CompilerHost - -external fun getPreEmitDiagnostics(program: Program, sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - -external interface FormatDiagnosticsHost { - fun getCurrentDirectory(): String - fun getCanonicalFileName(fileName: String): String - fun getNewLine(): String -} - -external fun formatDiagnostics(diagnostics: Array, host: FormatDiagnosticsHost): String - -external fun formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): String - -external fun formatDiagnosticsWithColorAndContext(diagnostics: Array, host: FormatDiagnosticsHost): String - -external fun flattenDiagnosticMessageText(diag: String?, newLine: String, indent: Number = definedExternally): String - -external fun flattenDiagnosticMessageText(diag: String?, newLine: String): String - -external fun flattenDiagnosticMessageText(diag: DiagnosticMessageChain?, newLine: String, indent: Number = definedExternally): String - -external fun flattenDiagnosticMessageText(diag: DiagnosticMessageChain?, newLine: String): String - -external fun getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): Array - -external fun createProgram(createProgramOptions: CreateProgramOptions): Program - -external fun createProgram(rootNames: Array, options: CompilerOptions, host: CompilerHost = definedExternally, oldProgram: Program = definedExternally, configFileParsingDiagnostics: Array = definedExternally): Program - -external fun createProgram(rootNames: Array, options: CompilerOptions): Program - -external fun createProgram(rootNames: Array, options: CompilerOptions, host: CompilerHost = definedExternally): Program - -external fun createProgram(rootNames: Array, options: CompilerOptions, host: CompilerHost = definedExternally, oldProgram: Program = definedExternally): Program - -external interface ResolveProjectReferencePathHost { - fun fileExists(fileName: String): Boolean -} - -external fun resolveProjectReferencePath(ref: ProjectReference): String /* String & `T$5` */ - -external fun resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): String /* String & `T$5` */ - -external interface EmitOutput { - var outputFiles: Array - var emitSkipped: Boolean -} - -external interface OutputFile { - var name: String - var writeByteOrderMark: Boolean - var text: String -} - -external interface `T$28` { - var result: T - var affected: dynamic /* SourceFile | Program */ - get() = definedExternally - set(value) = definedExternally -} - -external interface BuilderProgramHost { - fun useCaseSensitiveFileNames(): Boolean - var createHash: ((data: String) -> String)? - get() = definedExternally - set(value) = definedExternally - var writeFile: WriteFileCallback? - get() = definedExternally - set(value) = definedExternally -} - -external interface BuilderProgram { - fun getProgram(): Program - fun getCompilerOptions(): CompilerOptions - fun getSourceFile(fileName: String): SourceFile? - fun getSourceFiles(): Array - fun getOptionsDiagnostics(cancellationToken: CancellationToken = definedExternally): Array - fun getGlobalDiagnostics(cancellationToken: CancellationToken = definedExternally): Array - fun getConfigFileParsingDiagnostics(): Array - fun getSyntacticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - fun getDeclarationDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - fun getAllDependencies(sourceFile: SourceFile): Array - fun getSemanticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - fun emit(targetSourceFile: SourceFile = definedExternally, writeFile: WriteFileCallback = definedExternally, cancellationToken: CancellationToken = definedExternally, emitOnlyDtsFiles: Boolean = definedExternally, customTransformers: CustomTransformers = definedExternally): EmitResult - fun getCurrentDirectory(): String -} - -external interface SemanticDiagnosticsBuilderProgram : BuilderProgram { - fun getSemanticDiagnosticsOfNextAffectedFile(cancellationToken: CancellationToken = definedExternally, ignoreSourceFile: (sourceFile: SourceFile) -> Boolean = definedExternally): `T$28`>? -} - -external interface EmitAndSemanticDiagnosticsBuilderProgram : SemanticDiagnosticsBuilderProgram { - fun emitNextAffectedFile(writeFile: WriteFileCallback = definedExternally, cancellationToken: CancellationToken = definedExternally, emitOnlyDtsFiles: Boolean = definedExternally, customTransformers: CustomTransformers = definedExternally): `T$28`? -} - -external fun createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram: SemanticDiagnosticsBuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally): SemanticDiagnosticsBuilderProgram - -external fun createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost): SemanticDiagnosticsBuilderProgram - -external fun createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram: SemanticDiagnosticsBuilderProgram = definedExternally): SemanticDiagnosticsBuilderProgram - -external fun createSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: SemanticDiagnosticsBuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally, projectReferences: Array = definedExternally): SemanticDiagnosticsBuilderProgram - -external fun createSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?): SemanticDiagnosticsBuilderProgram - -external fun createSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally): SemanticDiagnosticsBuilderProgram - -external fun createSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: SemanticDiagnosticsBuilderProgram = definedExternally): SemanticDiagnosticsBuilderProgram - -external fun createSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: SemanticDiagnosticsBuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally): SemanticDiagnosticsBuilderProgram - -external fun createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram: EmitAndSemanticDiagnosticsBuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally): EmitAndSemanticDiagnosticsBuilderProgram - -external fun createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost): EmitAndSemanticDiagnosticsBuilderProgram - -external fun createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram: EmitAndSemanticDiagnosticsBuilderProgram = definedExternally): EmitAndSemanticDiagnosticsBuilderProgram - -external fun createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: EmitAndSemanticDiagnosticsBuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally, projectReferences: Array = definedExternally): EmitAndSemanticDiagnosticsBuilderProgram - -external fun createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?): EmitAndSemanticDiagnosticsBuilderProgram - -external fun createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally): EmitAndSemanticDiagnosticsBuilderProgram - -external fun createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: EmitAndSemanticDiagnosticsBuilderProgram = definedExternally): EmitAndSemanticDiagnosticsBuilderProgram - -external fun createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: EmitAndSemanticDiagnosticsBuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally): EmitAndSemanticDiagnosticsBuilderProgram - -external fun createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram: BuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally): BuilderProgram - -external fun createAbstractBuilder(newProgram: Program, host: BuilderProgramHost): BuilderProgram - -external fun createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram: BuilderProgram = definedExternally): BuilderProgram - -external fun createAbstractBuilder(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: BuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally, projectReferences: Array = definedExternally): BuilderProgram - -external fun createAbstractBuilder(rootNames: Array?, options: CompilerOptions?): BuilderProgram - -external fun createAbstractBuilder(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally): BuilderProgram - -external fun createAbstractBuilder(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: BuilderProgram = definedExternally): BuilderProgram - -external fun createAbstractBuilder(rootNames: Array?, options: CompilerOptions?, host: CompilerHost = definedExternally, oldProgram: BuilderProgram = definedExternally, configFileParsingDiagnostics: Array = definedExternally): BuilderProgram - -external interface ReadBuildProgramHost { - fun useCaseSensitiveFileNames(): Boolean - fun getCurrentDirectory(): String - fun readFile(fileName: String): String? -} - -external fun readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram? - -external fun createIncrementalCompilerHost(options: CompilerOptions, system: System = definedExternally): CompilerHost - -external interface IncrementalProgramOptions { - var rootNames: Array - var options: CompilerOptions - var configFileParsingDiagnostics: Array? - get() = definedExternally - set(value) = definedExternally - var projectReferences: Array? - get() = definedExternally - set(value) = definedExternally - var host: CompilerHost? - get() = definedExternally - set(value) = definedExternally - var createProgram: CreateProgram? - get() = definedExternally - set(value) = definedExternally -} - -external fun createIncrementalProgram(__0: IncrementalProgramOptions): T - -external interface WatchHost { - val onWatchStatusChange: ((diagnostic: Diagnostic, newLine: String, options: CompilerOptions, errorCount: Number) -> Unit)? - fun watchFile(path: String, callback: FileWatcherCallback, pollingInterval: Number = definedExternally, options: CompilerOptions = definedExternally): FileWatcher - fun watchDirectory(path: String, callback: DirectoryWatcherCallback, recursive: Boolean = definedExternally, options: CompilerOptions = definedExternally): FileWatcher - val setTimeout: ((callback: (args: Any) -> Unit, ms: Number, args: Any) -> Any)? - val clearTimeout: ((timeoutId: Any) -> Unit)? -} - -external interface ProgramHost { - var createProgram: CreateProgram - fun useCaseSensitiveFileNames(): Boolean - fun getNewLine(): String - fun getCurrentDirectory(): String - fun getDefaultLibFileName(options: CompilerOptions): String - val getDefaultLibLocation: (() -> String)? - val createHash: ((data: String) -> String)? - fun fileExists(path: String): Boolean - fun readFile(path: String, encoding: String = definedExternally): String? - val directoryExists: ((path: String) -> Boolean)? - val getDirectories: ((path: String) -> Array)? - val readDirectory: ((path: String, extensions: Array, exclude: Array, include: Array, depth: Number) -> Array)? - val realpath: ((path: String) -> String)? - val trace: ((s: String) -> Unit)? - val getEnvironmentVariable: ((name: String) -> String?)? - val resolveModuleNames: ((moduleNames: Array, containingFile: String, reusedNames: Array?, redirectedReference: ResolvedProjectReference?, options: CompilerOptions) -> Array)? - val resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: Array, containingFile: String, redirectedReference: ResolvedProjectReference?, options: CompilerOptions) -> Array)? -} - -external interface WatchCompilerHost : ProgramHost, WatchHost { - val useSourceOfProjectReferenceRedirect: (() -> Boolean)? - val getParsedCommandLine: ((fileName: String) -> ParsedCommandLine?)? - val afterProgramCreate: ((program: T) -> Unit)? -} - -external interface WatchCompilerHostOfFilesAndCompilerOptions : WatchCompilerHost { - var rootFiles: Array - var options: CompilerOptions - var watchOptions: WatchOptions? - get() = definedExternally - set(value) = definedExternally - var projectReferences: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface WatchCompilerHostOfConfigFile : WatchCompilerHost, ConfigFileDiagnosticsReporter { - var configFileName: String - var optionsToExtend: CompilerOptions? - get() = definedExternally - set(value) = definedExternally - var watchOptionsToExtend: WatchOptions? - get() = definedExternally - set(value) = definedExternally - var extraFileExtensions: Array? - get() = definedExternally - set(value) = definedExternally - override var readDirectory: (path: String, extensions: Array, exclude: Array, include: Array, depth: Number) -> Array -} - -external interface Watch { - fun getProgram(): T - fun close() -} - -external interface WatchOfConfigFile : Watch - -external interface WatchOfFilesAndCompilerOptions : Watch { - fun updateRootFileNames(fileNames: Array) -} - -external fun createWatchCompilerHost(configFileName: String, optionsToExtend: CompilerOptions?, system: System, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally, reportWatchStatus: WatchStatusReporter = definedExternally, watchOptionsToExtend: WatchOptions = definedExternally, extraFileExtensions: Array = definedExternally): WatchCompilerHostOfConfigFile - -external fun createWatchCompilerHost(configFileName: String, optionsToExtend: CompilerOptions?, system: System): WatchCompilerHostOfConfigFile - -external fun createWatchCompilerHost(configFileName: String, optionsToExtend: CompilerOptions?, system: System, createProgram: CreateProgram = definedExternally): WatchCompilerHostOfConfigFile - -external fun createWatchCompilerHost(configFileName: String, optionsToExtend: CompilerOptions?, system: System, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally): WatchCompilerHostOfConfigFile - -external fun createWatchCompilerHost(configFileName: String, optionsToExtend: CompilerOptions?, system: System, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally, reportWatchStatus: WatchStatusReporter = definedExternally): WatchCompilerHostOfConfigFile - -external fun createWatchCompilerHost(configFileName: String, optionsToExtend: CompilerOptions?, system: System, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally, reportWatchStatus: WatchStatusReporter = definedExternally, watchOptionsToExtend: WatchOptions = definedExternally): WatchCompilerHostOfConfigFile - -external fun createWatchCompilerHost(rootFiles: Array, options: CompilerOptions, system: System, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally, reportWatchStatus: WatchStatusReporter = definedExternally, projectReferences: Array = definedExternally, watchOptions: WatchOptions = definedExternally): WatchCompilerHostOfFilesAndCompilerOptions - -external fun createWatchCompilerHost(rootFiles: Array, options: CompilerOptions, system: System): WatchCompilerHostOfFilesAndCompilerOptions - -external fun createWatchCompilerHost(rootFiles: Array, options: CompilerOptions, system: System, createProgram: CreateProgram = definedExternally): WatchCompilerHostOfFilesAndCompilerOptions - -external fun createWatchCompilerHost(rootFiles: Array, options: CompilerOptions, system: System, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally): WatchCompilerHostOfFilesAndCompilerOptions - -external fun createWatchCompilerHost(rootFiles: Array, options: CompilerOptions, system: System, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally, reportWatchStatus: WatchStatusReporter = definedExternally): WatchCompilerHostOfFilesAndCompilerOptions - -external fun createWatchCompilerHost(rootFiles: Array, options: CompilerOptions, system: System, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally, reportWatchStatus: WatchStatusReporter = definedExternally, projectReferences: Array = definedExternally): WatchCompilerHostOfFilesAndCompilerOptions - -external fun createWatchProgram(host: WatchCompilerHostOfFilesAndCompilerOptions): WatchOfFilesAndCompilerOptions - -external fun createWatchProgram(host: WatchCompilerHostOfConfigFile): WatchOfConfigFile - -external interface BuildOptions { - var dry: Boolean? - get() = definedExternally - set(value) = definedExternally - var force: Boolean? - get() = definedExternally - set(value) = definedExternally - var verbose: Boolean? - get() = definedExternally - set(value) = definedExternally - var incremental: Boolean? - get() = definedExternally - set(value) = definedExternally - var assumeChangesOnlyAffectDirectDependencies: Boolean? - get() = definedExternally - set(value) = definedExternally - var traceResolution: Boolean? - get() = definedExternally - set(value) = definedExternally - @nativeGetter - operator fun get(option: String): dynamic /* String? | Number? | Boolean? | Array? | Array? | MapLike>? | Array? | Array? */ - @nativeSetter - operator fun set(option: String, value: String?) - @nativeSetter - operator fun set(option: String, value: Number?) - @nativeSetter - operator fun set(option: String, value: Boolean?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: MapLike>?) - @nativeSetter - operator fun set(option: String, value: Array?) - @nativeSetter - operator fun set(option: String, value: Array?) -} - -external interface SolutionBuilderHostBase : ProgramHost { - val createDirectory: ((path: String) -> Unit)? - val writeFile: ((path: String, data: String, writeByteOrderMark: Boolean) -> Unit)? - var getCustomTransformers: ((project: String) -> CustomTransformers?)? - get() = definedExternally - set(value) = definedExternally - fun getModifiedTime(fileName: String): Date? - fun setModifiedTime(fileName: String, date: Date) - fun deleteFile(fileName: String) - val getParsedCommandLine: ((fileName: String) -> ParsedCommandLine?)? - var reportDiagnostic: DiagnosticReporter - var reportSolutionBuilderStatus: DiagnosticReporter - val afterProgramEmitAndDiagnostics: ((program: T) -> Unit)? -} - -external interface SolutionBuilderHost : SolutionBuilderHostBase { - var reportErrorSummary: ReportEmitErrorSummary? - get() = definedExternally - set(value) = definedExternally -} - -external interface SolutionBuilderWithWatchHost : SolutionBuilderHostBase, WatchHost - -external interface SolutionBuilder { - fun build(project: String = definedExternally, cancellationToken: CancellationToken = definedExternally, writeFile: WriteFileCallback = definedExternally, getCustomTransformers: (project: String) -> CustomTransformers = definedExternally): ExitStatus - fun clean(project: String = definedExternally): ExitStatus - fun buildReferences(project: String, cancellationToken: CancellationToken = definedExternally, writeFile: WriteFileCallback = definedExternally, getCustomTransformers: (project: String) -> CustomTransformers = definedExternally): ExitStatus - fun cleanReferences(project: String = definedExternally): ExitStatus - fun getNextInvalidatedProject(cancellationToken: CancellationToken = definedExternally): dynamic /* UpdateOutputFileStampsProject? | BuildInvalidedProject? | UpdateBundleProject? */ -} - -external fun createBuilderStatusReporter(system: System, pretty: Boolean = definedExternally): DiagnosticReporter - -external fun createSolutionBuilderHost(system: System = definedExternally, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally, reportSolutionBuilderStatus: DiagnosticReporter = definedExternally, reportErrorSummary: ReportEmitErrorSummary = definedExternally): SolutionBuilderHost - -external fun createSolutionBuilderWithWatchHost(system: System = definedExternally, createProgram: CreateProgram = definedExternally, reportDiagnostic: DiagnosticReporter = definedExternally, reportSolutionBuilderStatus: DiagnosticReporter = definedExternally, reportWatchStatus: WatchStatusReporter = definedExternally): SolutionBuilderWithWatchHost - -external fun createSolutionBuilder(host: SolutionBuilderHost, rootNames: Array, defaultOptions: BuildOptions): SolutionBuilder - -external fun createSolutionBuilderWithWatch(host: SolutionBuilderWithWatchHost, rootNames: Array, defaultOptions: BuildOptions, baseWatchOptions: WatchOptions = definedExternally): SolutionBuilder - -external enum class InvalidatedProjectKind { - Build /* = 0 */, - UpdateBundle /* = 1 */, - UpdateOutputFileStamps /* = 2 */ -} - -external interface InvalidatedProjectBase { - var kind: InvalidatedProjectKind - var project: String /* String & `T$5` */ - fun done(cancellationToken: CancellationToken = definedExternally, writeFile: WriteFileCallback = definedExternally, customTransformers: CustomTransformers = definedExternally): ExitStatus - fun getCompilerOptions(): CompilerOptions - fun getCurrentDirectory(): String -} - -external interface UpdateOutputFileStampsProject : InvalidatedProjectBase { - fun updateOutputFileStatmps() -} - -external interface BuildInvalidedProject : InvalidatedProjectBase { - fun getBuilderProgram(): T? - fun getProgram(): Program? - fun getSourceFile(fileName: String): SourceFile? - fun getSourceFiles(): Array - fun getOptionsDiagnostics(cancellationToken: CancellationToken = definedExternally): Array - fun getGlobalDiagnostics(cancellationToken: CancellationToken = definedExternally): Array - fun getConfigFileParsingDiagnostics(): Array - fun getSyntacticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - fun getAllDependencies(sourceFile: SourceFile): Array - fun getSemanticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): Array - fun getSemanticDiagnosticsOfNextAffectedFile(cancellationToken: CancellationToken = definedExternally, ignoreSourceFile: (sourceFile: SourceFile) -> Boolean = definedExternally): `T$28`>? - fun emit(targetSourceFile: SourceFile = definedExternally, writeFile: WriteFileCallback = definedExternally, cancellationToken: CancellationToken = definedExternally, emitOnlyDtsFiles: Boolean = definedExternally, customTransformers: CustomTransformers = definedExternally): EmitResult? -} - -external interface UpdateBundleProject : InvalidatedProjectBase { - fun emit(writeFile: WriteFileCallback = definedExternally, customTransformers: CustomTransformers = definedExternally): dynamic /* EmitResult? | BuildInvalidedProject? */ -} - -external interface SourceFileLike { - fun getLineAndCharacterOfPosition(pos: Number): LineAndCharacter -} - -external interface IScriptSnapshot { - fun getText(start: Number, end: Number): String - fun getLength(): Number - fun getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange? - val dispose: (() -> Unit)? -} - -external interface PreProcessedFileInfo { - var referencedFiles: Array - var typeReferenceDirectives: Array - var libReferenceDirectives: Array - var importedFiles: Array - var ambientExternalModules: Array? - get() = definedExternally - set(value) = definedExternally - var isLibFile: Boolean -} - -external interface HostCancellationToken { - fun isCancellationRequested(): Boolean -} - -external interface InstallPackageOptions { - var fileName: String /* String & `T$3` */ - var packageName: String -} - -external interface PerformanceEvent { - var kind: String /* "UpdateGraph" | "CreatePackageJsonAutoImportProvider" */ - var durationMs: Number -} - -external enum class LanguageServiceMode { - Semantic /* = 0 */, - PartialSemantic /* = 1 */, - Syntactic /* = 2 */ -} - -external interface IncompleteCompletionsCache { - fun get(): CompletionInfo? - fun set(response: CompletionInfo) - fun clear() -} - -external interface LanguageServiceHost : GetEffectiveTypeRootsHost { - fun getCompilationSettings(): CompilerOptions - val getNewLine: (() -> String)? - val getProjectVersion: (() -> String)? - fun getScriptFileNames(): Array - val getScriptKind: ((fileName: String) -> ScriptKind)? - fun getScriptVersion(fileName: String): String - fun getScriptSnapshot(fileName: String): IScriptSnapshot? - val getProjectReferences: (() -> Array?)? - val getLocalizedDiagnosticMessages: (() -> Any)? - val getCancellationToken: (() -> HostCancellationToken)? - override var getCurrentDirectory: () -> String - fun getDefaultLibFileName(options: CompilerOptions): String - val log: ((s: String) -> Unit)? - val trace: ((s: String) -> Unit)? - val error: ((s: String) -> Unit)? - val useCaseSensitiveFileNames: (() -> Boolean)? - val readDirectory: ((path: String, extensions: Array, exclude: Array, include: Array, depth: Number) -> Array)? - val readFile: ((path: String, encoding: String) -> String?)? - val realpath: ((path: String) -> String)? - val fileExists: ((path: String) -> Boolean)? - val getTypeRootsVersion: (() -> Number)? - val resolveModuleNames: ((moduleNames: Array, containingFile: String, reusedNames: Array?, redirectedReference: ResolvedProjectReference?, options: CompilerOptions) -> Array)? - val getResolvedModuleWithFailedLookupLocationsFromCache: ((modulename: String, containingFile: String) -> ResolvedModuleWithFailedLookupLocations?)? - val resolveTypeReferenceDirectives: ((typeDirectiveNames: Array, containingFile: String, redirectedReference: ResolvedProjectReference?, options: CompilerOptions) -> Array)? - val getDirectories: ((directoryName: String) -> Array)? - val getCustomTransformers: (() -> CustomTransformers?)? - val isKnownTypesPackageName: ((name: String) -> Boolean)? - val installPackage: ((options: InstallPackageOptions) -> Promise)? - val writeFile: ((fileName: String, content: String) -> Unit)? - val getParsedCommandLine: ((fileName: String) -> ParsedCommandLine?)? -} - -external enum class SemanticClassificationFormat { - Original /* = "original" */, - TwentyTwenty /* = "2020" */ -} - -external interface LanguageService { - fun cleanupSemanticCache() - fun getSyntacticDiagnostics(fileName: String): Array - fun getSemanticDiagnostics(fileName: String): Array - fun getSuggestionDiagnostics(fileName: String): Array - fun getCompilerOptionsDiagnostics(): Array - fun getSyntacticClassifications(fileName: String, span: TextSpan): Array - fun getSyntacticClassifications(fileName: String, span: TextSpan, format: SemanticClassificationFormat): dynamic /* Array | Array */ - fun getSemanticClassifications(fileName: String, span: TextSpan): Array - fun getSemanticClassifications(fileName: String, span: TextSpan, format: SemanticClassificationFormat): dynamic /* Array | Array */ - fun getEncodedSyntacticClassifications(fileName: String, span: TextSpan): Classifications - fun getEncodedSemanticClassifications(fileName: String, span: TextSpan, format: SemanticClassificationFormat = definedExternally): Classifications - fun getCompletionsAtPosition(fileName: String, position: Number, options: GetCompletionsAtPositionOptions?): CompletionInfo /* CompletionInfo & `T$12` */ - fun getCompletionEntryDetails(fileName: String, position: Number, entryName: String, formatOptions: FormatCodeOptions?, source: String?, preferences: UserPreferences?, data: CompletionEntryData?): CompletionEntryDetails? - fun getCompletionEntryDetails(fileName: String, position: Number, entryName: String, formatOptions: FormatCodeSettings?, source: String?, preferences: UserPreferences?, data: CompletionEntryData?): CompletionEntryDetails? - fun getCompletionEntrySymbol(fileName: String, position: Number, name: String, source: String?): Symbol? - fun getQuickInfoAtPosition(fileName: String, position: Number): QuickInfo? - fun getNameOrDottedNameSpan(fileName: String, startPos: Number, endPos: Number): TextSpan? - fun getBreakpointStatementAtPosition(fileName: String, position: Number): TextSpan? - fun getSignatureHelpItems(fileName: String, position: Number, options: SignatureHelpItemsOptions?): SignatureHelpItems? - fun getRenameInfo(fileName: String, position: Number, options: RenameInfoOptions = definedExternally): dynamic /* RenameInfoSuccess | RenameInfoFailure */ - fun findRenameLocations(fileName: String, position: Number, findInStrings: Boolean, findInComments: Boolean, providePrefixAndSuffixTextForRename: Boolean = definedExternally): Array? - fun getSmartSelectionRange(fileName: String, position: Number): SelectionRange - fun getDefinitionAtPosition(fileName: String, position: Number): Array? - fun getDefinitionAndBoundSpan(fileName: String, position: Number): DefinitionInfoAndBoundSpan? - fun getTypeDefinitionAtPosition(fileName: String, position: Number): Array? - fun getImplementationAtPosition(fileName: String, position: Number): Array? - fun getReferencesAtPosition(fileName: String, position: Number): Array? - fun findReferences(fileName: String, position: Number): Array? - fun getDocumentHighlights(fileName: String, position: Number, filesToSearch: Array): Array? - fun getFileReferences(fileName: String): Array - fun getOccurrencesAtPosition(fileName: String, position: Number): Array? - fun getNavigateToItems(searchValue: String, maxResultCount: Number = definedExternally, fileName: String = definedExternally, excludeDtsFiles: Boolean = definedExternally): Array - fun getNavigationBarItems(fileName: String): Array - fun getNavigationTree(fileName: String): NavigationTree - fun prepareCallHierarchy(fileName: String, position: Number): dynamic /* CallHierarchyItem? | Array? */ - fun provideCallHierarchyIncomingCalls(fileName: String, position: Number): Array - fun provideCallHierarchyOutgoingCalls(fileName: String, position: Number): Array - fun provideInlayHints(fileName: String, span: TextSpan, preferences: UserPreferences?): Array - fun getOutliningSpans(fileName: String): Array - fun getTodoComments(fileName: String, descriptors: Array): Array - fun getBraceMatchingAtPosition(fileName: String, position: Number): Array - fun getIndentationAtPosition(fileName: String, position: Number, options: EditorOptions): Number - fun getIndentationAtPosition(fileName: String, position: Number, options: EditorSettings): Number - fun getFormattingEditsForRange(fileName: String, start: Number, end: Number, options: FormatCodeOptions): Array - fun getFormattingEditsForRange(fileName: String, start: Number, end: Number, options: FormatCodeSettings): Array - fun getFormattingEditsForDocument(fileName: String, options: FormatCodeOptions): Array - fun getFormattingEditsForDocument(fileName: String, options: FormatCodeSettings): Array - fun getFormattingEditsAfterKeystroke(fileName: String, position: Number, key: String, options: FormatCodeOptions): Array - fun getFormattingEditsAfterKeystroke(fileName: String, position: Number, key: String, options: FormatCodeSettings): Array - fun getDocCommentTemplateAtPosition(fileName: String, position: Number, options: DocCommentTemplateOptions = definedExternally): TextInsertion? - fun isValidBraceCompletionAtPosition(fileName: String, position: Number, openingBrace: Number): Boolean - fun getJsxClosingTagAtPosition(fileName: String, position: Number): JsxClosingTagInfo? - fun getSpanOfEnclosingComment(fileName: String, position: Number, onlyMultiLine: Boolean): TextSpan? - val toLineColumnOffset: ((fileName: String, position: Number) -> LineAndCharacter)? - fun getCodeFixesAtPosition(fileName: String, start: Number, end: Number, errorCodes: Array, formatOptions: FormatCodeSettings, preferences: UserPreferences): Array - fun getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: Any, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions - fun applyCodeActionCommand(action: CodeActionCommand, formatSettings: FormatCodeSettings = definedExternally): dynamic /* Promise | Promise */ - fun applyCodeActionCommand(action: CodeActionCommand): dynamic /* Promise | Promise */ - fun applyCodeActionCommand(action: Array, formatSettings: FormatCodeSettings = definedExternally): dynamic /* Promise | Promise */ - fun applyCodeActionCommand(action: Array): dynamic /* Promise | Promise */ - fun applyCodeActionCommand(fileName: String, action: CodeActionCommand): dynamic /* Promise | Promise */ - fun applyCodeActionCommand(fileName: String, action: Array): dynamic /* Promise | Promise */ - fun getApplicableRefactors(fileName: String, positionOrRange: Number, preferences: UserPreferences?, triggerReason: String /* "implicit" | "invoked" */ = definedExternally, kind: String = definedExternally): Array - fun getApplicableRefactors(fileName: String, positionOrRange: Number, preferences: UserPreferences?): Array - fun getApplicableRefactors(fileName: String, positionOrRange: Number, preferences: UserPreferences?, triggerReason: String /* "implicit" | "invoked" */ = definedExternally): Array - fun getApplicableRefactors(fileName: String, positionOrRange: TextRange, preferences: UserPreferences?, triggerReason: String /* "implicit" | "invoked" */ = definedExternally, kind: String = definedExternally): Array - fun getApplicableRefactors(fileName: String, positionOrRange: TextRange, preferences: UserPreferences?): Array - fun getApplicableRefactors(fileName: String, positionOrRange: TextRange, preferences: UserPreferences?, triggerReason: String /* "implicit" | "invoked" */ = definedExternally): Array - fun getEditsForRefactor(fileName: String, formatOptions: FormatCodeSettings, positionOrRange: Number, refactorName: String, actionName: String, preferences: UserPreferences?): RefactorEditInfo? - fun getEditsForRefactor(fileName: String, formatOptions: FormatCodeSettings, positionOrRange: TextRange, refactorName: String, actionName: String, preferences: UserPreferences?): RefactorEditInfo? - fun organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences?): Array - fun getEditsForFileRename(oldFilePath: String, newFilePath: String, formatOptions: FormatCodeSettings, preferences: UserPreferences?): Array - fun getEmitOutput(fileName: String, emitOnlyDtsFiles: Boolean = definedExternally, forceDtsEmit: Boolean = definedExternally): EmitOutput - fun getProgram(): Program? - fun toggleLineComment(fileName: String, textRange: TextRange): Array - fun toggleMultilineComment(fileName: String, textRange: TextRange): Array - fun commentSelection(fileName: String, textRange: TextRange): Array - fun uncommentSelection(fileName: String, textRange: TextRange): Array - fun dispose() -} - -external interface JsxClosingTagInfo { - var newText: String -} - -external interface CombinedCodeFixScope { - var type: String /* "file" */ - var fileName: String -} - -external interface OrganizeImportsArgs : CombinedCodeFixScope { - var skipDestructiveCodeActions: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external enum class CompletionTriggerKind { - Invoked /* = 1 */, - TriggerCharacter /* = 2 */, - TriggerForIncompleteCompletions /* = 3 */ -} - -external interface GetCompletionsAtPositionOptions : UserPreferences { - var triggerCharacter: String? /* "." | """ | "'" | "`" | "/" | "@" | "<" | "#" | " " */ - get() = definedExternally - set(value) = definedExternally - var triggerKind: CompletionTriggerKind? - get() = definedExternally - set(value) = definedExternally - var includeExternalModuleExports: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeInsertTextCompletions: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface InlayHintsOptions : UserPreferences { - var includeInlayParameterNameHints: String? /* "none" | "literals" | "all" */ - get() = definedExternally - set(value) = definedExternally - var includeInlayParameterNameHintsWhenArgumentMatchesName: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeInlayFunctionParameterTypeHints: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeInlayVariableTypeHints: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeInlayPropertyDeclarationTypeHints: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeInlayFunctionLikeReturnTypeHints: Boolean? - get() = definedExternally - set(value) = definedExternally - var includeInlayEnumMemberValueHints: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface SignatureHelpItemsOptions { - var triggerReason: dynamic /* SignatureHelpInvokedReason? | SignatureHelpCharacterTypedReason? | SignatureHelpRetriggeredReason? */ - get() = definedExternally - set(value) = definedExternally -} - -external interface SignatureHelpInvokedReason { - var kind: String /* "invoked" */ - var triggerCharacter: Any? - get() = definedExternally - set(value) = definedExternally -} - -external interface SignatureHelpCharacterTypedReason { - var kind: String /* "characterTyped" */ - var triggerCharacter: String /* "," | "(" | "<" */ -} - -external interface SignatureHelpRetriggeredReason { - var kind: String /* "retrigger" */ - var triggerCharacter: String? /* "," | "(" | "<" | ")" */ - get() = definedExternally - set(value) = definedExternally -} - -external interface ApplyCodeActionCommandResult { - var successMessage: String -} - -external interface Classifications { - var spans: Array - var endOfLineState: EndOfLineState -} - -external interface ClassifiedSpan { - var textSpan: TextSpan - var classificationType: ClassificationTypeNames -} - -external interface ClassifiedSpan2020 { - var textSpan: TextSpan - var classificationType: Number -} - -external interface NavigationBarItem { - var text: String - var kind: ScriptElementKind - var kindModifiers: String - var spans: Array - var childItems: Array - var indent: Number - var bolded: Boolean - var grayed: Boolean -} - -external interface NavigationTree { - var text: String - var kind: ScriptElementKind - var kindModifiers: String - var spans: Array - var nameSpan: TextSpan? - var childItems: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface CallHierarchyItem { - var name: String - var kind: ScriptElementKind - var kindModifiers: String? - get() = definedExternally - set(value) = definedExternally - var file: String - var span: TextSpan - var selectionSpan: TextSpan - var containerName: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface CallHierarchyIncomingCall { - var from: CallHierarchyItem - var fromSpans: Array -} - -external interface CallHierarchyOutgoingCall { - var to: CallHierarchyItem - var fromSpans: Array -} - -external enum class InlayHintKind { - Type /* = "Type" */, - Parameter /* = "Parameter" */, - Enum /* = "Enum" */ -} - -external interface InlayHint { - var text: String - var position: Number - var kind: InlayHintKind - var whitespaceBefore: Boolean? - get() = definedExternally - set(value) = definedExternally - var whitespaceAfter: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface TodoCommentDescriptor { - var text: String - var priority: Number -} - -external interface TodoComment { - var descriptor: TodoCommentDescriptor - var message: String - var position: Number -} - -external interface TextChange { - var span: TextSpan - var newText: String -} - -external interface FileTextChanges { - var fileName: String - var textChanges: Array - var isNewFile: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface CodeAction { - var description: String - var changes: Array - var commands: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface CodeFixAction : CodeAction { - var fixName: String - var fixId: Any? - get() = definedExternally - set(value) = definedExternally - var fixAllDescription: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface CombinedCodeActions { - var changes: Array - var commands: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface InstallPackageAction - -external interface ApplicableRefactorInfo { - var name: String - var description: String - var inlineable: Boolean? - get() = definedExternally - set(value) = definedExternally - var actions: Array -} - -external interface RefactorActionInfo { - var name: String - var description: String - var notApplicableReason: String? - get() = definedExternally - set(value) = definedExternally - var kind: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface RefactorEditInfo { - var edits: Array - var renameFilename: String? - get() = definedExternally - set(value) = definedExternally - var renameLocation: Number? - get() = definedExternally - set(value) = definedExternally - var commands: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface TextInsertion { - var newText: String - var caretOffset: Number -} - -external interface DocumentSpan { - var textSpan: TextSpan - var fileName: String - var originalTextSpan: TextSpan? - get() = definedExternally - set(value) = definedExternally - var originalFileName: String? - get() = definedExternally - set(value) = definedExternally - var contextSpan: TextSpan? - get() = definedExternally - set(value) = definedExternally - var originalContextSpan: TextSpan? - get() = definedExternally - set(value) = definedExternally -} - -external interface RenameLocation : DocumentSpan { - var prefixText: String? - get() = definedExternally - set(value) = definedExternally - var suffixText: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface ReferenceEntry : DocumentSpan { - var isWriteAccess: Boolean - var isDefinition: Boolean - var isInString: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface ImplementationLocation : DocumentSpan { - var kind: ScriptElementKind - var displayParts: Array -} - -external enum class HighlightSpanKind { - none /* = "none" */, - definition /* = "definition" */, - reference /* = "reference" */, - writtenReference /* = "writtenReference" */ -} - -external interface HighlightSpan { - var fileName: String? - get() = definedExternally - set(value) = definedExternally - var isInString: Boolean? - get() = definedExternally - set(value) = definedExternally - var textSpan: TextSpan - var contextSpan: TextSpan? - get() = definedExternally - set(value) = definedExternally - var kind: HighlightSpanKind -} - -external interface NavigateToItem { - var name: String - var kind: ScriptElementKind - var kindModifiers: String - var matchKind: String /* "exact" | "prefix" | "substring" | "camelCase" */ - var isCaseSensitive: Boolean - var fileName: String - var textSpan: TextSpan - var containerName: String - var containerKind: ScriptElementKind -} - -external enum class IndentStyle { - None /* = 0 */, - Block /* = 1 */, - Smart /* = 2 */ -} - -external enum class SemicolonPreference { - Ignore /* = "ignore" */, - Insert /* = "insert" */, - Remove /* = "remove" */ -} - -external interface EditorOptions { - var BaseIndentSize: Number? - get() = definedExternally - set(value) = definedExternally - var IndentSize: Number - var TabSize: Number - var NewLineCharacter: String - var ConvertTabsToSpaces: Boolean - var IndentStyle: IndentStyle -} - -external interface EditorSettings { - var baseIndentSize: Number? - get() = definedExternally - set(value) = definedExternally - var indentSize: Number? - get() = definedExternally - set(value) = definedExternally - var tabSize: Number? - get() = definedExternally - set(value) = definedExternally - var newLineCharacter: String? - get() = definedExternally - set(value) = definedExternally - var convertTabsToSpaces: Boolean? - get() = definedExternally - set(value) = definedExternally - var indentStyle: IndentStyle? - get() = definedExternally - set(value) = definedExternally - var trimTrailingWhitespace: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface FormatCodeOptions : EditorOptions { - var InsertSpaceAfterCommaDelimiter: Boolean - var InsertSpaceAfterSemicolonInForStatements: Boolean - var InsertSpaceBeforeAndAfterBinaryOperators: Boolean - var InsertSpaceAfterConstructor: Boolean? - get() = definedExternally - set(value) = definedExternally - var InsertSpaceAfterKeywordsInControlFlowStatements: Boolean - var InsertSpaceAfterFunctionKeywordForAnonymousFunctions: Boolean - var InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: Boolean - var InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: Boolean - var InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: Boolean? - get() = definedExternally - set(value) = definedExternally - var InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: Boolean - var InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: Boolean? - get() = definedExternally - set(value) = definedExternally - var InsertSpaceAfterTypeAssertion: Boolean? - get() = definedExternally - set(value) = definedExternally - var InsertSpaceBeforeFunctionParenthesis: Boolean? - get() = definedExternally - set(value) = definedExternally - var PlaceOpenBraceOnNewLineForFunctions: Boolean - var PlaceOpenBraceOnNewLineForControlBlocks: Boolean - var insertSpaceBeforeTypeAnnotation: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface FormatCodeSettings : EditorSettings { - var insertSpaceAfterCommaDelimiter: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterSemicolonInForStatements: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceBeforeAndAfterBinaryOperators: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterConstructor: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterKeywordsInControlFlowStatements: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterFunctionKeywordForAnonymousFunctions: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterOpeningAndBeforeClosingEmptyBraces: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceAfterTypeAssertion: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceBeforeFunctionParenthesis: Boolean? - get() = definedExternally - set(value) = definedExternally - var placeOpenBraceOnNewLineForFunctions: Boolean? - get() = definedExternally - set(value) = definedExternally - var placeOpenBraceOnNewLineForControlBlocks: Boolean? - get() = definedExternally - set(value) = definedExternally - var insertSpaceBeforeTypeAnnotation: Boolean? - get() = definedExternally - set(value) = definedExternally - var indentMultiLineObjectLiteralBeginningOnBlankLine: Boolean? - get() = definedExternally - set(value) = definedExternally - var semicolons: SemicolonPreference? - get() = definedExternally - set(value) = definedExternally -} - -external fun getDefaultFormatCodeSettings(newLineCharacter: String = definedExternally): FormatCodeSettings - -external interface DefinitionInfo : DocumentSpan { - var kind: ScriptElementKind - var name: String - var containerKind: ScriptElementKind - var containerName: String - var unverified: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface DefinitionInfoAndBoundSpan { - var definitions: Array? - get() = definedExternally - set(value) = definedExternally - var textSpan: TextSpan -} - -external interface ReferencedSymbolDefinitionInfo : DefinitionInfo { - var displayParts: Array -} - -external interface ReferencedSymbol { - var definition: ReferencedSymbolDefinitionInfo - var references: Array -} - -external enum class SymbolDisplayPartKind { - aliasName /* = 0 */, - className /* = 1 */, - enumName /* = 2 */, - fieldName /* = 3 */, - interfaceName /* = 4 */, - keyword /* = 5 */, - lineBreak /* = 6 */, - numericLiteral /* = 7 */, - stringLiteral /* = 8 */, - localName /* = 9 */, - methodName /* = 10 */, - moduleName /* = 11 */, - operator /* = 12 */, - parameterName /* = 13 */, - propertyName /* = 14 */, - punctuation /* = 15 */, - space /* = 16 */, - text /* = 17 */, - typeParameterName /* = 18 */, - enumMemberName /* = 19 */, - functionName /* = 20 */, - regularExpressionLiteral /* = 21 */, - link /* = 22 */, - linkName /* = 23 */, - linkText /* = 24 */ -} - -external interface SymbolDisplayPart { - var text: String - var kind: String -} - -external interface JSDocLinkDisplayPart : SymbolDisplayPart { - var target: DocumentSpan -} - -external interface JSDocTagInfo { - var name: String - var text: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface QuickInfo { - var kind: ScriptElementKind - var kindModifiers: String - var textSpan: TextSpan - var displayParts: Array? - get() = definedExternally - set(value) = definedExternally - var documentation: Array? - get() = definedExternally - set(value) = definedExternally - var tags: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface RenameInfoSuccess { - var canRename: Boolean - var fileToRename: String? - get() = definedExternally - set(value) = definedExternally - var displayName: String - var fullDisplayName: String - var kind: ScriptElementKind - var kindModifiers: String - var triggerSpan: TextSpan -} - -external interface RenameInfoFailure { - var canRename: Boolean - var localizedErrorMessage: String -} - -external interface RenameInfoOptions { - var allowRenameOfImportPath: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface DocCommentTemplateOptions { - var generateReturnInDocTemplate: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface SignatureHelpParameter { - var name: String - var documentation: Array - var displayParts: Array - var isOptional: Boolean - var isRest: Boolean? - get() = definedExternally - set(value) = definedExternally -} - -external interface SelectionRange { - var textSpan: TextSpan - var parent: SelectionRange? - get() = definedExternally - set(value) = definedExternally -} - -external interface SignatureHelpItem { - var isVariadic: Boolean - var prefixDisplayParts: Array - var suffixDisplayParts: Array - var separatorDisplayParts: Array - var parameters: Array - var documentation: Array - var tags: Array -} - -external interface SignatureHelpItems { - var items: Array - var applicableSpan: TextSpan - var selectedItemIndex: Number - var argumentIndex: Number - var argumentCount: Number -} - -external interface CompletionInfo { - var isGlobalCompletion: Boolean - var isMemberCompletion: Boolean - var optionalReplacementSpan: TextSpan? - get() = definedExternally - set(value) = definedExternally - var isNewIdentifierLocation: Boolean - var isIncomplete: Boolean? - get() = definedExternally - set(value) = definedExternally - var entries: Array -} - -external interface CompletionEntryData { - var fileName: String? - get() = definedExternally - set(value) = definedExternally - var ambientModuleName: String? - get() = definedExternally - set(value) = definedExternally - var isPackageJsonImport: Boolean? - get() = definedExternally - set(value) = definedExternally - var exportName: String - var moduleSpecifier: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface CompletionEntry { - var name: String - var kind: ScriptElementKind - var kindModifiers: String? - get() = definedExternally - set(value) = definedExternally - var sortText: String - var insertText: String? - get() = definedExternally - set(value) = definedExternally - var isSnippet: Boolean? - get() = definedExternally - set(value) = definedExternally - var replacementSpan: TextSpan? - get() = definedExternally - set(value) = definedExternally - var hasAction: Boolean? - get() = definedExternally - set(value) = definedExternally - var source: String? - get() = definedExternally - set(value) = definedExternally - var sourceDisplay: Array? - get() = definedExternally - set(value) = definedExternally - var isRecommended: Boolean? - get() = definedExternally - set(value) = definedExternally - var isFromUncheckedFile: Boolean? - get() = definedExternally - set(value) = definedExternally - var isPackageJsonImport: Boolean? - get() = definedExternally - set(value) = definedExternally - var isImportStatementCompletion: Boolean? - get() = definedExternally - set(value) = definedExternally - var data: CompletionEntryData? - get() = definedExternally - set(value) = definedExternally -} - -external interface CompletionEntryDetails { - var name: String - var kind: ScriptElementKind - var kindModifiers: String - var displayParts: Array - var documentation: Array? - get() = definedExternally - set(value) = definedExternally - var tags: Array? - get() = definedExternally - set(value) = definedExternally - var codeActions: Array? - get() = definedExternally - set(value) = definedExternally - var source: Array? - get() = definedExternally - set(value) = definedExternally - var sourceDisplay: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface OutliningSpan { - var textSpan: TextSpan - var hintSpan: TextSpan - var bannerText: String - var autoCollapse: Boolean - var kind: OutliningSpanKind -} - -external enum class OutliningSpanKind { - Comment /* = "comment" */, - Region /* = "region" */, - Code /* = "code" */, - Imports /* = "imports" */ -} - -external enum class OutputFileType { - JavaScript /* = 0 */, - SourceMap /* = 1 */, - Declaration /* = 2 */ -} - -external enum class EndOfLineState { - None /* = 0 */, - InMultiLineCommentTrivia /* = 1 */, - InSingleQuoteStringLiteral /* = 2 */, - InDoubleQuoteStringLiteral /* = 3 */, - InTemplateHeadOrNoSubstitutionTemplate /* = 4 */, - InTemplateMiddleOrTail /* = 5 */, - InTemplateSubstitutionPosition /* = 6 */ -} - -external enum class TokenClass { - Punctuation /* = 0 */, - Keyword /* = 1 */, - Operator /* = 2 */, - Comment /* = 3 */, - Whitespace /* = 4 */, - Identifier /* = 5 */, - NumberLiteral /* = 6 */, - BigIntLiteral /* = 7 */, - StringLiteral /* = 8 */, - RegExpLiteral /* = 9 */ -} - -external interface ClassificationResult { - var finalLexState: EndOfLineState - var entries: Array -} - -external interface ClassificationInfo { - var length: Number - var classification: TokenClass -} - -external interface Classifier { - fun getClassificationsForLine(text: String, lexState: EndOfLineState, syntacticClassifierAbsent: Boolean): ClassificationResult - fun getEncodedLexicalClassifications(text: String, endOfLineState: EndOfLineState, syntacticClassifierAbsent: Boolean): Classifications -} - -external enum class ScriptElementKind { - unknown /* = "" */, - warning /* = "warning" */, - keyword /* = "keyword" */, - scriptElement /* = "script" */, - moduleElement /* = "module" */, - classElement /* = "class" */, - localClassElement /* = "local class" */, - interfaceElement /* = "interface" */, - typeElement /* = "type" */, - enumElement /* = "enum" */, - enumMemberElement /* = "enum member" */, - variableElement /* = "var" */, - localVariableElement /* = "local var" */, - functionElement /* = "function" */, - localFunctionElement /* = "local function" */, - memberFunctionElement /* = "method" */, - memberGetAccessorElement /* = "getter" */, - memberSetAccessorElement /* = "setter" */, - memberVariableElement /* = "property" */, - constructorImplementationElement /* = "constructor" */, - callSignatureElement /* = "call" */, - indexSignatureElement /* = "index" */, - constructSignatureElement /* = "construct" */, - parameterElement /* = "parameter" */, - typeParameterElement /* = "type parameter" */, - primitiveType /* = "primitive type" */, - label /* = "label" */, - alias /* = "alias" */, - constElement /* = "const" */, - letElement /* = "let" */, - directory /* = "directory" */, - externalModuleName /* = "external module name" */, - jsxAttribute /* = "JSX attribute" */, - string /* = "string" */, - link /* = "link" */, - linkName /* = "link name" */, - linkText /* = "link text" */ -} - -external enum class ScriptElementKindModifier { - none /* = "" */, - publicMemberModifier /* = "public" */, - privateMemberModifier /* = "private" */, - protectedMemberModifier /* = "protected" */, - exportedModifier /* = "export" */, - ambientModifier /* = "declare" */, - staticModifier /* = "static" */, - abstractModifier /* = "abstract" */, - optionalModifier /* = "optional" */, - deprecatedModifier /* = "deprecated" */, - dtsModifier /* = ".d.ts" */, - tsModifier /* = ".ts" */, - tsxModifier /* = ".tsx" */, - jsModifier /* = ".js" */, - jsxModifier /* = ".jsx" */, - jsonModifier /* = ".json" */ -} - -external enum class ClassificationTypeNames { - comment /* = "comment" */, - identifier /* = "identifier" */, - keyword /* = "keyword" */, - numericLiteral /* = "number" */, - bigintLiteral /* = "bigint" */, - operator /* = "operator" */, - stringLiteral /* = "string" */, - whiteSpace /* = "whitespace" */, - text /* = "text" */, - punctuation /* = "punctuation" */, - className /* = "class name" */, - enumName /* = "enum name" */, - interfaceName /* = "interface name" */, - moduleName /* = "module name" */, - typeParameterName /* = "type parameter name" */, - typeAliasName /* = "type alias name" */, - parameterName /* = "parameter name" */, - docCommentTagName /* = "doc comment tag name" */, - jsxOpenTagName /* = "jsx open tag name" */, - jsxCloseTagName /* = "jsx close tag name" */, - jsxSelfClosingTagName /* = "jsx self closing tag name" */, - jsxAttribute /* = "jsx attribute" */, - jsxText /* = "jsx text" */, - jsxAttributeStringLiteralValue /* = "jsx attribute string literal value" */ -} - -external enum class ClassificationType { - comment /* = 1 */, - identifier /* = 2 */, - keyword /* = 3 */, - numericLiteral /* = 4 */, - operator /* = 5 */, - stringLiteral /* = 6 */, - regularExpressionLiteral /* = 7 */, - whiteSpace /* = 8 */, - text /* = 9 */, - punctuation /* = 10 */, - className /* = 11 */, - enumName /* = 12 */, - interfaceName /* = 13 */, - moduleName /* = 14 */, - typeParameterName /* = 15 */, - typeAliasName /* = 16 */, - parameterName /* = 17 */, - docCommentTagName /* = 18 */, - jsxOpenTagName /* = 19 */, - jsxCloseTagName /* = 20 */, - jsxSelfClosingTagName /* = 21 */, - jsxAttribute /* = 22 */, - jsxText /* = 23 */, - jsxAttributeStringLiteralValue /* = 24 */, - bigintLiteral /* = 25 */ -} - -external interface InlayHintsContext { - var file: SourceFile - var program: Program - var cancellationToken: CancellationToken - var host: LanguageServiceHost - var span: TextSpan - var preferences: InlayHintsOptions -} - -external fun createClassifier(): Classifier - -external interface DocumentHighlights { - var fileName: String - var highlightSpans: Array -} - -external interface DocumentRegistry { - fun acquireDocument(fileName: String, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: String, scriptKind: ScriptKind = definedExternally): SourceFile - fun acquireDocumentWithKey(fileName: String, path: String /* String & `T$3` */, compilationSettings: CompilerOptions, key: String /* String & `T$29` */, scriptSnapshot: IScriptSnapshot, version: String, scriptKind: ScriptKind = definedExternally): SourceFile - fun updateDocument(fileName: String, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: String, scriptKind: ScriptKind = definedExternally): SourceFile - fun updateDocumentWithKey(fileName: String, path: String /* String & `T$3` */, compilationSettings: CompilerOptions, key: String /* String & `T$29` */, scriptSnapshot: IScriptSnapshot, version: String, scriptKind: ScriptKind = definedExternally): SourceFile - fun getKeyForCompilationSettings(settings: CompilerOptions): String /* String & `T$29` */ - fun releaseDocument(fileName: String, compilationSettings: CompilerOptions) - fun releaseDocument(fileName: String, compilationSettings: CompilerOptions, scriptKind: ScriptKind) - fun releaseDocumentWithKey(path: String /* String & `T$3` */, key: String /* String & `T$29` */) - fun releaseDocumentWithKey(path: String /* String & `T$3` */, key: String /* String & `T$29` */, scriptKind: ScriptKind) - fun reportStats(): String -} - -external interface `T$29` { - var __bucketKey: Any -} - -external fun createDocumentRegistry(useCaseSensitiveFileNames: Boolean = definedExternally, currentDirectory: String = definedExternally): DocumentRegistry - -external fun preProcessFile(sourceText: String, readImportFiles: Boolean = definedExternally, detectJavaScriptImports: Boolean = definedExternally): PreProcessedFileInfo - -external interface TranspileOptions { - var compilerOptions: CompilerOptions? - get() = definedExternally - set(value) = definedExternally - var fileName: String? - get() = definedExternally - set(value) = definedExternally - var reportDiagnostics: Boolean? - get() = definedExternally - set(value) = definedExternally - var moduleName: String? - get() = definedExternally - set(value) = definedExternally - var renamedDependencies: MapLike? - get() = definedExternally - set(value) = definedExternally - var transformers: CustomTransformers? - get() = definedExternally - set(value) = definedExternally -} - -external interface TranspileOutput { - var outputText: String - var diagnostics: Array? - get() = definedExternally - set(value) = definedExternally - var sourceMapText: String? - get() = definedExternally - set(value) = definedExternally -} - -external fun transpileModule(input: String, transpileOptions: TranspileOptions): TranspileOutput - -external fun transpile(input: String, compilerOptions: CompilerOptions = definedExternally, fileName: String = definedExternally, diagnostics: Array = definedExternally, moduleName: String = definedExternally): String - -external var servicesVersion: Any - -external fun toEditorSettings(options: EditorOptions): EditorSettings - -external fun toEditorSettings(options: EditorSettings): EditorSettings - -external fun displayPartsToString(displayParts: Array?): String - -external fun getDefaultCompilerOptions(): CompilerOptions - -external fun getSupportedCodeFixes(): Array - -external fun createLanguageServiceSourceFile(fileName: String, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: String, setNodeParents: Boolean, scriptKind: ScriptKind = definedExternally): SourceFile - -external fun updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: String, textChangeRange: TextChangeRange?, aggressiveChecks: Boolean = definedExternally): SourceFile - -external fun createLanguageService(host: LanguageServiceHost, documentRegistry: DocumentRegistry = definedExternally, syntaxOnlyOrLanguageServiceMode: Boolean = definedExternally): LanguageService - -external fun createLanguageService(host: LanguageServiceHost): LanguageService - -external fun createLanguageService(host: LanguageServiceHost, documentRegistry: DocumentRegistry = definedExternally): LanguageService - -external fun createLanguageService(host: LanguageServiceHost, documentRegistry: DocumentRegistry = definedExternally, syntaxOnlyOrLanguageServiceMode: LanguageServiceMode = definedExternally): LanguageService - -external fun getDefaultLibFilePath(options: CompilerOptions): String - -external fun transform(source: T, transformers: Array>, compilerOptions: CompilerOptions = definedExternally): TransformationResult - -external fun transform(source: T, transformers: Array>): TransformationResult - -external fun transform(source: Array, transformers: Array>, compilerOptions: CompilerOptions = definedExternally): TransformationResult - -external fun transform(source: Array, transformers: Array>): TransformationResult - -external var createNodeArray: (elements: Array?, hasTrailingComma: Boolean?) -> NodeArray - -external var createNumericLiteral: (value: dynamic /* String | Number */, numericLiteralFlags: TokenFlags?) -> NumericLiteral - -external var createBigIntLiteral: (value: dynamic /* String | PseudoBigInt */) -> BigIntLiteral - -external object createStringLiteral { - @nativeInvoke - operator fun invoke(text: String, isSingleQuote: Boolean? = definedExternally): StringLiteral - @nativeInvoke - operator fun invoke(text: String, isSingleQuote: Boolean? = definedExternally, hasExtendedUnicodeEscape: Boolean? = definedExternally): StringLiteral -} - -external var createStringLiteralFromNode: (sourceNode: dynamic /* Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral */, isSingleQuote: Boolean?) -> StringLiteral - -external var createRegularExpressionLiteral: (text: String) -> RegularExpressionLiteral - -external var createLoopVariable: (reservedInNestedScopes: Boolean?) -> Identifier - -external var createUniqueName: (text: String, flags: GeneratedIdentifierFlags?) -> Identifier - -external var createPrivateIdentifier: (text: String) -> PrivateIdentifier - -external var createSuper: () -> SuperExpression - -external var createThis: () -> ThisExpression - -external var createNull: () -> NullLiteral - -external var createTrue: () -> TrueLiteral - -external var createFalse: () -> FalseLiteral - -external var createModifier: (kind: T) -> ModifierToken - -external var createModifiersFromModifierFlags: (flags: ModifierFlags) -> Array - -external var createQualifiedName: (left: dynamic /* Identifier | QualifiedName */, right: dynamic /* String | Identifier */) -> QualifiedName - -external var updateQualifiedName: (node: QualifiedName, left: dynamic /* Identifier | QualifiedName */, right: Identifier) -> QualifiedName - -external var createComputedPropertyName: (expression: Expression) -> ComputedPropertyName - -external var updateComputedPropertyName: (node: ComputedPropertyName, expression: Expression) -> ComputedPropertyName - -external var createTypeParameterDeclaration: (name: dynamic /* String | Identifier */, constraint: TypeNode?, defaultType: TypeNode?) -> TypeParameterDeclaration - -external var updateTypeParameterDeclaration: (node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode?, defaultType: TypeNode?) -> TypeParameterDeclaration - -external var createParameter: (decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: dynamic /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, questionToken: QuestionToken?, type: TypeNode?, initializer: Expression?) -> ParameterDeclaration - -external var updateParameter: (node: ParameterDeclaration, decorators: Array?, modifiers: Array?, dotDotDotToken: DotDotDotToken?, name: dynamic /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, questionToken: QuestionToken?, type: TypeNode?, initializer: Expression?) -> ParameterDeclaration - -external var createDecorator: (expression: Expression) -> Decorator - -external var updateDecorator: (node: Decorator, expression: Expression) -> Decorator - -external var createProperty: (decorators: Array?, modifiers: Array?, name: dynamic /* String | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, questionOrExclamationToken: dynamic /* QuestionToken? | ExclamationToken? */, type: TypeNode?, initializer: Expression?) -> PropertyDeclaration - -external var updateProperty: (node: PropertyDeclaration, decorators: Array?, modifiers: Array?, name: dynamic /* String | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, questionOrExclamationToken: dynamic /* QuestionToken? | ExclamationToken? */, type: TypeNode?, initializer: Expression?) -> PropertyDeclaration - -external var createMethod: (decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: dynamic /* String | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?) -> MethodDeclaration - -external var updateMethod: (node: MethodDeclaration, decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, questionToken: QuestionToken?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?) -> MethodDeclaration - -external var createConstructor: (decorators: Array?, modifiers: Array?, parameters: Array, body: Block?) -> ConstructorDeclaration - -external var updateConstructor: (node: ConstructorDeclaration, decorators: Array?, modifiers: Array?, parameters: Array, body: Block?) -> ConstructorDeclaration - -external var createGetAccessor: (decorators: Array?, modifiers: Array?, name: dynamic /* String | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, parameters: Array, type: TypeNode?, body: Block?) -> GetAccessorDeclaration - -external var updateGetAccessor: (node: GetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, parameters: Array, type: TypeNode?, body: Block?) -> GetAccessorDeclaration - -external var createSetAccessor: (decorators: Array?, modifiers: Array?, name: dynamic /* String | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, parameters: Array, body: Block?) -> SetAccessorDeclaration - -external var updateSetAccessor: (node: SetAccessorDeclaration, decorators: Array?, modifiers: Array?, name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, parameters: Array, body: Block?) -> SetAccessorDeclaration - -external var createCallSignature: (typeParameters: Array?, parameters: Array, type: TypeNode?) -> CallSignatureDeclaration - -external var updateCallSignature: (node: CallSignatureDeclaration, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?) -> CallSignatureDeclaration - -external var createConstructSignature: (typeParameters: Array?, parameters: Array, type: TypeNode?) -> ConstructSignatureDeclaration - -external var updateConstructSignature: (node: ConstructSignatureDeclaration, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?) -> ConstructSignatureDeclaration - -external var updateIndexSignature: (node: IndexSignatureDeclaration, decorators: Array?, modifiers: Array?, parameters: Array, type: TypeNode) -> IndexSignatureDeclaration - -external var createKeywordTypeNode: (kind: TKind) -> KeywordTypeNode - -external var createTypePredicateNodeWithModifier: (assertsModifier: AssertsKeyword?, parameterName: dynamic /* String | Identifier | ThisTypeNode */, type: TypeNode?) -> TypePredicateNode - -external var updateTypePredicateNodeWithModifier: (node: TypePredicateNode, assertsModifier: AssertsKeyword?, parameterName: dynamic /* Identifier | ThisTypeNode */, type: TypeNode?) -> TypePredicateNode - -external var createTypeReferenceNode: (typeName: dynamic /* String | Identifier | QualifiedName */, typeArguments: Array?) -> TypeReferenceNode - -external var updateTypeReferenceNode: (node: TypeReferenceNode, typeName: dynamic /* Identifier | QualifiedName */, typeArguments: NodeArray?) -> TypeReferenceNode - -external var createFunctionTypeNode: (typeParameters: Array?, parameters: Array, type: TypeNode) -> FunctionTypeNode - -external var updateFunctionTypeNode: (node: FunctionTypeNode, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode) -> FunctionTypeNode - -external var createConstructorTypeNode: (typeParameters: Array?, parameters: Array, type: TypeNode) -> ConstructorTypeNode - -external var updateConstructorTypeNode: (node: ConstructorTypeNode, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode) -> ConstructorTypeNode - -external var createTypeQueryNode: (exprName: dynamic /* Identifier | QualifiedName */) -> TypeQueryNode - -external var updateTypeQueryNode: (node: TypeQueryNode, exprName: dynamic /* Identifier | QualifiedName */) -> TypeQueryNode - -external var createTypeLiteralNode: (members: Array?) -> TypeLiteralNode - -external var updateTypeLiteralNode: (node: TypeLiteralNode, members: NodeArray) -> TypeLiteralNode - -external var createArrayTypeNode: (elementType: TypeNode) -> ArrayTypeNode - -external var updateArrayTypeNode: (node: ArrayTypeNode, elementType: TypeNode) -> ArrayTypeNode - -external var createTupleTypeNode: (elements: Array) -> TupleTypeNode - -external var updateTupleTypeNode: (node: TupleTypeNode, elements: Array) -> TupleTypeNode - -external var createOptionalTypeNode: (type: TypeNode) -> OptionalTypeNode - -external var updateOptionalTypeNode: (node: OptionalTypeNode, type: TypeNode) -> OptionalTypeNode - -external var createRestTypeNode: (type: TypeNode) -> RestTypeNode - -external var updateRestTypeNode: (node: RestTypeNode, type: TypeNode) -> RestTypeNode - -external var createUnionTypeNode: (types: Array) -> UnionTypeNode - -external var updateUnionTypeNode: (node: UnionTypeNode, types: NodeArray) -> UnionTypeNode - -external var createIntersectionTypeNode: (types: Array) -> IntersectionTypeNode - -external var updateIntersectionTypeNode: (node: IntersectionTypeNode, types: NodeArray) -> IntersectionTypeNode - -external var createConditionalTypeNode: (checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) -> ConditionalTypeNode - -external var updateConditionalTypeNode: (node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode) -> ConditionalTypeNode - -external var createInferTypeNode: (typeParameter: TypeParameterDeclaration) -> InferTypeNode - -external var updateInferTypeNode: (node: InferTypeNode, typeParameter: TypeParameterDeclaration) -> InferTypeNode - -external var createImportTypeNode: (argument: TypeNode, qualifier: dynamic /* Identifier? | QualifiedName? */, typeArguments: Array?, isTypeOf: Boolean?) -> ImportTypeNode - -external var updateImportTypeNode: (node: ImportTypeNode, argument: TypeNode, qualifier: dynamic /* Identifier? | QualifiedName? */, typeArguments: Array?, isTypeOf: Boolean?) -> ImportTypeNode - -external var createParenthesizedType: (type: TypeNode) -> ParenthesizedTypeNode - -external var updateParenthesizedType: (node: ParenthesizedTypeNode, type: TypeNode) -> ParenthesizedTypeNode - -external var createThisTypeNode: () -> ThisTypeNode - -external var updateTypeOperatorNode: (node: TypeOperatorNode, type: TypeNode) -> TypeOperatorNode - -external var createIndexedAccessTypeNode: (objectType: TypeNode, indexType: TypeNode) -> IndexedAccessTypeNode - -external var updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) -> IndexedAccessTypeNode - -external var createMappedTypeNode: (readonlyToken: dynamic /* ReadonlyKeyword? | PlusToken? | MinusToken? */, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: dynamic /* QuestionToken? | PlusToken? | MinusToken? */, type: TypeNode?) -> MappedTypeNode - -external var updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: dynamic /* ReadonlyKeyword? | PlusToken? | MinusToken? */, typeParameter: TypeParameterDeclaration, nameType: TypeNode?, questionToken: dynamic /* QuestionToken? | PlusToken? | MinusToken? */, type: TypeNode?) -> MappedTypeNode - -external var createLiteralTypeNode: (literal: dynamic /* LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral */) -> LiteralTypeNode - -external var updateLiteralTypeNode: (node: LiteralTypeNode, literal: dynamic /* LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral */) -> LiteralTypeNode - -external var createObjectBindingPattern: (elements: Array) -> ObjectBindingPattern - -external var updateObjectBindingPattern: (node: ObjectBindingPattern, elements: Array) -> ObjectBindingPattern - -external var createArrayBindingPattern: (elements: Array) -> ArrayBindingPattern - -external var updateArrayBindingPattern: (node: ArrayBindingPattern, elements: Array) -> ArrayBindingPattern - -external var createBindingElement: (dotDotDotToken: DotDotDotToken?, propertyName: dynamic /* String? | Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */, name: dynamic /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, initializer: Expression?) -> BindingElement - -external var updateBindingElement: (node: BindingElement, dotDotDotToken: DotDotDotToken?, propertyName: dynamic /* Identifier? | StringLiteral? | NumericLiteral? | ComputedPropertyName? | PrivateIdentifier? */, name: dynamic /* Identifier | ObjectBindingPattern | ArrayBindingPattern */, initializer: Expression?) -> BindingElement - -external var createArrayLiteral: (elements: Array?, multiLine: Boolean?) -> ArrayLiteralExpression - -external var updateArrayLiteral: (node: ArrayLiteralExpression, elements: Array) -> ArrayLiteralExpression - -external var createObjectLiteral: (properties: Array?, multiLine: Boolean?) -> ObjectLiteralExpression - -external var updateObjectLiteral: (node: ObjectLiteralExpression, properties: Array) -> ObjectLiteralExpression - -external var createPropertyAccess: (expression: Expression, name: dynamic /* String | Identifier | PrivateIdentifier */) -> PropertyAccessExpression - -external var updatePropertyAccess: (node: PropertyAccessExpression, expression: Expression, name: dynamic /* Identifier | PrivateIdentifier */) -> PropertyAccessExpression - -external var createPropertyAccessChain: (expression: Expression, questionDotToken: QuestionDotToken?, name: dynamic /* String | Identifier | PrivateIdentifier */) -> PropertyAccessChain - -external var updatePropertyAccessChain: (node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken?, name: dynamic /* Identifier | PrivateIdentifier */) -> PropertyAccessChain - -external var createElementAccess: (expression: Expression, index: dynamic /* Number | Expression */) -> ElementAccessExpression - -external var updateElementAccess: (node: ElementAccessExpression, expression: Expression, argumentExpression: Expression) -> ElementAccessExpression - -external var createElementAccessChain: (expression: Expression, questionDotToken: QuestionDotToken?, index: dynamic /* Number | Expression */) -> ElementAccessChain - -external var updateElementAccessChain: (node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken?, argumentExpression: Expression) -> ElementAccessChain - -external var createCall: (expression: Expression, typeArguments: Array?, argumentsArray: Array?) -> CallExpression - -external var updateCall: (node: CallExpression, expression: Expression, typeArguments: Array?, argumentsArray: Array) -> CallExpression - -external var createCallChain: (expression: Expression, questionDotToken: QuestionDotToken?, typeArguments: Array?, argumentsArray: Array?) -> CallChain - -external var updateCallChain: (node: CallChain, expression: Expression, questionDotToken: QuestionDotToken?, typeArguments: Array?, argumentsArray: Array) -> CallChain - -external var createNew: (expression: Expression, typeArguments: Array?, argumentsArray: Array?) -> NewExpression - -external var updateNew: (node: NewExpression, expression: Expression, typeArguments: Array?, argumentsArray: Array?) -> NewExpression - -external var createTypeAssertion: (type: TypeNode, expression: Expression) -> TypeAssertion - -external var updateTypeAssertion: (node: TypeAssertion, type: TypeNode, expression: Expression) -> TypeAssertion - -external var createParen: (expression: Expression) -> ParenthesizedExpression - -external var updateParen: (node: ParenthesizedExpression, expression: Expression) -> ParenthesizedExpression - -external var createFunctionExpression: (modifiers: Array?, asteriskToken: AsteriskToken?, name: dynamic /* String? | Identifier? */, typeParameters: Array?, parameters: Array?, type: TypeNode?, body: Block) -> FunctionExpression - -external var updateFunctionExpression: (node: FunctionExpression, modifiers: Array?, asteriskToken: AsteriskToken?, name: Identifier?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block) -> FunctionExpression - -external var createDelete: (expression: Expression) -> DeleteExpression - -external var updateDelete: (node: DeleteExpression, expression: Expression) -> DeleteExpression - -external var createTypeOf: (expression: Expression) -> TypeOfExpression - -external var updateTypeOf: (node: TypeOfExpression, expression: Expression) -> TypeOfExpression - -external var createVoid: (expression: Expression) -> VoidExpression - -external var updateVoid: (node: VoidExpression, expression: Expression) -> VoidExpression - -external var createAwait: (expression: Expression) -> AwaitExpression - -external var updateAwait: (node: AwaitExpression, expression: Expression) -> AwaitExpression - -external var createPrefix: (operator: dynamic /* SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken */, operand: Expression) -> PrefixUnaryExpression - -external var updatePrefix: (node: PrefixUnaryExpression, operand: Expression) -> PrefixUnaryExpression - -external var createPostfix: (operand: Expression, operator: dynamic /* SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken */) -> PostfixUnaryExpression - -external var updatePostfix: (node: PostfixUnaryExpression, operand: Expression) -> PostfixUnaryExpression - -external var createBinary: (left: Expression, operator: dynamic /* SyntaxKind.QuestionQuestionToken | ExponentiationOperator | SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword | SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.CommaToken | BinaryOperatorToken */, right: Expression) -> BinaryExpression - -external var updateConditional: (node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression) -> ConditionalExpression - -external var createTemplateExpression: (head: TemplateHead, templateSpans: Array) -> TemplateExpression - -external var updateTemplateExpression: (node: TemplateExpression, head: TemplateHead, templateSpans: Array) -> TemplateExpression - -external object createTemplateHead { - @nativeInvoke - operator fun invoke(text: String, rawText: String? = definedExternally, templateFlags: TokenFlags? = definedExternally): TemplateHead - @nativeInvoke - operator fun invoke(text: String?, rawText: String, templateFlags: TokenFlags? = definedExternally): TemplateHead -} - -external object createTemplateMiddle { - @nativeInvoke - operator fun invoke(text: String, rawText: String? = definedExternally, templateFlags: TokenFlags? = definedExternally): TemplateMiddle - @nativeInvoke - operator fun invoke(text: String?, rawText: String, templateFlags: TokenFlags? = definedExternally): TemplateMiddle -} - -external object createTemplateTail { - @nativeInvoke - operator fun invoke(text: String, rawText: String? = definedExternally, templateFlags: TokenFlags? = definedExternally): TemplateTail - @nativeInvoke - operator fun invoke(text: String?, rawText: String, templateFlags: TokenFlags? = definedExternally): TemplateTail -} - -external object createNoSubstitutionTemplateLiteral { - @nativeInvoke - operator fun invoke(text: String, rawText: String? = definedExternally): NoSubstitutionTemplateLiteral - @nativeInvoke - operator fun invoke(text: String?, rawText: String): NoSubstitutionTemplateLiteral -} - -external var updateYield: (node: YieldExpression, asteriskToken: AsteriskToken?, expression: Expression?) -> YieldExpression - -external var createSpread: (expression: Expression) -> SpreadElement - -external var updateSpread: (node: SpreadElement, expression: Expression) -> SpreadElement - -external var createOmittedExpression: () -> OmittedExpression - -external var createAsExpression: (expression: Expression, type: TypeNode) -> AsExpression - -external var updateAsExpression: (node: AsExpression, expression: Expression, type: TypeNode) -> AsExpression - -external var createNonNullExpression: (expression: Expression) -> NonNullExpression - -external var updateNonNullExpression: (node: NonNullExpression, expression: Expression) -> NonNullExpression - -external var createNonNullChain: (expression: Expression) -> NonNullChain - -external var updateNonNullChain: (node: NonNullChain, expression: Expression) -> NonNullChain - -external var createMetaProperty: (keywordToken: dynamic /* SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword */, name: Identifier) -> MetaProperty - -external var updateMetaProperty: (node: MetaProperty, name: Identifier) -> MetaProperty - -external var createTemplateSpan: (expression: Expression, literal: dynamic /* TemplateMiddle | TemplateTail */) -> TemplateSpan - -external var updateTemplateSpan: (node: TemplateSpan, expression: Expression, literal: dynamic /* TemplateMiddle | TemplateTail */) -> TemplateSpan - -external var createSemicolonClassElement: () -> SemicolonClassElement - -external var createBlock: (statements: Array, multiLine: Boolean?) -> Block - -external var updateBlock: (node: Block, statements: Array) -> Block - -external var createVariableStatement: (modifiers: Array?, declarationList: dynamic /* VariableDeclarationList | Array */) -> VariableStatement - -external var updateVariableStatement: (node: VariableStatement, modifiers: Array?, declarationList: VariableDeclarationList) -> VariableStatement - -external var createEmptyStatement: () -> EmptyStatement - -external var createExpressionStatement: (expression: Expression) -> ExpressionStatement - -external var updateExpressionStatement: (node: ExpressionStatement, expression: Expression) -> ExpressionStatement - -external var createStatement: (expression: Expression) -> ExpressionStatement - -external var updateStatement: (node: ExpressionStatement, expression: Expression) -> ExpressionStatement - -external var createIf: (expression: Expression, thenStatement: Statement, elseStatement: Statement?) -> IfStatement - -external var updateIf: (node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement?) -> IfStatement - -external var createDo: (statement: Statement, expression: Expression) -> DoStatement - -external var updateDo: (node: DoStatement, statement: Statement, expression: Expression) -> DoStatement - -external var createWhile: (expression: Expression, statement: Statement) -> WhileStatement - -external var updateWhile: (node: WhileStatement, expression: Expression, statement: Statement) -> WhileStatement - -external var createFor: (initializer: dynamic /* VariableDeclarationList? | Expression? */, condition: Expression?, incrementor: Expression?, statement: Statement) -> ForStatement - -external var updateFor: (node: ForStatement, initializer: dynamic /* VariableDeclarationList? | Expression? */, condition: Expression?, incrementor: Expression?, statement: Statement) -> ForStatement - -external var createForIn: (initializer: dynamic /* VariableDeclarationList | Expression */, expression: Expression, statement: Statement) -> ForInStatement - -external var updateForIn: (node: ForInStatement, initializer: dynamic /* VariableDeclarationList | Expression */, expression: Expression, statement: Statement) -> ForInStatement - -external var createForOf: (awaitModifier: AwaitKeyword?, initializer: dynamic /* VariableDeclarationList | Expression */, expression: Expression, statement: Statement) -> ForOfStatement - -external var updateForOf: (node: ForOfStatement, awaitModifier: AwaitKeyword?, initializer: dynamic /* VariableDeclarationList | Expression */, expression: Expression, statement: Statement) -> ForOfStatement - -external var createContinue: (label: dynamic /* String? | Identifier? */) -> ContinueStatement - -external var updateContinue: (node: ContinueStatement, label: Identifier?) -> ContinueStatement - -external var createBreak: (label: dynamic /* String? | Identifier? */) -> BreakStatement - -external var updateBreak: (node: BreakStatement, label: Identifier?) -> BreakStatement - -external var createReturn: (expression: Expression?) -> ReturnStatement - -external var updateReturn: (node: ReturnStatement, expression: Expression?) -> ReturnStatement - -external var createWith: (expression: Expression, statement: Statement) -> WithStatement - -external var updateWith: (node: WithStatement, expression: Expression, statement: Statement) -> WithStatement - -external var createSwitch: (expression: Expression, caseBlock: CaseBlock) -> SwitchStatement - -external var updateSwitch: (node: SwitchStatement, expression: Expression, caseBlock: CaseBlock) -> SwitchStatement - -external var createLabel: (label: dynamic /* String | Identifier */, statement: Statement) -> LabeledStatement - -external var updateLabel: (node: LabeledStatement, label: Identifier, statement: Statement) -> LabeledStatement - -external var createThrow: (expression: Expression) -> ThrowStatement - -external var updateThrow: (node: ThrowStatement, expression: Expression) -> ThrowStatement - -external var createTry: (tryBlock: Block, catchClause: CatchClause?, finallyBlock: Block?) -> TryStatement - -external var updateTry: (node: TryStatement, tryBlock: Block, catchClause: CatchClause?, finallyBlock: Block?) -> TryStatement - -external var createDebuggerStatement: () -> DebuggerStatement - -external var createVariableDeclarationList: (declarations: Array, flags: NodeFlags?) -> VariableDeclarationList - -external var updateVariableDeclarationList: (node: VariableDeclarationList, declarations: Array) -> VariableDeclarationList - -external var createFunctionDeclaration: (decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: dynamic /* String? | Identifier? */, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?) -> FunctionDeclaration - -external var updateFunctionDeclaration: (node: FunctionDeclaration, decorators: Array?, modifiers: Array?, asteriskToken: AsteriskToken?, name: Identifier?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Block?) -> FunctionDeclaration - -external var createClassDeclaration: (decorators: Array?, modifiers: Array?, name: dynamic /* String? | Identifier? */, typeParameters: Array?, heritageClauses: Array?, members: Array) -> ClassDeclaration - -external var updateClassDeclaration: (node: ClassDeclaration, decorators: Array?, modifiers: Array?, name: Identifier?, typeParameters: Array?, heritageClauses: Array?, members: Array) -> ClassDeclaration - -external var createInterfaceDeclaration: (decorators: Array?, modifiers: Array?, name: dynamic /* String | Identifier */, typeParameters: Array?, heritageClauses: Array?, members: Array) -> InterfaceDeclaration - -external var updateInterfaceDeclaration: (node: InterfaceDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, typeParameters: Array?, heritageClauses: Array?, members: Array) -> InterfaceDeclaration - -external var createTypeAliasDeclaration: (decorators: Array?, modifiers: Array?, name: dynamic /* String | Identifier */, typeParameters: Array?, type: TypeNode) -> TypeAliasDeclaration - -external var updateTypeAliasDeclaration: (node: TypeAliasDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, typeParameters: Array?, type: TypeNode) -> TypeAliasDeclaration - -external var createEnumDeclaration: (decorators: Array?, modifiers: Array?, name: dynamic /* String | Identifier */, members: Array) -> EnumDeclaration - -external var updateEnumDeclaration: (node: EnumDeclaration, decorators: Array?, modifiers: Array?, name: Identifier, members: Array) -> EnumDeclaration - -external var createModuleDeclaration: (decorators: Array?, modifiers: Array?, name: dynamic /* Identifier | StringLiteral */, body: dynamic /* ModuleBlock? | NamespaceDeclaration? | Identifier? | JSDocNamespaceDeclaration? */, flags: NodeFlags?) -> ModuleDeclaration - -external var updateModuleDeclaration: (node: ModuleDeclaration, decorators: Array?, modifiers: Array?, name: dynamic /* Identifier | StringLiteral */, body: dynamic /* ModuleBlock? | NamespaceDeclaration? | Identifier? | JSDocNamespaceDeclaration? */) -> ModuleDeclaration - -external var createModuleBlock: (statements: Array) -> ModuleBlock - -external var updateModuleBlock: (node: ModuleBlock, statements: Array) -> ModuleBlock - -external var createCaseBlock: (clauses: Array) -> CaseBlock - -external var updateCaseBlock: (node: CaseBlock, clauses: Array) -> CaseBlock - -external var createNamespaceExportDeclaration: (name: dynamic /* String | Identifier */) -> NamespaceExportDeclaration - -external var updateNamespaceExportDeclaration: (node: NamespaceExportDeclaration, name: Identifier) -> NamespaceExportDeclaration - -external var createImportEqualsDeclaration: (decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: dynamic /* String | Identifier */, moduleReference: dynamic /* Identifier | QualifiedName | ExternalModuleReference */) -> ImportEqualsDeclaration - -external var updateImportEqualsDeclaration: (node: ImportEqualsDeclaration, decorators: Array?, modifiers: Array?, isTypeOnly: Boolean, name: Identifier, moduleReference: dynamic /* Identifier | QualifiedName | ExternalModuleReference */) -> ImportEqualsDeclaration - -external var createImportDeclaration: (decorators: Array?, modifiers: Array?, importClause: ImportClause?, moduleSpecifier: Expression) -> ImportDeclaration - -external var updateImportDeclaration: (node: ImportDeclaration, decorators: Array?, modifiers: Array?, importClause: ImportClause?, moduleSpecifier: Expression) -> ImportDeclaration - -external var createNamespaceImport: (name: Identifier) -> NamespaceImport - -external var updateNamespaceImport: (node: NamespaceImport, name: Identifier) -> NamespaceImport - -external var createNamedImports: (elements: Array) -> NamedImports - -external var updateNamedImports: (node: NamedImports, elements: Array) -> NamedImports - -external var createImportSpecifier: (propertyName: Identifier?, name: Identifier) -> ImportSpecifier - -external var updateImportSpecifier: (node: ImportSpecifier, propertyName: Identifier?, name: Identifier) -> ImportSpecifier - -external var createExportAssignment: (decorators: Array?, modifiers: Array?, isExportEquals: Boolean?, expression: Expression) -> ExportAssignment - -external var updateExportAssignment: (node: ExportAssignment, decorators: Array?, modifiers: Array?, expression: Expression) -> ExportAssignment - -external var createNamedExports: (elements: Array) -> NamedExports - -external var updateNamedExports: (node: NamedExports, elements: Array) -> NamedExports - -external var createExportSpecifier: (propertyName: dynamic /* String? | Identifier? */, name: dynamic /* String | Identifier */) -> ExportSpecifier - -external var updateExportSpecifier: (node: ExportSpecifier, propertyName: Identifier?, name: Identifier) -> ExportSpecifier - -external var createExternalModuleReference: (expression: Expression) -> ExternalModuleReference - -external var updateExternalModuleReference: (node: ExternalModuleReference, expression: Expression) -> ExternalModuleReference - -external var createJSDocTypeExpression: (type: TypeNode) -> JSDocTypeExpression - -external var createJSDocTypeTag: (tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: dynamic /* String? | NodeArray? */) -> JSDocTypeTag - -external var createJSDocReturnTag: (tagName: Identifier?, typeExpression: JSDocTypeExpression?, comment: dynamic /* String? | NodeArray? */) -> JSDocReturnTag - -external var createJSDocThisTag: (tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: dynamic /* String? | NodeArray? */) -> JSDocThisTag - -external var createJSDocComment: (comment: dynamic /* String? | NodeArray? */, tags: Array?) -> JSDoc - -external var createJSDocParameterTag: (tagName: Identifier?, name: dynamic /* Identifier | QualifiedName */, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean?, comment: dynamic /* String? | NodeArray? */) -> JSDocParameterTag - -external var createJSDocClassTag: (tagName: Identifier?, comment: dynamic /* String? | NodeArray? */) -> JSDocClassTag - -external var createJSDocAugmentsTag: (tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: dynamic /* String? | NodeArray? */) -> JSDocAugmentsTag - -external var createJSDocEnumTag: (tagName: Identifier?, typeExpression: JSDocTypeExpression, comment: dynamic /* String? | NodeArray? */) -> JSDocEnumTag - -external var createJSDocTemplateTag: (tagName: Identifier?, constraint: JSDocTypeExpression?, typeParameters: Array, comment: dynamic /* String? | NodeArray? */) -> JSDocTemplateTag - -external var createJSDocTypedefTag: (tagName: Identifier?, typeExpression: dynamic /* JSDocTypeLiteral? | JSDocTypeExpression? */, fullName: dynamic /* Identifier? | JSDocNamespaceDeclaration? */, comment: dynamic /* String? | NodeArray? */) -> JSDocTypedefTag - -external var createJSDocCallbackTag: (tagName: Identifier?, typeExpression: JSDocSignature, fullName: dynamic /* Identifier? | JSDocNamespaceDeclaration? */, comment: dynamic /* String? | NodeArray? */) -> JSDocCallbackTag - -external var createJSDocSignature: (typeParameters: Array?, parameters: Array, type: JSDocReturnTag?) -> JSDocSignature - -external var createJSDocPropertyTag: (tagName: Identifier?, name: dynamic /* Identifier | QualifiedName */, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, isNameFirst: Boolean?, comment: dynamic /* String? | NodeArray? */) -> JSDocPropertyTag - -external var createJSDocTypeLiteral: (jsDocPropertyTags: Array?, isArrayType: Boolean?) -> JSDocTypeLiteral - -external var createJSDocImplementsTag: (tagName: Identifier?, className: ExpressionWithTypeArguments /* ExpressionWithTypeArguments & `T$21` */, comment: dynamic /* String? | NodeArray? */) -> JSDocImplementsTag - -external var createJSDocAuthorTag: (tagName: Identifier?, comment: dynamic /* String? | NodeArray? */) -> JSDocAuthorTag - -external var createJSDocPublicTag: (tagName: Identifier?, comment: dynamic /* String? | NodeArray? */) -> JSDocPublicTag - -external var createJSDocPrivateTag: (tagName: Identifier?, comment: dynamic /* String? | NodeArray? */) -> JSDocPrivateTag - -external var createJSDocProtectedTag: (tagName: Identifier?, comment: dynamic /* String? | NodeArray? */) -> JSDocProtectedTag - -external var createJSDocReadonlyTag: (tagName: Identifier?, comment: dynamic /* String? | NodeArray? */) -> JSDocReadonlyTag - -external var createJSDocTag: (tagName: Identifier, comment: dynamic /* String? | NodeArray? */) -> JSDocUnknownTag - -external var createJsxElement: (openingElement: JsxOpeningElement, children: Array, closingElement: JsxClosingElement) -> JsxElement - -external var updateJsxElement: (node: JsxElement, openingElement: JsxOpeningElement, children: Array, closingElement: JsxClosingElement) -> JsxElement - -external var createJsxSelfClosingElement: (tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */, typeArguments: Array?, attributes: JsxAttributes) -> JsxSelfClosingElement - -external var updateJsxSelfClosingElement: (node: JsxSelfClosingElement, tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */, typeArguments: Array?, attributes: JsxAttributes) -> JsxSelfClosingElement - -external var createJsxOpeningElement: (tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */, typeArguments: Array?, attributes: JsxAttributes) -> JsxOpeningElement - -external var updateJsxOpeningElement: (node: JsxOpeningElement, tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */, typeArguments: Array?, attributes: JsxAttributes) -> JsxOpeningElement - -external var createJsxClosingElement: (tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */) -> JsxClosingElement - -external var updateJsxClosingElement: (node: JsxClosingElement, tagName: dynamic /* Identifier | ThisExpression | JsxTagNamePropertyAccess */) -> JsxClosingElement - -external var createJsxFragment: (openingFragment: JsxOpeningFragment, children: Array, closingFragment: JsxClosingFragment) -> JsxFragment - -external var createJsxText: (text: String, containsOnlyTriviaWhiteSpaces: Boolean?) -> JsxText - -external var updateJsxText: (node: JsxText, text: String, containsOnlyTriviaWhiteSpaces: Boolean?) -> JsxText - -external var createJsxOpeningFragment: () -> JsxOpeningFragment - -external var createJsxJsxClosingFragment: () -> JsxClosingFragment - -external var updateJsxFragment: (node: JsxFragment, openingFragment: JsxOpeningFragment, children: Array, closingFragment: JsxClosingFragment) -> JsxFragment - -external var createJsxAttribute: (name: Identifier, initializer: dynamic /* StringLiteral? | JsxExpression? */) -> JsxAttribute - -external var updateJsxAttribute: (node: JsxAttribute, name: Identifier, initializer: dynamic /* StringLiteral? | JsxExpression? */) -> JsxAttribute - -external var createJsxAttributes: (properties: Array) -> JsxAttributes - -external var updateJsxAttributes: (node: JsxAttributes, properties: Array) -> JsxAttributes - -external var createJsxSpreadAttribute: (expression: Expression) -> JsxSpreadAttribute - -external var updateJsxSpreadAttribute: (node: JsxSpreadAttribute, expression: Expression) -> JsxSpreadAttribute - -external var createJsxExpression: (dotDotDotToken: DotDotDotToken?, expression: Expression?) -> JsxExpression - -external var updateJsxExpression: (node: JsxExpression, expression: Expression?) -> JsxExpression - -external var createCaseClause: (expression: Expression, statements: Array) -> CaseClause - -external var updateCaseClause: (node: CaseClause, expression: Expression, statements: Array) -> CaseClause - -external var createDefaultClause: (statements: Array) -> DefaultClause - -external var updateDefaultClause: (node: DefaultClause, statements: Array) -> DefaultClause - -external var createHeritageClause: (token: dynamic /* SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword */, types: Array) -> HeritageClause - -external var updateHeritageClause: (node: HeritageClause, types: Array) -> HeritageClause - -external var createCatchClause: (variableDeclaration: dynamic /* String? | VariableDeclaration? */, block: Block) -> CatchClause - -external var updateCatchClause: (node: CatchClause, variableDeclaration: VariableDeclaration?, block: Block) -> CatchClause - -external var createPropertyAssignment: (name: dynamic /* String | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, initializer: Expression) -> PropertyAssignment - -external var updatePropertyAssignment: (node: PropertyAssignment, name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, initializer: Expression) -> PropertyAssignment - -external var createShorthandPropertyAssignment: (name: dynamic /* String | Identifier */, objectAssignmentInitializer: Expression?) -> ShorthandPropertyAssignment - -external var updateShorthandPropertyAssignment: (node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression?) -> ShorthandPropertyAssignment - -external var createSpreadAssignment: (expression: Expression) -> SpreadAssignment - -external var updateSpreadAssignment: (node: SpreadAssignment, expression: Expression) -> SpreadAssignment - -external var createEnumMember: (name: dynamic /* String | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, initializer: Expression?) -> EnumMember - -external var updateEnumMember: (node: EnumMember, name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, initializer: Expression?) -> EnumMember - -external var updateSourceFileNode: (node: SourceFile, statements: Array, isDeclarationFile: Boolean?, referencedFiles: Array?, typeReferences: Array?, hasNoDefaultLib: Boolean?, libReferences: Array?) -> SourceFile - -external var createNotEmittedStatement: (original: Node) -> NotEmittedStatement - -external var createPartiallyEmittedExpression: (expression: Expression, original: Node?) -> PartiallyEmittedExpression - -external var updatePartiallyEmittedExpression: (node: PartiallyEmittedExpression, expression: Expression) -> PartiallyEmittedExpression - -external var createCommaList: (elements: Array) -> CommaListExpression - -external var updateCommaList: (node: CommaListExpression, elements: Array) -> CommaListExpression - -external var createBundle: (sourceFiles: Array, prepends: Array?) -> Bundle - -external var updateBundle: (node: Bundle, sourceFiles: Array, prepends: Array?) -> Bundle - -external object createImmediatelyInvokedFunctionExpression { - @nativeInvoke - operator fun invoke(statements: Array): CallExpression - @nativeInvoke - operator fun invoke(statements: Array, param: ParameterDeclaration, paramValue: Expression): CallExpression -} - -external object createImmediatelyInvokedArrowFunction { - @nativeInvoke - operator fun invoke(statements: Array): CallExpression - @nativeInvoke - operator fun invoke(statements: Array, param: ParameterDeclaration, paramValue: Expression): CallExpression -} - -external var createVoidZero: () -> VoidExpression - -external var createExportDefault: (expression: Expression) -> ExportAssignment - -external var createExternalModuleExport: (exportName: Identifier) -> ExportDeclaration - -external var createNamespaceExport: (name: Identifier) -> NamespaceExport - -external var updateNamespaceExport: (node: NamespaceExport, name: Identifier) -> NamespaceExport - -external var createToken: (kind: TKind) -> Token - -external var createIdentifier: (text: String) -> Identifier - -external var createTempVariable: (recordTempVariable: ((node: Identifier) -> Unit)?) -> Identifier - -external var getGeneratedNameForNode: (node: Node?) -> Identifier - -external var createOptimisticUniqueName: (text: String) -> Identifier - -external var createFileLevelUniqueName: (text: String) -> Identifier - -external var createIndexSignature: (decorators: Array?, modifiers: Array?, parameters: Array, type: TypeNode) -> IndexSignatureDeclaration - -external var createTypePredicateNode: (parameterName: dynamic /* Identifier | ThisTypeNode | String */, type: TypeNode) -> TypePredicateNode - -external var updateTypePredicateNode: (node: TypePredicateNode, parameterName: dynamic /* Identifier | ThisTypeNode */, type: TypeNode) -> TypePredicateNode - -external object createLiteral { - @nativeInvoke - operator fun invoke(value: Any /* String | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier */): StringLiteral - @nativeInvoke - operator fun invoke(value: Any /* Number | PseudoBigInt */): NumericLiteral - @nativeInvoke - operator fun invoke(value: Boolean): dynamic /* TrueLiteral | FalseLiteral */ - @nativeInvoke - operator fun invoke(value: Any /* String | Number | PseudoBigInt | Boolean */): PrimaryExpression -} - -external var createMethodSignature: (typeParameters: Array?, parameters: Array, type: TypeNode?, name: dynamic /* String | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, questionToken: QuestionToken?) -> MethodSignature - -external var updateMethodSignature: (node: MethodSignature, typeParameters: NodeArray?, parameters: NodeArray, type: TypeNode?, name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, questionToken: QuestionToken?) -> MethodSignature - -external object createTypeOperatorNode { - @nativeInvoke - operator fun invoke(type: TypeNode): TypeOperatorNode - @nativeInvoke - operator fun invoke(operator: Any /* SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword */, type: TypeNode): TypeOperatorNode -} - -external object createTaggedTemplate { - @nativeInvoke - operator fun invoke(tag: Expression, template: Any /* TemplateExpression | NoSubstitutionTemplateLiteral */): TaggedTemplateExpression - @nativeInvoke - operator fun invoke(tag: Expression, typeArguments: Array?, template: Any /* TemplateExpression | NoSubstitutionTemplateLiteral */): TaggedTemplateExpression -} - -external object updateTaggedTemplate { - @nativeInvoke - operator fun invoke(node: TaggedTemplateExpression, tag: Expression, template: Any /* TemplateExpression | NoSubstitutionTemplateLiteral */): TaggedTemplateExpression - @nativeInvoke - operator fun invoke(node: TaggedTemplateExpression, tag: Expression, typeArguments: Array?, template: Any /* TemplateExpression | NoSubstitutionTemplateLiteral */): TaggedTemplateExpression -} - -external var updateBinary: (node: BinaryExpression, left: Expression, right: Expression, operator: dynamic /* SyntaxKind.QuestionQuestionToken | ExponentiationOperator | SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword | SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.CommaToken | BinaryOperatorToken */) -> BinaryExpression - -external object createConditional { - @nativeInvoke - operator fun invoke(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression - @nativeInvoke - operator fun invoke(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression -} - -external object createYield { - @nativeInvoke - operator fun invoke(expression: Expression? = definedExternally): YieldExpression - @nativeInvoke - operator fun invoke(asteriskToken: AsteriskToken?, expression: Expression): YieldExpression -} - -external var createClassExpression: (modifiers: Array?, name: dynamic /* String? | Identifier? */, typeParameters: Array?, heritageClauses: Array?, members: Array) -> ClassExpression - -external var updateClassExpression: (node: ClassExpression, modifiers: Array?, name: Identifier?, typeParameters: Array?, heritageClauses: Array?, members: Array) -> ClassExpression - -external var createPropertySignature: (modifiers: Array?, name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | String */, questionToken: QuestionToken?, type: TypeNode?, initializer: Expression?) -> PropertySignature - -external var updatePropertySignature: (node: PropertySignature, modifiers: Array?, name: dynamic /* Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier */, questionToken: QuestionToken?, type: TypeNode?, initializer: Expression?) -> PropertySignature - -external var createExpressionWithTypeArguments: (typeArguments: Array?, expression: Expression) -> ExpressionWithTypeArguments - -external var updateExpressionWithTypeArguments: (node: ExpressionWithTypeArguments, typeArguments: Array?, expression: Expression) -> ExpressionWithTypeArguments - -external object createArrowFunction { - @nativeInvoke - operator fun invoke(modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode?, equalsGreaterThanToken: EqualsGreaterThanToken?, body: Any /* FunctionBody | Expression */): ArrowFunction - @nativeInvoke - operator fun invoke(modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Any /* FunctionBody | Expression */): ArrowFunction -} - -external object updateArrowFunction { - @nativeInvoke - operator fun invoke(node: ArrowFunction, modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode?, equalsGreaterThanToken: EqualsGreaterThanToken, body: Any /* FunctionBody | Expression */): ArrowFunction - @nativeInvoke - operator fun invoke(node: ArrowFunction, modifiers: Array?, typeParameters: Array?, parameters: Array, type: TypeNode?, body: Any /* FunctionBody | Expression */): ArrowFunction -} - -external object createVariableDeclaration { - @nativeInvoke - operator fun invoke(name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, type: TypeNode? = definedExternally, initializer: Expression? = definedExternally): VariableDeclaration - @nativeInvoke - operator fun invoke(name: Any /* String | Identifier | ObjectBindingPattern | ArrayBindingPattern */, exclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): VariableDeclaration -} - -external object updateVariableDeclaration { - @nativeInvoke - operator fun invoke(node: VariableDeclaration, name: Any /* Identifier | ObjectBindingPattern | ArrayBindingPattern */, type: TypeNode?, initializer: Expression?): VariableDeclaration - @nativeInvoke - operator fun invoke(node: VariableDeclaration, name: Any /* Identifier | ObjectBindingPattern | ArrayBindingPattern */, exclamationToken: ExclamationToken?, type: TypeNode?, initializer: Expression?): VariableDeclaration -} - -external var createImportClause: (name: Identifier?, namedBindings: dynamic /* NamespaceImport? | NamedImports? */, isTypeOnly: Any) -> ImportClause - -external var updateImportClause: (node: ImportClause, name: Identifier?, namedBindings: dynamic /* NamespaceImport? | NamedImports? */, isTypeOnly: Boolean) -> ImportClause - -external var createExportDeclaration: (decorators: Array?, modifiers: Array?, exportClause: dynamic /* NamespaceExport? | NamedExports? */, moduleSpecifier: Expression?, isTypeOnly: Any) -> ExportDeclaration - -external var updateExportDeclaration: (node: ExportDeclaration, decorators: Array?, modifiers: Array?, exportClause: dynamic /* NamespaceExport? | NamedExports? */, moduleSpecifier: Expression?, isTypeOnly: Boolean) -> ExportDeclaration - -external var createJSDocParamTag: (name: dynamic /* Identifier | QualifiedName */, isBracketed: Boolean, typeExpression: JSDocTypeExpression?, comment: String?) -> JSDocParameterTag - -external var createComma: (left: Expression, right: Expression) -> Expression - -external var createLessThan: (left: Expression, right: Expression) -> Expression - -external var createAssignment: (left: Expression, right: Expression) -> BinaryExpression - -external var createStrictEquality: (left: Expression, right: Expression) -> BinaryExpression - -external var createStrictInequality: (left: Expression, right: Expression) -> BinaryExpression - -external var createAdd: (left: Expression, right: Expression) -> BinaryExpression - -external var createSubtract: (left: Expression, right: Expression) -> BinaryExpression - -external var createLogicalAnd: (left: Expression, right: Expression) -> BinaryExpression - -external var createLogicalOr: (left: Expression, right: Expression) -> BinaryExpression - -external var createPostfixIncrement: (operand: Expression) -> PostfixUnaryExpression - -external var createLogicalNot: (operand: Expression) -> PrefixUnaryExpression - -external var createNode: (kind: SyntaxKind, pos: Any, end: Any) -> Node - -external var getMutableClone: (node: T) -> T - -external var isTypeAssertion: (node: Node) -> Boolean - -external var isIdentifierOrPrivateIdentifier: (node: Node) -> Boolean \ No newline at end of file diff --git a/modules/mod2/externals/typescript.ts.server.module_typescript.kt b/modules/mod2/externals/typescript.ts.server.module_typescript.kt deleted file mode 100644 index 4ce5432..0000000 --- a/modules/mod2/externals/typescript.ts.server.module_typescript.kt +++ /dev/null @@ -1,104 +0,0 @@ -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") -package ts.server - -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.CompilerOptions -import ts.WatchOptions -import ts.TypeAcquisition -import ts.SortedReadonlyArray - -external interface TypingInstallerResponse { - var kind: String /* "action::set" | "action::invalidate" | "event::typesRegistry" | "action::packageInstalled" | "event::beginInstallTypes" | "event::endInstallTypes" | "event::initializationFailed" */ -} - -external interface TypingInstallerRequestWithProjectName { - var projectName: String -} - -external interface DiscoverTypings : TypingInstallerRequestWithProjectName { - var fileNames: Array - var projectRootPath: String /* String & `T$3` */ - var compilerOptions: CompilerOptions - var watchOptions: WatchOptions? - get() = definedExternally - set(value) = definedExternally - var typeAcquisition: TypeAcquisition - var unresolvedImports: SortedReadonlyArray - var cachePath: String? - get() = definedExternally - set(value) = definedExternally - var kind: String /* "discover" */ -} - -external interface CloseProject : TypingInstallerRequestWithProjectName { - var kind: String /* "closeProject" */ -} - -external interface TypesRegistryRequest { - var kind: String /* "typesRegistry" */ -} - -external interface InstallPackageRequest : TypingInstallerRequestWithProjectName { - var kind: String /* "installPackage" */ - var fileName: String /* String & `T$3` */ - var packageName: String - var projectRootPath: String /* String & `T$3` */ -} - -external interface PackageInstalledResponse : ProjectResponse { - override var kind: String /* "action::packageInstalled" */ - var success: Boolean - var message: String -} - -external interface InitializationFailedResponse : TypingInstallerResponse { - override var kind: String /* "event::initializationFailed" */ - var message: String - var stack: String? - get() = definedExternally - set(value) = definedExternally -} - -external interface ProjectResponse : TypingInstallerResponse { - var projectName: String -} - -external interface InvalidateCachedTypings : ProjectResponse { - override var kind: String /* "action::invalidate" */ -} - -external interface InstallTypes : ProjectResponse { - override var kind: String /* "event::beginInstallTypes" | "event::endInstallTypes" */ - var eventId: Number - var typingsInstallerVersion: String - var packagesToInstall: Array -} - -external interface BeginInstallTypes : InstallTypes { - override var kind: String /* "event::beginInstallTypes" */ -} - -external interface EndInstallTypes : InstallTypes { - override var kind: String /* "event::endInstallTypes" */ - var installSuccess: Boolean -} - -external interface SetTypings : ProjectResponse { - var typeAcquisition: TypeAcquisition - var compilerOptions: CompilerOptions - var typings: Array - var unresolvedImports: SortedReadonlyArray - override var kind: String /* "action::set" */ -} \ No newline at end of file diff --git a/modules/mod2/externals/utils.module_typescript-to-lua.kt b/modules/mod2/externals/utils.module_typescript-to-lua.kt deleted file mode 100644 index 08363d8..0000000 --- a/modules/mod2/externals/utils.module_typescript-to-lua.kt +++ /dev/null @@ -1,46 +0,0 @@ -@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.SourceFile - -external interface EmitHost { - fun directoryExists(path: String): Boolean - fun fileExists(path: String): Boolean - fun getCurrentDirectory(): String - fun readFile(path: String): String? - var writeFile: WriteFileCallback -} - -external interface BaseFile { - var code: String - var sourceMap: String? - get() = definedExternally - set(value) = definedExternally - var sourceFiles: Array? - get() = definedExternally - set(value) = definedExternally -} - -external interface ProcessedFile : BaseFile { - var fileName: String - var luaAst: File? - get() = definedExternally - set(value) = definedExternally -} - -external interface EmitFile : BaseFile { - var outputPath: String -} \ No newline at end of file diff --git a/modules/mod2/externals/visitors.module_typescript-to-lua.kt b/modules/mod2/externals/visitors.module_typescript-to-lua.kt deleted file mode 100644 index 69513ac..0000000 --- a/modules/mod2/externals/visitors.module_typescript-to-lua.kt +++ /dev/null @@ -1,38 +0,0 @@ -@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.Statement -import ts.Node -import tsstdlib.Map -import ts.SyntaxKind - -external interface NodesBySyntaxKind - -typealias StatementLikeNode = Statement - -typealias VisitorResult = Any - -typealias FunctionVisitor = (node: T, context: TransformationContext) -> VisitorResult - -external interface ObjectVisitor { - var transform: FunctionVisitor - var priority: Number? - get() = definedExternally - set(value) = definedExternally -} - -typealias Visitors = Any - -typealias VisitorMap = Map>> \ No newline at end of file diff --git a/modules/mod2/src/main/kotlin/events.kt b/modules/mod2/src/main/kotlin/events.kt deleted file mode 100644 index 5684b55..0000000 --- a/modules/mod2/src/main/kotlin/events.kt +++ /dev/null @@ -1,11 +0,0 @@ -fun main() { - - -script.on_event( - defines.events.on_tick -) { event -> - -} - - -} diff --git a/modules/mod2/typed-factorio/README.md b/modules/mod2/typed-factorio/README.md deleted file mode 100644 index 08ae6dc..0000000 --- a/modules/mod2/typed-factorio/README.md +++ /dev/null @@ -1,113 +0,0 @@ -# Typed Factorio - -Complete and featureful typescript definitions for the Factorio modding lua api. This is intended to be used with [TypescriptToLua](https://typescripttolua.github.io/). - -This project aims to provide type definitions for the Factorio API that are as complete as possible. This means minimal `any`s and `unknown`s, correct nullability, and smart types where possible. The generator integrates both the Factorio JSON api docs and manually defined additions and overrides. - -## Installation - -To use in your TypescriptToLua project: - -1. Install this package - -``` -npm install typed-factorio - -or - -yarn add typed-factorio -``` - -2. Add to your `tsconfig.json`: - -```diff -{ - "compilerOptions": { -+ "types": [ "typed-factorio/runtime" ] - } -} -``` - -This will add the types for the runtime stage to your entire project. - -Note: When types are updated, or released for a new factorio version, you will need update your package version to get the types. - -### Settings and data stage - -There are also definitions for the settings/data stage. - -To avoid type conflicts, the global tables for the settings/data stages have to be declared manually where you need them. These types can be imported from `typed-factorio/data/types` or `typed-factorio/settings/types`. - -Example: - -```ts -import { Data, Mods } from "typed-factorio/data/types" -// or -import { Data, Mods } from "typed-factorio/settings/types" - -declare const data: Data -declare const mods: Mods - -data.extend([{ ... }]) -``` - -There are currently full types for settings stage, but only basic types for the data stage. - -### Factorio lualib modules - -Currently, there are types for the following modules: - -- `util` -- `mod-gui` - -If you have a need for types to more lualib modules, feel free to open an issue or pull request on GitHub. - -## Type features - -Typed-factorio has 100% complete types for the runtime stage. Description-only concepts and some not documented types are filled in manually. - -### Lua features - -The types include [TypescriptToLua language extensions](https://typescripttolua.github.io/docs/advanced/language-extensions/) -and [lua-types](https://github.com/TypeScriptToLua/lua-types) (for v5.2) as dependencies. - -This is to use tstl features such as `LuaLengthMethod` and `LuaMultiReturn`. - -### `nil` - -The types consistently use `undefined` to represent `nil`. -`null` is not used, because `undefined` in typescript is much more similar to `nil` in lua, and optional parameters/properties already use `undefined`. - -A class attribute is marked as possibly undefined only if the _read_ type is possibly `nil`. For properties where `nil` is not possible on _read_, but is possible on _write_, you can write `nil` by using `undefined!` or `myNullableValue!`, e.g. `controlBehavior.parameters = undefined!`. - -### Variant parameter types - -Variant parameter types (types with "additional fields can be specified depending on ...") are handled as discriminated unions. This gives proper type checking for individual variants. - -The type for a specific variant is prefixed with the either variant name or "Other" for variants without additional fields, e.g. `AmmoDamageTechnologyModifier`, `OtherTechnologyModifier` - -### Events - -`script.on_event()`, `script.get/set_filters()`, and `script.raise_event()` all have type checking on the event data/filter type, inferred from what is passed as the event name/id. - -You can pass a type parameter to `script.generate_event_name()`, and it will return an `EventId` that holds type info of the event data. Event functions on `script` can then use the type data when the `EventId` is passed. - -### Array-like types - -Classes that have an index operator, a length operator, and have an array-like structure, inherit from `(Readonly)Array`. These are `LuaInventory`, `LuaFluidBox`, `LuaTransportLine`. This allows you to use these classes like arrays, meaning having array methods, and `.length` translating to the lua length operator. However, this also means, like typescript arrays, they are **0-indexed, not 1-indexed**. - -### Table or array types - -For table or array types (e.g. Position), there also are types such as `PositionTable` and `PositionArray` that refer to the table or array form specifically. - -### LuaGuiElement - -`LuaGuiElement` is broken up into a discriminated union for each gui element type (See [here](https://basarat.gitbook.io/typescript/type-system/discriminated-unions) for information on discriminated unions). The type for a specific GuiElement type is `GuiElement`, e.g. `ButtonGuiElement`. - -Similarly, the table passed to `LuaGuiElement.add`, referred to as `GuiSpec`, is also broken up into a discriminated union for each gui element type. The type for a specific GuiSpec type is `GuiSpec`, e.g. `ListBoxGuiSpec`. - -This is done both to provide more accurate types, and for possible integration with [JSX](https://typescripttolua.github.io/docs/jsx/). - -### Examples - -Check out the `test` directory on GitHub for more examples on particular type features. diff --git a/modules/mod2/typed-factorio/data/types.d.ts b/modules/mod2/typed-factorio/data/types.d.ts deleted file mode 100644 index 408f32a..0000000 --- a/modules/mod2/typed-factorio/data/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface Data { - readonly raw: Record> - - /** - * The `data` table expects a specific format for each item in the table. Missing properties will either fall back to - * default values or give an error indicating what's missing. Extra properties that the game isn't looking for are - * simply ignored. - */ - extend(prototypes: Record[]): void -} - -/** A mapping of mod names to mod version for all enabled mods. */ -export type Mods = Record diff --git a/modules/mod2/typed-factorio/generated/builtin-types.d.ts b/modules/mod2/typed-factorio/generated/builtin-types.d.ts deleted file mode 100644 index bcd4172..0000000 --- a/modules/mod2/typed-factorio/generated/builtin-types.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** @noSelfInFile */ - -/** - * A floating-point number. This is a single-precision floating point number. Whilst Lua only uses double-precision - * numbers, when a function takes a float, the game engine will immediately convert the double-precision number to - * single-precision. - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#float View documentation} - */ -type float = number - -/** - * A double-precision floating-point number. This is the same data type as all Lua numbers use. - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#double View documentation} - */ -type double = number - -/** - * 32-bit signed integer. Possible values are -2,147,483,648 to 2,147,483,647. - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#int View documentation} - */ -type int = number - -/** - * 8-bit signed integer. Possible values are -128 to 127. - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#int8 View documentation} - */ -type int8 = number - -/** - * 32-bit unsigned integer. Possible values are 0 to 4,294,967,295. - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#uint View documentation} - */ -type uint = number - -/** - * 8-bit unsigned integer. Possible values are 0 to 255. - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#uint8 View documentation} - */ -type uint8 = number - -/** - * 16-bit unsigned integer. Possible values are 0 to 65535. - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#uint16 View documentation} - */ -type uint16 = number - -/** - * 64-bit unsigned integer. Possible values are 0 to 18,446,744,073,709,551,615. - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#uint64 View documentation} - */ -type uint64 = number - -/** - * Tables are enclosed in curly brackets, like this `{}` - * - * {@link https://lua-api.factorio.com/next/Builtin-Types.html#table View documentation} - */ -type table = object diff --git a/modules/mod2/typed-factorio/generated/classes.d.ts b/modules/mod2/typed-factorio/generated/classes.d.ts deleted file mode 100644 index 65469c5..0000000 --- a/modules/mod2/typed-factorio/generated/classes.d.ts +++ /dev/null @@ -1,20023 +0,0 @@ -/** @noSelfInFile */ - -/** - * Collection of settings for overriding default ai behavior. - * - * {@link https://lua-api.factorio.com/next/LuaAISettings.html View documentation} - * - * @noSelf - */ -interface LuaAISettings { - /** - * If enabled, units that repeatedly fail to succeed at commands will be destroyed. - * - * {@link https://lua-api.factorio.com/next/LuaAISettings.html#LuaAISettings.allow_destroy_when_commands_fail View documentation} - */ - allow_destroy_when_commands_fail: boolean - /** - * If enabled, units that have nothing else to do will attempt to return to a spawner. - * - * {@link https://lua-api.factorio.com/next/LuaAISettings.html#LuaAISettings.allow_try_return_to_spawner View documentation} - */ - allow_try_return_to_spawner: boolean - /** - * If enabled, units will try to separate themselves from nearby friendly units. - * - * {@link https://lua-api.factorio.com/next/LuaAISettings.html#LuaAISettings.do_separation View documentation} - */ - do_separation: boolean - /** - * The pathing resolution modifier, must be between -8 and 8. - * - * {@link https://lua-api.factorio.com/next/LuaAISettings.html#LuaAISettings.path_resolution_modifier View documentation} - */ - path_resolution_modifier: int8 - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaAISettings" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for accumulators. - * - * {@link https://lua-api.factorio.com/next/LuaAccumulatorControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaAccumulatorControlBehavior extends LuaControlBehavior { - output_signal: SignalID - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaAccumulatorControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a achievement. - * - * {@link https://lua-api.factorio.com/next/LuaAchievementPrototype.html View documentation} - * - * @noSelf - */ -interface LuaAchievementPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaAchievementPrototype.html#LuaAchievementPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaAchievementPrototype.html#LuaAchievementPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - readonly allowed_without_fight: boolean - readonly hidden: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaAchievementPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a ammo category. - * - * {@link https://lua-api.factorio.com/next/LuaAmmoCategoryPrototype.html View documentation} - * - * @noSelf - */ -interface LuaAmmoCategoryPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - readonly bonus_gui_order: string - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaAmmoCategoryPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for arithmetic combinators. - * - * {@link https://lua-api.factorio.com/next/LuaArithmeticCombinatorControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaArithmeticCombinatorControlBehavior extends LuaCombinatorControlBehavior { - /** - * The arithmetic combinator parameters. - * - * **Note**: `parameters` may be `nil` in order to clear the parameters. - * - * {@link https://lua-api.factorio.com/next/LuaArithmeticCombinatorControlBehavior.html#LuaArithmeticCombinatorControlBehavior.parameters View documentation} - */ - parameters: ArithmeticCombinatorParameters - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaArithmeticCombinatorControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of an autoplace control. - * - * {@link https://lua-api.factorio.com/next/LuaAutoplaceControlPrototype.html View documentation} - * - * @noSelf - */ -interface LuaAutoplaceControlPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - readonly richness: boolean - readonly control_order: string - /** - * Category name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.category View documentation} - */ - readonly category: string - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaAutoplaceControlPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -type RaiseableEvents = - | typeof defines.events.on_console_chat - | typeof defines.events.on_player_crafted_item - | typeof defines.events.on_player_fast_transferred - | typeof defines.events.on_biter_base_built - | typeof defines.events.on_market_item_purchased - | typeof defines.events.script_raised_built - | typeof defines.events.script_raised_destroy - | typeof defines.events.script_raised_revive - | typeof defines.events.script_raised_set_tiles - -/** - * Entry point for registering event handlers. It is accessible through the global object named `script`. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html View documentation} - * - * @noSelf - */ -interface LuaBootstrap { - /** - * Register a callback to be run on mod initialization. This is only called when a new save game is created or when - * a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up - * initial values that it will use for its lifetime. It has full access to {@link LuaGameScript} and the `global` - * table and can change anything about them that it deems appropriate. No other events will be raised for the mod - * until it has finished this step. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.on_init View documentation} - * - * @example - * Initialize a `players` table in `global` for later use. - * - * ```lua - * script.on_init(function() - * global.players = {} - * end) - * ``` - * - * @param f - The handler for this event. Passing `nil` will unregister it. - */ - on_init(f: (() => void) | undefined): void - /** - * Register a function to be run on save load. This is only called for mods that have been part of the save - * previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do - * some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which - * breaks multiplayer and replay functionality. Access to {@link LuaGameScript} and {@link LuaRendering} is not - * available. The `global` table can be accessed and is safe to read from, but not write to. - * - * The only legitimate uses of this event are these three: - * - * - Re-setup {@link https://www.lua.org/pil/13.html metatables} as they are not persisted through save-load. - * - Re-setup conditional event handlers. - * - Create local references to data stored in the {@link https://lua-api.factorio.com/next/Global.html global} table. - * - * For all other purposes, {@link LuaBootstrap.on_init LuaBootstrap::on_init}, - * {@link LuaBootstrap.on_configuration_changed LuaBootstrap::on_configuration_changed} or migration scripts should - * be used instead. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.on_load View documentation} - * - * @param f - The handler for this event. Passing `nil` will unregister it. - */ - on_load(f: (() => void) | undefined): void - /** - * Register a function to be run when mod configuration changes. This is called when the game version or any mod - * version changes; when any mod is added or removed; or when prototypes or startup mod settings have changed. It - * allows the mod to make any changes it deems appropriate to both the data structures in its `global` table or to - * the game state through {@link LuaGameScript}. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.on_configuration_changed View documentation} - * - * @param f - The handler for this event. Passing `nil` will unregister it. - */ - on_configuration_changed(f: ((param1: ConfigurationChangedData) => void) | undefined): void - /** - * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any - * additional registration will overwrite the previous one. This holds true even if different filters are used for - * subsequent registrations. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.on_event View documentation} - * - * @example - * Register for the {@link OnTickEvent on_tick} event to print the current tick to console each tick. - * - * ```lua - * script.on_event(defines.events.on_tick, - * function(event) game.print(event.tick) end) - * ``` - * - * @example - * Register for the {@link OnBuiltEntityEvent on_built_entity} event, limiting it to only be received when a `"fast-inserter"` is built. - * - * ```lua - * script.on_event(defines.events.on_built_entity, - * function(event) game.print("Gotta go fast!") end, - * {{filter = "name", name = "fast-inserter"}}) - * ``` - * - * @param event - The event(s) or custom-input to invoke the handler on. - * @param f - The handler for this event. Passing `nil` will unregister it. - * @param filters - The filters for this event. Can only be used when registering for individual events. - */ - on_event>( - event: E, - f: ((data: E["_eventData"]) => void) | undefined, - filters?: E["_filter"][] - ): void - on_event>(event: E | E[], f: ((data: E["_eventData"]) => void) | undefined): void - on_event(event: string, f: ((data: CustomInputEvent) => void) | undefined): void - /** - * Register a handler to run every nth-tick(s). When the game is on tick 0 it will trigger all registered handlers. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.on_nth_tick View documentation} - * - * @param tick - The nth-tick(s) to invoke the handler on. Passing `nil` as the only parameter will unregister all - * nth-tick handlers. - * @param f - The handler to run. Passing `nil` will unregister it for the provided nth-tick(s). - */ - on_nth_tick(tick: uint | uint[] | undefined, f: ((param1: NthTickEventData) => void) | undefined): void - /** - * Registers an entity so that after it's destroyed, {@link OnEntityDestroyedEvent on_entity_destroyed} is called. - * Once an entity is registered, it stays registered until it is actually destroyed, even through save/load cycles. - * The registration is global across all mods, meaning once one mod registers an entity, all mods listening to - * {@link OnEntityDestroyedEvent on_entity_destroyed} will receive the event when it is destroyed. Registering the - * same entity multiple times will still only fire the destruction event once, and will return the same registration number. - * - * **Note**: Depending on when a given entity is destroyed, {@link OnEntityDestroyedEvent on_entity_destroyed} will - * either be fired at the end of the current tick or at the end of the next tick. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.register_on_entity_destroyed View documentation} - * - * @param entity - The entity to register. - * @returns The registration number. It is used to identify the entity in the - * {@link OnEntityDestroyedEvent on_entity_destroyed} event. - */ - register_on_entity_destroyed(entity: LuaEntity): uint64 - /** - * Generate a new, unique event ID that can be used to raise custom events with - * {@link LuaBootstrap.raise_event LuaBootstrap::raise_event}. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.generate_event_name View documentation} - * - * @returns The newly generated event ID. - */ - generate_event_name(): CustomEventId - /** - * Find the event handler for an event. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.get_event_handler View documentation} - * - * @param event - The event identifier to get a handler for. - * @returns Reference to the function currently registered as the handler. - */ - get_event_handler>(event: E): (data: E["_eventData"]) => void - get_event_handler(event: string): (data: CustomInputEvent) => void - /** - * Gets the mod event order as a string. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.get_event_order View documentation} - */ - get_event_order(): string - /** - * Sets the filters for the given event. The filters are only retained when set after the actual event registration, - * because registering for an event with different or no filters will overwrite previously set ones. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.set_event_filter View documentation} - * - * @example - * Limit the {@link OnMarkedForDeconstructionEvent on_marked_for_deconstruction} event to only be received when a non-ghost entity is marked for deconstruction. - * - * ```lua - * script.set_event_filter(defines.events.on_marked_for_deconstruction, {{filter = "ghost", invert = true}}) - * ``` - * - * @example - * Limit the {@link OnBuiltEntityEvent on_built_entity} event to only be received when either a `unit` or a `unit-spawner` is built. - * - * ```lua - * script.set_event_filter(defines.events.on_built_entity, {{filter = "type", type = "unit"}, {filter = "type", type = "unit-spawner"}}) - * ``` - * - * @example - * Limit the {@link OnEntityDamagedEvent on_entity_damaged} event to only be received when a `rail` is damaged by an `acid` attack. - * - * ```lua - * script.set_event_filter(defines.events.on_entity_damaged, {{filter = "rail"}, {filter = "damage-type", type = "acid", mode = "and"}}) - * ``` - * - * @param event - ID of the event to filter. - * @param filters - The filters or `nil` to clear them. - */ - set_event_filter>(event: E, filters: E["_filter"][] | undefined): void - /** - * Gets the filters for the given event. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.get_event_filter View documentation} - * - * @param event - ID of the event to get. - * @returns The filters or `nil` if none are defined. - */ - get_event_filter>(event: E): E["_filter"][] | undefined - /** - * Raise an event. Only events generated with - * {@link LuaBootstrap.generate_event_name LuaBootstrap::generate_event_name} and the following can be raised: - * - * - {@link OnConsoleChatEvent on_console_chat} - * - {@link OnPlayerCraftedItemEvent on_player_crafted_item} - * - {@link OnPlayerFastTransferredEvent on_player_fast_transferred} - * - {@link OnBiterBaseBuiltEvent on_biter_base_built} - * - {@link OnMarketItemPurchasedEvent on_market_item_purchased} - * - {@link ScriptRaisedBuiltEvent script_raised_built} - * - {@link ScriptRaisedDestroyEvent script_raised_destroy} - * - {@link ScriptRaisedReviveEvent script_raised_revive} - * - {@link ScriptRaisedSetTilesEvent script_raised_set_tiles} - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_event View documentation} - * - * @example - * Raise the {@link OnConsoleChatEvent on_console_chat} event with the desired message 'from' the first player. - * - * ```lua - * local data = {player_index = 1, message = "Hello friends!"} - * script.raise_event(defines.events.on_console_chat, data) - * ``` - * - * @param event - ID of the event to raise. - * @param data - Table with extra data that will be passed to the event handler. - */ - raise_event>( - event: E, - data: Omit - ): void - /** - * Raises {@link OnConsoleChatEvent on_console_chat} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_console_chat View documentation} - */ - raise_console_chat(params: { - /** The player doing the chatting. */ - readonly player_index: uint - /** The chat message to send. */ - readonly message: string - }): void - /** - * Raises {@link OnPlayerCraftedItemEvent on_player_crafted_item} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_player_crafted_item View documentation} - */ - raise_player_crafted_item(params: { - /** The item that has been crafted. */ - readonly item_stack: LuaItemStack - /** The player doing the crafting. */ - readonly player_index: uint - /** The recipe used to craft this item. */ - readonly recipe: LuaRecipe - }): void - /** - * Raises {@link OnPlayerFastTransferredEvent on_player_fast_transferred} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_player_fast_transferred View documentation} - */ - raise_player_fast_transferred(params: { - /** The player transferred from or to. */ - readonly player_index: uint - /** The entity transferred from or to. */ - readonly entity: LuaEntity - /** Whether the transfer was from player to entity. If `false`, the transfer was from entity to player. */ - readonly from_player: boolean - }): void - /** - * Raises {@link OnBiterBaseBuiltEvent on_biter_base_built} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_biter_base_built View documentation} - */ - raise_biter_base_built(params: { - /** The entity that was built. */ - readonly entity: LuaEntity - }): void - /** - * Raises {@link OnMarketItemPurchasedEvent on_market_item_purchased} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_market_item_purchased View documentation} - */ - raise_market_item_purchased(params: { - /** The player who did the purchasing. */ - readonly player_index: uint - /** The market entity. */ - readonly market: LuaEntity - /** The index of the offer purchased. */ - readonly offer_index: uint - /** The amount of offers purchased. */ - readonly count: uint - }): void - /** - * Raises {@link ScriptRaisedBuiltEvent script_raised_built} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_script_built View documentation} - */ - raise_script_built(params: { - /** The entity that has been built. */ - readonly entity: LuaEntity - }): void - /** - * Raises {@link ScriptRaisedDestroyEvent script_raised_destroy} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_script_destroy View documentation} - */ - raise_script_destroy(params: { - /** The entity that was destroyed. */ - readonly entity: LuaEntity - }): void - /** - * Raises {@link ScriptRaisedReviveEvent script_raised_revive} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_script_revive View documentation} - */ - raise_script_revive(params: { - /** The entity that was revived. */ - readonly entity: LuaEntity - /** The tags associated with this entity, if any. */ - readonly tags?: Tags - }): void - /** - * Raises {@link ScriptRaisedSetTilesEvent script_raised_set_tiles} with the given parameters. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.raise_script_set_tiles View documentation} - */ - raise_script_set_tiles(params: { - /** The surface whose tiles have been changed. */ - readonly surface_index: uint - /** The tiles that have been changed. */ - readonly tiles: Tile[] - }): void - /** - * The name of the mod from the environment this is used in. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.mod_name View documentation} - */ - readonly mod_name: string - /** - * Information about the currently running scenario/campaign/tutorial. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.level View documentation} - */ - readonly level: { - /** Is this level a simulation? (The main menu and 'Tips and tricks' use simulations) */ - readonly is_simulation?: boolean - /** Is this level a tutorial? */ - readonly is_tutorial?: boolean - /** The campaign name if any. */ - readonly campaign_name?: string - /** The level name. */ - readonly level_name: string - /** The mod name if any. */ - readonly mod_name?: string - } - /** - * A dictionary listing the names of all currently active mods and mapping them to their version. - * - * {@link https://lua-api.factorio.com/next/LuaBootstrap.html#LuaBootstrap.active_mods View documentation} - * - * @example - * This will print the names and versions of all active mods to the console. - * - * ```lua - * for name, version in pairs(script.active_mods) do - * game.print(name .. " version " .. version) - * end - * ``` - */ - readonly active_mods: Record - /** This object's name. */ - readonly object_name: "LuaBootstrap" -} - -/** - * A reference to the burner energy source owned by a specific {@link LuaEntity} or {@link LuaEquipment}. - * - * {@link https://lua-api.factorio.com/next/LuaBurner.html View documentation} - * - * @noSelf - */ -interface LuaBurner { - /** - * The owner of this burner energy source - * - * {@link https://lua-api.factorio.com/next/LuaBurner.html#LuaBurner.owner View documentation} - */ - readonly owner: LuaEntity | LuaEquipment - /** - * The fuel inventory. - * - * {@link https://lua-api.factorio.com/next/LuaBurner.html#LuaBurner.inventory View documentation} - */ - readonly inventory: LuaInventory - /** - * The burnt result inventory. - * - * {@link https://lua-api.factorio.com/next/LuaBurner.html#LuaBurner.burnt_result_inventory View documentation} - */ - readonly burnt_result_inventory: LuaInventory - heat: double - readonly heat_capacity: double - /** - * **Note**: Writing will silently do nothing if there's no - * {@link LuaBurner.currently_burning LuaBurner::currently_burning} set. - * - * {@link https://lua-api.factorio.com/next/LuaBurner.html#LuaBurner.remaining_burning_fuel View documentation} - */ - remaining_burning_fuel: double - /** - * **Note**: Writing automatically handles correcting - * {@link LuaBurner.remaining_burning_fuel LuaBurner::remaining_burning_fuel}. - * - * {@link https://lua-api.factorio.com/next/LuaBurner.html#LuaBurner.currently_burning View documentation} - */ - currently_burning: LuaItemPrototype - /** - * The fuel categories this burner uses. - * - * **Note**: The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup. - * - * {@link https://lua-api.factorio.com/next/LuaBurner.html#LuaBurner.fuel_categories View documentation} - */ - readonly fuel_categories: Record - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaBurner" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a burner energy source. - * - * {@link https://lua-api.factorio.com/next/LuaBurnerPrototype.html View documentation} - * - * @noSelf - */ -interface LuaBurnerPrototype { - readonly emissions: double - readonly render_no_network_icon: boolean - readonly render_no_power_icon: boolean - readonly effectivity: double - readonly fuel_inventory_size: uint - readonly burnt_inventory_size: uint - /** - * The smoke sources for this burner prototype if any. - * - * {@link https://lua-api.factorio.com/next/LuaBurnerPrototype.html#LuaBurnerPrototype.smoke View documentation} - */ - readonly smoke: SmokeSource[] - /** - * The light flicker definition for this burner prototype if any. - * - * {@link https://lua-api.factorio.com/next/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker View documentation} - */ - readonly light_flicker: { - readonly minimum_intensity: float - readonly maximum_intensity: float - readonly derivation_change_frequency: float - readonly derivation_change_deviation: float - readonly border_fix_speed: float - readonly minimum_light_size: float - readonly light_intensity_to_size_coefficient: float - readonly color: Color - } - /** - * **Note**: The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup. - * - * {@link https://lua-api.factorio.com/next/LuaBurnerPrototype.html#LuaBurnerPrototype.fuel_categories View documentation} - */ - readonly fuel_categories: Record - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaBurnerPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A chunk iterator can be used for iterating chunks coordinates of a surface. - * - * The returned type is a {@link ChunkPositionAndArea} containing the chunk coordinates and its area. - * - * {@link https://lua-api.factorio.com/next/LuaChunkIterator.html View documentation} - * - * @example - * ```lua - * for chunk in some_surface.get_chunks() do - * game.player.print("x: " .. chunk.x .. ", y: " .. chunk.y) - * game.player.print("area: " .. serpent.line(chunk.area)) - * end - * ``` - * - * @noSelf - */ -interface LuaChunkIterator extends LuaIterable { - /** - * Get the next chunk position or `nil`, and increments the iterator. - * - * {@link https://lua-api.factorio.com/next/LuaChunkIterator.html#LuaChunkIterator.operator%20() View documentation} - */ - (): ChunkPositionAndArea | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaChunkIterator" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A circuit network associated with a given entity, connector, and wire type. - * - * {@link https://lua-api.factorio.com/next/LuaCircuitNetwork.html View documentation} - * - * @noSelf - */ -interface LuaCircuitNetwork { - /** - * {@link https://lua-api.factorio.com/next/LuaCircuitNetwork.html#LuaCircuitNetwork.get_signal View documentation} - * - * @param signal - The signal to read. - * @returns The current value of the signal. - */ - get_signal(signal: SignalID): int - /** - * The entity this circuit network reference is associated with - * - * {@link https://lua-api.factorio.com/next/LuaCircuitNetwork.html#LuaCircuitNetwork.entity View documentation} - */ - readonly entity: LuaEntity - /** - * The wire type this network is associated with. - * - * {@link https://lua-api.factorio.com/next/LuaCircuitNetwork.html#LuaCircuitNetwork.wire_type View documentation} - */ - readonly wire_type: defines.wire_type - /** - * The circuit connector ID on the associated entity this network was gotten from. - * - * {@link https://lua-api.factorio.com/next/LuaCircuitNetwork.html#LuaCircuitNetwork.circuit_connector_id View documentation} - */ - readonly circuit_connector_id: defines.circuit_connector_id - /** - * The circuit network signals last tick. `nil` if there are no signals. - * - * {@link https://lua-api.factorio.com/next/LuaCircuitNetwork.html#LuaCircuitNetwork.signals View documentation} - */ - readonly signals: Signal[] | undefined - /** - * The circuit networks ID. - * - * {@link https://lua-api.factorio.com/next/LuaCircuitNetwork.html#LuaCircuitNetwork.network_id View documentation} - */ - readonly network_id: uint - /** - * The number of circuits connected to this network. - * - * {@link https://lua-api.factorio.com/next/LuaCircuitNetwork.html#LuaCircuitNetwork.connected_circuit_count View documentation} - */ - readonly connected_circuit_count: uint - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaCircuitNetwork" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * {@link https://lua-api.factorio.com/next/LuaCombinatorControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaCombinatorControlBehavior extends LuaControlBehavior { - /** - * Gets the value of a specific signal sent by this combinator behavior last tick or nil if the signal didn't exist. - * - * {@link https://lua-api.factorio.com/next/LuaCombinatorControlBehavior.html#LuaCombinatorControlBehavior.get_signal_last_tick View documentation} - * - * @param signal - The signal to get - * @returns The value or `nil` if none. - */ - get_signal_last_tick(signal: SignalID): int | undefined - /** - * The circuit network signals sent by this combinator last tick. - * - * {@link https://lua-api.factorio.com/next/LuaCombinatorControlBehavior.html#LuaCombinatorControlBehavior.signals_last_tick View documentation} - */ - readonly signals_last_tick: Signal[] -} - -/** - * Allows for the registration of custom console commands. Similarly to - * {@link LuaBootstrap.on_event event subscriptions}, these don't persist through a save-and-load cycle. - * - * {@link https://lua-api.factorio.com/next/LuaCommandProcessor.html View documentation} - * - * @noSelf - */ -interface LuaCommandProcessor { - /** - * Add a custom console command. - * - * **Note**: Trying to add a command with the `name` of a game command or the name of a custom command that is - * already in use will result in an error. - * - * {@link https://lua-api.factorio.com/next/LuaCommandProcessor.html#LuaCommandProcessor.add_command View documentation} - * - * @example - * This will register a custom event called `print_tick` that prints the current tick to either the player issuing the command or to everyone on the server, depending on the command parameter. It shows the usage of the table that gets passed to any function handling a custom command. This specific example makes use of the `tick` and the optional `player_index` and `parameter` fields. The user is supposed to either call it without any parameter (`"/print_tick"`) or with the `"me"` parameter (`"/print_tick me"`). - * - * ```lua - * commands.add_command("print_tick", nil, function(command) - * if command.player_index ~= nil and command.parameter == "me" then - * game.get_player(command.player_index).print(command.tick) - * else - * game.print(command.tick) - * end - * end) - * ``` - * - * @param name - The desired name of the command (case sensitive). - * @param help - The localised help message. It will be shown to players using the `/help` command. - * @param _function - The function that will be called when this command is invoked. - */ - add_command(name: string, help: LocalisedString, _function: (param1: CustomCommandData) => void): void - /** - * Remove a custom console command. - * - * {@link https://lua-api.factorio.com/next/LuaCommandProcessor.html#LuaCommandProcessor.remove_command View documentation} - * - * @param name - The name of the command to remove (case sensitive). - * @returns Whether the command was successfully removed. Returns `false` if the command didn't exist. - */ - remove_command(name: string): boolean - /** - * Lists the custom commands registered by scripts through `LuaCommandProcessor`. - * - * {@link https://lua-api.factorio.com/next/LuaCommandProcessor.html#LuaCommandProcessor.commands View documentation} - */ - readonly commands: Record - /** - * Lists the built-in commands of the core game. The {@link https://wiki.factorio.com/Console wiki} has an overview of these. - * - * {@link https://lua-api.factorio.com/next/LuaCommandProcessor.html#LuaCommandProcessor.game_commands View documentation} - */ - readonly game_commands: Record - /** This object's name. */ - readonly object_name: "LuaCommandProcessor" -} - -/** - * Control behavior for constant combinators. - * - * {@link https://lua-api.factorio.com/next/LuaConstantCombinatorControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior { - /** - * Sets the signal at the given index - * - * {@link https://lua-api.factorio.com/next/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.set_signal View documentation} - * - * @param index - * @param signal - */ - set_signal(index: uint, signal: Signal): void - /** - * Gets the signal at the given index. Returned {@link Signal} will not contain signal if none is set for the index. - * - * {@link https://lua-api.factorio.com/next/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.get_signal View documentation} - * - * @param index - */ - get_signal(index: uint): Signal - /** - * The constant combinator parameters - * - * **Note**: Setting to `nil` clears the parameters. - * - * {@link https://lua-api.factorio.com/next/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.parameters View documentation} - */ - parameters: ConstantCombinatorParameters[] - /** - * Turns this constant combinator on and off. - * - * {@link https://lua-api.factorio.com/next/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.enabled View documentation} - */ - enabled: boolean - /** - * The number of signals this constant combinator supports - * - * {@link https://lua-api.factorio.com/next/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.signals_count View documentation} - */ - readonly signals_count: uint - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaConstantCombinatorControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for container entities. - * - * {@link https://lua-api.factorio.com/next/LuaContainerControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaContainerControlBehavior extends LuaControlBehavior { - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaContainerControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -interface BaseControlSetGuiArrow { - /** - * Where to point to. This field determines what other fields are mandatory. May be `"nowhere"`, `"goal"`, - * `"entity_info"`, `"active_window"`, `"entity"`, `"position"`, `"crafting_queue"`, or `"item_stack"`. - */ - readonly type: - | "nowhere" - | "goal" - | "entity_info" - | "active_window" - | "entity" - | "position" - | "crafting_queue" - | "item_stack" -} - -interface EntityControlSetGuiArrow extends BaseControlSetGuiArrow { - readonly type: "entity" - readonly entity: LuaEntity -} - -interface PositionControlSetGuiArrow extends BaseControlSetGuiArrow { - readonly type: "position" - readonly position: Position -} - -interface CraftingQueueControlSetGuiArrow extends BaseControlSetGuiArrow { - readonly type: "crafting_queue" - readonly crafting_queueindex: uint -} - -interface ItemStackControlSetGuiArrow extends BaseControlSetGuiArrow { - readonly type: "item_stack" - readonly inventory_index: defines.inventory - readonly item_stack_index: uint - /** May be either `"player"` or `"target"`. */ - readonly source: "player" | "target" -} - -interface OtherControlSetGuiArrow extends BaseControlSetGuiArrow { - readonly type: "nowhere" | "goal" | "entity_info" | "active_window" -} - -type ControlSetGuiArrow = - | EntityControlSetGuiArrow - | PositionControlSetGuiArrow - | CraftingQueueControlSetGuiArrow - | ItemStackControlSetGuiArrow - | OtherControlSetGuiArrow - -/** - * This is an abstract base class containing the common functionality between {@link LuaPlayer} and entities (see - * {@link LuaEntity}). When accessing player-related functions through a {@link LuaEntity}, it must refer to a character entity. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html View documentation} - * - * @noSelf - */ -interface LuaControl { - /** - * Get an inventory belonging to this entity. This can be either the "main" inventory or some auxiliary one, like - * the module slots or logistic trash slots. - * - * **Note**: A given {@link defines.inventory} is only meaningful for the corresponding LuaObject type. EG: - * get_inventory(defines.inventory.character_main) is only meaningful if 'this' is a player character. You may get a - * value back but if the type of 'this' isn't the type referred to by the {@link defines.inventory} it's almost - * guaranteed to not be the inventory asked for. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.get_inventory View documentation} - * - * @param inventory - * @returns Or `nil` if this entity doesn't have an inventory with the given index. - */ - get_inventory(inventory: defines.inventory): LuaInventory | undefined - /** - * Gets the main inventory for this character or player if this is a character or player. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.get_main_inventory View documentation} - * - * @returns Or `nil` if this entity is not a character or player. - */ - get_main_inventory(): LuaInventory | undefined - /** - * Can at least some items be inserted? - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.can_insert View documentation} - * - * @param items - Items that would be inserted. - * @returns `true` if at least a part of the given items could be inserted into this inventory. - */ - can_insert(items: ItemStackIdentification): boolean - /** - * Insert items into this entity. This works the same way as inserters or shift-clicking: the "best" inventory is - * chosen automatically. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.insert View documentation} - * - * @param items - Items to insert. - * @returns Number of items actually inserted. - */ - insert(items: ItemStackIdentification): uint - /** - * Create an arrow which points at this entity. This is used in the tutorial. For examples, see `control.lua` in the - * campaign missions. - * - * Other attributes may be specified depending on `type`: - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.set_gui_arrow View documentation} - */ - set_gui_arrow(params: ControlSetGuiArrow): void - /** - * Removes the arrow created by `set_gui_arrow`. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.clear_gui_arrow View documentation} - */ - clear_gui_arrow(): void - /** - * Get the number of all or some items in this entity. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.get_item_count View documentation} - * - * @param item - Prototype name of the item to count. If not specified, count all items. - */ - get_item_count(item?: string): uint - /** - * Does this entity have any item inside it? - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.has_items_inside View documentation} - */ - has_items_inside(): boolean - /** - * Can a given entity be opened or accessed? - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.can_reach_entity View documentation} - * - * @param entity - */ - can_reach_entity(entity: LuaEntity): boolean - /** - * Remove all items from this entity. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.clear_items_inside View documentation} - */ - clear_items_inside(): void - /** - * Remove items from this entity. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.remove_item View documentation} - * - * @param items - Items to remove. - * @returns Number of items actually removed. - */ - remove_item(items: ItemStackIdentification): uint - /** - * Teleport the entity to a given position, possibly on another surface. - * - * **Note**: Some entities may not be teleported. For instance, transport belts won't allow teleportation and this - * method will always return `false` when used on any such entity. - * - * **Note**: You can also pass 1 or 2 numbers as the parameters and they will be used as relative teleport - * coordinates `'teleport(0, 1)'` to move the entity 1 tile positive y. `'teleport(4)'` to move the entity 4 tiles - * to the positive x. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.teleport View documentation} - * - * @param position - Where to teleport to. - * @param surface - Surface to teleport to. If not given, will teleport to the entity's current surface. Only - * players, cars, and spidertrons can be teleported cross-surface. - * @returns `true` when the entity was successfully teleported. - */ - teleport(position: Position, surface?: SurfaceIdentification): boolean - /** - * Select an entity, as if by hovering the mouse above it. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.update_selected_entity View documentation} - * - * @param position - Position of the entity to select - */ - update_selected_entity(position: Position): void - /** - * Unselect any selected entity. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.clear_selected_entity View documentation} - */ - clear_selected_entity(): void - /** - * Disable the flashlight. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.disable_flashlight View documentation} - */ - disable_flashlight(): void - /** - * Enable the flashlight. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.enable_flashlight View documentation} - */ - enable_flashlight(): void - /** - * Is the flashlight enabled. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.is_flashlight_enabled View documentation} - */ - is_flashlight_enabled(): void - /** - * Gets the count of the given recipe that can be crafted. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.get_craftable_count View documentation} - * - * @param recipe - The recipe. - * @returns The count that can be crafted. - */ - get_craftable_count(recipe: string | LuaRecipe): uint - /** - * Begins crafting the given count of the given recipe. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.begin_crafting View documentation} - * - * @returns The count that was actually started crafting. - */ - begin_crafting(params: { - /** The count to craft. */ - readonly count: uint - /** The recipe to craft. */ - readonly recipe: string | LuaRecipe - /** If false and the recipe can't be crafted the requested number of times printing the failure is skipped. */ - readonly silent?: boolean - }): uint - /** - * Cancels crafting the given count of the given crafting queue index. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.cancel_crafting View documentation} - */ - cancel_crafting(params: { - /** The crafting queue index. */ - readonly index: uint - /** The count to cancel crafting. */ - readonly count: uint - }): void - /** - * Mines the given entity as if this player (or character) mined it. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.mine_entity View documentation} - * - * @param entity - The entity to mine - * @param force - Forces mining the entity even if the items can't fit in the player. - * @returns If the mining succeeded. - */ - mine_entity(entity: LuaEntity, force?: boolean): boolean - /** - * Mines the given tile as if this player (or character) mined it. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.mine_tile View documentation} - * - * @param tile - The tile to mine. - * @returns If the mining succeeded. - */ - mine_tile(tile: LuaTile): boolean - /** - * When `true` control adapter is a LuaPlayer object, `false` for entities including characters with players - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.is_player View documentation} - */ - is_player(): boolean - /** - * Open the technology GUI and select a given technology. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.open_technology_gui View documentation} - * - * @param technology - The technology to select after opening the GUI. - */ - open_technology_gui(technology?: TechnologyIdentification): void - /** - * Sets a personal logistic request and auto-trash slot to the given value. - * - * **Note**: This will silently fail if personal logistics are not researched yet. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.set_personal_logistic_slot View documentation} - * - * @param slot_index - The slot to set. - * @param value - The logistic request parameters. - * @returns Whether the slot was set successfully. - */ - set_personal_logistic_slot(slot_index: uint, value: PersonalLogisticParameters): boolean - /** - * Sets a vehicle logistic request and auto-trash slot to the given value. - * - * **Note**: This will silently fail if the vehicle does not use logistics. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.set_vehicle_logistic_slot View documentation} - * - * @param slot_index - The slot to set. - * @param value - The logistic request parameters. - * @returns Whether the slot was set successfully. - */ - set_vehicle_logistic_slot(slot_index: uint, value: PersonalLogisticParameters): boolean - /** - * Gets the parameters of a personal logistic request and auto-trash slot. - * - * **Note**: This will silently return an empty value (`name` will be `nil`) if personal logistics are not researched yet. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.get_personal_logistic_slot View documentation} - * - * @param slot_index - The slot to get. - */ - get_personal_logistic_slot(slot_index: uint): PersonalLogisticParameters - /** - * Gets the parameters of a vehicle logistic request and auto-trash slot. - * - * **Note**: This will silently return an empty value (`name` will be `nil`) if the vehicle does not use logistics. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.get_vehicle_logistic_slot View documentation} - * - * @param slot_index - The slot to get. - */ - get_vehicle_logistic_slot(slot_index: uint): PersonalLogisticParameters - /** - * **Note**: This will silently fail if personal logistics are not researched yet. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.clear_personal_logistic_slot View documentation} - * - * @param slot_index - The slot to clear. - */ - clear_personal_logistic_slot(slot_index: uint): void - /** - * **Note**: This will silently fail if the vehicle does not use logistics. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.clear_vehicle_logistic_slot View documentation} - * - * @param slot_index - The slot to clear. - */ - clear_vehicle_logistic_slot(slot_index: uint): void - /** - * Returns whether the player is holding a blueprint, it takes into account a blueprint as an item as well as - * blueprint from the blueprint record from the blueprint library. Note that the is_cursor_blueprint and - * get_cursor_blueprint_entities refer to the currently selected blueprint, so it returns blueprint related - * information also when holding a blueprint book with a blueprint being selected in it. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.is_cursor_blueprint View documentation} - */ - is_cursor_blueprint(): boolean - /** - * Gets the entities that are part of the currently selected blueprint, regardless of it being in a blueprint book - * or picked from the blueprint library. Returns `nil` if there is no currently selected blueprint. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.get_blueprint_entities View documentation} - */ - get_blueprint_entities(): BlueprintEntity[] | undefined - /** - * Returns whether the player is holding something in the cursor. It takes into account items from the blueprint - * library, as well as items and ghost cursor. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.is_cursor_empty View documentation} - */ - is_cursor_empty(): boolean - /** - * The surface this entity is currently on. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.surface View documentation} - */ - readonly surface: LuaSurface - /** - * Current position of the entity. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.position View documentation} - */ - readonly position: PositionTable - /** - * The vehicle the player is currently sitting in; `nil` if none. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.vehicle View documentation} - */ - readonly vehicle: LuaEntity | undefined - /** - * The force of this entity. Reading will always give a {@link LuaForce}, but it is possible to assign either - * {@link string} or {@link LuaForce} to this attribute to change the force. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.force View documentation} - */ - force: ForceIdentification - /** - * The currently selected entity; `nil` if none. Assigning an entity will select it if selectable otherwise clears selection. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.selected View documentation} - */ - selected: LuaEntity | undefined - /** - * The GUI target the player currently has open; `nil` if none. - * - * **Note**: Write supports any of the types. Read will return the entity, equipment, equipment-grid, player, element or nil. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.opened View documentation} - */ - opened: - | LuaEntity - | LuaItemStack - | LuaEquipment - | LuaEquipmentGrid - | LuaPlayer - | LuaGuiElement - | defines.gui_type - | undefined - /** - * Size of the crafting queue. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.crafting_queue_size View documentation} - */ - readonly crafting_queue_size: uint - /** - * The crafting queue progress [0-1] 0 when no recipe is being crafted. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.crafting_queue_progress View documentation} - */ - readonly crafting_queue_progress: double - /** - * Current walking state. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.walking_state View documentation} - * - * @example - * Make the player go north. Note that a one-shot action like this will only make the player walk for one tick. - * - * ```lua - * game.player.walking_state = {walking = true, direction = defines.direction.north} - * ``` - */ - walking_state: { - /** If `false`, the player is currently not walking; otherwise it's going somewhere */ - readonly walking: boolean - /** Direction where the player is walking */ - readonly direction: defines.direction - } - /** - * Current riding state of this car or the vehicle this player is riding in. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.riding_state View documentation} - */ - riding_state: RidingState - /** - * Current mining state. - * - * **Note**: When the player isn't mining tiles the player will mine what ever entity is currently selected. See - * {@link LuaControl.selected LuaControl::selected} and - * {@link LuaControl.update_selected_entity LuaControl::update_selected_entity}. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.mining_state View documentation} - */ - mining_state: { - /** Whether the player is mining at all */ - readonly mining: boolean - /** What tiles the player is mining; only used when the player is mining tiles (holding a tile in the cursor). */ - readonly position?: Position - } - /** - * Current shooting state. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.shooting_state View documentation} - */ - shooting_state: { - /** The current state */ - readonly state: defines.shooting - /** The position being shot at */ - readonly position: Position - } - /** - * Current item-picking state. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.picking_state View documentation} - */ - picking_state: boolean - /** - * Current repair state. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.repair_state View documentation} - */ - repair_state: { - /** The current state */ - readonly repairing: boolean - /** The position being repaired */ - readonly position: Position - } - /** - * The player's cursor stack, or `nil` if the player controller is a spectator. Even though this property is marked - * as read-only, it returns a {@link LuaItemStack}, meaning it can be manipulated like so: - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.cursor_stack View documentation} - * - * @example - * ```lua - * player.cursor_stack.clear() - * ``` - */ - readonly cursor_stack: LuaItemStack | undefined - /** - * The ghost prototype in the player's cursor. - * - * **Note**: When read, it will be a {@link LuaItemPrototype}. - * - * **Note**: Items in the cursor stack will take priority over the cursor ghost. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.cursor_ghost View documentation} - */ - cursor_ghost: ItemPrototypeIdentification - /** - * `true` if the player is in a vehicle. Writing to this attribute puts the player in or out of a vehicle. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.driving View documentation} - */ - driving: boolean - /** - * Gets the current crafting queue items. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.crafting_queue View documentation} - */ - readonly crafting_queue: CraftingQueueItem[] - /** - * The current combat robots following the character - * - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character(see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.following_robots View documentation} - */ - readonly following_robots: LuaEntity[] - /** - * When `true` hand crafting is free and instant - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.cheat_mode View documentation} - */ - cheat_mode: boolean - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_crafting_speed_modifier View documentation} - */ - character_crafting_speed_modifier: double - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_mining_speed_modifier View documentation} - */ - character_mining_speed_modifier: double - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_additional_mining_categories View documentation} - */ - character_additional_mining_categories: string[] - /** - * Modifies the running speed of this character by the given value as a percentage. Setting the running modifier to - * `0.5` makes the character run 50% faster. The minimum value of `-1` reduces the movement speed by 100%, resulting - * in a speed of `0`. - * - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_running_speed_modifier View documentation} - */ - character_running_speed_modifier: double - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_build_distance_bonus View documentation} - */ - character_build_distance_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_item_drop_distance_bonus View documentation} - */ - character_item_drop_distance_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_reach_distance_bonus View documentation} - */ - character_reach_distance_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_resource_reach_distance_bonus View documentation} - */ - character_resource_reach_distance_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_item_pickup_distance_bonus View documentation} - */ - character_item_pickup_distance_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_loot_pickup_distance_bonus View documentation} - */ - character_loot_pickup_distance_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_inventory_slots_bonus View documentation} - */ - character_inventory_slots_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_trash_slot_count_bonus View documentation} - */ - character_trash_slot_count_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_maximum_following_robot_count_bonus View documentation} - */ - character_maximum_following_robot_count_bonus: uint - /** - * **Note**: When called on a {@link LuaPlayer}, it must be associated with a character (see - * {@link LuaPlayer.character LuaPlayer::character}). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_health_bonus View documentation} - */ - character_health_bonus: float - /** - * If personal logistic requests are enabled for this character or players character. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_personal_logistic_requests_enabled View documentation} - */ - character_personal_logistic_requests_enabled: boolean - /** - * If personal logistic requests are enabled for this vehicle (spidertron). - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.vehicle_logistic_requests_enabled View documentation} - */ - vehicle_logistic_requests_enabled: boolean - /** - * Returns the {@link defines.gui_type} or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.opened_gui_type View documentation} - */ - readonly opened_gui_type: defines.gui_type | undefined - /** - * The build distance of this character or max uint when not a character or player connected to a character. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.build_distance View documentation} - */ - readonly build_distance: uint - /** - * The item drop distance of this character or max uint when not a character or player connected to a character. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.drop_item_distance View documentation} - */ - readonly drop_item_distance: uint - /** - * The reach distance of this character or max uint when not a character or player connected to a character. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.reach_distance View documentation} - */ - readonly reach_distance: uint - /** - * The item pickup distance of this character or max double when not a character or player connected to a character. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.item_pickup_distance View documentation} - */ - readonly item_pickup_distance: double - /** - * The loot pickup distance of this character or max double when not a character or player connected to a character. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.loot_pickup_distance View documentation} - */ - readonly loot_pickup_distance: double - /** - * The resource reach distance of this character or max double when not a character or player connected to a character. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.resource_reach_distance View documentation} - */ - readonly resource_reach_distance: double - /** - * If this character entity is in combat. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.in_combat View documentation} - */ - readonly in_combat: boolean - /** - * Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_running_speed View documentation} - */ - readonly character_running_speed: double - /** - * Gets the current mining progress between 0 and 1 of this character, or 0 if they aren't mining. - * - * {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.character_mining_progress View documentation} - */ - readonly character_mining_progress: double -} - -/** - * The control behavior for an entity. Inserters have logistic network and circuit network behavior logic, lamps have - * circuit logic and so on. This is an abstract base class that concrete control behaviors inherit. - * - * **Note**: An control reference becomes invalid once the control behavior is removed or the entity (see - * {@link LuaEntity}) it resides in is destroyed. - * - * {@link https://lua-api.factorio.com/next/LuaControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaControlBehavior { - /** - * {@link https://lua-api.factorio.com/next/LuaControlBehavior.html#LuaControlBehavior.get_circuit_network View documentation} - * - * @param wire - Wire color of the network connected to this entity. - * @param circuit_connector - The connector to get circuit network for. Must be specified for entities with more - * than one circuit network connector. - * @returns The circuit network or nil. - */ - get_circuit_network( - wire: defines.wire_type, - circuit_connector?: defines.circuit_connector_id - ): LuaCircuitNetwork | undefined - /** - * The concrete type of this control behavior. - * - * {@link https://lua-api.factorio.com/next/LuaControlBehavior.html#LuaControlBehavior.type View documentation} - */ - readonly type: defines.control_behavior.type - /** - * The entity this control behavior belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaControlBehavior.html#LuaControlBehavior.entity View documentation} - */ - readonly entity: LuaEntity -} - -/** - * A custom tag that shows on the map view. - * - * {@link https://lua-api.factorio.com/next/LuaCustomChartTag.html View documentation} - * - * @noSelf - */ -interface LuaCustomChartTag { - /** - * Destroys this tag. - * - * {@link https://lua-api.factorio.com/next/LuaCustomChartTag.html#LuaCustomChartTag.destroy View documentation} - */ - destroy(): void - /** - * This tag's icon, if it has one. Writing `nil` removes it. - * - * {@link https://lua-api.factorio.com/next/LuaCustomChartTag.html#LuaCustomChartTag.icon View documentation} - */ - icon: SignalID | undefined - /** - * The player who last edited this tag. - * - * {@link https://lua-api.factorio.com/next/LuaCustomChartTag.html#LuaCustomChartTag.last_user View documentation} - */ - last_user: LuaPlayer - /** - * The position of this tag. - * - * {@link https://lua-api.factorio.com/next/LuaCustomChartTag.html#LuaCustomChartTag.position View documentation} - */ - readonly position: PositionTable - text: string - /** - * The unique ID for this tag on this force. - * - * {@link https://lua-api.factorio.com/next/LuaCustomChartTag.html#LuaCustomChartTag.tag_number View documentation} - */ - readonly tag_number: uint - /** - * The force this tag belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaCustomChartTag.html#LuaCustomChartTag.force View documentation} - */ - readonly force: LuaForce - /** - * The surface this tag belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaCustomChartTag.html#LuaCustomChartTag.surface View documentation} - */ - readonly surface: LuaSurface - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaCustomChartTag" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a custom input. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html View documentation} - * - * @noSelf - */ -interface LuaCustomInputPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * The default key sequence for this custom input. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.key_sequence View documentation} - */ - readonly key_sequence: string - /** - * The default alternative key sequence for this custom input. `nil` when not defined. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.alternative_key_sequence View documentation} - */ - readonly alternative_key_sequence: string | undefined - /** - * The linked game control name or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.linked_game_control View documentation} - */ - readonly linked_game_control: string | undefined - /** - * The consuming type: `"none"` or `"game-only"`. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.consuming View documentation} - */ - readonly consuming: "none" | "game-only" - /** - * The action that happens when this custom input is triggered. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.action View documentation} - */ - readonly action: string - /** - * If this custom input is enabled. Disabled custom inputs exist but are not used by the game. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.enabled View documentation} - */ - readonly enabled: boolean - /** - * If this custom input is enabled while using the spectator controller. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.enabled_while_spectating View documentation} - */ - readonly enabled_while_spectating: boolean - /** - * If this custom input is enabled while using the cutscene controller. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.enabled_while_in_cutscene View documentation} - */ - readonly enabled_while_in_cutscene: boolean - /** - * If this custom input will include the selected prototype (if any) when triggered. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.include_selected_prototype View documentation} - */ - readonly include_selected_prototype: boolean - /** - * The item that gets spawned when this custom input is fired or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaCustomInputPrototype.html#LuaCustomInputPrototype.item_to_spawn View documentation} - */ - readonly item_to_spawn: LuaItemPrototype | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaCustomInputPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -type CustomTableIndex -/** - * Access an element of this custom table. - * - * {@link https://lua-api.factorio.com/next/LuaCustomTable.html#LuaCustomTable.operator%20[] View documentation} - */ = { - [P in K]: V -} - -/** @noSelf */ -interface LuaCustomTableMembers { - /** - * Number of elements in this table. - * - * {@link https://lua-api.factorio.com/next/LuaCustomTable.html#LuaCustomTable.operator%20# View documentation} - */ - readonly length: LuaLengthMethod - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaCustomTable" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Lazily evaluated table. For performance reasons, we sometimes return a custom table-like type instead of a native Lua - * table. This custom type lazily constructs the necessary Lua wrappers of the corresponding C++ objects, therefore - * preventing their unnecessary construction in some cases. - * - * There are some notable consequences to the usage of a custom table type rather than the native Lua table type: - * Iterating a custom table is only possible using the `pairs` Lua function; `ipairs` won't work. Another key difference - * is that custom tables cannot be serialised into a game save file -- if saving the game would require serialisation of - * a custom table, an error will be displayed and the game will not be saved. - * - * {@link https://lua-api.factorio.com/next/LuaCustomTable.html View documentation} - * - * @example - * In previous versions of Factorio, this would create a {@link LuaPlayer} instance for every player in the game, even though only one such wrapper is needed. In the current version, accessing {@link LuaGameScript.players game.players} by itself does not create any {@link LuaPlayer} instances; they are created lazily when accessed. Therefore, this example only constructs one {@link LuaPlayer} instance, no matter how many elements there are in `game.players`. - * - * ```lua - * game.players["Oxyd"].character.die() - * ``` - * - * @example - * Custom tables may be iterated using `pairs`. - * - * ```lua - * for _, p in pairs(game.players) do game.player.print(p.name); end - * ``` - * - * @example - * The following will produce no output because `ipairs` is not supported with custom tables. - * - * ```lua - * for _, p in ipairs(game.players) do game.player.print(p.name); end -- incorrect; use pairs instead - * ``` - * - * @example - * This statement will execute successfully and `global.p` will be useable as one might expect. However, as soon as the user tries to save the game, a "LuaCustomTable cannot be serialized" error will be shown. The game will remain unsaveable so long as `global.p` refers to an instance of a custom table. - * - * ```lua - * global.p = game.players -- This has high potential to make the game unsaveable - * ``` - */ -type LuaCustomTable = LuaCustomTableMembers & CustomTableIndex - -/** - * Prototype of a damage. - * - * {@link https://lua-api.factorio.com/next/LuaDamagePrototype.html View documentation} - * - * @noSelf - */ -interface LuaDamagePrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaDamagePrototype.html#LuaDamagePrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaDamagePrototype.html#LuaDamagePrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Whether this damage type is hidden from entity tooltips. - * - * {@link https://lua-api.factorio.com/next/LuaDamagePrototype.html#LuaDamagePrototype.hidden View documentation} - */ - readonly hidden: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaDamagePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for decider combinators. - * - * {@link https://lua-api.factorio.com/next/LuaDeciderCombinatorControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaDeciderCombinatorControlBehavior extends LuaCombinatorControlBehavior { - /** - * The decider combinator parameters - * - * **Note**: Setting to `nil` clears the parameters. - * - * {@link https://lua-api.factorio.com/next/LuaDeciderCombinatorControlBehavior.html#LuaDeciderCombinatorControlBehavior.parameters View documentation} - */ - parameters: DeciderCombinatorParameters - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaDeciderCombinatorControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of an optimized decorative. - * - * {@link https://lua-api.factorio.com/next/LuaDecorativePrototype.html View documentation} - * - * @noSelf - */ -interface LuaDecorativePrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaDecorativePrototype.html#LuaDecorativePrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaDecorativePrototype.html#LuaDecorativePrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * The bounding box used for collision checking. - * - * {@link https://lua-api.factorio.com/next/LuaDecorativePrototype.html#LuaDecorativePrototype.collision_box View documentation} - */ - readonly collision_box: BoundingBoxTable - /** - * The collision masks this decorative uses - * - * {@link https://lua-api.factorio.com/next/LuaDecorativePrototype.html#LuaDecorativePrototype.collision_mask View documentation} - */ - readonly collision_mask: CollisionMask - readonly collision_mask_with_flags: CollisionMaskWithFlags - /** - * Autoplace specification for this decorative prototype. `nil` if none. - * - * {@link https://lua-api.factorio.com/next/LuaDecorativePrototype.html#LuaDecorativePrototype.autoplace_specification View documentation} - */ - readonly autoplace_specification: AutoplaceSpecification | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaDecorativePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of an electric energy source. - * - * {@link https://lua-api.factorio.com/next/LuaElectricEnergySourcePrototype.html View documentation} - * - * @noSelf - */ -interface LuaElectricEnergySourcePrototype { - readonly buffer_capacity: double - readonly usage_priority: string - readonly input_flow_limit: double - readonly output_flow_limit: double - readonly drain: double - readonly emissions: double - readonly render_no_network_icon: boolean - readonly render_no_power_icon: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaElectricEnergySourcePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * The primary interface for interacting with entities through the Lua API. Entities are everything that exists on the - * map except for tiles (see {@link LuaTile}). - * - * Most functions on LuaEntity also work when the entity is contained in a ghost. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html View documentation} - * - * @noSelf - */ -interface LuaEntity extends LuaControl { - /** - * Gets the entities output inventory if it has one. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_output_inventory View documentation} - * - * @returns A reference to the entities output inventory. - */ - get_output_inventory(): LuaInventory - /** - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_module_inventory View documentation} - * - * @returns Inventory for storing modules of this entity; `nil` if this entity has no module inventory. - */ - get_module_inventory(): LuaInventory | undefined - /** - * The fuel inventory for this entity or `nil` if this entity doesn't have a fuel inventory. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_fuel_inventory View documentation} - */ - get_fuel_inventory(): LuaInventory | undefined - /** - * The burnt result inventory for this entity or `nil` if this entity doesn't have a burnt result inventory. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_burnt_result_inventory View documentation} - */ - get_burnt_result_inventory(): LuaInventory | undefined - /** - * Damages the entity. - * - * *Can only be used if this is EntityWithHealth* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.damage View documentation} - * - * @param damage - The amount of damage to be done - * @param force - The force that will be doing the damage. - * @param type - The type of damage to be done, defaults to "impact". - * @param dealer - The entity to consider as the damage dealer. - * @returns The total damage actually applied after resistances. - */ - damage(damage: float, force: ForceIdentification, type?: string, dealer?: LuaEntity): float - /** - * Checks if the entity can be destroyed - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.can_be_destroyed View documentation} - * - * @returns If the entity can be destroyed. - */ - can_be_destroyed(): boolean - /** - * Destroys the entity. - * - * **Note**: Not all entities can be destroyed - things such as rails under trains cannot be destroyed until the - * train is moved or destroyed. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.destroy View documentation} - * - * @returns Returns `false` if the entity was valid and destruction failed, `true` in all other cases. - */ - destroy(params?: { - /** Whether neighbouring cliffs should be corrected. Defaults to `false`. */ - readonly do_cliff_correction?: boolean - /** If `true`, {@link ScriptRaisedDestroyEvent script_raised_destroy} will be called. Defaults to `false`. */ - readonly raise_destroy?: boolean - }): boolean - /** - * Give the entity a command. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_command View documentation} - * - * @param command - */ - set_command(command: Command): void - /** - * Give the entity a distraction command. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_distraction_command View documentation} - * - * @param command - */ - set_distraction_command(command: Command): void - /** - * Has this unit been assigned a command? - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.has_command View documentation} - */ - has_command(): boolean - /** - * Immediately kills the entity. Does nothing if the entity doesn't have health. - * - * Unlike {@link LuaEntity.destroy LuaEntity::destroy}, `die` will trigger the - * {@link OnEntityDiedEvent on_entity_died} event and the entity will produce a corpse and drop loot if it has any. - * - * **Note**: If `force` is not specified, `on_entity_died` will blame the `"neutral"` force. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.die View documentation} - * - * @example - * This function can be called with only the `cause` argument and no `force`: - * - * ```lua - * entity.die(nil, killer_entity) - * ``` - * - * @param force - The force to attribute the kill to. - * @param cause - The cause to attribute the kill to. - * @returns Whether the entity was successfully killed. - */ - die(force?: ForceIdentification, cause?: LuaEntity): boolean - /** - * Test whether this entity's prototype has a flag set. - * - * **Note**: `entity.has_flag(f)` is a shortcut for `entity.prototype.has_flag(f)`. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.has_flag View documentation} - * - * @param flag - The flag to test - * @returns `true` if the entity has the given flag set. - */ - has_flag(flag: string): boolean - /** - * Same as {@link LuaEntity.has_flag LuaEntity::has_flag} but targets the inner entity on a entity ghost. - * - * *Can only be used if this is EntityGhost* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.ghost_has_flag View documentation} - * - * @param flag - The flag to test - * @returns `true` if the entity has the given flag set. - */ - ghost_has_flag(flag: string): boolean - /** - * Offer a thing on the market. - * - * *Can only be used if this is Market* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.add_market_item View documentation} - * - * @example - * Adds market offer, 1 copper ore for 10 iron ore. - * - * ```lua - * market.add_market_item{price={{"iron-ore", 10}}, offer={type="give-item", item="copper-ore"}} - * ``` - * - * @example - * Adds market offer, 1 copper ore for 5 iron ore and 5 stone ore. - * - * ```lua - * market.add_market_item{price={{"iron-ore", 5}, {"stone", 5}}, offer={type="give-item", item="copper-ore"}} - * ``` - * - * @param offer - */ - add_market_item(offer: Offer): void - /** - * Remove an offer from a market. - * - * **Note**: The other offers are moved down to fill the gap created by removing the offer, which decrements the - * overall size of the offer array. - * - * *Can only be used if this is Market* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.remove_market_item View documentation} - * - * @param offer - Index of offer to remove. - * @returns `true` if the offer was successfully removed; `false` when the given index was not valid. - */ - remove_market_item(offer: uint): boolean - /** - * Get all offers in a market as an array. - * - * *Can only be used if this is Market* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_market_items View documentation} - */ - get_market_items(): Offer[] - /** - * Removes all offers from a market. - * - * *Can only be used if this is Market* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.clear_market_items View documentation} - */ - clear_market_items(): void - /** - * Connect two devices with a circuit wire or copper cable. Depending on which type of connection should be made, - * there are different procedures: - * - * - To connect two electric poles, `target` must be a {@link LuaEntity} that specifies another electric pole. This - * will connect them with copper cable. - * - To connect two devices with circuit wire, `target` must be a table of type {@link WireConnectionDefinition}. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.connect_neighbour View documentation} - * - * @param target - The target with which to establish a connection. - * @returns Whether the connection was successfully formed. - */ - connect_neighbour(target: LuaEntity | WireConnectionDefinition): boolean - /** - * Disconnect circuit wires or copper cables between devices. Depending on which type of connection should be cut, - * there are different procedures: - * - * - To remove all copper cables, leave the `target` parameter blank: `pole.disconnect_neighbour()`. - * - To remove all wires of a specific color, set `target` to {@link defines.wire_type.red} or {@link defines.wire_type.green}. - * - To remove a specific copper cable between two electric poles, `target` must be a {@link LuaEntity} that specifies - * the other pole: `pole1.disconnect_neighbour(pole2)`. - * - To remove a specific circuit wire, `target` must be a table of type {@link WireConnectionDefinition}. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.disconnect_neighbour View documentation} - * - * @param target - The target with which to cut a connection. - */ - disconnect_neighbour(target?: defines.wire_type | LuaEntity | WireConnectionDefinition): void - /** - * Sets the entity to be deconstructed by construction robots. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.order_deconstruction View documentation} - * - * @param force - The force whose robots are supposed to do the deconstruction. - * @param player - The player to set the last_user to if any. - * @returns If the entity was marked for deconstruction. - */ - order_deconstruction(force: ForceIdentification, player?: PlayerIdentification): boolean - /** - * Cancels deconstruction if it is scheduled, does nothing otherwise. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.cancel_deconstruction View documentation} - * - * @param force - The force who did the deconstruction order. - * @param player - The player to set the last_user to if any. - */ - cancel_deconstruction(force: ForceIdentification, player?: PlayerIdentification): void - /** - * Is this entity marked for deconstruction? - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.to_be_deconstructed View documentation} - */ - to_be_deconstructed(): boolean - /** - * Sets the entity to be upgraded by construction robots. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.order_upgrade View documentation} - * - * @returns If the entity was marked for upgrade. - */ - order_upgrade(params: { - /** The force whose robots are supposed to do the upgrade. */ - readonly force: ForceIdentification - /** The prototype of the entity to upgrade to. */ - readonly target: EntityPrototypeIdentification - readonly player?: PlayerIdentification - /** The new direction if any. */ - readonly direction?: defines.direction - }): boolean - /** - * Cancels upgrade if it is scheduled, does nothing otherwise. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.cancel_upgrade View documentation} - * - * @param force - The force who did the upgrade order. - * @param player - The player to set the last_user to if any. - * @returns If the cancel was successful. - */ - cancel_upgrade(force: ForceIdentification, player?: PlayerIdentification): boolean - /** - * Is this entity marked for upgrade? - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.to_be_upgraded View documentation} - */ - to_be_upgraded(): boolean - /** - * Get a logistic requester slot. - * - * **Note**: Useable only on entities that have requester slots. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_request_slot View documentation} - * - * @param slot - The slot index. - * @returns Contents of the specified slot; `nil` if the given slot contains no request. - */ - get_request_slot(slot: uint): SimpleItemStack | undefined - /** - * Set a logistic requester slot. - * - * **Note**: Useable only on entities that have requester slots. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_request_slot View documentation} - * - * @param request - What to request. - * @param slot - The slot index. - * @returns If the slot was set. - */ - set_request_slot(request: ItemStackIdentification, slot: uint): boolean - /** - * Clear a logistic requester slot. - * - * **Note**: Useable only on entities that have requester slots. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.clear_request_slot View documentation} - * - * @param slot - The slot index. - */ - clear_request_slot(slot: uint): void - /** - * Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, - * but whether any crafting action has made progress in this machine. - * - * *Can only be used if this is CraftingMachine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_crafting View documentation} - */ - is_crafting(): void - /** - * *Can only be used if this is Gate* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_opened View documentation} - * - * @returns `true` if this gate is currently opened. - */ - is_opened(): boolean - /** - * *Can only be used if this is Gate* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_opening View documentation} - * - * @returns `true` if this gate is currently opening. - */ - is_opening(): boolean - /** - * *Can only be used if this is Gate* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_closed View documentation} - * - * @returns `true` if this gate is currently closed. - */ - is_closed(): boolean - /** - * *Can only be used if this is Gate* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_closing View documentation} - * - * @returns `true` if this gate is currently closing - */ - is_closing(): boolean - /** - * *Can only be used if this is Gate* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.request_to_open View documentation} - * - * @param force - The force that requests the gate to be open. - * @param extra_time - Extra ticks to stay open. - */ - request_to_open(force: ForceIdentification, extra_time?: uint): void - /** - * *Can only be used if this is Gate* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.request_to_close View documentation} - * - * @param force - The force that requests the gate to be closed. - */ - request_to_close(force: ForceIdentification): void - /** - * Get a transport line of a belt or belt connectable entity. - * - * *Can only be used if this is TransportBeltConnectable* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_transport_line View documentation} - * - * @param index - Index of the requested transport line. - */ - get_transport_line(index: uint): LuaTransportLine - /** - * Get the maximum transport line index of a belt or belt connectable entity. - * - * *Can only be used if this is TransportBeltConnectable* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_max_transport_line_index View documentation} - */ - get_max_transport_line_index(): uint - /** - * *Can only be used if this is RocketSilo* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.launch_rocket View documentation} - * - * @returns `true` if the rocket was successfully launched. Return value of `false` means the silo is not ready for launch. - */ - launch_rocket(): boolean - /** - * Revive a ghost. I.e. turn it from a ghost to a real entity or tile. - * - * **Note**: If this is an entity ghost and it is successfully revived this will also return the revived entity or - * `nil` as a second return value and possibly item request proxy as the third parameter depending on value of - * return_item_request_proxy. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.revive View documentation} - * - * @returns Any items the new real entity collided with or `nil` if the ghost could not be revived. - */ - revive(params?: { - /** If `true` the function will return item request proxy as the third parameter. */ - readonly return_item_request_proxy?: boolean - /** - * If true, and an entity ghost; {@link ScriptRaisedReviveEvent script_raised_revive} will be called. Else if - * true, and a tile ghost; {@link ScriptRaisedSetTilesEvent script_raised_set_tiles} will be called. - */ - readonly raise_revive?: boolean - }): LuaMultiReturn<[undefined] | [Record, LuaEntity, LuaEntity | undefined]> - /** - * Revives a ghost silently. - * - * **Note**: If this is an entity ghost and it is successfully revived this will also return the revived entity or - * `nil` as a second return value and possibly item request proxy as the third parameter depending on value of - * return_item_request_proxy. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.silent_revive View documentation} - * - * @returns Any items the new real entity collided with or `nil` if the ghost could not be revived. - */ - silent_revive(params?: { - /** If `true` the function will return item request proxy as the third parameter. */ - readonly return_item_request_proxy?: boolean - /** - * If true, and an entity ghost; {@link ScriptRaisedReviveEvent script_raised_revive} will be called. Else if - * true, and a tile ghost; {@link ScriptRaisedSetTilesEvent script_raised_set_tiles} will be called. - */ - readonly raise_revive?: boolean - }): LuaMultiReturn<[undefined] | [Record, LuaEntity, LuaEntity | undefined]> - /** - * *Can only be used if this is Rail* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_connected_rail View documentation} - * - * @returns Rail connected in the specified manner to this one. - */ - get_connected_rail(params: { - readonly rail_direction: defines.rail_direction - readonly rail_connection_direction: defines.rail_connection_direction - }): LuaEntity - /** - * Get the rails that this signal is connected to. - * - * *Can only be used if this is RailSignal* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_connected_rails View documentation} - */ - get_connected_rails(): LuaEntity[] - /** - * Get the rail signal or train stop at the start/end of the rail segment this rail is in, or `nil` if the rail - * segment doesn't start/end with a signal nor a train stop. - * - * **Note**: A rail segment is a continuous section of rail with no branches, signals, nor train stops. - * - * *Can only be used if this is Rail* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_rail_segment_entity View documentation} - * - * @param direction - The direction of travel relative to this rail. - * @param in_else_out - If true, gets the entity at the entrance of the rail segment, otherwise gets the entity at - * the exit of the rail segment. - */ - get_rail_segment_entity(direction: defines.rail_direction, in_else_out: boolean): LuaEntity | undefined - /** - * Get the rail at the end of the rail segment this rail is in. - * - * **Note**: A rail segment is a continuous section of rail with no branches, signals, nor train stops. - * - * **Note**: This function has a second return value. A {@link defines.rail_direction} that points out of the rail - * segment from the end rail. - * - * *Can only be used if this is Rail* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_rail_segment_end View documentation} - * - * @param direction - */ - get_rail_segment_end(direction: defines.rail_direction): LuaMultiReturn<[LuaEntity, defines.rail_direction]> - /** - * Get the length of the rail segment this rail is in. - * - * **Note**: A rail segment is a continuous section of rail with no branches, signals, nor train stops. - * - * *Can only be used if this is Rail* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_rail_segment_length View documentation} - */ - get_rail_segment_length(): double - /** - * Get a rail from each rail segment that overlaps with this rail's rail segment. - * - * **Note**: A rail segment is a continuous section of rail with no branches, signals, nor train stops. - * - * *Can only be used if this is Rail* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_rail_segment_overlaps View documentation} - */ - get_rail_segment_overlaps(): LuaEntity[] - /** - * Get the filter for a slot in an inserter, loader, or logistic storage container. - * - * **Note**: The entity must allow filters. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_filter View documentation} - * - * @param slot_index - Index of the slot to get the filter for. - * @returns Prototype name of the item being filtered. `nil` if the given slot has no filter. - */ - get_filter(slot_index: uint): string | undefined - /** - * Set the filter for a slot in an inserter, loader, or logistic storage container. - * - * **Note**: The entity must allow filters. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_filter View documentation} - * - * @param slot_index - Index of the slot to set the filter for. - * @param item - Prototype name of the item to filter. - */ - set_filter(slot_index: uint, item: string): void - /** - * Gets the filter for this infinity container at the given index or `nil` if the filter index doesn't exist or is empty. - * - * *Can only be used if this is InfinityContainer* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_infinity_container_filter View documentation} - * - * @param index - The index to get. - */ - get_infinity_container_filter(index: uint): InfinityInventoryFilter | undefined - /** - * Sets the filter for this infinity container at the given index. - * - * *Can only be used if this is InfinityContainer* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_infinity_container_filter View documentation} - * - * @param index - The index to set. - * @param filter - The new filter or `nil` to clear the filter. - */ - set_infinity_container_filter(index: uint, filter: InfinityInventoryFilter | undefined): void - /** - * Gets the filter for this infinity pipe or `nil` if the filter is empty. - * - * *Can only be used if this is InfinityPipe* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_infinity_pipe_filter View documentation} - */ - get_infinity_pipe_filter(): InfinityPipeFilter | undefined - /** - * Sets the filter for this infinity pipe. - * - * *Can only be used if this is InfinityPipe* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_infinity_pipe_filter View documentation} - * - * @param filter - The new filter or `nil` to clear the filter. - */ - set_infinity_pipe_filter(filter: InfinityPipeFilter | undefined): void - /** - * Gets the heat setting for this heat interface. - * - * *Can only be used if this is HeatInterface* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_heat_setting View documentation} - */ - get_heat_setting(): HeatSetting - /** - * Sets the heat setting for this heat interface. - * - * *Can only be used if this is HeatInterface* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_heat_setting View documentation} - * - * @param filter - The new setting. - */ - set_heat_setting(filter: HeatSetting): void - /** - * Gets the control behavior of the entity (if any). - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_control_behavior View documentation} - * - * @returns The control behavior or nil. - */ - get_control_behavior(): LuaControlBehavior | undefined - /** - * Gets (and or creates if needed) the control behavior of the entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_or_create_control_behavior View documentation} - * - * @returns The control behavior or nil. - */ - get_or_create_control_behavior(): LuaControlBehavior | undefined - /** - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_circuit_network View documentation} - * - * @param wire - Wire color of the network connected to this entity. - * @param circuit_connector - The connector to get circuit network for. Must be specified for entities with more - * than one circuit network connector. - * @returns The circuit network or nil. - */ - get_circuit_network( - wire: defines.wire_type, - circuit_connector?: defines.circuit_connector_id - ): LuaCircuitNetwork | undefined - /** - * Read a single signal from the combined circuit networks. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_merged_signal View documentation} - * - * @param signal - The signal to read. - * @param circuit_connector - The connector to get signals for. Must be specified for entities with more than one - * circuit network connector. - * @returns The current value of the signal. - */ - get_merged_signal(signal: SignalID, circuit_connector?: defines.circuit_connector_id): int - /** - * The merged circuit network signals or `nil` if there are no signals. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_merged_signals View documentation} - * - * @param circuit_connector - The connector to get signals for. Must be specified for entities with more than one - * circuit network connector. - * @returns The sum of signals on both the red and green networks, or nil if it doesn't have a circuit connector. - */ - get_merged_signals(circuit_connector?: defines.circuit_connector_id): Signal[] | undefined - /** - * Whether this entity supports a backer name. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.supports_backer_name View documentation} - */ - supports_backer_name(): boolean - /** - * Copies settings from the given entity onto this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.copy_settings View documentation} - * - * @param entity - * @param by_player - If provided, the copying is done 'as' this player and - * {@link OnEntitySettingsPastedEvent on_entity_settings_pasted} is triggered. - * @returns Any items removed from this entity as a result of copying the settings. - */ - copy_settings(entity: LuaEntity, by_player?: PlayerIdentification): Record - /** - * Gets all the `LuaLogisticPoint`s that this entity owns. Optionally returns only the point specified by the index parameter. - * - * **Note**: When `index` is not given, this will be a single `LuaLogisticPoint` for most entities. For some (such - * as the player character), it can be zero or more. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_logistic_point View documentation} - * - * @param index - If provided, only returns the `LuaLogisticPoint` specified by this index. - */ - get_logistic_point(index?: defines.logistic_member_index): LuaLogisticPoint | LuaLogisticPoint[] - /** - * Plays a note with the given instrument and note. - * - * *Can only be used if this is ProgrammableSpeaker* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.play_note View documentation} - * - * @param instrument - * @param note - * @returns If the request is valid. The sound may or may not be played depending on polyphony settings. - */ - play_note(instrument: uint, note: uint): boolean - /** - * Connects the rolling stock in the given direction. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.connect_rolling_stock View documentation} - * - * @param direction - * @returns If any connection was made - */ - connect_rolling_stock(direction: defines.rail_direction): boolean - /** - * Tries to disconnect this rolling stock in the given direction. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.disconnect_rolling_stock View documentation} - * - * @param direction - * @returns If anything was disconnected - */ - disconnect_rolling_stock(direction: defines.rail_direction): boolean - /** - * Reconnect loader, beacon, cliff and mining drill connections to entities that might have been teleported out or - * in by the script. The game doesn't do this automatically as we don't want to loose performance by checking this - * in normal games. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.update_connections View documentation} - */ - update_connections(): void - /** - * Current recipe being assembled by this machine or `nil` if no recipe is set. - * - * *Can only be used if this is CraftingMachine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_recipe View documentation} - */ - get_recipe(): LuaRecipe | undefined - /** - * Sets the current recipe in this assembly machine. - * - * *Can only be used if this is CraftingMachine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_recipe View documentation} - * - * @param recipe - The new recipe or `nil` to clear the recipe. - * @returns Any items removed from this entity as a result of setting the recipe. - */ - set_recipe(recipe: string | LuaRecipe | undefined): Record - /** - * Rotates this entity as if the player rotated it. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.rotate View documentation} - * - * @returns Whether the rotation was successful. - */ - rotate(params?: { - /** If `true`, rotate the entity in the counter-clockwise direction. */ - readonly reverse?: boolean - readonly by_player?: PlayerIdentification - /** If the player is not given should extra items be spilled or returned as a second return value from this. */ - readonly spill_items?: boolean - /** When true, each spilled item will be flagged with the {@link LuaEntity.to_be_looted LuaEntity::to_be_looted} flag. */ - readonly enable_looted?: boolean - /** When provided the spilled items will be marked for deconstruction by this force. */ - readonly force?: LuaForce | string - }): boolean - /** - * Gets the driver of this vehicle if any. - * - * **Note**: May be `nil` if the vehicle contains no driver. To check if there's a passenger see - * {@link LuaEntity.get_passenger LuaEntity::get_passenger}. - * - * *Can only be used if this is Vehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_driver View documentation} - */ - get_driver(): LuaEntity | LuaPlayer | undefined - /** - * Sets the driver of this vehicle. - * - * **Note**: This differs over {@link LuaEntity.set_passenger LuaEntity::set_passenger} in that the passenger can't - * drive the vehicle. - * - * *Can only be used if this is Vehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_driver View documentation} - * - * @param driver - The new driver or `nil` to eject the current driver if any. - */ - set_driver(driver: LuaEntity | PlayerIdentification | undefined): void - /** - * Gets the passenger of this car or spidertron if any. - * - * **Note**: May be `nil` if the vehicle contains no passenger. To check if there's a driver see - * {@link LuaEntity.get_driver LuaEntity::get_driver}. - * - * **Note**: This differs over {@link LuaEntity.get_driver LuaEntity::get_driver} in that the passenger can't drive the car. - * - * *Can only be used if this is Vehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_passenger View documentation} - */ - get_passenger(): LuaEntity | LuaPlayer | undefined - /** - * Sets the passenger of this car or spidertron. - * - * **Note**: This differs over {@link LuaEntity.get_driver LuaEntity::get_driver} in that the passenger can't drive the car. - * - * *Can only be used if this is Vehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_passenger View documentation} - * - * @param passenger - */ - set_passenger(passenger: LuaEntity | PlayerIdentification): void - /** - * Returns true if this entity is connected to an electric network. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_connected_to_electric_network View documentation} - */ - is_connected_to_electric_network(): boolean - /** - * The trains scheduled to stop at this train stop. - * - * *Can only be used if this is TrainStop* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_train_stop_trains View documentation} - */ - get_train_stop_trains(): LuaTrain[] - /** - * The train currently stopped at this train stop or `nil` if none. - * - * *Can only be used if this is TrainStop* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_stopped_train View documentation} - */ - get_stopped_train(): LuaTrain | undefined - /** - * Clones this entity. - * - * **Note**: {@link defines.events.on_entity_cloned} is raised. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.clone View documentation} - * - * @returns The cloned entity or `nil` if this entity can't be cloned/can't be cloned to the given location. - */ - clone(params: { - /** The destination position */ - readonly position: Position - /** The destination surface */ - readonly surface?: LuaSurface - readonly force?: ForceIdentification - /** If false, the building effect smoke will not be shown around the new entity. */ - readonly create_build_effect_smoke?: boolean - }): LuaEntity | undefined - /** - * Get the amount of all or some fluid in this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_fluid_count View documentation} - * - * @param fluid - Prototype name of the fluid to count. If not specified, count all fluids. - */ - get_fluid_count(fluid?: string): double - /** - * Get amounts of all fluids in this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_fluid_contents View documentation} - * - * @returns The amounts, indexed by fluid names. - */ - get_fluid_contents(): Record - /** - * Remove fluid from this entity. - * - * **Note**: If temperature is given only fluid matching that exact temperature is removed. If minimum and maximum - * is given fluid within that range is removed. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.remove_fluid View documentation} - * - * @returns Amount of fluid actually removed. - */ - remove_fluid(params: { - /** Fluid prototype name. */ - readonly name: string - /** Amount to remove */ - readonly amount: double - readonly minimum_temperature?: double - readonly maximum_temperature?: double - readonly temperature?: double - }): double - /** - * Insert fluid into this entity. Fluidbox is chosen automatically. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.insert_fluid View documentation} - * - * @param fluid - Fluid to insert. - * @returns Amount of fluid actually inserted. - */ - insert_fluid(fluid: Fluid): double - /** - * Remove all fluids from this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.clear_fluid_inside View documentation} - */ - clear_fluid_inside(): void - /** - * Get the source of this beam. - * - * *Can only be used if this is Beam* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_beam_source View documentation} - */ - get_beam_source(): BeamTarget - /** - * Set the source of this beam. - * - * *Can only be used if this is Beam* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_beam_source View documentation} - * - * @param source - */ - set_beam_source(source: LuaEntity | Position): void - /** - * Get the target of this beam. - * - * *Can only be used if this is Beam* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_beam_target View documentation} - */ - get_beam_target(): BeamTarget - /** - * Set the target of this beam. - * - * *Can only be used if this is Beam* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.set_beam_target View documentation} - * - * @param target - */ - set_beam_target(target: LuaEntity | Position): void - /** - * The radius of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_radius View documentation} - */ - get_radius(): double - /** - * The health ratio of this entity between 1 and 0 (for full health and no health respectively). - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_health_ratio View documentation} - */ - get_health_ratio(): float - /** - * Creates the same smoke that is created when you place a building by hand. You can play the building sound to go - * with it by using {@link LuaSurface.play_sound LuaSurface::play_sound}, eg: - * entity.surface.play_sound{path="entity-build/"..entity.prototype.name, position=entity.position} - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.create_build_effect_smoke View documentation} - */ - create_build_effect_smoke(): void - /** - * Release the unit from the spawner which spawned it. This allows the spawner to continue spawning additional units. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.release_from_spawner View documentation} - */ - release_from_spawner(): void - /** - * Toggle this entity's equipment movement bonus. Does nothing if the entity does not have an equipment grid. - * - * **Note**: This property can also be read and written on the equipment grid of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.toggle_equipment_movement_bonus View documentation} - */ - toggle_equipment_movement_bonus(): void - /** - * If this character can shoot the given entity or position. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.can_shoot View documentation} - * - * @param target - * @param position - */ - can_shoot(target: LuaEntity, position: Position): boolean - /** - * Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style. Starts animating - * the opacity of the speech bubble towards zero, and destroys the entity when it hits zero. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.start_fading_out View documentation} - */ - start_fading_out(): void - /** - * Returns the new entity prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_upgrade_target View documentation} - * - * @returns Nil if this entity is not marked for upgrade. - */ - get_upgrade_target(): LuaEntityPrototype | undefined - /** - * Returns the new entity direction after upgrading. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_upgrade_direction View documentation} - * - * @returns Nil if this entity is not marked for upgrade. - */ - get_upgrade_direction(): defines.direction | undefined - /** - * Returns the amount of damage to be taken by this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_damage_to_be_taken View documentation} - */ - get_damage_to_be_taken(): float - /** - * Depletes and destroys this resource entity. - * - * *Can only be used if this is ResourceEntity* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.deplete View documentation} - */ - deplete(): void - /** - * Mines this entity. - * - * **Note**: 'standard' operation is to keep calling mine() with an inventory until all items are transferred and - * the items dealt with. - * - * **Note**: The result of mining the entity (the item(s) it produces when mined) will be dropped on the ground if - * they don't fit into the provided inventory. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.mine View documentation} - * - * @returns Whether mining succeeded. - */ - mine(params?: { - /** - * If provided the item(s) will be transferred into this inventory. If provided, this must be an inventory - * created with {@link LuaGameScript.create_inventory LuaGameScript::create_inventory} or be a basic inventory - * owned by some entity. - */ - readonly inventory?: LuaInventory - /** - * If true, when the item(s) don't fit into the given inventory the entity is force mined. If false, the mining - * operation fails when there isn't enough room to transfer all of the items into the inventory. Defaults to - * false. This is ignored and acts as 'true' if no inventory is provided. - */ - readonly force?: boolean - /** If true, {@link ScriptRaisedDestroyEvent script_raised_destroy} will be raised. Defaults to true. */ - readonly raise_destroyed?: boolean - /** - * If true, the minable state of the entity is ignored. Defaults to false. If false, an entity that isn't - * minable (set as not-minable in the prototype or isn't minable for other reasons) will fail to be mined. - */ - readonly ignore_minable?: boolean - }): boolean - /** - * Triggers spawn_decoration actions defined in the entity prototype or does nothing if entity is not "turret" or - * "unit-spawner". - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.spawn_decorations View documentation} - */ - spawn_decorations(): void - /** - * Can wires reach between these entities. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.can_wires_reach View documentation} - * - * @param entity - */ - can_wires_reach(entity: LuaEntity): boolean - /** - * Gets rolling stock connected to the given end of this stock - * - * **Note**: This will also return {@link defines.rail_direction} of other rolling stock that is connected back to - * this rolling stock - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.get_connected_rolling_stock View documentation} - * - * @param direction - * @returns One of connected rolling stocks - */ - get_connected_rolling_stock(direction: defines.rail_direction): LuaEntity - /** - * Is this entity or tile ghost or item request proxy registered for construction? If false, it means a construction - * robot has been dispatched to build the entity, or it is not an entity that can be constructed. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_registered_for_construction View documentation} - */ - is_registered_for_construction(): boolean - /** - * Is this entity registered for deconstruction with this force? If false, it means a construction robot has been - * dispatched to deconstruct it, or it is not marked for deconstruction. This is worst-case O(N) complexity where N - * is the current number of things in the deconstruct queue. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_registered_for_deconstruction View documentation} - * - * @param force - The force construction manager to check. - */ - is_registered_for_deconstruction(force: ForceIdentification): boolean - /** - * Is this entity registered for upgrade? If false, it means a construction robot has been dispatched to upgrade it, - * or it is not marked for upgrade. This is worst-case O(N) complexity where N is the current number of things in - * the upgrade queue. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_registered_for_upgrade View documentation} - */ - is_registered_for_upgrade(): boolean - /** - * Is this entity registered for repair? If false, it means a construction robot has been dispatched to upgrade it, - * or it is not damaged. This is worst-case O(N) complexity where N is the current number of things in the repair queue. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_registered_for_repair View documentation} - */ - is_registered_for_repair(): boolean - /** - * Adds the given position to this spidertron's autopilot's queue of destinations. - * - * *Can only be used if this is SpiderVehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.add_autopilot_destination View documentation} - * - * @param position - The position the spidertron should move to. - */ - add_autopilot_destination(position: Position): void - /** - * Connects current linked belt with another one. - * - * Neighbours have to be of different type. If given linked belt is connected to something else it will be - * disconnected first. If provided neighbour is connected to something else it will also be disconnected first. - * Automatically updates neighbour to be connected back to this one. - * - * **Note**: Can also be used on entity ghost if it contains linked-belt - * - * *Can only be used if this is LinkedBelt* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.connect_linked_belts View documentation} - * - * @param neighbour - Another linked belt or entity ghost containing linked belt to connect or nil to disconnect - */ - connect_linked_belts(neighbour: LuaEntity | undefined): void - /** - * Disconnects linked belt from its neighbour. - * - * **Note**: Can also be used on entity ghost if it contains linked-belt - * - * *Can only be used if this is LinkedBelt* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.disconnect_linked_belts View documentation} - */ - disconnect_linked_belts(): void - /** - * Name of the entity prototype. E.g. "inserter" or "filter-inserter". - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.name View documentation} - */ - readonly name: "inserter" | "filter-inserter" - /** - * Name of the entity or tile contained in this ghost - * - * *Can only be used if this is Ghost* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.ghost_name View documentation} - */ - readonly ghost_name: string - /** - * Localised name of the entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.localised_name View documentation} - */ - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Localised name of the entity or tile contained in this ghost. - * - * *Can only be used if this is Ghost* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.ghost_localised_name View documentation} - */ - readonly ghost_localised_name: LocalisedString - /** - * *Can only be used if this is Ghost* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.ghost_localised_description View documentation} - */ - readonly ghost_localised_description: LocalisedString - /** - * The entity prototype type of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.type View documentation} - */ - readonly type: string - /** - * The prototype type of the entity or tile contained in this ghost. - * - * *Can only be used if this is Ghost* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.ghost_type View documentation} - */ - readonly ghost_type: string - /** - * Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will - * stop moving etc). - * - * **Note**: Entities that are not active naturally can't be set to be active (setting it to be active will do nothing) - * - * **Note**: Ghosts, simple smoke, and corpses can't be modified at this time. - * - * **Note**: It is even possible to set the character to not be active, so he can't move and perform most of the tasks. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.active View documentation} - */ - active: boolean - /** - * When the entity is not destructible it can't be damaged. - * - * **Note**: An indestructible entity can still be mined. - * - * **Note**: Entities that are indestructible naturally (they have no health, like smoke, resource etc) can't be set - * to be destructible. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.destructible View documentation} - */ - destructible: boolean - /** - * **Note**: Not minable entities can still be destroyed. - * - * **Note**: Entities that are not minable naturally (like smoke, character, enemy units etc) can't be set to minable. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.minable View documentation} - */ - minable: boolean - /** - * When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key. - * - * **Note**: Entities that are not rotatable naturally (like chest or furnace) can't be set to be rotatable. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.rotatable View documentation} - */ - rotatable: boolean - /** - * Player can't open gui of this entity and he can't quick insert/input stuff in to the entity when it is not operable. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.operable View documentation} - */ - operable: boolean - /** - * The current health of the entity, or `nil` if it doesn't have health. Health is automatically clamped to be - * between `0` and max health (inclusive). Entities with a health of `0` can not be attacked. - * - * **Note**: To get the maximum possible health of this entity, see - * {@link LuaEntityPrototype.max_health LuaEntityPrototype::max_health} on its prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.health View documentation} - */ - health: float | undefined - /** - * The current direction this entity is facing. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.direction View documentation} - */ - direction: defines.direction - /** - * Whether the entity has direction. When it is false for this entity, it will always return north direction when asked for. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.supports_direction View documentation} - */ - readonly supports_direction: boolean - /** - * The smooth orientation of this entity, if it supports orientation. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.orientation View documentation} - */ - orientation: RealOrientation - /** - * The orientation of this cliff. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.cliff_orientation View documentation} - */ - readonly cliff_orientation: CliffOrientation - /** - * The relative orientation of the vehicle turret, artillery turret, artillery wagon or `nil` if this entity isn't a - * vehicle with a vehicle turret or artillery turret/wagon. - * - * **Note**: Writing does nothing if the vehicle doesn't have a turret. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.relative_turret_orientation View documentation} - */ - relative_turret_orientation: RealOrientation | undefined - /** - * The torso orientation of this spider vehicle. - * - * *Can only be used if this is SpiderVehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.torso_orientation View documentation} - */ - torso_orientation: RealOrientation - /** - * Count of resource units contained. - * - * *Can only be used if this is ResourceEntity* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.amount View documentation} - */ - amount: uint - /** - * Count of initial resource units contained. - * - * **Note**: If this is not an infinite resource reading will give `nil` and writing will give an error. - * - * *Can only be used if this is ResourceEntity* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.initial_amount View documentation} - */ - initial_amount: uint | undefined - /** - * Multiplies the acceleration the vehicle can create for one unit of energy. By default is `1`. - * - * *Can only be used if this is Car* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.effectivity_modifier View documentation} - */ - effectivity_modifier: float - /** - * Multiplies the energy consumption. - * - * *Can only be used if this is Car* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.consumption_modifier View documentation} - */ - consumption_modifier: float - /** - * Multiplies the car friction rate. - * - * *Can only be used if this is Car* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.friction_modifier View documentation} - * - * @example - * This will allow the car to go much faster - * - * ```lua - * game.player.vehicle.friction_modifier = 0.5 - * ``` - */ - friction_modifier: float - /** - * Whether the driver of this car or spidertron is the gunner, if false, the passenger is the gunner. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.driver_is_gunner View documentation} - */ - driver_is_gunner: boolean - /** - * Read when this spidertron auto-targets enemies - * - * *Can only be used if this is SpiderVehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.vehicle_automatic_targeting_parameters View documentation} - */ - vehicle_automatic_targeting_parameters: VehicleAutomaticTargetingParameters - /** - * The current speed of this car in tiles per tick, rolling stock, projectile or spider vehicle, or current max - * speed of the unit. Only the speed of units, cars, and projectiles are writable. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.speed View documentation} - */ - speed: float - /** - * The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the - * tile the unit is standing on. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.effective_speed View documentation} - */ - readonly effective_speed: float - /** - * *Can only be used if this is ItemEntity* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.stack View documentation} - */ - readonly stack: LuaItemStack - /** - * The entity prototype of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.prototype View documentation} - */ - readonly prototype: LuaEntityPrototype - /** - * The prototype of the entity or tile contained in this ghost. - * - * *Can only be used if this is Ghost* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.ghost_prototype View documentation} - */ - readonly ghost_prototype: LuaEntityPrototype | LuaTilePrototype - /** - * Position where the entity puts its stuff. - * - * **Note**: Meaningful only for entities that put stuff somewhere, such as mining drills or inserters. Mining - * drills can't have their drop position changed; inserters must have `allow_custom_vectors` set to true on their - * prototype to allow changing the drop position. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.drop_position View documentation} - */ - drop_position: Position - /** - * Where the inserter will pick up items from. - * - * **Note**: Inserters must have `allow_custom_vectors` set to true on their prototype to allow changing the pickup position. - * - * *Can only be used if this is Inserter* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.pickup_position View documentation} - */ - pickup_position: Position - /** - * The entity this entity is putting its stuff to or `nil` if there is no such entity. - * - * **Note**: Meaningful only for entities that put stuff somewhere, such as mining drills or inserters. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.drop_target View documentation} - */ - drop_target: LuaEntity | undefined - /** - * The entity the inserter will attempt to pick up from. For example, this can be a transport belt or a storage chest. - * - * *Can only be used if this is Inserter* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.pickup_target View documentation} - */ - pickup_target: LuaEntity - /** - * Index of the currently selected weapon slot of this character, car, or spidertron, or `nil` if the car/spidertron - * doesn't have guns. - * - * *Can only be used if this is Character or Car* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.selected_gun_index View documentation} - */ - selected_gun_index: uint | undefined - /** - * Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). always 0 for entities - * that don't have the concept of energy stored inside. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.energy View documentation} - * - * @example - * ```lua - * game.player.print("Machine energy: " .. game.player.selected.energy .. "J") - * game.player.selected.energy = 3000 - * ``` - */ - energy: double - /** - * The temperature of this entities heat energy source if this entity uses a heat energy source or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.temperature View documentation} - */ - temperature: double | undefined - /** - * The previous recipe this furnace was using or nil if the furnace had no previous recipe. - * - * *Can only be used if this is Furnace* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.previous_recipe View documentation} - */ - readonly previous_recipe: LuaRecipe | undefined - /** - * The item stack currently held in an inserter's hand. - * - * *Can only be used if this is Inserter* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.held_stack View documentation} - */ - readonly held_stack: LuaItemStack - /** - * Current position of the inserter's "hand". - * - * *Can only be used if this is Inserter* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.held_stack_position View documentation} - */ - readonly held_stack_position: PositionTable - /** - * The train this rolling stock belongs to or nil if not rolling stock. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.train View documentation} - */ - readonly train: LuaTrain | undefined - /** - * - When called on an electric pole, this is a dictionary of all connections, indexed by the strings `"copper"`, - * `"red"`, and `"green"`. - * - When called on a pipe-connectable entity, this is an array of entity arrays of all entities a given fluidbox is - * connected to. - * - When called on an underground transport belt, this is the other end of the underground belt connection, or `nil` if none. - * - When called on a wall-connectable entity or reactor, this is a dictionary of all connections indexed by the - * connection direction "north", "south", "east", and "west". - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.neighbours View documentation} - */ - readonly neighbours: Record | LuaEntity[][] | LuaEntity | undefined - /** - * The belt connectable neighbours of this belt connectable entity. Only entities that input to or are outputs of - * this entity. Does not contain the other end of an underground belt, see - * {@link LuaEntity.neighbours LuaEntity::neighbours} for that. This is a dictionary with `"inputs"`, `"outputs"` - * entries that are arrays of transport belt connectable entities, or empty tables if no entities. - * - * *Can only be used if this is TransportBeltConnectable* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.belt_neighbours View documentation} - */ - readonly belt_neighbours: Record - /** - * Fluidboxes of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.fluidbox View documentation} - */ - fluidbox: LuaFluidBox - /** - * The backer name assigned to this entity, or `nil` if this entity doesn't support backer names. Entities that - * support backer names are labs, locomotives, radars, roboports, and train stops. - * - * **Note**: While train stops get the name of a backer when placed down, players can rename them if they want to. - * In this case, `backer_name` returns the player-given name of the entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.backer_name View documentation} - */ - backer_name: string | undefined - /** - * The label of this entity if it has one or `nil`. Changing the value will trigger on_entity_renamed event - * - * **Note**: only usable on entities that have labels (currently only spider-vehicles). - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.entity_label View documentation} - */ - entity_label: string | undefined - /** - * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed. - * - * - For ghosts set to uint32 max (4,294,967,295) to never expire. - * - For ghosts Cannot be set higher than {@link LuaForce.ghost_time_to_live LuaForce::ghost_time_to_live} of the entity's force. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.time_to_live View documentation} - */ - time_to_live: uint - /** - * The character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner - * color. Returns `nil` if this entity doesn't use custom colors. - * - * **Note**: Car color is overridden by the color of the current driver/passenger, if there is one. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.color View documentation} - */ - color: Color | undefined - /** - * The text of this flying-text entity. - * - * *Can only be used if this is FlyingText* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.text View documentation} - */ - text: LocalisedString - /** - * The state of this rail signal. - * - * *Can only be used if this is RailSignal* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.signal_state View documentation} - */ - readonly signal_state: defines.signal_state - /** - * The state of this chain signal. - * - * *Can only be used if this is RailChainSignal* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.chain_signal_state View documentation} - */ - readonly chain_signal_state: defines.chain_signal_state - /** - * Will this entity be picked up automatically when the player walks over it? - * - * *Can only be used if this is ItemEntity* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.to_be_looted View documentation} - */ - to_be_looted: boolean - /** - * The current crafting speed, including speed bonuses from modules and beacons. - * - * *Can only be used if this is CraftingMachine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.crafting_speed View documentation} - */ - readonly crafting_speed: double - /** - * The current crafting progress, as a number in range [0, 1]. - * - * *Can only be used if this is CraftingMachine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.crafting_progress View documentation} - */ - crafting_progress: float - /** - * The current productivity bonus progress, as a number in range [0, 1]. - * - * *Can only be used if this is CraftingMachine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.bonus_progress View documentation} - */ - bonus_progress: double - /** - * The productivity bonus of this entity. - * - * **Note**: This includes force based bonuses as well as beacon/module bonuses. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.productivity_bonus View documentation} - */ - readonly productivity_bonus: double - /** - * The pollution bonus of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.pollution_bonus View documentation} - */ - readonly pollution_bonus: double - /** - * The speed bonus of this entity. - * - * **Note**: This includes force based bonuses as well as beacon/module bonuses. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.speed_bonus View documentation} - */ - readonly speed_bonus: double - /** - * The consumption bonus of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.consumption_bonus View documentation} - */ - readonly consumption_bonus: double - /** - * `"input"` or `"output"`, depending on whether this underground belt goes down or up. - * - * *Can only be used if this is TransportBeltToGround* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.belt_to_ground_type View documentation} - */ - readonly belt_to_ground_type: "input" | "output" - /** - * `"input"` or `"output"`, depending on whether this loader puts to or gets from a container. - * - * *Can only be used if this is Loader* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.loader_type View documentation} - */ - loader_type: "input" | "output" - /** - * Number of rocket parts in the silo. - * - * *Can only be used if this is RocketSilo* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.rocket_parts View documentation} - */ - rocket_parts: uint - /** - * The logistic network this entity is a part of. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.logistic_network View documentation} - */ - logistic_network: LuaLogisticNetwork - /** - * The logistic cell this entity is a part of. Will be `nil` if this entity is not a part of any logistic cell. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.logistic_cell View documentation} - */ - readonly logistic_cell: LuaLogisticCell | undefined - /** - * Items this ghost will request when revived or items this item request proxy is requesting. Result is a dictionary - * mapping each item prototype name to the required count. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.item_requests View documentation} - */ - item_requests: Record - /** - * The player connected to this character or `nil` if none. - * - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.player View documentation} - */ - readonly player: LuaPlayer | undefined - /** - * The unit group this unit is a member of, or `nil` if none. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.unit_group View documentation} - */ - readonly unit_group: LuaUnitGroup | undefined - /** - * The damage dealt by this turret, artillery turret, or artillery wagon. - * - * *Can only be used if this is Turret* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.damage_dealt View documentation} - */ - damage_dealt: double - /** - * The number of units killed by this turret, artillery turret, or artillery wagon. - * - * *Can only be used if this is Turret* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.kills View documentation} - */ - kills: uint - /** - * The last player that changed any setting on this entity. This includes building the entity, changing its color, - * or configuring its circuit network. Can be `nil` if the last user is not part of the save anymore. Mods can - * overwrite it if desired. - * - * *Can only be used if this is EntityWithOwner* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.last_user View documentation} - */ - last_user: LuaPlayer | undefined - /** - * The buffer size for the electric energy source or nil if the entity doesn't have an electric energy source. - * - * **Note**: Write access is limited to the ElectricEnergyInterface type - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.electric_buffer_size View documentation} - */ - electric_buffer_size: double | undefined - /** - * The input flow limit for the electric energy source or nil if the entity doesn't have an electric energy source. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.electric_input_flow_limit View documentation} - */ - readonly electric_input_flow_limit: double | undefined - /** - * The output flow limit for the electric energy source or nil if the entity doesn't have an electric energy source. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.electric_output_flow_limit View documentation} - */ - readonly electric_output_flow_limit: double | undefined - /** - * The electric drain for the electric energy source or nil if the entity doesn't have an electric energy source. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.electric_drain View documentation} - */ - readonly electric_drain: double | undefined - /** - * The emissions for the electric energy source or nil if the entity doesn't have an electric energy source. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.electric_emissions View documentation} - */ - readonly electric_emissions: double | undefined - /** - * The unit number or nil if the entity doesn't have one. This is universally unique for every entity that has one, - * for the lifetime of a whole game. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.unit_number View documentation} - */ - readonly unit_number: uint | undefined - /** - * The unit number of the entity contained in this ghost or nil if the entity doesn't have one. - * - * *Can only be used if this is EntityGhost* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.ghost_unit_number View documentation} - */ - readonly ghost_unit_number: uint | undefined - /** - * The mining progress for this mining drill or `nil` if this isn't a mining drill. Is a number in range [0, - * mining_target.prototype.mineable_properties.mining_time] - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.mining_progress View documentation} - */ - mining_progress: double | undefined - /** - * The bonus mining progress for this mining drill or `nil` if this isn't a mining drill. Read yields a number in - * range [0, mining_target.prototype.mineable_properties.mining_time] - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.bonus_mining_progress View documentation} - */ - bonus_mining_progress: double | undefined - /** - * The power production specific to the ElectricEnergyInterface entity type. - * - * *Can only be used if this is ElectricEnergyInterface* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.power_production View documentation} - */ - power_production: double - /** - * The power usage specific to the ElectricEnergyInterface entity type. - * - * *Can only be used if this is ElectricEnergyInterface* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.power_usage View documentation} - */ - power_usage: double - /** - * {@link LuaEntityPrototype.collision_box LuaEntityPrototype::collision_box} around entity's given position and - * respecting the current entity orientation. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.bounding_box View documentation} - */ - readonly bounding_box: BoundingBoxTable - /** - * The secondary bounding box of this entity or `nil` if it doesn't have one. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.secondary_bounding_box View documentation} - */ - readonly secondary_bounding_box: BoundingBoxTable | undefined - /** - * {@link LuaEntityPrototype.selection_box LuaEntityPrototype::selection_box} around entity's given position and - * respecting the current entity orientation. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.selection_box View documentation} - */ - readonly selection_box: BoundingBoxTable - /** - * The secondary selection box of this entity or `nil` if it doesn't have one. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.secondary_selection_box View documentation} - */ - readonly secondary_selection_box: BoundingBoxTable | undefined - /** - * The mining target or `nil` if none - * - * *Can only be used if this is MiningDrill* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.mining_target View documentation} - */ - readonly mining_target: LuaEntity | undefined - /** - * Entities that are directly connected to this entity via the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.circuit_connected_entities View documentation} - */ - readonly circuit_connected_entities: { - /** Entities connected via the red wire. */ - readonly red: LuaEntity[] - /** Entities connected via the green wire. */ - readonly green: LuaEntity[] - } - /** - * The connection definition for entities that are directly connected to this entity via the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.circuit_connection_definitions View documentation} - */ - readonly circuit_connection_definitions: CircuitConnectionDefinition[] - /** - * The index of the configured request with the highest index for this entity. This means 0 if no requests are set - * and e.g. 20 if the 20th request slot is configured. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.request_slot_count View documentation} - */ - readonly request_slot_count: uint - /** - * The number of filter slots this inserter, loader, or logistic storage container has. 0 if not one of those entities. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.filter_slot_count View documentation} - */ - readonly filter_slot_count: uint - /** - * The container entity this loader is pointing at/pulling from depending on the - * {@link LuaEntity.loader_type LuaEntity::loader_type}. - * - * *Can only be used if this is Loader* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.loader_container View documentation} - */ - readonly loader_container: LuaEntity - /** - * The equipment grid or `nil` if this entity doesn't have an equipment grid. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.grid View documentation} - */ - readonly grid: LuaEquipmentGrid | undefined - /** - * The graphics variation for this entity or `nil` if this entity doesn't use graphics variations. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.graphics_variation View documentation} - */ - graphics_variation: uint8 | undefined - /** - * Index of the tree color. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tree_color_index View documentation} - */ - tree_color_index: uint8 - /** - * Maximum index of the tree colors. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tree_color_index_max View documentation} - */ - readonly tree_color_index_max: uint8 - /** - * Index of the tree stage. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tree_stage_index View documentation} - */ - tree_stage_index: uint8 - /** - * Maximum index of the tree stages. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tree_stage_index_max View documentation} - */ - readonly tree_stage_index_max: uint8 - /** - * Index of the tree gray stage - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tree_gray_stage_index View documentation} - */ - tree_gray_stage_index: uint8 - /** - * Maximum index of the tree gray stages. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tree_gray_stage_index_max View documentation} - */ - readonly tree_gray_stage_index_max: uint8 - /** - * The burner energy source for this entity or `nil` if there isn't one. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.burner View documentation} - */ - readonly burner: LuaBurner | undefined - /** - * The shooting target for this turret or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.shooting_target View documentation} - */ - shooting_target: LuaEntity | undefined - /** - * The target entity for this item-request-proxy or `nil` - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.proxy_target View documentation} - */ - readonly proxy_target: LuaEntity | undefined - /** - * The sticker entities attached to this entity or `nil` if none. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.stickers View documentation} - */ - readonly stickers: LuaEntity[] | undefined - /** - * The entity this sticker is sticked to. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.sticked_to View documentation} - */ - readonly sticked_to: LuaEntity - /** - * *Can only be used if this is ProgrammableSpeaker* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.parameters View documentation} - */ - parameters: ProgrammableSpeakerParameters - /** - * *Can only be used if this is ProgrammableSpeaker* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.alert_parameters View documentation} - */ - alert_parameters: ProgrammableSpeakerAlertParameters - /** - * The electric network statistics for this electric pole. - * - * *Can only be used if this is ElectricPole* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.electric_network_statistics View documentation} - */ - readonly electric_network_statistics: LuaFlowStatistics - /** - * Sets the stack size limit on this inserter. If the stack size is > than the force stack size limit the value is ignored. - * - * **Note**: Set to 0 to reset. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.inserter_stack_size_override View documentation} - */ - inserter_stack_size_override: uint - /** - * The number of products this machine finished crafting in its lifetime. - * - * *Can only be used if this is CraftingMachine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.products_finished View documentation} - */ - products_finished: uint - /** - * The spawner associated with this unit entity or `nil` if the unit has no associated spawner. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.spawner View documentation} - */ - readonly spawner: LuaEntity | undefined - /** - * The units associated with this spawner entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.units View documentation} - */ - readonly units: LuaEntity[] - /** - * The state of this power switch. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.power_switch_state View documentation} - */ - power_switch_state: boolean - /** - * The effects being applied to this entity or `nil`. For beacons this is the effect the beacon is broadcasting. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.effects View documentation} - */ - readonly effects: ModuleEffects | undefined - /** - * The filters for this infinity container. - * - * *Can only be used if this is InfinityContainer* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.infinity_container_filters View documentation} - */ - infinity_container_filters: InfinityInventoryFilter[] - /** - * If items not included in this infinity container filters should be removed from the container. - * - * *Can only be used if this is InfinityContainer* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.remove_unfiltered_items View documentation} - */ - remove_unfiltered_items: boolean - /** - * The player index associated with this character corpse. - * - * **Note**: The index is not guaranteed to be valid so it should always be checked first if a player with that - * index actually exists. - * - * *Can only be used if this is CharacterCorpse* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.character_corpse_player_index View documentation} - */ - character_corpse_player_index: uint - /** - * The tick this character corpse died at. - * - * *Can only be used if this is CharacterCorpse* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.character_corpse_tick_of_death View documentation} - */ - character_corpse_tick_of_death: uint - /** - * The reason this character corpse character died (if any). - * - * *Can only be used if this is CharacterCorpse* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.character_corpse_death_cause View documentation} - */ - character_corpse_death_cause: LocalisedString - /** - * The player this character is associated with or `nil` if none. When the player logs off in multiplayer all of the - * associated characters will be logged off with him. - * - * **Note**: A character associated with a player is not directly controlled by any player. - * - * **Note**: Set to `nil` to clear. The player will be automatically disassociated when a controller is set on the character. - * - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.associated_player View documentation} - */ - associated_player: LuaPlayer | undefined - /** - * The last tick this character entity was attacked. - * - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tick_of_last_attack View documentation} - */ - tick_of_last_attack: uint - /** - * The last tick this character entity was damaged. - * - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tick_of_last_damage View documentation} - */ - tick_of_last_damage: uint - /** - * The filter for this splitter or `nil` if no filter is set. - * - * *Can only be used if this is Splitter* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.splitter_filter View documentation} - */ - splitter_filter: LuaItemPrototype | undefined - /** - * The filter mode for this filter inserter: "whitelist", "blacklist", or `nil` if this inserter doesn't use filters. - * - * *Can only be used if this is Inserter* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.inserter_filter_mode View documentation} - */ - inserter_filter_mode: "whitelist" | "blacklist" | undefined - /** - * The input priority for this splitter : "left", "none", or "right". - * - * *Can only be used if this is Splitter* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.splitter_input_priority View documentation} - */ - splitter_input_priority: "left" | "none" | "right" - /** - * The output priority for this splitter : "left", "none", or "right". - * - * *Can only be used if this is Splitter* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.splitter_output_priority View documentation} - */ - splitter_output_priority: "left" | "none" | "right" - /** - * If this land mine is armed. - * - * *Can only be used if this is LandMine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.armed View documentation} - */ - readonly armed: boolean - /** - * When locked; the recipe in this assembling machine can't be changed by the player. - * - * *Can only be used if this is AssemblingMachine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.recipe_locked View documentation} - */ - recipe_locked: boolean - /** - * The rail entity this train stop is connected to or `nil` if there is none. - * - * *Can only be used if this is TrainStop* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.connected_rail View documentation} - */ - readonly connected_rail: LuaEntity | undefined - /** - * The number of trains in this rail block for this rail entity. - * - * *Can only be used if this is Rail* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.trains_in_block View documentation} - */ - readonly trains_in_block: uint - /** - * The timeout that's left on this landmine in ticks. It describes the time between the landmine being placed and it - * being armed. - * - * *Can only be used if this is LandMine* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.timeout View documentation} - */ - timeout: uint - /** - * The current total neighbour bonus of this reactor. - * - * *Can only be used if this is Reactor* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.neighbour_bonus View documentation} - */ - readonly neighbour_bonus: double - /** - * The ai settings of this unit. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.ai_settings View documentation} - */ - readonly ai_settings: LuaAISettings - /** - * The hightlight box type of this highlight box entity. - * - * *Can only be used if this is HighlightBox* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.highlight_box_type View documentation} - */ - highlight_box_type: string - /** - * The blink interval of this highlight box entity. 0 indicates no blink. - * - * *Can only be used if this is HighlightBox* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.highlight_box_blink_interval View documentation} - */ - highlight_box_blink_interval: uint - /** - * The status of this entity or `nil` if no status. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.status View documentation} - */ - readonly status: defines.entity_status | undefined - /** - * If equipment grid logistics are enabled while this vehicle is moving. - * - * *Can only be used if this is Vehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.enable_logistics_while_moving View documentation} - */ - enable_logistics_while_moving: boolean - /** - * The player that this `simple-entity-with-owner`, `simple-entity-with-force`, `flying-text`, or `highlight-box` is - * visible to. `nil` means it is rendered for every player. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.render_player View documentation} - */ - render_player: LuaPlayer | undefined - /** - * The forces that this `simple-entity-with-owner`, `simple-entity-with-force`, or `flying-text` is visible to. - * `nil` or an empty array means it is rendered for every force. - * - * **Note**: Reading will always give an array of {@link LuaForce} - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.render_to_forces View documentation} - */ - render_to_forces: ForceIdentification[] | undefined - /** - * The rail target of this pump or `nil`. - * - * *Can only be used if this is Pump* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.pump_rail_target View documentation} - */ - readonly pump_rail_target: LuaEntity | undefined - /** - * Returns true if this unit is moving. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.moving View documentation} - */ - readonly moving: boolean - /** - * Returns the id of the electric network that this entity is connected to or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.electric_network_id View documentation} - */ - readonly electric_network_id: uint | undefined - /** - * Whether this character's personal roboports are allowed to dispatch robots. - * - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.allow_dispatching_robots View documentation} - */ - allow_dispatching_robots: boolean - /** - * Whether this rocket silo automatically launches the rocket when cargo is inserted. - * - * *Can only be used if this is RocketSilo* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.auto_launch View documentation} - */ - auto_launch: boolean - /** - * How much energy this generator generated in the last tick. - * - * *Can only be used if this is Generator* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.energy_generated_last_tick View documentation} - */ - readonly energy_generated_last_tick: double - /** - * The storage filter for this logistic storage container. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.storage_filter View documentation} - */ - storage_filter: LuaItemPrototype - /** - * Whether this requester chest is set to also request from buffer chests. - * - * **Note**: Useable only on entities that have requester slots. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.request_from_buffers View documentation} - */ - request_from_buffers: boolean - /** - * Whether this corpse will ever fade away. - * - * **Note**: Useable only on corpses. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.corpse_expires View documentation} - */ - corpse_expires: boolean - /** - * If true, corpse won't be destroyed when entities are placed over it. If false, whether corpse will be removed or - * not depends on value of CorpsePrototype::remove_on_entity_placement. - * - * **Note**: Useable only on corpses. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.corpse_immune_to_entity_placement View documentation} - */ - corpse_immune_to_entity_placement: boolean - /** - * The tags associated with this entity ghost or `nil` if not an entity ghost. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.tags View documentation} - */ - tags: Tags | undefined - /** - * The command given to this unit or `nil` is the unit has no command. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.command View documentation} - */ - readonly command: Command | undefined - /** - * The distraction command given to this unit or `nil` is the unit currently isn't distracted. - * - * *Can only be used if this is Unit* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.distraction_command View documentation} - */ - readonly distraction_command: Command | undefined - /** - * The ticks until the next trigger effect of this smoke-with-trigger. - * - * *Can only be used if this is SmokeWithTrigger* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.time_to_next_effect View documentation} - */ - time_to_next_effect: uint - /** - * Destination position of spidertron's autopilot. Returns `nil` if autopilot doesn't have destination set. - * - * *Can only be used if this is SpiderVehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.autopilot_destination View documentation} - */ - autopilot_destination: Position | undefined - /** - * The queued destination positions of spidertron's autopilot. - * - * *Can only be used if this is SpiderVehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.autopilot_destinations View documentation} - */ - readonly autopilot_destinations: PositionTable[] - /** - * Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds - * a path to next target) and trains having this train stop as goal or waypoint. Writing nil will disable the limit - * (will set a maximum possible value). - * - * **Note**: Train may be included multiple times when braking distance covers this train stop multiple times - * - * **Note**: Value may be read even when train stop has no control behavior - * - * *Can only be used if this is TrainStop* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.trains_count View documentation} - */ - readonly trains_count: uint | undefined - /** - * Amount of trains above which no new trains will be sent to this train stop. - * - * **Note**: When a train stop has a control behavior with wire connected and set_trains_limit enabled, this value - * will be overwritten by it - * - * *Can only be used if this is TrainStop* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.trains_limit View documentation} - */ - trains_limit: uint - /** - * If this entity is EntityWithForce - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_entity_with_force View documentation} - */ - readonly is_entity_with_force: boolean - /** - * If this entity is EntityWithOwner - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_entity_with_owner View documentation} - */ - readonly is_entity_with_owner: boolean - /** - * If this entity is EntityWithHealth - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.is_entity_with_health View documentation} - */ - readonly is_entity_with_health: boolean - /** - * The owner of this combat robot if any. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.combat_robot_owner View documentation} - */ - combat_robot_owner: LuaEntity - /** - * The link ID this linked container is using. - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.link_id View documentation} - */ - link_id: uint - /** - * The follow target of this spidertron if any. - * - * *Can only be used if this is SpiderVehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.follow_target View documentation} - */ - follow_target: LuaEntity - /** - * The follow offset of this spidertron if any. If it is not following an entity this will be nil. This is - * randomized each time the follow entity is set. - * - * *Can only be used if this is SpiderVehicle* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.follow_offset View documentation} - */ - follow_offset: Position | undefined - /** - * Type of linked belt: it is either `"input"` or `"output"`. Changing type will also flip direction so the belt is - * out of the same side - * - * **Note**: Can only be changed when linked belt is disconnected (has no neighbour set) - * - * **Note**: Can also be used on entity ghost if it contains linked-belt - * - * *Can only be used if this is LinkedBelt* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.linked_belt_type View documentation} - */ - linked_belt_type: "input" | "output" - /** - * Neighbour to which this linked belt is connected to. Returns nil if not connected. - * - * **Note**: Can also be used on entity ghost if it contains linked-belt - * - * **Note**: May return entity ghost which contains linked belt to which connection is made - * - * *Can only be used if this is LinkedBelt* - * - * {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.linked_belt_neighbour View documentation} - */ - readonly linked_belt_neighbour: LuaEntity | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaEntity" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of an entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html View documentation} - * - * @noSelf - */ -interface LuaEntityPrototype { - /** - * Does this prototype have a flag enabled? - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.has_flag View documentation} - * - * @param flag - The flag to check. Must be one of - `"not-rotatable"` - `"placeable-neutral"` - - * `"placeable-player"` - `"placeable-enemy"` - `"placeable-off-grid"` - `"player-creation"` - - * `"building-direction-8-way"` - `"filter-directions"` - `"fast-replaceable-no-build-while-moving"` - - * `"breaths-air"` - `"not-repairable"` - `"not-on-map"` - `"not-deconstructable"` - `"not-blueprintable"` - - * `"hide-from-bonus-gui"` - `"hide-alt-info"` - `"fast-replaceable-no-cross-type-while-moving"` - - * `"no-gap-fill-while-building"` - `"not-flammable"` - `"no-automated-item-removal"` - - * `"no-automated-item-insertion"` - `"not-upgradable"` - */ - has_flag( - flag: - | "not-rotatable" - | "placeable-neutral" - | "placeable-player" - | "placeable-enemy" - | "placeable-off-grid" - | "player-creation" - | "filter-directions" - | "fast-replaceable-no-build-while-moving" - | "breaths-air" - | "not-repairable" - | "not-on-map" - | "not-deconstructable" - | "not-blueprintable" - | "hide-from-bonus-gui" - | "hide-alt-info" - | "fast-replaceable-no-cross-type-while-moving" - | "no-gap-fill-while-building" - | "not-flammable" - | "no-automated-item-removal" - | "no-automated-item-insertion" - | "not-upgradable" - ): boolean - /** - * Gets the base size of the given inventory on this entity or `nil` if the given inventory doesn't exist. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.get_inventory_size View documentation} - * - * @param index - */ - get_inventory_size(index: defines.inventory): uint | undefined - /** - * Type of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.type View documentation} - */ - readonly type: string - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.name View documentation} - */ - readonly name: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Max health of this entity. Will be `0` if this is not an entity with health. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_health View documentation} - */ - readonly max_health: float - /** - * Is this resource infinite? Will be `nil` when used on a non-resource. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.infinite_resource View documentation} - */ - readonly infinite_resource: boolean | undefined - /** - * Minimum amount of this resource. Will be `nil` when used on a non-resource. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.minimum_resource_amount View documentation} - */ - readonly minimum_resource_amount: uint | undefined - /** - * The normal amount for this resource. `nil` when not a resource. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.normal_resource_amount View documentation} - */ - readonly normal_resource_amount: uint | undefined - /** - * Every time this infinite resource 'ticks' down it is reduced by this amount. `nil` when not a resource. - * Meaningless if this isn't an infinite type resource. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.infinite_depletion_resource_amount View documentation} - */ - readonly infinite_depletion_resource_amount: uint | undefined - /** - * Name of the category of this resource or `nil` when not a resource. - * - * **Note**: During data stage this property is named "category". - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.resource_category View documentation} - */ - readonly resource_category: string | undefined - /** - * Whether this entity is minable and what can be obtained by mining it. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties View documentation} - */ - readonly mineable_properties: { - /** Is this entity mineable at all? */ - readonly minable: boolean - /** Energy required to mine an entity. */ - readonly mining_time: double - /** - * Prototype name of the particle produced when mining this entity. Will only be present if this entity produces - * any particle during mining. - */ - readonly mining_particle?: string - /** Products obtained by mining this entity. */ - readonly products?: Product[] - /** The required fluid amount if any. */ - readonly fluid_amount?: double - /** The prototype name of the required fluid if any. */ - readonly required_fluid?: string - /** The mining trigger if any. */ - readonly mining_trigger?: TriggerItem[] - } - /** - * Items that, when placed, will produce this entity. It is an array of items, or `nil` if no items place this - * entity. Construction bots will always choose the first item in this list to build this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.items_to_place_this View documentation} - */ - readonly items_to_place_this: SimpleItemStack[] | undefined - /** - * The bounding box used for collision checking. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.collision_box View documentation} - */ - readonly collision_box: BoundingBoxTable - /** - * The secondary bounding box used for collision checking, or `nil` if it doesn't have one. This is only used in - * rails and rail remnants. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.secondary_collision_box View documentation} - */ - readonly secondary_collision_box: BoundingBoxTable | undefined - /** - * The bounding box used for map generator collision checking. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.map_generator_bounding_box View documentation} - */ - readonly map_generator_bounding_box: BoundingBoxTable - /** - * The bounding box used for drawing selection. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.selection_box View documentation} - */ - readonly selection_box: BoundingBoxTable - /** - * The bounding box used for drawing the entity icon. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.drawing_box View documentation} - */ - readonly drawing_box: BoundingBoxTable - /** - * The bounding box used to attach sticker type entities. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.sticker_box View documentation} - */ - readonly sticker_box: BoundingBoxTable - /** - * The collision masks this entity uses - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask View documentation} - */ - readonly collision_mask: CollisionMask - readonly collision_mask_with_flags: CollisionMaskWithFlags - /** - * The hardcoded default collision mask (with flags) for this entity prototype type. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.default_collision_mask_with_flags View documentation} - */ - readonly default_collision_mask_with_flags: CollisionMaskWithFlags - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.order View documentation} - */ - readonly order: string - /** - * Group of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.group View documentation} - */ - readonly group: LuaGroup - /** - * Subgroup of this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.subgroup View documentation} - */ - readonly subgroup: LuaGroup - /** - * Amount this entity can heal per tick. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.healing_per_tick View documentation} - */ - readonly healing_per_tick: float - /** - * Amount of pollution emissions per second this entity will create. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.emissions_per_second View documentation} - */ - readonly emissions_per_second: double - /** - * Corpses used when this entity is destroyed. It is a dictionary indexed by the corpse's prototype name. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.corpses View documentation} - */ - readonly corpses: Record - /** - * Is this entity selectable? - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.selectable_in_game View documentation} - */ - readonly selectable_in_game: boolean - /** - * The selection priority of this entity - a value between 0 and 255 - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.selection_priority View documentation} - */ - readonly selection_priority: uint - /** - * The weight of this vehicle prototype or `nil` if not a vehicle prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.weight View documentation} - */ - readonly weight: double | undefined - /** - * List of resistances towards each damage type. It is a dictionary indexed by damage type names (see - * `data/base/prototypes/damage-type.lua`). - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.resistances View documentation} - */ - readonly resistances: Record - /** - * The group of mutually fast-replaceable entities. Possibly `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.fast_replaceable_group View documentation} - */ - readonly fast_replaceable_group: string | undefined - /** - * The next upgrade for this entity or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.next_upgrade View documentation} - */ - readonly next_upgrade: LuaEntityPrototype | undefined - /** - * Loot that will be dropped when this entity is killed. `nil` if there is no loot. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.loot View documentation} - */ - readonly loot: Loot[] | undefined - /** - * Repair-speed modifier for this entity. Actual repair speed will be `tool_repair_speed * - * entity_repair_speed_modifier`. May be `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.repair_speed_modifier View documentation} - */ - readonly repair_speed_modifier: uint | undefined - /** - * The range of this turret or `nil` if this isn't a turret related prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.turret_range View documentation} - */ - readonly turret_range: uint | undefined - /** - * Autoplace specification for this entity prototype. `nil` if none. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.autoplace_specification View documentation} - */ - readonly autoplace_specification: AutoplaceSpecification | undefined - /** - * The speed of this transport belt or `nil` if this isn't a transport belt related prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.belt_speed View documentation} - */ - readonly belt_speed: double | undefined - /** - * The result units and spawn points with weight and evolution factor for a biter spawner entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.result_units View documentation} - */ - readonly result_units: UnitSpawnDefinition[] - /** - * The attack result of this entity if the entity has one, else `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.attack_result View documentation} - */ - readonly attack_result: TriggerItem[] | undefined - /** - * The final attack result for projectiles `nil` if not a projectile - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.final_attack_result View documentation} - */ - readonly final_attack_result: TriggerItem[] | undefined - /** - * The attack parameters for this entity or `nil` if the entity doesn't use attack parameters. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.attack_parameters View documentation} - */ - readonly attack_parameters: AttackParameters | undefined - /** - * The spawning cooldown for this enemy spawner prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.spawn_cooldown View documentation} - */ - readonly spawn_cooldown: - | { - readonly min: double - readonly max: double - } - | undefined - /** - * The mining radius of this mining drill prototype or `nil` if this isn't a mining drill prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.mining_drill_radius View documentation} - */ - readonly mining_drill_radius: double | undefined - /** - * The mining speed of this mining drill/character prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.mining_speed View documentation} - */ - readonly mining_speed: double | undefined - /** - * The logistic mode of this logistic container or `nil` if this isn't a logistic container prototype. One of - * `"requester"`, `"active-provider"`, `"passive-provider"`, `"buffer"`, `"storage"`, `"none"`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.logistic_mode View documentation} - */ - readonly logistic_mode: - | "requester" - | "active-provider" - | "passive-provider" - | "buffer" - | "storage" - | "none" - | undefined - /** - * The max underground distance for underground belts and underground pipes or `nil` if this isn't one of those prototypes. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_underground_distance View documentation} - */ - readonly max_underground_distance: uint8 | undefined - /** - * The entity prototype flags for this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.flags View documentation} - */ - readonly flags: EntityPrototypeFlags - /** - * The remains left behind when this entity is mined. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.remains_when_mined View documentation} - */ - readonly remains_when_mined: LuaEntityPrototype[] - /** - * Entities this entity can be pasted onto in addition to the normal allowed ones. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.additional_pastable_entities View documentation} - */ - readonly additional_pastable_entities: LuaEntityPrototype[] - /** - * When false copy-paste is not allowed for this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.allow_copy_paste View documentation} - */ - readonly allow_copy_paste: boolean - /** - * The cursor size used when shooting at this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.shooting_cursor_size View documentation} - */ - readonly shooting_cursor_size: double - /** - * The smoke trigger run when this entity is built or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke View documentation} - */ - readonly created_smoke: - | { - readonly smoke_name: string - readonly offsets: Vector[] - readonly offset_deviation: BoundingBox - readonly initial_height: float - readonly max_radius?: float - readonly speed: Vector - readonly speed_multiplier: float - readonly speed_multiplier_deviation: float - readonly starting_frame: float - readonly starting_frame_deviation: float - readonly starting_frame_speed: float - readonly starting_frame_speed_deviation: float - readonly speed_from_center: float - readonly speed_from_center_deviation: float - } - | undefined - /** - * The trigger run when this entity is created or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.created_effect View documentation} - */ - readonly created_effect: TriggerItem[] | undefined - /** - * The map color used when charting this entity if a friendly or enemy color isn't defined or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.map_color View documentation} - */ - readonly map_color: ColorTable | undefined - /** - * The friendly map color used when charting this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.friendly_map_color View documentation} - */ - readonly friendly_map_color: ColorTable - /** - * The enemy map color used when charting this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.enemy_map_color View documentation} - */ - readonly enemy_map_color: ColorTable - /** - * The evolution requirement to build this entity as a base when expanding enemy bases. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.build_base_evolution_requirement View documentation} - */ - readonly build_base_evolution_requirement: double - /** - * The instruments for this programmable speaker or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.instruments View documentation} - */ - readonly instruments: ProgrammableSpeakerInstrument[] | undefined - /** - * The maximum polyphony for this programmable speaker or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_polyphony View documentation} - */ - readonly max_polyphony: uint | undefined - /** - * The module inventory size or `nil` if this entity doesn't support modules. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.module_inventory_size View documentation} - */ - readonly module_inventory_size: uint | undefined - /** - * The max number of ingredients this crafting-machine prototype supports or `nil` if this isn't a crafting-machine prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.ingredient_count View documentation} - */ - readonly ingredient_count: uint | undefined - /** - * The crafting speed of this crafting-machine or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.crafting_speed View documentation} - */ - readonly crafting_speed: double | undefined - /** - * The crafting categories this entity supports. Only meaningful when this is a crafting-machine or player entity type. - * - * **Note**: The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.crafting_categories View documentation} - */ - readonly crafting_categories: Record - /** - * The resource categories this character or mining drill supports, or `nil` if not a character or mining dill. - * - * **Note**: The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.resource_categories View documentation} - */ - readonly resource_categories: Record | undefined - /** - * The supply area of this electric pole, beacon, or `nil` if this is neither. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.supply_area_distance View documentation} - */ - readonly supply_area_distance: double | undefined - /** - * The maximum wire distance for this entity. 0 when the entity doesn't support wires. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_wire_distance View documentation} - */ - readonly max_wire_distance: double - /** - * The maximum circuit wire distance for this entity. 0 when the entity doesn't support circuit wires. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_circuit_wire_distance View documentation} - */ - readonly max_circuit_wire_distance: double - /** - * The direct energy usage of this entity or `nil` if this entity doesn't have a direct energy usage. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.energy_usage View documentation} - */ - readonly energy_usage: double | undefined - /** - * The theoretical maximum energy usage for this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_energy_usage View documentation} - */ - readonly max_energy_usage: double - /** - * The theoretical maximum energy production for this this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_energy_production View documentation} - */ - readonly max_energy_production: double - /** - * The effectivity of this car prototype, generator prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.effectivity View documentation} - */ - readonly effectivity: double | undefined - /** - * The energy consumption of this car prototype or `nil` if not a car prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.consumption View documentation} - */ - readonly consumption: double | undefined - /** - * The friction of this vehicle prototype or `nil` if not a vehicle prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.friction_force View documentation} - */ - readonly friction_force: double | undefined - /** - * The braking force of this vehicle prototype or `nil` if not a vehicle prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.braking_force View documentation} - */ - readonly braking_force: double | undefined - /** - * The air resistance of this rolling stock prototype or `nil` if not a rolling stock prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.air_resistance View documentation} - */ - readonly air_resistance: double | undefined - /** - * If this car prototype uses tank controls to drive or `nil` if this is not a car prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.tank_driving View documentation} - */ - readonly tank_driving: boolean | undefined - /** - * The rotation speed of this car prototype or `nil` if not a car prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.rotation_speed View documentation} - */ - readonly rotation_speed: double | undefined - /** - * The turret rotation speed of this car prototype or `nil` if not a car prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.turret_rotation_speed View documentation} - */ - readonly turret_rotation_speed: double | undefined - /** - * The guns this prototype uses or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.guns View documentation} - */ - readonly guns: Record | undefined - /** - * The default speed of this flying robot, rolling stock or unit, `nil` if not one of these. - * - * **Note**: For rolling stocks, this is their `max_speed`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.speed View documentation} - */ - readonly speed: double | undefined - /** - * The speed multiplier when this flying robot is out of energy or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.speed_multiplier_when_out_of_energy View documentation} - */ - readonly speed_multiplier_when_out_of_energy: float | undefined - /** - * The max payload size of this logistics or construction robot or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_payload_size View documentation} - */ - readonly max_payload_size: uint | undefined - /** - * Whether this logistics or construction robot renders its cargo when flying or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.draw_cargo View documentation} - */ - readonly draw_cargo: boolean | undefined - /** - * The energy consumed per tile moved for this flying robot or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.energy_per_move View documentation} - */ - readonly energy_per_move: double | undefined - /** - * The energy consumed per tick for this flying robot or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.energy_per_tick View documentation} - */ - readonly energy_per_tick: double | undefined - /** - * The max energy for this flying robot or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_energy View documentation} - */ - readonly max_energy: double | undefined - /** - * The minimum energy for this flying robot before it tries to recharge or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.min_to_charge View documentation} - */ - readonly min_to_charge: float | undefined - /** - * The maximum energy for this flying robot above which it won't try to recharge when stationing or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_to_charge View documentation} - */ - readonly max_to_charge: float | undefined - /** - * The burner energy source prototype this entity uses or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.burner_prototype View documentation} - */ - readonly burner_prototype: LuaBurnerPrototype | undefined - /** - * The electric energy source prototype this entity uses or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.electric_energy_source_prototype View documentation} - */ - readonly electric_energy_source_prototype: LuaElectricEnergySourcePrototype | undefined - /** - * The heat energy source prototype this entity uses or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.heat_energy_source_prototype View documentation} - */ - readonly heat_energy_source_prototype: LuaHeatEnergySourcePrototype | undefined - /** - * The fluid energy source prototype this entity uses or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.fluid_energy_source_prototype View documentation} - */ - readonly fluid_energy_source_prototype: LuaFluidEnergySourcePrototype | undefined - /** - * The void energy source prototype this entity uses or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.void_energy_source_prototype View documentation} - */ - readonly void_energy_source_prototype: LuaVoidEnergySourcePrototype | undefined - /** - * The log2 of grid size of the building - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.building_grid_bit_shift View documentation} - */ - readonly building_grid_bit_shift: uint - /** - * The fluid usage of this generator prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.fluid_usage_per_tick View documentation} - */ - readonly fluid_usage_per_tick: double | undefined - /** - * The maximum fluid temperature of this generator prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.maximum_temperature View documentation} - */ - readonly maximum_temperature: double | undefined - /** - * The target temperature of this boiler prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.target_temperature View documentation} - */ - readonly target_temperature: double | undefined - /** - * The fluid this offshore pump produces or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.fluid View documentation} - */ - readonly fluid: LuaFluidPrototype | undefined - /** - * The fluid capacity of this entity or 0 if this entity doesn't support fluids. - * - * **Note**: Crafting machines will report 0 due to their fluid capacity being what ever a given recipe needs. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.fluid_capacity View documentation} - */ - readonly fluid_capacity: double - /** - * The pumping speed of this offshore pump, normal pump, or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.pumping_speed View documentation} - */ - readonly pumping_speed: double | undefined - /** - * If this inserter is a stack-type. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.stack View documentation} - */ - readonly stack: boolean - /** - * If this inserter allows custom pickup and drop vectors. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.allow_custom_vectors View documentation} - */ - readonly allow_custom_vectors: boolean - /** - * If this inserter allows burner leeching. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.allow_burner_leech View documentation} - */ - readonly allow_burner_leech: boolean - /** - * The extension speed of this inserter or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.inserter_extension_speed View documentation} - */ - readonly inserter_extension_speed: double | undefined - /** - * The rotation speed of this inserter or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.inserter_rotation_speed View documentation} - */ - readonly inserter_rotation_speed: double | undefined - /** - * The pickup position for this inserter or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.inserter_pickup_position View documentation} - */ - readonly inserter_pickup_position: Vector | undefined - /** - * The drop position for this inserter or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.inserter_drop_position View documentation} - */ - readonly inserter_drop_position: Vector | undefined - /** - * True if this inserter chases items on belts for pickup or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.inserter_chases_belt_items View documentation} - */ - readonly inserter_chases_belt_items: boolean | undefined - /** - * If this simple-entity is counted as a rock for the deconstruction planner "trees and rocks only" filter. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.count_as_rock_for_filtered_deconstruction View documentation} - */ - readonly count_as_rock_for_filtered_deconstruction: boolean - /** - * The filter count of this inserter, loader, or logistic chest or `nil`. For logistic containers, `nil` means no limit. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.filter_count View documentation} - */ - readonly filter_count: uint | undefined - /** - * The time to live for this prototype or `0` if prototype doesn't have time_to_live or time_before_removed. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.time_to_live View documentation} - */ - readonly time_to_live: uint - /** - * The distribution effectivity for this beacon prototype or `nil` if not a beacon prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.distribution_effectivity View documentation} - */ - readonly distribution_effectivity: double | undefined - /** - * Does this explosion have a beam or `nil` if not an explosion prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.explosion_beam View documentation} - */ - readonly explosion_beam: double | undefined - /** - * Does this explosion rotate or `nil` if not an explosion prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.explosion_rotate View documentation} - */ - readonly explosion_rotate: double | undefined - /** - * If it is a tree, return the number of colors it supports. `nil` otherwise. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.tree_color_count View documentation} - */ - readonly tree_color_count: uint8 | undefined - /** - * Does this entity with health prototype alert when damaged? or `nil` if not entity with health prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.alert_when_damaged View documentation} - */ - readonly alert_when_damaged: boolean | undefined - /** - * Does this turret prototype alert when attacking? or `nil` if not turret prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.alert_when_attacking View documentation} - */ - readonly alert_when_attacking: boolean | undefined - /** - * The color of the prototype, or `nil` if the prototype doesn't have color. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.color View documentation} - */ - readonly color: ColorTable | undefined - /** - * Does this prototype collision mask collide with itself? - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask_collides_with_self View documentation} - */ - readonly collision_mask_collides_with_self: boolean - /** - * Does this prototype collision mask collide with tiles only? - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask_collides_with_tiles_only View documentation} - */ - readonly collision_mask_collides_with_tiles_only: boolean - /** - * Does this prototype collision mask consider tile transitions? - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask_considers_tile_transitions View documentation} - */ - readonly collision_mask_considers_tile_transitions: boolean - /** - * The allowed module effects for this entity or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.allowed_effects View documentation} - */ - readonly allowed_effects: Record | undefined - /** - * The rocket parts required for this rocket silo prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.rocket_parts_required View documentation} - */ - readonly rocket_parts_required: uint | undefined - /** - * The rocket rising delay for this rocket silo prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.rocket_rising_delay View documentation} - */ - readonly rocket_rising_delay: uint8 | undefined - /** - * The rocket launch delay for this rocket silo prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.launch_wait_time View documentation} - */ - readonly launch_wait_time: uint8 | undefined - /** - * The light blinking speed for this rocket silo prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.light_blinking_speed View documentation} - */ - readonly light_blinking_speed: double | undefined - /** - * The door opening speed for this rocket silo prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.door_opening_speed View documentation} - */ - readonly door_opening_speed: double | undefined - /** - * The rising speed for this rocket silo rocket prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.rising_speed View documentation} - */ - readonly rising_speed: double | undefined - /** - * The engine starting speed for this rocket silo rocket prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.engine_starting_speed View documentation} - */ - readonly engine_starting_speed: double | undefined - /** - * The flying speed for this rocket silo rocket prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.flying_speed View documentation} - */ - readonly flying_speed: double | undefined - /** - * The flying acceleration for this rocket silo rocket prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.flying_acceleration View documentation} - */ - readonly flying_acceleration: double | undefined - /** - * The fixed recipe name for this assembling machine prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.fixed_recipe View documentation} - */ - readonly fixed_recipe: string | undefined - /** - * The construction radius for this roboport prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.construction_radius View documentation} - */ - readonly construction_radius: double | undefined - /** - * The logistic radius for this roboport prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.logistic_radius View documentation} - */ - readonly logistic_radius: double | undefined - /** - * The energy used per hitpoint taken for this vehicle during collisions or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.energy_per_hit_point View documentation} - */ - readonly energy_per_hit_point: double | undefined - /** - * If this prototype will attempt to create a ghost of itself on death. - * - * **Note**: If this is false then a ghost will never be made, if it's true a ghost may be made. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.create_ghost_on_death View documentation} - */ - readonly create_ghost_on_death: boolean - /** - * The time it takes this land mine to arm. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.timeout View documentation} - */ - readonly timeout: uint - /** - * The fluidbox prototypes for this entity. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.fluidbox_prototypes View documentation} - */ - readonly fluidbox_prototypes: LuaFluidBoxPrototype[] - /** - * *Can only be used if this is Reactor* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.neighbour_bonus View documentation} - */ - readonly neighbour_bonus: double - /** - * Controls how much a reactor extends when connected to other reactors. - * - * *Can only be used if this is Reactor* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.neighbour_collision_increase View documentation} - */ - readonly neighbour_collision_increase: double - /** - * *Can only be used if this is Loader* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.container_distance View documentation} - */ - readonly container_distance: double - /** - * *Can only be used if this is Loader* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.belt_distance View documentation} - */ - readonly belt_distance: double - /** - * *Can only be used if this is Loader* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.belt_length View documentation} - */ - readonly belt_length: double - readonly is_building: boolean - /** - * The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.automated_ammo_count View documentation} - */ - readonly automated_ammo_count: uint | undefined - /** - * The max speed of this projectile prototype or flying robot prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_speed View documentation} - */ - readonly max_speed: double | undefined - /** - * Value between 0 and 1 darkness where all lamps of this lamp prototype are on or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.darkness_for_all_lamps_on View documentation} - */ - readonly darkness_for_all_lamps_on: float | undefined - /** - * Value between 0 and 1 darkness where all lamps of this lamp prototype are off or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.darkness_for_all_lamps_off View documentation} - */ - readonly darkness_for_all_lamps_off: float | undefined - /** - * Whether the lamp is always on (except when out of power or turned off by the circuit network) or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.always_on View documentation} - */ - readonly always_on: boolean | undefined - /** - * The minimum darkness at which this unit spawner can spawn entities. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.min_darkness_to_spawn View documentation} - */ - readonly min_darkness_to_spawn: float - /** - * The maximum darkness at which this unit spawner can spawn entities. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_darkness_to_spawn View documentation} - */ - readonly max_darkness_to_spawn: float - readonly call_for_help_radius: double - /** - * Count of enemies this spawner can sustain. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_count_of_owned_units View documentation} - */ - readonly max_count_of_owned_units: double - /** - * How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_friends_around_to_spawn View documentation} - */ - readonly max_friends_around_to_spawn: double - /** - * How far from the spawner can the units be spawned. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.spawning_radius View documentation} - */ - readonly spawning_radius: double - /** - * What spaces should be between the spawned units. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.spawning_spacing View documentation} - */ - readonly spawning_spacing: double - /** - * The radius of this entity prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.radius View documentation} - */ - readonly radius: double - /** - * The item prototype name used to destroy this cliff or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.cliff_explosive_prototype View documentation} - */ - readonly cliff_explosive_prototype: string | undefined - /** - * The rocket entity prototype associated with this rocket silo prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.rocket_entity_prototype View documentation} - */ - readonly rocket_entity_prototype: LuaEntityPrototype | undefined - /** - * Whether this unit, car, or character prototype has belt immunity, `nil` if not car, unit, or character prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.has_belt_immunity View documentation} - */ - readonly has_belt_immunity: boolean | undefined - /** - * The vision distance of this unit prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.vision_distance View documentation} - */ - readonly vision_distance: double | undefined - /** - * The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and - * attack the source of the pollution. `nil` when prototype is not a unit prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.pollution_to_join_attack View documentation} - */ - readonly pollution_to_join_attack: float | undefined - /** - * The minimum pursue time of this unit prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.min_pursue_time View documentation} - */ - readonly min_pursue_time: uint | undefined - /** - * The maximum pursue distance of this unit prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_pursue_distance View documentation} - */ - readonly max_pursue_distance: double | undefined - /** - * The radar range of this unit prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.radar_range View documentation} - */ - readonly radar_range: uint | undefined - /** - * Whether this unit prototype can move while shooting or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.move_while_shooting View documentation} - */ - readonly move_while_shooting: boolean | undefined - /** - * Whether this unit prototype can open gates or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.can_open_gates View documentation} - */ - readonly can_open_gates: boolean | undefined - /** - * Whether this unit prototype is affected by tile walking speed modifiers or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.affected_by_tiles View documentation} - */ - readonly affected_by_tiles: boolean | undefined - /** - * The distraction cooldown of this unit prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.distraction_cooldown View documentation} - */ - readonly distraction_cooldown: uint | undefined - /** - * The spawning time modifier of this unit prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.spawning_time_modifier View documentation} - */ - readonly spawning_time_modifier: double | undefined - /** - * The alert icon shift of this entity prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.alert_icon_shift View documentation} - */ - readonly alert_icon_shift: Vector - /** - * The item prototype names that are the inputs of this lab prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.lab_inputs View documentation} - */ - readonly lab_inputs: string[] | undefined - /** - * The base researching speed of this lab prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.researching_speed View documentation} - */ - readonly researching_speed: double | undefined - /** - * The item slot count of this constant combinator prototype or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.item_slot_count View documentation} - */ - readonly item_slot_count: uint | undefined - /** - * The base productivity of this crafting machine, lab, or mining drill, or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.base_productivity View documentation} - */ - readonly base_productivity: double | undefined - /** - * If this market allows access to all forces or just friendly ones. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.allow_access_to_all_forces View documentation} - */ - readonly allow_access_to_all_forces: boolean - /** - * If this entity prototype could possibly ever be rotated. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.supports_direction View documentation} - */ - readonly supports_direction: boolean - /** - * The terrain friction modifier for this vehicle. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.terrain_friction_modifier View documentation} - */ - readonly terrain_friction_modifier: float - /** - * If this vehicle allows passengers. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.allow_passengers View documentation} - */ - readonly allow_passengers: boolean - /** - * The radius of the area this radar can chart, in chunks. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_distance_of_sector_revealed View documentation} - */ - readonly max_distance_of_sector_revealed: uint - /** - * The radius of the area constantly revealed by this radar, in chunks. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.max_distance_of_nearby_sector_revealed View documentation} - */ - readonly max_distance_of_nearby_sector_revealed: uint - /** - * The bounding box that specifies which tiles adjacent to the offshore pump should be checked. - * - * *Can only be used if this is OffshorePump* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.adjacent_tile_collision_box View documentation} - */ - readonly adjacent_tile_collision_box: BoundingBoxTable - /** - * Tiles adjacent to the offshore pump must not collide with this collision mask. - * - * *Can only be used if this is OffshorePump* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.adjacent_tile_collision_mask View documentation} - */ - readonly adjacent_tile_collision_mask: CollisionMask - /** - * If this mask is not empty, tiles adjacent to the offshore pump must not collide with this collision mask. - * - * *Can only be used if this is OffshorePump* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.adjacent_tile_collision_test View documentation} - */ - readonly adjacent_tile_collision_test: CollisionMask - /** - * The collision mask used only for collision test with tile directly at offshore pump position. - * - * *Can only be used if this is OffshorePump* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.center_collision_mask View documentation} - */ - readonly center_collision_mask: CollisionMask - /** - * The equipment grid prototype for this entity or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.grid_prototype View documentation} - */ - readonly grid_prototype: LuaEquipmentGridPrototype | undefined - readonly remove_decoratives: string - /** - * *Can only be used if this is TransportBelt* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.related_underground_belt View documentation} - */ - readonly related_underground_belt: LuaEntityPrototype - /** - * Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting. - * - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.running_speed View documentation} - */ - readonly running_speed: double - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.maximum_corner_sliding_distance View documentation} - */ - readonly maximum_corner_sliding_distance: double - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.build_distance View documentation} - */ - readonly build_distance: uint - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.drop_item_distance View documentation} - */ - readonly drop_item_distance: uint - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.reach_distance View documentation} - */ - readonly reach_distance: uint - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.reach_resource_distance View documentation} - */ - readonly reach_resource_distance: double - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.item_pickup_distance View documentation} - */ - readonly item_pickup_distance: double - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.loot_pickup_distance View documentation} - */ - readonly loot_pickup_distance: double - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.enter_vehicle_distance View documentation} - */ - readonly enter_vehicle_distance: double - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.ticks_to_keep_gun View documentation} - */ - readonly ticks_to_keep_gun: uint - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.ticks_to_keep_aiming_direction View documentation} - */ - readonly ticks_to_keep_aiming_direction: uint - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.ticks_to_stay_in_combat View documentation} - */ - readonly ticks_to_stay_in_combat: uint - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.respawn_time View documentation} - */ - readonly respawn_time: uint - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.damage_hit_tint View documentation} - */ - readonly damage_hit_tint: ColorTable - /** - * *Can only be used if this is Character* - * - * {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.character_corpse View documentation} - */ - readonly character_corpse: LuaEntityPrototype - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaEntityPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * An item in a {@link LuaEquipmentGrid}, for example one's power armor. - * - * **Note**: An equipment reference becomes invalid once the equipment is removed or the equipment grid it resides in is - * destroyed. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html View documentation} - * - * @noSelf - */ -interface LuaEquipment { - /** - * Name of this equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.name View documentation} - */ - readonly name: string - /** - * Type of this equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.type View documentation} - */ - readonly type: string - /** - * Position of this equipment in the equipment grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.position View documentation} - */ - readonly position: PositionTable - /** - * Shape of this equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.shape View documentation} - */ - readonly shape: { - readonly width: uint - readonly height: uint - } - /** - * Current shield value of the equipment. - * - * **Note**: Can't be set higher than {@link LuaEquipment.max_shield LuaEquipment::max_shield}. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.shield View documentation} - */ - shield: double - /** - * Maximum shield value. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.max_shield View documentation} - */ - readonly max_shield: double - /** - * Maximum solar power generated. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.max_solar_power View documentation} - */ - readonly max_solar_power: double - /** - * Movement speed bonus. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.movement_bonus View documentation} - */ - readonly movement_bonus: double - /** - * Energy generated per tick. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.generator_power View documentation} - */ - readonly generator_power: double - /** - * Current available energy. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.energy View documentation} - */ - energy: double - /** - * Maximum amount of energy that can be stored in this equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.max_energy View documentation} - */ - readonly max_energy: double - readonly prototype: LuaEquipmentPrototype - /** - * The burner energy source for this equipment or `nil` if there isn't one. - * - * {@link https://lua-api.factorio.com/next/LuaEquipment.html#LuaEquipment.burner View documentation} - */ - readonly burner: LuaBurner | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaEquipment" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of an equipment category. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentCategoryPrototype.html View documentation} - * - * @noSelf - */ -interface LuaEquipmentCategoryPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaEquipmentCategoryPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * An equipment grid is for example the inside of a power armor. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html View documentation} - * - * @noSelf - */ -interface LuaEquipmentGrid { - /** - * Remove an equipment from the grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.take View documentation} - * - * @returns The removed equipment, or `nil` if no equipment was removed. - */ - take(params: { - /** Take the equipment that contains this position in the grid. */ - readonly position?: Position - /** Take this exact equipment. */ - readonly equipment?: LuaEquipment - /** - * If provided the action is done 'as' this player and - * {@link OnPlayerRemovedEquipmentEvent on_player_removed_equipment} is triggered. - */ - readonly by_player?: PlayerIdentification - }): SimpleItemStack | undefined - /** - * Remove all equipment from the grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.take_all View documentation} - * - * @param by_player - If provided, the action is done 'as' this player and - * {@link OnPlayerRemovedEquipmentEvent on_player_removed_equipment} is triggered. - * @returns Count of each removed equipment, indexed by their prototype names. - */ - take_all(by_player?: PlayerIdentification): Record - /** - * Clear all equipment from the grid, removing it without actually returning it. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.clear View documentation} - * - * @param by_player - If provided, the action is done 'as' this player and - * {@link OnPlayerRemovedEquipmentEvent on_player_removed_equipment} is triggered. - */ - clear(by_player?: PlayerIdentification): void - /** - * Insert an equipment into the grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.put View documentation} - * - * @returns The newly-added equipment, or `nil` if the equipment could not be added. - */ - put(params: { - /** Equipment prototype name */ - readonly name: string - /** Grid position to put the equipment in. */ - readonly position?: Position - /** - * If provided the action is done 'as' this player and - * {@link OnPlayerPlacedEquipmentEvent on_player_placed_equipment} is triggered. - */ - readonly by_player?: PlayerIdentification - }): LuaEquipment | undefined - /** - * Check whether moving an equipment would succeed. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.can_move View documentation} - */ - can_move(params: { - /** The equipment to move */ - readonly equipment: LuaEquipment - /** Where to put it */ - readonly position: Position - }): boolean - /** - * Move an equipment within this grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.move View documentation} - * - * @returns `true` if the equipment was successfully moved. - */ - move(params: { - /** The equipment to move */ - readonly equipment: LuaEquipment - /** Where to put it */ - readonly position: Position - }): boolean - /** - * Find equipment in the Equipment Grid based off a position. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.get View documentation} - * - * @param position - The position - * @returns The found equipment, or `nil` if equipment could not be found at the given position. - */ - get(position: Position): LuaEquipment | undefined - /** - * Get counts of all equipment in this grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.get_contents View documentation} - * - * @returns The counts, indexed by equipment names. - */ - get_contents(): Record - readonly prototype: LuaEquipmentGridPrototype - /** - * Width of the equipment grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.width View documentation} - */ - readonly width: uint - /** - * Height of the equipment grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.height View documentation} - */ - readonly height: uint - /** - * All the equipment in this grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.equipment View documentation} - */ - readonly equipment: LuaEquipment[] - /** - * Total energy per tick generated by the equipment inside this grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.generator_energy View documentation} - */ - readonly generator_energy: double - /** - * Maximum energy per tick that can be created by any solar panels in the equipment grid. Actual generated energy - * varies depending on the daylight levels. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.max_solar_energy View documentation} - */ - readonly max_solar_energy: double - /** - * The total energy stored in all batteries in the equipment grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.available_in_batteries View documentation} - */ - readonly available_in_batteries: double - /** - * Total energy storage capacity of all batteries in the equipment grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.battery_capacity View documentation} - */ - readonly battery_capacity: double - /** - * The amount of shields this equipment grid has. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.shield View documentation} - */ - readonly shield: float - /** - * The maximum amount of shields this equipment grid has. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.max_shield View documentation} - */ - readonly max_shield: float - /** - * True if this movement bonus equipment is turned off, otherwise false. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGrid.html#LuaEquipmentGrid.inhibit_movement_bonus View documentation} - */ - inhibit_movement_bonus: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaEquipmentGrid" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of an equipment grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGridPrototype.html View documentation} - * - * @noSelf - */ -interface LuaEquipmentGridPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Equipment category names for the categories that may be inserted into this equipment grid. The grid will accept - * any equipment that has at least one category in this list. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.equipment_categories View documentation} - * - * @see {@link LuaEquipmentPrototype.equipment_categories} - */ - readonly equipment_categories: string[] - readonly width: uint - readonly height: uint - /** - * If the player can move equipment into or out of this grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.locked View documentation} - */ - readonly locked: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaEquipmentGridPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a modular equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html View documentation} - * - * @noSelf - */ -interface LuaEquipmentPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.name View documentation} - */ - readonly name: string - /** - * Type of this equipment prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.type View documentation} - */ - readonly type: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Shape of this equipment prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.shape View documentation} - */ - readonly shape: { - readonly width: uint - readonly height: uint - /** Only set when the shape is "manual" */ - readonly points?: EquipmentPoint[] - } - /** - * The result item when taking this equipment out of an equipment grid. `nil` if there is no result item. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.take_result View documentation} - */ - readonly take_result: LuaItemPrototype | undefined - /** - * The max power generated by this equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.energy_production View documentation} - */ - readonly energy_production: double - /** - * The shield value of this equipment. 0 for non-shield equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.shield View documentation} - */ - readonly shield: float - /** - * The energy per shield point restored. 0 for non-shield equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.energy_per_shield View documentation} - */ - readonly energy_per_shield: double - /** - * The logistic parameters for this roboport equipment. - * - * **Note**: Both the `charging_station_shift` and `stationing_offset` vectors are tables with `x` and `y` keys - * instead of an array. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters View documentation} - */ - readonly logistic_parameters: { - readonly spawn_and_station_height: float - readonly spawn_and_station_shadow_height_offset: float - readonly charge_approach_distance: float - readonly logistic_radius: float - readonly construction_radius: float - readonly charging_station_count: uint - readonly charging_distance: float - readonly charging_station_shift: Vector - readonly charging_energy: double - readonly charging_threshold_distance: float - readonly robot_vertical_acceleration: float - readonly stationing_offset: Vector - readonly robot_limit: uint - readonly logistics_connection_distance: float - readonly robots_shrink_when_entering_and_exiting: boolean - } - readonly energy_consumption: double - /** - * *Can only be used if this is MovementBonusEquipmentPrototype* - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.movement_bonus View documentation} - */ - readonly movement_bonus: float - /** - * The energy source prototype for the equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.energy_source View documentation} - */ - readonly energy_source: LuaElectricEnergySourcePrototype - /** - * Category names for this equipment. These categories will be used to determine whether this equipment is allowed - * in a particular equipment grid. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.equipment_categories View documentation} - * - * @see {@link LuaEquipmentGridPrototype.equipment_categories} - */ - readonly equipment_categories: string[] - /** - * The burner energy source prototype this equipment uses or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.burner_prototype View documentation} - */ - readonly burner_prototype: LuaBurnerPrototype | undefined - /** - * The electric energy source prototype this equipment uses or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.electric_energy_source_prototype View documentation} - */ - readonly electric_energy_source_prototype: LuaElectricEnergySourcePrototype | undefined - /** - * The background color of this equipment prototype. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.background_color View documentation} - */ - readonly background_color: ColorTable - /** - * The equipment attack parameters or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.attack_parameters View documentation} - */ - readonly attack_parameters: AttackParameters | undefined - /** - * Is this active defense equipment automatic. Returns false if not active defense equipment. - * - * {@link https://lua-api.factorio.com/next/LuaEquipmentPrototype.html#LuaEquipmentPrototype.automatic View documentation} - */ - readonly automatic: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaEquipmentPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Encapsulates statistic data for different parts of the game. In the context of flow statistics, `input` and `output` - * describe on which side of the associated GUI the values are shown. Input values are shown on the left side, output - * values on the right side. - * - * Examples: - * - * - The item production GUI shows "consumption" on the right, thus `output` describes the item consumption numbers. The - * same goes for fluid consumption. - * - The kills gui shows "losses" on the right, so `output` describes how many of the force's entities were killed by enemies. - * - The electric network GUI shows "power consumption" on the left side, so in this case `input` describes the power - * consumption numbers. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html View documentation} - * - * @noSelf - */ -interface LuaFlowStatistics { - /** - * Gets the total input count for a given prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.get_input_count View documentation} - * - * @param name - The prototype name. - */ - get_input_count(name: string): uint64 | double - /** - * Sets the total input count for a given prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.set_input_count View documentation} - * - * @param name - The prototype name. - * @param count - The new count. The type depends on the instance of the statistics. - */ - set_input_count(name: string, count: uint64 | double): void - /** - * Gets the total output count for a given prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.get_output_count View documentation} - * - * @param name - The prototype name. - */ - get_output_count(name: string): uint64 | double - /** - * Sets the total output count for a given prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.set_output_count View documentation} - * - * @param name - The prototype name. - * @param count - The new count. The type depends on the instance of the statistics. - */ - set_output_count(name: string, count: uint64 | double): void - /** - * Gets the flow count value for the given time frame. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.get_flow_count View documentation} - */ - get_flow_count(params: { - /** The prototype name. */ - readonly name: string - /** Read the input values or the output values */ - readonly input: boolean - /** The precision to read. */ - readonly precision_index: defines.flow_precision_index - /** If true, the count is returned instead of the per-time-frame value. */ - readonly count?: boolean - }): double - /** - * Adds a value to this flow statistics. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.on_flow View documentation} - * - * @param name - The prototype name. - * @param count - The count: positive or negative determines if the value goes in the input or output statistics. - */ - on_flow(name: string, count: float): void - /** - * Reset all the statistics data to 0. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.clear View documentation} - */ - clear(): void - /** - * List of input counts indexed by prototype name. Represents the data that is shown on the left side of the GUI for - * the given statistics. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.input_counts View documentation} - */ - readonly input_counts: Record - /** - * List of output counts indexed by prototype name. Represents the data that is shown on the right side of the GUI - * for the given statistics. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.output_counts View documentation} - */ - readonly output_counts: Record - /** - * The force these statistics belong to or `nil` for pollution statistics. - * - * {@link https://lua-api.factorio.com/next/LuaFlowStatistics.html#LuaFlowStatistics.force View documentation} - */ - readonly force: LuaForce | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaFlowStatistics" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * An array of fluid boxes of an entity. Entities may contain more than one fluid box, and some can change the number of - * fluid boxes -- for instance, an assembling machine will change its number of fluid boxes depending on its active recipe. - * - * See {@link Fluid} - * - * Do note that reading from a {@link LuaFluidBox} creates a new table and writing will copy the given fields from the - * table into the engine's own fluid box structure. Therefore, the correct way to update a fluidbox of an entity is to - * read it first, modify the table, then write the modified table back. Directly accessing the returned table's - * attributes won't have the desired effect. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html View documentation} - * - * @example - * Double the temperature of the fluid in `entity`'s first fluid box. - * - * ```lua - * fluid = entity.fluidbox[1] - * fluid.temperature = fluid.temperature * 2 - * entity.fluidbox[1] = fluid - * ``` - * - * @noSelf - */ -interface LuaFluidBox extends Array { - /** - * The prototype of this fluidbox index. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.get_prototype View documentation} - * - * @param index - */ - get_prototype(index: uint): LuaFluidBoxPrototype - /** - * The capacity of the given fluidbox index. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.get_capacity View documentation} - * - * @param index - */ - get_capacity(index: uint): double - /** - * The fluidbox connections for the given fluidbox index. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.get_connections View documentation} - * - * @param index - */ - get_connections(index: uint): LuaFluidBox[] - /** - * Get a fluid box filter - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.get_filter View documentation} - * - * @param index - The index of the filter to get. - * @returns The filter at the requested index. `nil` if there isn't one. - */ - get_filter(index: uint): FluidBoxFilter | undefined - /** - * Set a fluid box filter. - * - * **Note**: Some entities cannot have their fluidbox filter set, notably fluid wagons and crafting machines. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.set_filter View documentation} - * - * @param index - The index of the filter to set. - * @param filter - The filter to set. Setting `nil` clears the filter. - * @returns Whether the filter was set successfully. - */ - set_filter(index: uint, filter?: FluidBoxFilterSpec): boolean - /** - * Flow through the fluidbox in the last tick. It is the larger of in-flow and out-flow. - * - * **Note**: Fluid wagons do not track it and will return 0. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.get_flow View documentation} - * - * @param index - */ - get_flow(index: uint): double - /** - * Returns the fluid the fluidbox is locked onto Returns 'nil' for no lock - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.get_locked_fluid View documentation} - * - * @param index - */ - get_locked_fluid(index: uint): string | undefined - /** - * Flushes all fluid from this fluidbox and its fluid system. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.flush View documentation} - * - * @param index - * @param fluid - If provided, only this fluid is flushed. - * @returns The fluid removed. - */ - flush(index: uint, fluid?: FluidIdentification): Record - /** - * Number of fluid boxes. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.operator%20# View documentation} - */ - readonly length: uint - /** - * The entity that owns this fluidbox. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.owner View documentation} - */ - readonly owner: LuaEntity - /** - * Access, set or clear a fluid box. The index must always be in bounds (see - * {@link LuaFluidBox.length LuaFluidBox::operator #}). New fluidboxes may not be added or removed using this - * operator. If the given fluid box doesn't contain any fluid, `nil` is returned. Similarly, `nil` can be written to - * a fluid box to remove all fluid from it. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBox.html#LuaFluidBox.operator%20[] View documentation} - */ - [index: number]: Fluid | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaFluidBox" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A prototype of a fluidbox owned by some {@link LuaEntityPrototype}. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html View documentation} - * - * @noSelf - */ -interface LuaFluidBoxPrototype { - /** - * The entity that this belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.entity View documentation} - */ - readonly entity: LuaEntityPrototype - /** - * The index of this fluidbox prototype in the owning entity. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.index View documentation} - */ - readonly index: uint - /** - * The pipe connection points. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.pipe_connections View documentation} - */ - readonly pipe_connections: FluidBoxConnection[] - /** - * The production type. "input", "output", "input-output", or "none". - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.production_type View documentation} - */ - readonly production_type: "input" | "output" | "input-output" | "none" - readonly base_area: double - readonly base_level: double - readonly height: double - readonly volume: double - /** - * The filter or `nil` if no filter is set. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.filter View documentation} - */ - readonly filter: LuaFluidPrototype | undefined - /** - * The minimum temperature or `nil` if none is set. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.minimum_temperature View documentation} - */ - readonly minimum_temperature: double | undefined - /** - * The maximum temperature or `nil` if none is set. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.maximum_temperature View documentation} - */ - readonly maximum_temperature: double | undefined - /** - * The secondary draw orders for the 4 possible connection directions. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.secondary_draw_orders View documentation} - */ - readonly secondary_draw_orders: int[] - /** - * The render layer. - * - * {@link https://lua-api.factorio.com/next/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.render_layer View documentation} - */ - readonly render_layer: string - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaFluidBoxPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a fluid energy source. - * - * {@link https://lua-api.factorio.com/next/LuaFluidEnergySourcePrototype.html View documentation} - * - * @noSelf - */ -interface LuaFluidEnergySourcePrototype { - readonly emissions: double - readonly render_no_network_icon: boolean - readonly render_no_power_icon: boolean - readonly effectivity: double - readonly burns_fluid: boolean - readonly scale_fluid_usage: boolean - readonly fluid_usage_per_tick: double - /** - * The smoke sources for this prototype if any. - * - * {@link https://lua-api.factorio.com/next/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.smoke View documentation} - */ - readonly smoke: SmokeSource[] - readonly maximum_temperature: double - /** - * The fluid box for this energy source. - * - * {@link https://lua-api.factorio.com/next/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.fluid_box View documentation} - */ - readonly fluid_box: LuaFluidBoxPrototype - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaFluidEnergySourcePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a fluid. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html View documentation} - * - * @noSelf - */ -interface LuaFluidPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.name View documentation} - */ - readonly name: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Default temperature of this fluid. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.default_temperature View documentation} - */ - readonly default_temperature: double - /** - * Maximum temperature this fluid can reach. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.max_temperature View documentation} - */ - readonly max_temperature: double - /** - * The amount of energy in Joules required to heat one unit of this fluid by 1°C. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.heat_capacity View documentation} - */ - readonly heat_capacity: double - /** - * Order string for this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.order View documentation} - */ - readonly order: string - /** - * Group of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.group View documentation} - */ - readonly group: LuaGroup - /** - * Subgroup of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.subgroup View documentation} - */ - readonly subgroup: LuaGroup - readonly base_color: ColorTable - readonly flow_color: ColorTable - /** - * The temperature above which this fluid will be shown as gaseous inside tanks and pipes. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.gas_temperature View documentation} - */ - readonly gas_temperature: double - /** - * A multiplier on the amount of emissions produced when this fluid is burnt in a generator. A value above `1.0` - * increases emissions and vice versa. The multiplier can't be negative. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.emissions_multiplier View documentation} - */ - readonly emissions_multiplier: double - /** - * The amount of energy in Joules one unit of this fluid will produce when burnt in a generator. A value of `0` - * means this fluid can't be used for energy generation. The value can't be negative. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.fuel_value View documentation} - */ - readonly fuel_value: double - /** - * Whether this fluid is hidden from the fluid and signal selectors. - * - * {@link https://lua-api.factorio.com/next/LuaFluidPrototype.html#LuaFluidPrototype.hidden View documentation} - */ - readonly hidden: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaFluidPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a font. - * - * {@link https://lua-api.factorio.com/next/LuaFontPrototype.html View documentation} - * - * @noSelf - */ -interface LuaFontPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFontPrototype.html#LuaFontPrototype.name View documentation} - */ - readonly name: string - readonly from: string - readonly size: int - readonly spacing: float - readonly border: boolean - readonly filtered: boolean - /** - * The border color or `nil` if not set. - * - * {@link https://lua-api.factorio.com/next/LuaFontPrototype.html#LuaFontPrototype.border_color View documentation} - */ - readonly border_color: ColorTable | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaFontPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * `LuaForce` encapsulates data local to each "force" or "faction" of the game. Default forces are player, enemy and - * neutral. Players and mods can create additional forces (up to 64 total). - * - * {@link https://lua-api.factorio.com/next/LuaForce.html View documentation} - * - * @noSelf - */ -interface LuaForce { - /** - * Count entities of given type. - * - * **Note**: This function has O(1) time complexity as entity counts are kept and maintained in the game engine. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_entity_count View documentation} - * - * @param name - Prototype name of the entity. - * @returns Number of entities of given prototype belonging to this force. - */ - get_entity_count(name: string): uint - /** - * Disable research for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.disable_research View documentation} - */ - disable_research(): void - /** - * Enable research for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.enable_research View documentation} - */ - enable_research(): void - /** - * Disable all recipes and technologies. Only recipes and technologies enabled explicitly will be useable from this point. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.disable_all_prototypes View documentation} - */ - disable_all_prototypes(): void - /** - * Enables all recipes and technologies. The opposite of - * {@link LuaForce.disable_all_prototypes LuaForce::disable_all_prototypes} - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.enable_all_prototypes View documentation} - */ - enable_all_prototypes(): void - /** - * Load the original version of all recipes from the prototypes. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.reset_recipes View documentation} - */ - reset_recipes(): void - /** - * Unlock all recipes. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.enable_all_recipes View documentation} - */ - enable_all_recipes(): void - /** - * Unlock all technologies. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.enable_all_technologies View documentation} - */ - enable_all_technologies(): void - /** - * Research all technologies. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.research_all_technologies View documentation} - * - * @param include_disabled_prototypes - Whether technologies that are explicitly disabled in the prototype should - * also be researched. Defaults to `false`. - */ - research_all_technologies(include_disabled_prototypes?: boolean): void - /** - * Load the original versions of technologies from prototypes. Preserves research state of technologies. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.reset_technologies View documentation} - */ - reset_technologies(): void - /** - * Reset everything. All technologies are set to not researched, all modifiers are set to default values. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.reset View documentation} - */ - reset(): void - /** - * Reapplies all possible research effects, including unlocked recipes. Any custom changes are lost. Preserves - * research state of technologies. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.reset_technology_effects View documentation} - */ - reset_technology_effects(): void - /** - * Chart a portion of the map. The chart for the given area is refreshed; it creates chart for any parts of the - * given area that haven't been charted yet. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.chart View documentation} - * - * @example - * Charts a 2048x2048 rectangle centered around the origin. - * - * ```lua - * game.player.force.chart(game.player.surface, {{x = -1024, y = -1024}, {x = 1024, y = 1024}}) - * ``` - * - * @param surface - * @param area - The area on the given surface to chart. - */ - chart(surface: SurfaceIdentification, area: BoundingBox): void - /** - * Erases chart data for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.clear_chart View documentation} - * - * @param surface - Which surface to erase chart data for or if not provided all surfaces charts are erased. - */ - clear_chart(surface?: SurfaceIdentification): void - /** - * Force a rechart of the whole chart. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.rechart View documentation} - */ - rechart(): void - /** - * Chart all generated chunks. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.chart_all View documentation} - * - * @param surface - Which surface to chart or all if not given. - */ - chart_all(surface?: SurfaceIdentification): void - /** - * Has a chunk been charted? - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.is_chunk_charted View documentation} - * - * @param surface - * @param position - Position of the chunk. - */ - is_chunk_charted(surface: SurfaceIdentification, position: ChunkPosition): boolean - /** - * Is the given chunk currently charted and visible (not covered by fog of war) on the map. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.is_chunk_visible View documentation} - * - * @param surface - * @param position - */ - is_chunk_visible(surface: SurfaceIdentification, position: ChunkPosition): boolean - /** - * Cancels pending chart requests for the given surface or all surfaces. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.cancel_charting View documentation} - * - * @param surface - */ - cancel_charting(surface?: SurfaceIdentification): void - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_ammo_damage_modifier View documentation} - * - * @param ammo - Ammo category - */ - get_ammo_damage_modifier(ammo: string): double - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_ammo_damage_modifier View documentation} - * - * @param ammo - Ammo category - * @param modifier - */ - set_ammo_damage_modifier(ammo: string, modifier: double): void - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_gun_speed_modifier View documentation} - * - * @param ammo - Ammo category - */ - get_gun_speed_modifier(ammo: string): double - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_gun_speed_modifier View documentation} - * - * @param ammo - Ammo category - * @param modifier - */ - set_gun_speed_modifier(ammo: string, modifier: double): void - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_turret_attack_modifier View documentation} - * - * @param turret - Turret prototype name - */ - get_turret_attack_modifier(turret: string): double - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_turret_attack_modifier View documentation} - * - * @param turret - Turret prototype name - * @param modifier - */ - set_turret_attack_modifier(turret: string, modifier: double): void - /** - * Add `other` force to this force's cease fire list. Forces on the cease fire list won't be targeted for attack. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_cease_fire View documentation} - * - * @param other - * @param cease_fire - */ - set_cease_fire(other: ForceIdentification, cease_fire: boolean): void - /** - * Is `other` force in this force's cease fire list? - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_cease_fire View documentation} - * - * @param other - */ - get_cease_fire(other: ForceIdentification): boolean - /** - * Add `other` force to this force's friends list. Friends have unrestricted access to buildings and turrets won't - * fire at them. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_friend View documentation} - * - * @param other - * @param friend - */ - set_friend(other: ForceIdentification, friend: boolean): void - /** - * Is `other` force in this force's friends list. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_friend View documentation} - * - * @param other - */ - get_friend(other: ForceIdentification): boolean - /** - * Is pathfinder busy? When the pathfinder is busy, it won't accept any more pathfinding requests. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.is_pathfinder_busy View documentation} - */ - is_pathfinder_busy(): boolean - /** - * Kill all units and flush the pathfinder. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.kill_all_units View documentation} - */ - kill_all_units(): void - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.find_logistic_network_by_position View documentation} - * - * @param position - Position to find a network for - * @param surface - Surface to search on - * @returns The found network or `nil`. - */ - find_logistic_network_by_position(position: Position, surface: SurfaceIdentification): LuaLogisticNetwork | undefined - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_spawn_position View documentation} - * - * @param position - The new position on the given surface. - * @param surface - Surface to set the spawn position for. - */ - set_spawn_position(position: Position, surface: SurfaceIdentification): void - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_spawn_position View documentation} - * - * @param surface - */ - get_spawn_position(surface: SurfaceIdentification): PositionTable - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.unchart_chunk View documentation} - * - * @param position - The chunk position to unchart. - * @param surface - Surface to unchart on. - */ - unchart_chunk(position: ChunkPosition, surface: SurfaceIdentification): void - /** - * Gets the count of a given item launched in rockets. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_item_launched View documentation} - * - * @param item - The item to get - * @returns The count of the item that has been launched. - */ - get_item_launched(item: string): uint - /** - * Sets the count of a given item launched in rockets. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_item_launched View documentation} - * - * @param item - The item to set - * @param count - The count to set - */ - set_item_launched(item: string, count: uint): void - /** - * Print text to the chat console of all players on this force. - * - * **Note**: Messages that are identical to a message sent in the last 60 ticks are not printed again. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.print View documentation} - * - * @param message - * @param color - */ - print(message: LocalisedString, color?: Color): void - /** - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_trains View documentation} - * - * @param surface - If given only trains on the surface are returned. - */ - get_trains(surface?: SurfaceIdentification): LuaTrain[] - /** - * Adds a custom chart tag to the given surface and returns the new tag or `nil` if the given position isn't valid - * for a chart tag. - * - * **Note**: The chunk must be charted for a tag to be valid at that location. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.add_chart_tag View documentation} - * - * @param surface - Which surface to add the tag to. - * @param tag - The tag to add. - */ - add_chart_tag(surface: SurfaceIdentification, tag: ChartTagSpec): LuaCustomChartTag | undefined - /** - * Finds all custom chart tags within the given bounding box on the given surface. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.find_chart_tags View documentation} - * - * @param surface - * @param area - */ - find_chart_tags(surface: SurfaceIdentification, area?: BoundingBox): LuaCustomChartTag[] - /** - * Gets the saved progress for the given technology or `nil` if there is no saved progress. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_saved_technology_progress View documentation} - * - * @param technology - The technology - * @returns The progress as a percent. - */ - get_saved_technology_progress(technology: TechnologyIdentification): double | undefined - /** - * Sets the saved progress for the given technology. The technology must not be in progress, must not be completed, - * and the new progress must be < 100%. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_saved_technology_progress View documentation} - * - * @param technology - The technology - * @param progress - Progress as a percent. Set to `nil` to remove the saved progress. - */ - set_saved_technology_progress(technology: TechnologyIdentification, progress: double | undefined): void - /** - * Resets evolution for this force to zero. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.reset_evolution View documentation} - */ - reset_evolution(): void - /** - * Play a sound for every player in this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.play_sound View documentation} - */ - play_sound(params: { - /** The sound to play. */ - readonly path: SoundPath - /** Where the sound should be played. If not given, it's played at the current position of each player. */ - readonly position?: Position - /** The volume of the sound to play. Must be between 0 and 1 inclusive. */ - readonly volume_modifier?: double - /** The volume mixer to play the sound through. Defaults to the default mixer for the given sound type. */ - readonly override_sound_type?: SoundType - }): void - /** - * Gets train stops matching the given filters. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_train_stops View documentation} - */ - get_train_stops(params?: { readonly name?: string | string[]; readonly surface?: SurfaceIdentification }): LuaEntity[] - /** - * Gets if the given recipe is explicitly disabled from being hand crafted. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_hand_crafting_disabled_for_recipe View documentation} - * - * @param recipe - */ - get_hand_crafting_disabled_for_recipe(recipe: string | LuaRecipe): boolean - /** - * Sets if the given recipe can be hand-crafted. This is used to explicitly disable hand crafting a recipe - it - * won't allow hand-crafting otherwise not hand-craftable recipes. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.set_hand_crafting_disabled_for_recipe View documentation} - * - * @param recipe - * @param hand_crafting_disabled - */ - set_hand_crafting_disabled_for_recipe(recipe: string | LuaRecipe, hand_crafting_disabled: boolean): void - /** - * Add this technology to the back of the research queue if the queue is enabled. Otherwise, set this technology to - * be researched now. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.add_research View documentation} - * - * @param technology - * @returns If the technology was added. - */ - add_research(technology: TechnologyIdentification): boolean - /** - * Stop the research currently in progress. This will remove any dependent technologies from the research queue. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.cancel_current_research View documentation} - */ - cancel_current_research(): void - /** - * Gets the linked inventory for the given prototype and link ID if it exists or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.get_linked_inventory View documentation} - * - * @param prototype - * @param link_id - */ - get_linked_inventory(prototype: EntityPrototypeIdentification, link_id: uint): LuaInventory | undefined - /** - * Is this force a friend? This differs from `get_friend` in that it is always true for neutral force. This is - * equivalent to checking the `friend` ForceCondition. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.is_friend View documentation} - * - * @param other - */ - is_friend(other: ForceIdentification): boolean - /** - * Is this force an enemy? This differs from `get_cease_fire` in that it is always false for neutral force. This is - * equivalent to checking the `enemy` ForceCondition. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.is_enemy View documentation} - * - * @param other - */ - is_enemy(other: ForceIdentification): boolean - /** - * Name of the force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.name View documentation} - * - * @example - * Prints "`player`" - * - * ```lua - * game.player.print(game.player.force.name) - * ``` - */ - readonly name: string - /** - * Technologies owned by this force, indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.technologies View documentation} - * - * @example - * Researches the technology for the player's force - * - * ```lua - * game.player.force.technologies["steel-processing"].researched = true - * ``` - */ - readonly technologies: LuaCustomTable - /** - * Recipes available to this force, indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.recipes View documentation} - * - * @example - * Prints the category of the given recipe - * - * ```lua - * game.player.print(game.player.force.recipes["transport-belt"].category) - * ``` - */ - readonly recipes: LuaCustomTable - /** - * Multiplier of the manual mining speed. Default value is `0`. The actual mining speed will be multiplied by `1 + - * manual_mining_speed_modifier`. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.manual_mining_speed_modifier View documentation} - * - * @example - * Double the player's mining speed - * - * ```lua - * game.player.force.manual_mining_speed_modifier = 1 - * ``` - */ - manual_mining_speed_modifier: double - /** - * Multiplier of the manual crafting speed. Default value is `0`. The actual crafting speed will be multiplied by `1 - * + manual_crafting_speed_modifier`. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.manual_crafting_speed_modifier View documentation} - * - * @example - * Double the player's crafting speed - * - * ```lua - * game.player.force.manual_crafting_speed_modifier = 1 - * ``` - */ - manual_crafting_speed_modifier: double - laboratory_speed_modifier: double - laboratory_productivity_bonus: double - worker_robots_speed_modifier: double - worker_robots_battery_modifier: double - worker_robots_storage_bonus: double - /** - * The current technology in research, or `nil` if no research is currently ongoing. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.current_research View documentation} - */ - readonly current_research: LuaTechnology | undefined - /** - * Progress of current research, as a number in range [0, 1]. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.research_progress View documentation} - */ - research_progress: double - /** - * The previous research if any. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.previous_research View documentation} - */ - previous_research: LuaTechnology - /** - * The inserter stack size bonus for non stack inserters - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.inserter_stack_size_bonus View documentation} - */ - inserter_stack_size_bonus: double - /** - * Number of items that can be transferred by stack inserters. When writing to this value, it must be >= 0 and <= 254. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.stack_inserter_capacity_bonus View documentation} - */ - stack_inserter_capacity_bonus: uint - /** - * Number of character trash slots. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.character_trash_slot_count View documentation} - */ - character_trash_slot_count: double - /** - * Maximum number of follower robots. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.maximum_following_robot_count View documentation} - */ - maximum_following_robot_count: uint - /** - * Additional lifetime for following robots. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.following_robots_lifetime_modifier View documentation} - */ - following_robots_lifetime_modifier: double - /** - * The time, in ticks, before a placed ghost disappears. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.ghost_time_to_live View documentation} - */ - ghost_time_to_live: uint - /** - * Players belonging to this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.players View documentation} - */ - readonly players: LuaPlayer[] - /** - * Enables some higher-level AI behaviour for this force. When set to `true`, biters belonging to this force will - * automatically expand into new territories, build new spawners, and form unit groups. By default, this value is - * `true` for the enemy force and `false` for all others. - * - * **Note**: Setting this to `false` does not turn off biters' AI. They will still move around and attack players - * who come close. - * - * **Note**: It is necessary for a force to be AI controllable in order to be able to create unit groups or build - * bases from scripts. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.ai_controllable View documentation} - */ - ai_controllable: boolean - /** - * List of logistic networks, grouped by surface. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.logistic_networks View documentation} - */ - readonly logistic_networks: Record - /** - * The item production statistics for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.item_production_statistics View documentation} - */ - readonly item_production_statistics: LuaFlowStatistics - /** - * The fluid production statistics for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.fluid_production_statistics View documentation} - */ - readonly fluid_production_statistics: LuaFlowStatistics - /** - * The kill counter statistics for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.kill_count_statistics View documentation} - */ - readonly kill_count_statistics: LuaFlowStatistics - /** - * The entity build statistics for this force (built and mined) - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.entity_build_count_statistics View documentation} - */ - readonly entity_build_count_statistics: LuaFlowStatistics - /** - * Modifies the running speed of all characters in this force by the given value as a percentage. Setting the - * running modifier to `0.5` makes the character run 50% faster. The minimum value of `-1` reduces the movement - * speed by 100%, resulting in a speed of `0`. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.character_running_speed_modifier View documentation} - */ - character_running_speed_modifier: double - artillery_range_modifier: double - character_build_distance_bonus: uint - character_item_drop_distance_bonus: uint - character_reach_distance_bonus: uint - character_resource_reach_distance_bonus: double - character_item_pickup_distance_bonus: double - character_loot_pickup_distance_bonus: double - /** - * The number of additional inventory slots the character main inventory has. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.character_inventory_slots_bonus View documentation} - */ - character_inventory_slots_bonus: uint - /** - * The time, in ticks, before a deconstruction order is removed. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.deconstruction_time_to_live View documentation} - */ - deconstruction_time_to_live: uint - character_health_bonus: double - max_successful_attempts_per_tick_per_construction_queue: uint - max_failed_attempts_per_tick_per_construction_queue: uint - /** - * Ability to use zoom-to-world on map. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.zoom_to_world_enabled View documentation} - */ - zoom_to_world_enabled: boolean - /** - * Ability to build ghosts through blueprint or direct ghost placement, or "mine" ghosts when using zoom-to-world. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.zoom_to_world_ghost_building_enabled View documentation} - */ - zoom_to_world_ghost_building_enabled: boolean - /** - * Ability to create new blueprints using empty blueprint item when using zoom-to-world. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.zoom_to_world_blueprint_enabled View documentation} - */ - zoom_to_world_blueprint_enabled: boolean - /** - * Ability to use deconstruction planner when using zoom-to-world. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.zoom_to_world_deconstruction_planner_enabled View documentation} - */ - zoom_to_world_deconstruction_planner_enabled: boolean - /** - * Ability to use custom selection tools when using zoom-to-world. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.zoom_to_world_selection_tool_enabled View documentation} - */ - zoom_to_world_selection_tool_enabled: boolean - /** - * `true` if character requester logistics is enabled. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.character_logistic_requests View documentation} - */ - character_logistic_requests: boolean - /** - * The number of rockets launched. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.rockets_launched View documentation} - */ - rockets_launched: uint - /** - * All of the items that have been launched in rockets. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.items_launched View documentation} - */ - readonly items_launched: Record - /** - * The connected players belonging to this force. - * - * This is primarily useful when you want to do some action against all online players of this force. - * - * **Note**: This does *not* index using player index. See {@link LuaPlayer.index LuaPlayer::index} on each player - * instance for the player index. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.connected_players View documentation} - */ - readonly connected_players: LuaPlayer[] - mining_drill_productivity_bonus: double - train_braking_force_bonus: double - /** - * Evolution factor of this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.evolution_factor View documentation} - */ - evolution_factor: double - evolution_factor_by_pollution: double - evolution_factor_by_time: double - evolution_factor_by_killing_spawners: double - /** - * If friendly fire is enabled for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.friendly_fire View documentation} - */ - friendly_fire: boolean - /** - * If sharing chart data is enabled for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.share_chart View documentation} - */ - share_chart: boolean - /** - * Whether the research queue is available for this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.research_queue_enabled View documentation} - */ - research_queue_enabled: boolean - /** - * Unique ID associated with this force. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.index View documentation} - */ - readonly index: uint - /** - * The research queue of this force. The first technology in the array is the currently active one. Reading this - * attribute gives an array of {@link LuaTechnology}. - * - * To write to this, the entire table must be written. Providing an empty table or `nil` will empty the research - * queue and cancel the current research. Writing to this when the research queue is disabled will simply set the - * last research in the table as the current research. - * - * **Note**: This only allows mods to queue research that this force is able to research in the first place. As an - * example, an already researched technology or one whose prerequisites are not fulfilled will not be queued, but - * dropped silently instead. - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.research_queue View documentation} - */ - research_queue: TechnologyIdentification[] | undefined - /** - * Whether research is enabled for this force, see {@link LuaForce.enable_research LuaForce::enable_research} and - * {@link LuaForce.disable_research LuaForce::disable_research} - * - * {@link https://lua-api.factorio.com/next/LuaForce.html#LuaForce.research_enabled View documentation} - */ - readonly research_enabled: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaForce" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a fuel category. - * - * {@link https://lua-api.factorio.com/next/LuaFuelCategoryPrototype.html View documentation} - * - * @noSelf - */ -interface LuaFuelCategoryPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaFuelCategoryPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Main toplevel type, provides access to most of the API though its members. An instance of LuaGameScript is available - * as the global object named `game`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html View documentation} - * - * @noSelf - */ -interface LuaGameScript { - /** - * Set scenario state. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.set_game_state View documentation} - */ - set_game_state(params: { - readonly game_finished: boolean - readonly player_won: boolean - readonly next_level: string - readonly can_continue: boolean - readonly victorious_force: ForceIdentification - }): void - /** - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_entity_by_tag View documentation} - * - * @param tag - */ - get_entity_by_tag(tag: string): LuaEntity - /** - * Show an in-game message dialog. - * - * **Note**: Can only be used when the map contains exactly one player. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.show_message_dialog View documentation} - */ - show_message_dialog(params: { - /** What the dialog should say */ - readonly text: LocalisedString - /** Path to an image to show on the dialog */ - readonly image?: string - /** - * If specified, dialog will show an arrow pointing to this place. When not specified, the arrow will point to - * the player's position. (Use `point_to={type="nowhere"}` to remove the arrow entirely.) The dialog itself will - * be placed near the arrow's target. - */ - readonly point_to?: GuiArrowSpecification - /** The gui style to use for this speech bubble. Must be of type speech_bubble. */ - readonly style?: string - /** Must be of type flow_style. */ - readonly wrapper_frame_style?: string - }): void - /** - * Is this the demo version of Factorio? - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.is_demo View documentation} - */ - is_demo(): boolean - /** - * Forces a reload of the scenario script from the original scenario location. - * - * **Note**: This disables the replay if replay is enabled. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.reload_script View documentation} - */ - reload_script(): void - /** - * Forces a reload of all mods. - * - * **Note**: This will act like saving and loading from the mod(s) perspective. - * - * **Note**: This will do nothing if run in multiplayer. - * - * **Note**: This disables the replay if replay is enabled. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.reload_mods View documentation} - */ - reload_mods(): void - /** - * Saves the current configuration of Atlas to a file. This will result in huge file containing all of the game - * graphics moved to as small space as possible. - * - * **Note**: Exists mainly for debugging reasons. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.save_atlas View documentation} - */ - save_atlas(): void - /** - * Run internal consistency checks. Allegedly prints any errors it finds. - * - * **Note**: Exists mainly for debugging reasons. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.check_consistency View documentation} - */ - check_consistency(): void - /** - * Regenerate autoplacement of some entities on all surfaces. This can be used to autoplace newly-added entities. - * - * **Note**: All specified entity prototypes must be autoplacable. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.regenerate_entity View documentation} - * - * @param entities - Prototype names of entity or entities to autoplace. - */ - regenerate_entity(entities: string | string[]): void - /** - * Take a screenshot and save it to a file. - * - * **Note**: If Factorio is running headless, this function will do nothing. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.take_screenshot View documentation} - */ - take_screenshot(params: { - readonly player?: PlayerIdentification - /** If defined, the screenshot will only be taken for this player. */ - readonly by_player?: PlayerIdentification - /** If defined, the screenshot will be taken on this surface. */ - readonly surface?: SurfaceIdentification - /** If defined, the screenshot will be centered on this position. */ - readonly position?: Position - /** - * Maximum allowed resolution is 16384x16384 (resp. 8192x8192 when anti_alias is true), but maximum recommended - * resolution is 4096x4096 (resp. 2048x2048). - */ - readonly resolution?: Position - readonly zoom?: double - /** Path to save the screenshot in */ - readonly path?: string - /** Include game GUI in the screenshot? */ - readonly show_gui?: boolean - /** Include entity info (alt-mode)? */ - readonly show_entity_info?: boolean - /** When true, and player is specified, building preview for item in player's cursor will be rendered also. */ - readonly show_cursor_building_preview?: boolean - /** Render in double resolution and scale down (including GUI)? */ - readonly anti_alias?: boolean - /** The render quality if using jpg format (0-100 inclusive). */ - readonly quality?: int - /** - * If true, the screenshot will be saved even during replay playback, otherwise this function call does nothing - * in replays. - */ - readonly allow_in_replay?: boolean - /** Overrides current surface daytime for duration of screenshot rendering. */ - readonly daytime?: double - /** Overrides tick of water animation (if animated water is enabled). */ - readonly water_tick?: uint - /** - * Screenshot requests are processed in between update and render. The game may skip rendering (drop frames) if - * previous frame has not finished rendering or the game simulation starts to fall under 60 updates per second. - * If force_render is set to true, the game won't drop frames and process the screenshot request at the end of - * the update in which the request was created. This is not honored on multiplayer clients that are catching up - * to server. - */ - readonly force_render?: boolean - }): void - /** - * Forces the screenshot saving system to wait until all queued screenshots have been written to disk. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.set_wait_for_screenshots_to_finish View documentation} - */ - set_wait_for_screenshots_to_finish(): void - take_technology_screenshot(params: { - /** The force to use. If not given the `"player`" force is used. */ - readonly force?: ForceIdentification - /** Path to save the screenshot in. */ - readonly path?: string - /** If defined, the screenshot will only be taken for this player. */ - readonly by_player?: PlayerIdentification - /** The technology to highlight. */ - readonly selected_technology?: TechnologyIdentification - /** - * If `true`, disabled technologies will be skipped. Their successors will be attached to the disabled - * technology's parents. Defaults to `false`. - */ - readonly skip_disabled?: boolean - /** The render quality if using jpg format (0-100 inclusive). */ - readonly quality?: int - }): void - /** - * Convert a table to a JSON string - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.table_to_json View documentation} - * - * @param data - */ - table_to_json(data: table): string - /** - * Convert a JSON string to a table. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.json_to_table View documentation} - * - * @param json - The string to convert. - * @returns The returned object, or `nil` if the json was invalid. - */ - json_to_table(json: string): AnyBasic | undefined - /** - * Write a string to a file. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.write_file View documentation} - * - * @param filename - Path to the file to write to. - * @param data - File content - * @param append - When `true`, this will append to the end of the file. Defaults to `false`, which will overwrite - * any pre-existing file with the new data. - * @param for_player - If given, the file will only be written for this player_index. 0 means only the server if one exists. - */ - write_file(filename: string, data: LocalisedString, append?: boolean, for_player?: uint): void - /** - * Remove file or directory. Given path is taken relative to the script output directory. Can be used to remove - * files created by {@link LuaGameScript.write_file LuaGameScript::write_file}. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.remove_path View documentation} - * - * @param path - Path to remove, relative to the script output directory - */ - remove_path(path: string): void - /** - * Remove players who are currently not connected from the map. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.remove_offline_players View documentation} - * - * @param players - List of players to remove. If not specified, remove all offline players. - */ - remove_offline_players(players?: (LuaPlayer | string)[]): void - /** - * Force a CRC check. Tells all peers to calculate their current map CRC; these CRC are then compared against each - * other. If a mismatch is detected, the game is desynced and some peers are forced to reconnect. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.force_crc View documentation} - */ - force_crc(): void - /** - * Create a new force. - * - * **Note**: The game currently supports a maximum of 64 forces, including the three built-in forces. This means - * that a maximum of 61 new forces may be created. - * - * **Note**: Force names must be unique. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.create_force View documentation} - * - * @param force - Name of the new force - * @returns The force that was just created - */ - create_force(force: string): LuaForce - /** - * Marks two forces to be merge together. All entities in the source force will be reassigned to the target force. - * The source force will then be destroyed. - * - * **Note**: The three built-in forces -- player, enemy and neutral -- can't be destroyed. I.e. they can't be used - * as the source argument to this function. - * - * **Note**: The source force is not merged until the end of the current tick or if called during the - * {@link OnForcesMergingEvent on_forces_merging} event or {@link OnForcesMergedEvent on_forces_merged} event the end - * of the next tick. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.merge_forces View documentation} - * - * @param source - The force to remove - * @param destination - The force to reassign all entities to - */ - merge_forces(source: ForceIdentification, destination: ForceIdentification): void - /** - * Create a new surface - * - * **Note**: The game currently supports a maximum of 4,294,967,295 surfaces, including the default surface. - * - * **Note**: Surface names must be unique - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.create_surface View documentation} - * - * @param name - Name of the new surface - * @param settings - Map generation settings - * @returns The surface that was just created - */ - create_surface(name: string, settings?: MapGenSettings): LuaSurface - /** - * Instruct the server to save the map. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.server_save View documentation} - * - * @param name - Save name. If not specified, writes into the currently-running save. - */ - server_save(name?: string): void - /** - * Instruct the game to perform an auto-save. - * - * **Note**: Only the server will save in multiplayer. In single player a standard auto-save is triggered. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.auto_save View documentation} - * - * @param name - The autosave name if any. Saves will be named _autosave-*name* when provided. - */ - auto_save(name?: string): void - /** - * Deletes the given surface and all entities on it. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.delete_surface View documentation} - * - * @param surface - The surface to be deleted. Currently the primary surface (1, 'nauvis') cannot be deleted. - */ - delete_surface(surface: string | LuaSurface): void - /** - * Disables replay saving for the current save file. Once done there's no way to re-enable replay saving for the - * save file without loading an old save. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.disable_replay View documentation} - */ - disable_replay(): void - /** - * Disables tutorial triggers, that unlock new tutorials and show notices about unlocked tutorials. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.disable_tutorial_triggers View documentation} - */ - disable_tutorial_triggers(): void - /** - * Converts the given direction into the string version of the direction. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.direction_to_string View documentation} - * - * @param direction - */ - direction_to_string(direction: defines.direction): void - /** - * Print text to the chat console all players. - * - * **Note**: Messages that are identical to a message sent in the last 60 ticks are not printed again. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.print View documentation} - * - * @param message - * @param color - */ - print(message: LocalisedString, color?: Color): void - /** - * Creates a deterministic standalone random generator with the given seed or if a seed is not provided the initial - * map seed is used. - * - * **Note**: *Make sure* you actually want to use this over math.random(...) as this provides entirely different - * functionality over math.random(...). - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.create_random_generator View documentation} - * - * @param seed - */ - create_random_generator(seed?: uint): LuaRandomGenerator - /** - * Goes over all items, entities, tiles, recipes, technologies among other things and logs if the locale is incorrect. - * - * **Note**: Also prints true/false if called from the console. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.check_prototype_translations View documentation} - */ - check_prototype_translations(): void - /** - * Play a sound for every player in the game. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.play_sound View documentation} - */ - play_sound(params: { - /** The sound to play. */ - readonly path: SoundPath - /** Where the sound should be played. If not given, it's played at the current position of each player. */ - readonly position?: Position - /** The volume of the sound to play. Must be between 0 and 1 inclusive. */ - readonly volume_modifier?: double - /** The volume mixer to play the sound through. Defaults to the default mixer for the given sound type. */ - readonly override_sound_type?: SoundType - }): void - /** - * Checks if the given SoundPath is valid. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.is_valid_sound_path View documentation} - * - * @param sound_path - Path to the sound. - */ - is_valid_sound_path(sound_path: SoundPath): boolean - /** - * Checks if the given SpritePath is valid and contains a loaded sprite. - * - * **Note**: The existence of the image is not checked for paths of type `file`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.is_valid_sprite_path View documentation} - * - * @param sprite_path - Path to the image. - */ - is_valid_sprite_path(sprite_path: SpritePath): boolean - /** - * Kicks the given player from this multiplayer game. Does nothing if this is a single player game or if the player - * running this isn't an admin. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.kick_player View documentation} - * - * @param player - The player to kick. - * @param reason - The reason given if any. - */ - kick_player(player: PlayerIdentification, reason?: LocalisedString): void - /** - * Bans the given player from this multiplayer game. Does nothing if this is a single player game of if the player - * running this isn't an admin. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.ban_player View documentation} - * - * @param player - The player to ban. - * @param reason - The reason given if any. - */ - ban_player(player: PlayerIdentification, reason?: LocalisedString): void - /** - * Unbans the given player from this multiplayer game. Does nothing if this is a single player game of if the player - * running this isn't an admin. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.unban_player View documentation} - * - * @param player - The player to unban. - */ - unban_player(player: PlayerIdentification): void - /** - * Purges the given players messages from the game. Does nothing if the player running this isn't an admin. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.purge_player View documentation} - * - * @param player - The player to purge. - */ - purge_player(player: PlayerIdentification): void - /** - * Mutes the given player. Does nothing if the player running this isn't an admin. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.mute_player View documentation} - * - * @param player - The player to mute. - */ - mute_player(player: PlayerIdentification): void - /** - * Unmutes the given player. Does nothing if the player running this isn't an admin. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.unmute_player View documentation} - * - * @param player - The player to unmute. - */ - unmute_player(player: PlayerIdentification): void - /** - * Counts how many distinct groups of pipes exist in the world. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.count_pipe_groups View documentation} - */ - count_pipe_groups(): void - /** - * Is the map loaded is multiplayer? - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.is_multiplayer View documentation} - */ - is_multiplayer(): boolean - /** - * Gets the number of entities that are active (updated each tick). - * - * **Note**: This is very expensive to calculate. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_active_entities_count View documentation} - * - * @param surface - If give, only the entities active on this surface are counted. - */ - get_active_entities_count(surface?: SurfaceIdentification): uint - /** - * Gets the map exchange string for the map generation settings that were used to create this map. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_map_exchange_string View documentation} - */ - get_map_exchange_string(): string - /** - * Convert a map exchange string to map gen settings and map settings. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.parse_map_exchange_string View documentation} - * - * @param map_exchange_string - */ - parse_map_exchange_string(map_exchange_string: string): MapExchangeStringData - /** - * Gets train stops matching the given filters. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_train_stops View documentation} - */ - get_train_stops(params?: { - readonly name?: string | string[] - readonly surface?: SurfaceIdentification - readonly force?: ForceIdentification - }): LuaEntity[] - /** - * Gets the given player or returns `nil` if no player is found. - * - * **Note**: This is a shortcut for game.players[...] - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_player View documentation} - * - * @param player - The player index or name. - */ - get_player(player: uint | string): LuaPlayer | undefined - /** - * Gets the given surface or returns `nil` if no surface is found. - * - * **Note**: This is a shortcut for game.surfaces[...] - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_surface View documentation} - * - * @param surface - The surface index or name. - */ - get_surface(surface: uint | string): LuaSurface | undefined - /** - * Creates a {@link LuaProfiler}, which is used for measuring script performance. - * - * **Note**: LuaProfiler cannot be serialized. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.create_profiler View documentation} - * - * @param stopped - Create the timer stopped - */ - create_profiler(stopped?: boolean): LuaProfiler - /** - * Evaluate an expression, substituting variables as provided. For details on the formula, see the relevant page on - * the {@link https://wiki.factorio.com/Prototype/Technology#unit Factorio wiki}. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.evaluate_expression View documentation} - * - * @example - * Calculate the number of research units required to unlock mining productivity level 10. - * - * ```lua - * local formula = game.forces["player"].technologies["mining-productivity-4"].research_unit_count_formula - * local units = game.evaluate_expression(formula, { L = 10, l = 10 }) - * ``` - * - * @param expression - The expression to evaluate. - * @param variables - Variables to be substituted. - */ - evaluate_expression(expression: string, variables?: Record): double - /** - * Returns a dictionary of all LuaEntityPrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_entity_prototypes View documentation} - * - * @example - * Get every entity prototype that can craft recipes involving fluids in the way some assembling machines can. - * - * ```lua - * local prototypes = game.get_filtered_entity_prototypes{{filter="crafting-category", crafting_category="crafting-with-fluid"}} - * ``` - * - * @param filters - */ - get_filtered_entity_prototypes(filters: EntityPrototypeFilter[]): LuaCustomTable - /** - * Returns a dictionary of all LuaItemPrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_item_prototypes View documentation} - * - * @example - * Get every item prototype that, when launched with a rocket, produces a result. - * - * ```lua - * local prototypes = game.get_filtered_item_prototypes{{filter="has-rocket-launch-products"}} - * ``` - * - * @param filters - */ - get_filtered_item_prototypes(filters: ItemPrototypeFilter[]): LuaCustomTable - /** - * Returns a dictionary of all LuaEquipmentPrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_equipment_prototypes View documentation} - * - * @example - * Get every equipment prototype that functions as a battery. - * - * ```lua - * local prototypes = game.get_filtered_equipment_prototypes{{filter="type", type="battery-equipment"}} - * ``` - * - * @param filters - */ - get_filtered_equipment_prototypes(filters: EquipmentPrototypeFilter[]): LuaCustomTable - /** - * Returns a dictionary of all LuaModSettingPrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_mod_setting_prototypes View documentation} - * - * @example - * Get every mod setting prototype that belongs to the specified mod. - * - * ```lua - * local prototypes = game.get_filtered_mod_setting_prototypes{{filter="mod", mod="space-exploration"}} - * ``` - * - * @param filters - */ - get_filtered_mod_setting_prototypes( - filters: ModSettingPrototypeFilter[] - ): LuaCustomTable - /** - * Returns a dictionary of all LuaAchievementPrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_achievement_prototypes View documentation} - * - * @example - * Get every achievement prototype that is not allowed to be completed on the peaceful difficulty setting. - * - * ```lua - * local prototypes = game.get_filtered_achievement_prototypes{{filter="allowed-without-fight", invert=true}} - * ``` - * - * @param filters - */ - get_filtered_achievement_prototypes( - filters: AchievementPrototypeFilter[] - ): LuaCustomTable - /** - * Returns a dictionary of all LuaTilePrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_tile_prototypes View documentation} - * - * @example - * Get every tile prototype that improves a player's walking speed by at least 50%. - * - * ```lua - * local prototypes = game.get_filtered_tile_prototypes{{filter="walking-speed-modifier", comparison="≥", value=1.5}} - * ``` - * - * @param filters - */ - get_filtered_tile_prototypes(filters: TilePrototypeFilter[]): LuaCustomTable - /** - * Returns a dictionary of all LuaDecorativePrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_decorative_prototypes View documentation} - * - * @example - * Get every decorative prototype that is auto-placed. - * - * ```lua - * local prototypes = game.get_filtered_decorative_prototypes{{filter="autoplace"}} - * ``` - * - * @param filters - */ - get_filtered_decorative_prototypes( - filters: DecorativePrototypeFilter[] - ): LuaCustomTable - /** - * Returns a dictionary of all LuaFluidPrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_fluid_prototypes View documentation} - * - * @example - * Get every fluid prototype that has a heat capacity of exactly `100`. - * - * ```lua - * local prototypes = game.get_filtered_fluid_prototypes{{filter="heat-capacity", comparison="=", value=100}} - * ``` - * - * @param filters - */ - get_filtered_fluid_prototypes(filters: FluidPrototypeFilter[]): LuaCustomTable - /** - * Returns a dictionary of all LuaRecipePrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_recipe_prototypes View documentation} - * - * @example - * Get every recipe prototype that takes less than half a second to craft (at crafting speed `1`). - * - * ```lua - * local prototypes = game.get_filtered_recipe_prototypes{{filter="energy", comparison="<", value=0.5}} - * ``` - * - * @param filters - */ - get_filtered_recipe_prototypes(filters: RecipePrototypeFilter[]): LuaCustomTable - /** - * Returns a dictionary of all LuaTechnologyPrototypes that fit the given filters. The prototypes are indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_filtered_technology_prototypes View documentation} - * - * @example - * Get every technology prototype that can be researched at the start of the game. - * - * ```lua - * local prototypes = game.get_filtered_technology_prototypes{{filter="has-prerequisites", invert=true}} - * ``` - * - * @param filters - */ - get_filtered_technology_prototypes( - filters: TechnologyPrototypeFilter[] - ): LuaCustomTable - /** - * Creates an inventory that is not owned by any game object. It can be resized later with - * {@link LuaInventory.resize LuaInventory::resize}. - * - * **Note**: Make sure to destroy it when you are done with it with {@link LuaInventory.destroy LuaInventory::destroy}. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.create_inventory View documentation} - * - * @param size - The number of slots the inventory initially has. - */ - create_inventory(size: uint16): LuaInventory - /** - * Gets the inventories created through {@link LuaGameScript.create_inventory LuaGameScript::create_inventory} - * - * **Note**: Inventories created through console commands will be owned by `"core"`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_script_inventories View documentation} - * - * @param mod - The mod who's inventories to get. If not provided all inventories are returned. - * @returns A mapping of mod name to array of inventories owned by that mod. - */ - get_script_inventories(mod?: string): Record - /** - * Resets the amount of time played for this map. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.reset_time_played View documentation} - */ - reset_time_played(): void - /** - * Deflates and base64 encodes the given string. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.encode_string View documentation} - * - * @param string - The string to encode. - * @returns The encoded string or `nil` if the encode failed. - */ - encode_string(string: string): string | undefined - /** - * Base64 decodes and inflates the given string. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.decode_string View documentation} - * - * @param string - The string to decode. - * @returns The decoded string or `nil` if the decode failed. - */ - decode_string(string: string): string | undefined - /** - * The player typing at the console - `nil` in all other instances. See - * {@link LuaGameScript.players LuaGameScript::players} for accessing all players. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.player View documentation} - */ - readonly player: LuaPlayer | undefined - /** - * Get a table of all the players that currently exist. This sparse table allows you to find players by indexing it - * with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the - * table. Iterating with `ipairs()` will not work at all. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.players View documentation} - */ - readonly players: LuaCustomTable - /** - * The currently active set of map settings. Even though this property is marked as read-only, the members of the - * dictionary that is returned can be modified mid-game. - * - * **Note**: This does not contain difficulty settings, use - * {@link LuaGameScript.difficulty_settings LuaGameScript::difficulty_settings} instead. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.map_settings View documentation} - */ - readonly map_settings: MapSettings - /** - * The currently active set of difficulty settings. Even though this property is marked as read-only, the members of - * the dictionary that is returned can be modified mid-game. This is however not recommended as different - * difficulties can have differing technology and recipe trees, which can cause problems for players. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.difficulty_settings View documentation} - * - * @example - * This will set the technology price multiplier to 12. - * - * ```lua - * game.difficulty_settings.technology_price_multiplier = 12 - * ``` - */ - readonly difficulty_settings: DifficultySettings - /** - * Current scenario difficulty. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.difficulty View documentation} - */ - readonly difficulty: defines.difficulty - /** - * Get a table of all the forces that currently exist. This sparse table allows you to find forces by indexing it - * with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the - * table. Iterating with `ipairs()` will not work at all. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.forces View documentation} - */ - readonly forces: LuaCustomTable - /** - * A dictionary containing every LuaEntityPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.entity_prototypes View documentation} - */ - readonly entity_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaItemPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.item_prototypes View documentation} - */ - readonly item_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaFluidPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.fluid_prototypes View documentation} - */ - readonly fluid_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaTilePrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.tile_prototypes View documentation} - */ - readonly tile_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaEquipmentPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.equipment_prototypes View documentation} - */ - readonly equipment_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaDamagePrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.damage_prototypes View documentation} - */ - readonly damage_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaVirtualSignalPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.virtual_signal_prototypes View documentation} - */ - readonly virtual_signal_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaEquipmentGridPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.equipment_grid_prototypes View documentation} - */ - readonly equipment_grid_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaRecipePrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.recipe_prototypes View documentation} - */ - readonly recipe_prototypes: LuaCustomTable - /** - * A dictionary containing every {@link LuaTechnologyPrototype} indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.technology_prototypes View documentation} - */ - readonly technology_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaDecorativePrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.decorative_prototypes View documentation} - */ - readonly decorative_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaParticlePrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.particle_prototypes View documentation} - */ - readonly particle_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaAutoplaceControlPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.autoplace_control_prototypes View documentation} - */ - readonly autoplace_control_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaNoiseLayerPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.noise_layer_prototypes View documentation} - */ - readonly noise_layer_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaModSettingPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.mod_setting_prototypes View documentation} - */ - readonly mod_setting_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaCustomInputPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.custom_input_prototypes View documentation} - */ - readonly custom_input_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaAmmoCategoryPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.ammo_category_prototypes View documentation} - */ - readonly ammo_category_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaNamedNoiseExpression indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.named_noise_expressions View documentation} - */ - readonly named_noise_expressions: LuaCustomTable - /** - * A dictionary containing every ItemSubgroup indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.item_subgroup_prototypes View documentation} - */ - readonly item_subgroup_prototypes: LuaCustomTable - /** - * A dictionary containing every ItemGroup indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.item_group_prototypes View documentation} - */ - readonly item_group_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaFuelCategoryPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.fuel_category_prototypes View documentation} - */ - readonly fuel_category_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaResourceCategoryPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.resource_category_prototypes View documentation} - */ - readonly resource_category_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaAchievementPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.achievement_prototypes View documentation} - */ - readonly achievement_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaModuleCategoryPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.module_category_prototypes View documentation} - */ - readonly module_category_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaEquipmentCategoryPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.equipment_category_prototypes View documentation} - */ - readonly equipment_category_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaTrivialSmokePrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.trivial_smoke_prototypes View documentation} - */ - readonly trivial_smoke_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaShortcutPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.shortcut_prototypes View documentation} - */ - readonly shortcut_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaRecipeCategoryPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.recipe_category_prototypes View documentation} - */ - readonly recipe_category_prototypes: LuaCustomTable - /** - * A dictionary containing every LuaFontPrototype indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.font_prototypes View documentation} - */ - readonly font_prototypes: LuaCustomTable - /** - * A dictionary containing every MapGenPreset indexed by `name`. - * - * **Note**: A MapGenPreset is an exact copy of the prototype table provided from the data stage. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.map_gen_presets View documentation} - */ - readonly map_gen_presets: LuaCustomTable - /** - * The styles that {@link LuaGuiElement} can use, indexed by `name`. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.styles View documentation} - */ - readonly styles: LuaCustomTable - /** - * Current map tick. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.tick View documentation} - */ - readonly tick: uint - /** - * The number of ticks since this game was 'created'. A game is 'created' either by using "new game" or "new game - * from scenario". - * - * **Note**: This differs over {@link LuaGameScript.tick LuaGameScript::tick} in that making a game from a scenario - * always starts with ticks_played value at 0 even if the scenario has its own level data where the - * {@link LuaGameScript.tick LuaGameScript::tick} is > 0. - * - * **Note**: This value has no relation with {@link LuaGameScript.tick LuaGameScript::tick} and can be completely - * different values. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.ticks_played View documentation} - */ - readonly ticks_played: uint - /** - * If the tick has been paused. This means that entity update has been paused. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.tick_paused View documentation} - */ - tick_paused: boolean - /** - * The number of ticks to be run while the tick is paused. When - * {@link LuaGameScript.tick_paused LuaGameScript::tick_paused} is true, ticks_to_run behaves the following way: - * While this is > 0, the entity update is running normally and this value is decremented every tick. When this - * reaches 0, the game will pause again. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.ticks_to_run View documentation} - */ - ticks_to_run: uint - /** - * Is the scenario finished? - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.finished View documentation} - */ - readonly finished: boolean - /** - * Speed to update the map at. 1.0 is normal speed -- 60 UPS. - * - * **Note**: Minimum value is 0.01. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.speed View documentation} - */ - speed: float - /** - * Get a table of all the surfaces that currently exist. This sparse table allows you to find surfaces by indexing - * it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of - * the table. Iterating with `ipairs()` will not work at all. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.surfaces View documentation} - */ - readonly surfaces: LuaCustomTable - /** - * The active mods versions. The keys are mod names, the values are the versions. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.active_mods View documentation} - * - * @example - * This will print the names and versions of active mods to player p's console. - * - * ```lua - * for name, version in pairs(game.active_mods) do - * p.print(name .. " version " .. version) - * end - * ``` - */ - readonly active_mods: Record - /** - * The players that are currently online. - * - * This is primarily useful when you want to do some action against all online players. - * - * **Note**: This does *not* index using player index. See {@link LuaPlayer.index LuaPlayer::index} on each player - * instance for the player index. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.connected_players View documentation} - */ - readonly connected_players: LuaPlayer[] - readonly permissions: LuaPermissionGroups - /** - * Array of the names of all the backers that supported the game development early on. These are used as names for - * labs, locomotives, radars, roboports, and train stops. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.backer_names View documentation} - */ - readonly backer_names: LuaCustomTable - /** - * The default map gen settings for this save. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.default_map_gen_settings View documentation} - */ - readonly default_map_gen_settings: MapGenSettings - /** - * Determines if enemy land mines are completely invisible or not. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.enemy_has_vision_on_land_mines View documentation} - */ - enemy_has_vision_on_land_mines: boolean - /** - * True by default. Can be used to disable autosaving. Make sure to turn it back on soon after. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.autosave_enabled View documentation} - */ - autosave_enabled: boolean - /** - * True by default. Can be used to disable the highlighting of resource patches when they are hovered on the map. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.draw_resource_selection View documentation} - */ - draw_resource_selection: boolean - /** - * The pollution statistics for this map. - * - * {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.pollution_statistics View documentation} - */ - readonly pollution_statistics: LuaFlowStatistics - readonly max_force_distraction_distance: double - readonly max_force_distraction_chunk_distance: uint - readonly max_electric_pole_supply_area_distance: float - readonly max_electric_pole_connection_distance: double - readonly max_beacon_supply_area_distance: double - readonly max_gate_activation_distance: double - readonly max_inserter_reach_distance: double - readonly max_pipe_to_ground_distance: uint8 - readonly max_underground_belt_distance: uint8 - /** This object's name. */ - readonly object_name: "LuaGameScript" -} - -/** - * An abstract base class for behaviors that support switching the entity on or off based on some condition. - * - * {@link https://lua-api.factorio.com/next/LuaGenericOnOffControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaGenericOnOffControlBehavior extends LuaControlBehavior { - /** - * If the entity is currently disabled because of the control behavior. - * - * {@link https://lua-api.factorio.com/next/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.disabled View documentation} - */ - readonly disabled: boolean - /** - * The circuit condition. - * - * **Note**: `condition` may be `nil` in order to clear the circuit condition. - * - * {@link https://lua-api.factorio.com/next/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.circuit_condition View documentation} - * - * @example - * Tell an entity to be active (e.g. a lamp to be lit) when it receives a circuit signal of more than 4 chain signals. - * - * ```lua - * a_behavior.circuit_condition = {condition={comparator=">", - * first_signal={type="item", name="rail-chain-signal"}, - * constant=4}} - * ``` - */ - circuit_condition: CircuitConditionDefinition - /** - * The logistic condition. - * - * **Note**: `condition` may be `nil` in order to clear the logistic condition. - * - * {@link https://lua-api.factorio.com/next/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.logistic_condition View documentation} - * - * @example - * Tell an entity to be active (e.g. a lamp to be lit) when the logistics network it's connected to has more than four chain signals. - * - * ```lua - * a_behavior.logistic_condition = {condition={comparator=">", - * first_signal={type="item", name="rail-chain-signal"}, - * constant=4}} - * ``` - */ - logistic_condition: CircuitConditionDefinition - /** - * `true` if this should connect to the logistic network. - * - * {@link https://lua-api.factorio.com/next/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.connect_to_logistic_network View documentation} - */ - connect_to_logistic_network: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: string - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Item group or subgroup. - * - * {@link https://lua-api.factorio.com/next/LuaGroup.html View documentation} - * - * @noSelf - */ -interface LuaGroup { - readonly name: string - /** - * Localised name of the group. - * - * {@link https://lua-api.factorio.com/next/LuaGroup.html#LuaGroup.localised_name View documentation} - */ - readonly localised_name: LocalisedString - readonly type: string - /** - * The parent group if any; `nil` if none. - * - * {@link https://lua-api.factorio.com/next/LuaGroup.html#LuaGroup.group View documentation} - */ - readonly group: LuaGroup | undefined - /** - * Subgroups of this group. - * - * **Note**: Can only be used on groups, not on subgroups. - * - * {@link https://lua-api.factorio.com/next/LuaGroup.html#LuaGroup.subgroups View documentation} - */ - readonly subgroups: LuaGroup[] - /** - * The additional order value used in recipe ordering. - * - * **Note**: Can only be used on groups, not on subgroups. - * - * {@link https://lua-api.factorio.com/next/LuaGroup.html#LuaGroup.order_in_recipe View documentation} - */ - readonly order_in_recipe: string - readonly order: string - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaGroup" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * The root of the GUI. This type houses the root elements, `top`, `left`, `center`, `goal`, and `screen`, to which - * other elements can be added to be displayed on screen. - * - * **Note**: Every player can have a different GUI state. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html View documentation} - * - * @noSelf - */ -interface LuaGui { - /** - * Returns `true` if sprite_path is valid and contains loaded sprite, otherwise `false`. Sprite path of type `file` - * doesn't validate if file exists. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.is_valid_sprite_path View documentation} - * - * @param sprite_path - Path to a image. - */ - is_valid_sprite_path(sprite_path: SpritePath): boolean - /** - * The player who owns this gui. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.player View documentation} - */ - readonly player: LuaPlayer - /** - * The children GUI elements mapped by name <> element. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.children View documentation} - */ - readonly children: Record - /** - * The top part of the GUI. It is a flow element inside a scroll pane element. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.top View documentation} - */ - readonly top: LuaGuiElement - /** - * The left part of the GUI. It is a flow element inside a scroll pane element. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.left View documentation} - */ - readonly left: LuaGuiElement - /** - * The center part of the GUI. It is a flow element. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.center View documentation} - */ - readonly center: LuaGuiElement - /** - * The flow used in the objectives window. It is a flow element. The objectives window is only visible when the flow - * is not empty or the objective text is set. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.goal View documentation} - */ - readonly goal: LuaGuiElement - /** - * For showing a GUI somewhere on the entire screen. It is an empty-widget element. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.screen View documentation} - */ - readonly screen: LuaGuiElement - /** - * For showing a GUI somewhere relative to one of the game GUIs. It is an empty-widget element. - * - * {@link https://lua-api.factorio.com/next/LuaGui.html#LuaGui.relative View documentation} - */ - readonly relative: LuaGuiElement - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaGui" - /** All methods and properties that this object supports. */ - help(): string -} - -type GuiElementType = - | "choose-elem-button" - | "drop-down" - | "empty-widget" - | "entity-preview" - | "list-box" - | "scroll-pane" - | "sprite-button" - | "tabbed-pane" - | "text-box" - | "button" - | "camera" - | "checkbox" - | "flow" - | "frame" - | "label" - | "line" - | "minimap" - | "progressbar" - | "radiobutton" - | "slider" - | "sprite" - | "switch" - | "tab" - | "table" - | "textfield" - -interface BaseGuiSpec { - /** The kind of element to add. Has to be one of the GUI element types listed at the top of this page. */ - readonly type: GuiElementType - /** Name of the child element. */ - readonly name?: string - /** - * Text displayed on the child element. For frames, this is their title. For other elements, like buttons or labels, - * this is the content. Whilst this attribute may be used on all elements, it doesn't make sense for tables and - * flows as they won't display it. - */ - readonly caption?: LocalisedString - /** Tooltip of the child element. */ - readonly tooltip?: LocalisedString - /** Whether the child element is enabled. Defaults to `true`. */ - readonly enabled?: boolean - /** Whether the child element is visible. Defaults to `true`. */ - readonly visible?: boolean - /** Whether the child element is ignored by interaction. Defaults to `false`. */ - readonly ignored_by_interaction?: boolean - /** Style of the child element. */ - readonly style?: string - /** {@link Tags} associated with the child element. */ - readonly tags?: Tags - /** Location in its parent that the child element should slot into. By default, the child will be appended onto the end. */ - readonly index?: uint - /** Where to position the child element when in the `relative` element. */ - readonly anchor?: GuiAnchor -} - -interface ButtonGuiSpec extends BaseGuiSpec { - readonly type: "button" - /** Which mouse buttons the button responds to. Defaults to `"left-and-right"`. */ - readonly mouse_button_filter?: MouseButtonFlags -} - -interface FlowGuiSpec extends BaseGuiSpec { - readonly type: "flow" - /** - * The initial direction of the flow's layout. See {@link LuaGuiElement.direction LuaGuiElement::direction}. Defaults - * to `"horizontal"`. - */ - readonly direction?: "horizontal" | "vertical" -} - -interface FrameGuiSpec extends BaseGuiSpec { - readonly type: "frame" - /** - * The initial direction of the frame's layout. See {@link LuaGuiElement.direction LuaGuiElement::direction}. - * Defaults to `"horizontal"`. - */ - readonly direction?: "horizontal" | "vertical" -} - -interface TableGuiSpec extends BaseGuiSpec { - readonly type: "table" - /** Number of columns. This can't be changed after the table is created. */ - readonly column_count: uint - /** Whether the table should draw vertical grid lines. Defaults to `false`. */ - readonly draw_vertical_lines?: boolean - /** Whether the table should draw horizontal grid lines. Defaults to `false`. */ - readonly draw_horizontal_lines?: boolean - /** Whether the table should draw a single horizontal grid line after the headers. Defaults to `false`. */ - readonly draw_horizontal_line_after_headers?: boolean - /** Whether the content of the table should be vertically centered. Defaults to `true`. */ - readonly vertical_centering?: boolean -} - -interface TextfieldGuiSpec extends BaseGuiSpec { - readonly type: "textfield" - /** The initial text contained in the textfield. */ - readonly text?: string - /** Defaults to `false`. */ - readonly numeric?: boolean - /** Defaults to `false`. */ - readonly allow_decimal?: boolean - /** Defaults to `false`. */ - readonly allow_negative?: boolean - /** Defaults to `false`. */ - readonly is_password?: boolean - /** Defaults to `false`. */ - readonly lose_focus_on_confirm?: boolean - /** Defaults to `false`. */ - readonly clear_and_focus_on_right_click?: boolean -} - -interface ProgressbarGuiSpec extends BaseGuiSpec { - readonly type: "progressbar" - /** The initial value of the progressbar, in the range [0, 1]. Defaults to `0`. */ - readonly value?: double -} - -interface CheckboxGuiSpec extends BaseGuiSpec { - readonly type: "checkbox" - /** The initial checked-state of the checkbox. */ - readonly state: boolean -} - -interface RadiobuttonGuiSpec extends BaseGuiSpec { - readonly type: "radiobutton" - /** The initial checked-state of the radiobutton. */ - readonly state: boolean -} - -interface SpriteButtonGuiSpec extends BaseGuiSpec { - readonly type: "sprite-button" - /** Path to the image to display on the button. */ - readonly sprite?: SpritePath - /** Path to the image to display on the button when it is hovered. */ - readonly hovered_sprite?: SpritePath - /** Path to the image to display on the button when it is clicked. */ - readonly clicked_sprite?: SpritePath - /** The number shown on the button. */ - readonly number?: double - /** Formats small numbers as percentages. Defaults to `false`. */ - readonly show_percent_for_small_numbers?: boolean - /** The mouse buttons that the button responds to. Defaults to `"left-and-right"`. */ - readonly mouse_button_filter?: MouseButtonFlags -} - -interface SpriteGuiSpec extends BaseGuiSpec { - readonly type: "sprite" - /** Path to the image to display. */ - readonly sprite?: SpritePath - /** Whether the widget should resize according to the sprite in it. Defaults to `true`. */ - readonly resize_to_sprite?: boolean -} - -interface ScrollPaneGuiSpec extends BaseGuiSpec { - readonly type: "scroll-pane" - /** - * Policy of the horizontal scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, - * `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. Defaults to `"auto"`. - */ - readonly horizontal_scroll_policy?: - | "auto" - | "never" - | "always" - | "auto-and-reserve-space" - | "dont-show-but-allow-scrolling" - /** - * Policy of the vertical scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, - * `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. Defaults to `"auto"`. - */ - readonly vertical_scroll_policy?: - | "auto" - | "never" - | "always" - | "auto-and-reserve-space" - | "dont-show-but-allow-scrolling" -} - -interface DropDownGuiSpec extends BaseGuiSpec { - readonly type: "drop-down" - /** The initial items in the dropdown. */ - readonly items?: LocalisedString[] - /** The index of the initially selected item. Defaults to 0. */ - readonly selected_index?: uint -} - -interface LineGuiSpec extends BaseGuiSpec { - readonly type: "line" - /** The initial direction of the line. Defaults to `"horizontal"`. */ - readonly direction?: "horizontal" | "vertical" -} - -interface ListBoxGuiSpec extends BaseGuiSpec { - readonly type: "list-box" - /** The initial items in the listbox. */ - readonly items?: LocalisedString[] - /** The index of the initially selected item. Defaults to 0. */ - readonly selected_index?: uint -} - -interface CameraGuiSpec extends BaseGuiSpec { - readonly type: "camera" - /** The position the camera centers on. */ - readonly position: Position - /** The surface that the camera will render. Defaults to the player's current surface. */ - readonly surface_index?: uint - /** The initial camera zoom. Defaults to `0.75`. */ - readonly zoom?: double -} - -type ChooseElemButtonType = - | "item" - | "tile" - | "entity" - | "signal" - | "fluid" - | "recipe" - | "decorative" - | "item-group" - | "achievement" - | "equipment" - | "technology" - -interface ChooseElemButtonFilters { - item: ItemPrototypeFilter[] - tile: TilePrototypeFilter[] - entity: EntityPrototypeFilter[] - signal: never - fluid: FluidPrototypeFilter[] - recipe: RecipePrototypeFilter[] - decorative: DecorativePrototypeFilter[] - "item-group": never - achievement: AchievementPrototypeFilter[] - equipment: EquipmentPrototypeFilter[] - technology: TechnologyPrototypeFilter[] -} - -interface BaseChooseElemButtonSpec extends BaseGuiSpec { - readonly type: "choose-elem-button" - /** The type of the button - one of the following values. */ - readonly elem_type: ChooseElemButtonType - /** Filters describing what to show in the selection window. See {@link LuaGuiElement.elem_filters LuaGuiElement::elem_filters}. */ - readonly filters?: ChooseElemButtonFilters[this["elem_type"]] -} - -interface ItemChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "item" - /** If type is `"item"` - the default value for the button. */ - readonly item?: string -} - -interface TileChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "tile" - /** If type is `"tile"` - the default value for the button. */ - readonly tile?: string -} - -interface EntityChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "entity" - /** If type is `"entity"` - the default value for the button. */ - readonly entity?: string -} - -interface SignalChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "signal" - /** If type is `"signal"` - the default value for the button. */ - readonly signal?: SignalID -} - -interface FluidChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "fluid" - /** If type is `"fluid"` - the default value for the button. */ - readonly fluid?: string -} - -interface RecipeChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "recipe" - /** If type is `"recipe"` - the default value for the button. */ - readonly recipe?: string -} - -interface DecorativeChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "decorative" - /** If type is `"decorative"` - the default value for the button. */ - readonly decorative?: string -} - -interface ItemGroupChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "item-group" - /** If type is `"item-group"` - the default value for the button. */ - readonly "item-group"?: string -} - -interface AchievementChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "achievement" - /** If type is `"achievement"` - the default value for the button. */ - readonly achievement?: string -} - -interface EquipmentChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "equipment" - /** If type is `"equipment"` - the default value for the button. */ - readonly equipment?: string -} - -interface TechnologyChooseElemButtonSpec extends BaseChooseElemButtonSpec { - readonly elem_type: "technology" - /** If type is `"technology"` - the default value for the button. */ - readonly technology?: string -} - -type ChooseElemButtonGuiSpec = - | ItemChooseElemButtonSpec - | TileChooseElemButtonSpec - | EntityChooseElemButtonSpec - | SignalChooseElemButtonSpec - | FluidChooseElemButtonSpec - | RecipeChooseElemButtonSpec - | DecorativeChooseElemButtonSpec - | ItemGroupChooseElemButtonSpec - | AchievementChooseElemButtonSpec - | EquipmentChooseElemButtonSpec - | TechnologyChooseElemButtonSpec - -interface TextBoxGuiSpec extends BaseGuiSpec { - readonly type: "text-box" - /** The initial text contained in the text-box. */ - readonly text?: string - /** Defaults to `false`. */ - readonly clear_and_focus_on_right_click?: boolean -} - -interface SliderGuiSpec extends BaseGuiSpec { - readonly type: "slider" - /** The minimum value for the slider. Defaults to `0`. */ - readonly minimum_value?: double - /** The maximum value for the slider. Defaults to `30`. */ - readonly maximum_value?: double - /** The initial value for the slider. Defaults to `minimum_value`. */ - readonly value?: double - /** The minimum value the slider can move. Defaults to `1`. */ - readonly value_step?: double - /** Defaults to `false`. */ - readonly discrete_slider?: boolean - /** Defaults to `true`. */ - readonly discrete_values?: boolean -} - -interface MinimapGuiSpec extends BaseGuiSpec { - readonly type: "minimap" - /** The position the minimap centers on. Defaults to the player's current position. */ - readonly position?: Position - /** The surface the camera will render. Defaults to the player's current surface. */ - readonly surface_index?: uint - /** The player index the map should use. Defaults to the current player. */ - readonly chart_player_index?: uint - /** The force this minimap should use. Defaults to the player's current force. */ - readonly force?: string - /** The initial camera zoom. Defaults to `0.75`. */ - readonly zoom?: double -} - -interface TabGuiSpec extends BaseGuiSpec { - readonly type: "tab" - /** The text to display after the normal tab text (designed to work with numbers). */ - readonly badge_text?: LocalisedString -} - -interface SwitchGuiSpec extends BaseGuiSpec { - readonly type: "switch" - /** - * Possible values are `"left"`, `"right"`, or `"none"`. If set to "none", `allow_none_state` must be `true`. - * Defaults to `"left"`. - */ - readonly switch_state?: "left" | "right" | "none" - /** Whether the switch can be set to a middle state. Defaults to `false`. */ - readonly allow_none_state?: boolean - readonly left_label_caption?: LocalisedString - readonly left_label_tooltip?: LocalisedString - readonly right_label_caption?: LocalisedString - readonly right_label_tooltip?: LocalisedString -} - -interface OtherGuiSpec extends BaseGuiSpec { - readonly type: "empty-widget" | "entity-preview" | "tabbed-pane" | "label" -} - -type GuiSpec = - | ButtonGuiSpec - | FlowGuiSpec - | FrameGuiSpec - | TableGuiSpec - | TextfieldGuiSpec - | ProgressbarGuiSpec - | CheckboxGuiSpec - | RadiobuttonGuiSpec - | SpriteButtonGuiSpec - | SpriteGuiSpec - | ScrollPaneGuiSpec - | DropDownGuiSpec - | LineGuiSpec - | ListBoxGuiSpec - | CameraGuiSpec - | ChooseElemButtonGuiSpec - | TextBoxGuiSpec - | SliderGuiSpec - | MinimapGuiSpec - | TabGuiSpec - | SwitchGuiSpec - | OtherGuiSpec - -interface GuiElementIndex { - /** - * The indexing operator. Gets children by name. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.operator%20[] View documentation} - */ - readonly [name: string]: LuaGuiElement | undefined -} - -/** @noSelf */ -interface BaseGuiElement { - /** - * Add a new child element to this GuiElement. - * - * Other attributes may be specified depending on `type`: - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.add View documentation} - * - * @returns The added GUI element. - */ - add( - element: GuiSpec & { - type: Type - } - ): Extract< - LuaGuiElement, - { - type: Type - } - > - /** - * Remove children of this element. Any {@link LuaGuiElement} objects referring to the destroyed elements become - * invalid after this operation. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.clear View documentation} - * - * @example - * ```lua - * game.player.gui.top.clear() - * ``` - */ - clear(): void - /** - * Remove this element, along with its children. Any {@link LuaGuiElement} objects referring to the destroyed - * elements become invalid after this operation. - * - * **Note**: The top-level GUI elements - {@link LuaGui.top LuaGui::top}, {@link LuaGui.left LuaGui::left}, - * {@link LuaGui.center LuaGui::center} and {@link LuaGui.screen LuaGui::screen} - can't be destroyed. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.destroy View documentation} - * - * @example - * ```lua - * game.player.gui.top.greeting.destroy() - * ``` - */ - destroy(): void - /** - * The mod that owns this Gui element or `nil` if it's owned by the scenario script. - * - * **Note**: This has a not-super-expensive, but non-free cost to get. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.get_mod View documentation} - */ - get_mod(): string | undefined - /** - * Gets the index that this element has in its parent element. - * - * **Note**: This iterates through the children of the parent of this element, meaning this has a non-free cost to - * get, but is faster than doing the equivalent in Lua. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.get_index_in_parent View documentation} - */ - get_index_in_parent(): uint - /** - * Removes the items in this dropdown or listbox. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.clear_items View documentation} - */ - clear_items(): void - /** - * Gets the item at the given index from this dropdown or listbox. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.get_item View documentation} - * - * @param index - The index to get - */ - get_item(index: uint): LocalisedString - /** - * Sets the given string at the given index in this dropdown or listbox. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.set_item View documentation} - * - * @param index - The index whose text to replace. - * @param string - The text to set at the given index. - */ - set_item(index: uint, string: LocalisedString): void - /** - * Inserts a string at the end or at the given index of this dropdown or listbox. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.add_item View documentation} - * - * @param string - The text to insert. - * @param index - The index at which to insert the item. - */ - add_item(string: LocalisedString, index?: uint): void - /** - * Removes the item at the given index from this dropdown or listbox. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.remove_item View documentation} - * - * @param index - The index - */ - remove_item(index: uint): void - /** - * Gets this sliders minimum value. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.get_slider_minimum View documentation} - */ - get_slider_minimum(): double - /** - * Gets this sliders maximum value. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.get_slider_maximum View documentation} - */ - get_slider_maximum(): double - /** - * Sets this sliders minimum and maximum values. - * - * **Note**: The minimum can't be >= the maximum. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.set_slider_minimum_maximum View documentation} - * - * @param minimum - * @param maximum - */ - set_slider_minimum_maximum(minimum: double, maximum: double): void - /** - * Gets the minimum distance this slider can move. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.get_slider_value_step View documentation} - */ - get_slider_value_step(): double - /** - * Returns whether this slider only allows being moved to discrete positions. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.get_slider_discrete_slider View documentation} - */ - get_slider_discrete_slider(): boolean - /** - * Returns whether this slider only allows discrete values. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.get_slider_discrete_values View documentation} - */ - get_slider_discrete_values(): boolean - /** - * Sets the minimum distance this slider can move. - * - * **Note**: The minimum distance can't be > (max - min). - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.set_slider_value_step View documentation} - * - * @param value - */ - set_slider_value_step(value: double): void - /** - * Sets whether this slider only allows being moved to discrete positions. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.set_slider_discrete_slider View documentation} - * - * @param value - */ - set_slider_discrete_slider(value: boolean): void - /** - * Sets whether this slider only allows discrete values. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.set_slider_discrete_values View documentation} - * - * @param value - */ - set_slider_discrete_values(value: boolean): void - /** - * Focuses this GUI element if possible. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.focus View documentation} - */ - focus(): void - /** - * Moves this GUI element to the "front" so it will draw over other elements. - * - * **Note**: Only works for elements in {@link LuaGui.screen LuaGui::screen} - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.bring_to_front View documentation} - */ - bring_to_front(): void - /** - * The index of this GUI element (unique amongst the GUI elements of a LuaPlayer). - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.index View documentation} - */ - readonly index: uint - /** - * The GUI this element is a child of. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.gui View documentation} - */ - readonly gui: LuaGui - /** - * The direct parent of this element; `nil` if this is a top-level element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.parent View documentation} - */ - readonly parent: LuaGuiElement | undefined - /** - * The name of this element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.name View documentation} - * - * @example - * ```lua - * game.player.gui.top.greeting.name == "greeting" - * ``` - */ - name: string - /** - * The text displayed on this element. For frames, this is the "heading". For other elements, like buttons or - * labels, this is the content. - * - * **Note**: Whilst this attribute may be used on all elements without producing an error, it doesn't make sense for - * tables and flows as they won't display it. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.caption View documentation} - */ - caption: LocalisedString - /** - * The style of this element. When read, this evaluates to a {@link LuaStyle}. For writing, it only accepts a string - * that specifies the textual identifier (prototype name) of the desired style. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.style View documentation} - */ - style: LuaStyle | string - /** - * Sets whether this GUI element is visible or completely hidden, taking no space in the layout. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.visible View documentation} - */ - visible: boolean - /** - * Names of all the children of this element. These are the identifiers that can be used to access the child as an - * attribute of this element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.children_names View documentation} - */ - readonly children_names: string[] - /** - * Index into {@link LuaGameScript.players LuaGameScript::players} specifying the player who owns this element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.player_index View documentation} - */ - readonly player_index: uint - /** - * The image to display on this sprite-button or sprite in the default state. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.sprite View documentation} - */ - sprite: SpritePath - /** - * Whether the image widget should resize according to the sprite in it. Defaults to `true`. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.resize_to_sprite View documentation} - */ - resize_to_sprite: boolean - /** - * The image to display on this sprite-button when it is clicked. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.clicked_sprite View documentation} - */ - clicked_sprite: SpritePath - tooltip: LocalisedString - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: GuiElementType - /** - * The child-elements of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.children View documentation} - */ - readonly children: LuaGuiElement[] - /** - * The items in this dropdown or listbox. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.items View documentation} - */ - items: LocalisedString[] - /** - * The selected index for this dropdown or listbox. Returns `0` if none is selected. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.selected_index View documentation} - */ - selected_index: uint - /** - * The number to be shown in the bottom right corner of this sprite-button. Set this to `nil` to show nothing. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.number View documentation} - */ - number: double | undefined - /** - * Related to the number to be shown in the bottom right corner of this sprite-button. When set to `true`, numbers - * that are non-zero and smaller than one are shown as a percentage rather than the value. For example, `0.5` will - * be shown as `50%` instead. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.show_percent_for_small_numbers View documentation} - */ - show_percent_for_small_numbers: boolean - /** - * The location of this widget when stored in {@link LuaGui.screen LuaGui::screen} or `nil` if not not set or not in - * {@link LuaGui.screen LuaGui::screen}. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.location View documentation} - */ - location: GuiLocation | undefined - /** - * The position this camera or minimap is focused on, if any. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.position View documentation} - */ - position: Position - /** - * The surface index this camera or minimap is using. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.surface_index View documentation} - */ - surface_index: uint - /** - * The zoom this camera or minimap is using. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.zoom View documentation} - */ - zoom: double - /** - * The force this minimap is using or `nil` if no force is set. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.force View documentation} - */ - force: string | undefined - /** - * Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.enabled View documentation} - */ - enabled: boolean - /** - * Whether this GUI element is ignored by interaction. This makes clicks on this element 'go through' to the GUI - * element or even the game surface below it. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.ignored_by_interaction View documentation} - */ - ignored_by_interaction: boolean - /** - * The mouse button filters for this button or sprite-button. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.mouse_button_filter View documentation} - */ - mouse_button_filter: MouseButtonFlags - /** - * The frame drag target for this flow, frame, label, table, or empty-widget. - * - * **Note**: drag_target can only be set to a frame stored directly in {@link LuaGui.screen LuaGui::screen} or `nil`. - * - * **Note**: drag_target can only be set on child elements in {@link LuaGui.screen LuaGui::screen}. - * - * **Note**: drag_target can only be set to a higher level parent element (this element must be owned at some nested - * level by the drag_target). - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.drag_target View documentation} - */ - drag_target: LuaGuiElement | undefined - /** - * The tabs and contents being shown in this tabbed-pane. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.tabs View documentation} - */ - readonly tabs: TabAndContent[] - /** - * The entity associated with this entity-preview, camera, minimap or `nil` if no entity is associated. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.entity View documentation} - */ - entity: LuaEntity | undefined - /** - * Sets the anchor for this relative widget. Setting `nil` clears the anchor. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.anchor View documentation} - */ - anchor: GuiAnchor | undefined - /** - * The tags associated with this LuaGuiElement. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.tags View documentation} - */ - tags: Tags - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaGuiElement" - /** All methods and properties that this object supports. */ - help(): string -} - -/** @noSelf */ -interface ChooseElemButtonGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "choose-elem-button" - /** - * The elem type of this choose-elem-button. - * - * *Can only be used if this is choose-elem-button* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.elem_type View documentation} - */ - readonly elem_type: ChooseElemButtonType - /** - * The elem value of this choose-elem-button or `nil` if there is no value. - * - * **Note**: The `"signal"` type operates with {@link SignalID}, while all other types use strings. - * - * *Can only be used if this is choose-elem-button* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.elem_value View documentation} - */ - elem_value: (this["elem_type"] extends "signal" ? SignalID : string) | undefined - /** - * The elem filters of this choose-elem-button or `nil` if there are no filters. - * - * The compatible type of filter is determined by elem_type: - * - * - Type `"item"` - {@link ItemPrototypeFilter} - * - Type `"tile"` - {@link TilePrototypeFilter} - * - Type `"entity"` - {@link EntityPrototypeFilter} - * - Type `"signal"` - Does not support filters - * - Type `"fluid"` - {@link FluidPrototypeFilter} - * - Type `"recipe"` - {@link RecipePrototypeFilter} - * - Type `"decorative"` - {@link DecorativePrototypeFilter} - * - Type `"item-group"` - Does not support filters - * - Type `"achievement"` - {@link AchievementPrototypeFilter} - * - Type `"equipment"` - {@link EquipmentPrototypeFilter} - * - Type `"technology"` - {@link TechnologyPrototypeFilter} - * - * **Note**: Writing to this field does not change or clear the currently selected element. - * - * *Can only be used if this is choose-elem-button* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.elem_filters View documentation} - * - * @example - * This will configure a choose-elem-button of type `"entity"` to only show items of type `"furnace"`. - * - * ```lua - * button.elem_filters = {{filter = "type", type = "furnace"}} - * ``` - * - * @example - * Then, there are some types of filters that work on a specific kind of attribute. The following will configure a choose-elem-button of type `"entity"` to only show entities that have their `"hidden"` {@link EntityPrototypeFlags flags} set. - * - * ```lua - * button.elem_filters = {{filter = "hidden"}} - * ``` - * - * @example - * Lastly, these filters can be combined at will, taking care to specify how they should be combined (either `"and"` or `"or"`. The following will filter for any `"entities"` that are `"furnaces"` and that are not `"hidden"`. - * - * ```lua - * button.elem_filters = {{filter = "type", type = "furnace"}, {filter = "hidden", invert = true, mode = "and"}} - * ``` - */ - elem_filters: ChooseElemButtonFilters[this["elem_type"]] | undefined - /** - * Whether this choose-elem-button can be changed by the player. - * - * *Can only be used if this is choose-elem-button* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.locked View documentation} - */ - locked: boolean -} - -type ChooseElemButtonGuiElement = ChooseElemButtonGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface DropDownGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "drop-down" -} - -type DropDownGuiElement = DropDownGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface EmptyWidgetGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "empty-widget" -} - -type EmptyWidgetGuiElement = EmptyWidgetGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface EntityPreviewGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "entity-preview" -} - -type EntityPreviewGuiElement = EntityPreviewGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface ListBoxGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "list-box" - /** - * Scrolls the scroll bar such that the specified listbox item is visible to the player. - * - * *Can only be used if this is list-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_item View documentation} - * - * @param index - The item index to scroll to. - * @param scroll_mode - Where the item should be positioned in the scroll-pane. Must be either `"in-view"` or - * `"top-third"`. Defaults to `"in-view"`. - */ - scroll_to_item(index: int, scroll_mode?: "in-view" | "top-third"): void -} - -type ListBoxGuiElement = ListBoxGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface ScrollPaneGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "scroll-pane" - /** - * Scrolls this scroll bar to the top. - * - * *Can only be used if this is scroll-pane or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_top View documentation} - */ - scroll_to_top(): void - /** - * Scrolls this scroll bar to the bottom. - * - * *Can only be used if this is scroll-pane or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_bottom View documentation} - */ - scroll_to_bottom(): void - /** - * Scrolls this scroll bar to the left. - * - * *Can only be used if this is scroll-pane or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_left View documentation} - */ - scroll_to_left(): void - /** - * Scrolls this scroll bar to the right. - * - * *Can only be used if this is scroll-pane or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_right View documentation} - */ - scroll_to_right(): void - /** - * Scrolls this scroll bar such that the specified GUI element is visible to the player. - * - * *Can only be used if this is scroll-pane* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_element View documentation} - * - * @param element - The element to scroll to. - * @param scroll_mode - Where the element should be positioned in the scroll-pane. Must be either `"in-view"` or - * `"top-third"`. Defaults to `"in-view"`. - */ - scroll_to_element(element: LuaGuiElement, scroll_mode?: "in-view" | "top-third"): void - /** - * Policy of the horizontal scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, - * `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. - * - * *Can only be used if this is scroll-pane* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.horizontal_scroll_policy View documentation} - */ - horizontal_scroll_policy: "auto" | "never" | "always" | "auto-and-reserve-space" | "dont-show-but-allow-scrolling" - /** - * Policy of the vertical scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, - * `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. - * - * *Can only be used if this is scroll-pane* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.vertical_scroll_policy View documentation} - */ - vertical_scroll_policy: "auto" | "never" | "always" | "auto-and-reserve-space" | "dont-show-but-allow-scrolling" -} - -type ScrollPaneGuiElement = ScrollPaneGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface SpriteButtonGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "sprite-button" - /** - * The image to display on this sprite-button when it is hovered. - * - * *Can only be used if this is sprite-button* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.hovered_sprite View documentation} - */ - hovered_sprite: SpritePath -} - -type SpriteButtonGuiElement = SpriteButtonGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface TabbedPaneGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "tabbed-pane" - /** - * Adds the given tab and content widgets to this tabbed pane as a new tab. - * - * *Can only be used if this is tabbed-pane* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.add_tab View documentation} - * - * @param tab - The tab to add, must be a GUI element of type "tab". - * @param content - The content to show when this tab is selected. Can be any type of GUI element. - */ - add_tab(tab: LuaGuiElement, content: LuaGuiElement): void - /** - * Removes the given tab and its associated content from this tabbed pane. - * - * **Note**: Removing a tab does not destroy the tab or the tab contents. It just removes them from the view. - * - * **Note**: When removing tabs, {@link LuaGuiElement.selected_tab_index LuaGuiElement::selected_tab_index} needs to - * be manually updated. - * - * *Can only be used if this is tabbed-pane* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.remove_tab View documentation} - * - * @param tab - The tab to remove. If not given, it removes all tabs. - */ - remove_tab(tab: LuaGuiElement): void - /** - * The selected tab index for this tabbed pane or `nil` if no tab is selected. - * - * *Can only be used if this is tabbed-pane* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.selected_tab_index View documentation} - */ - selected_tab_index: uint | undefined -} - -type TabbedPaneGuiElement = TabbedPaneGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface TextBoxGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "text-box" - /** - * Scrolls this scroll bar to the top. - * - * *Can only be used if this is scroll-pane or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_top View documentation} - */ - scroll_to_top(): void - /** - * Scrolls this scroll bar to the bottom. - * - * *Can only be used if this is scroll-pane or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_bottom View documentation} - */ - scroll_to_bottom(): void - /** - * Scrolls this scroll bar to the left. - * - * *Can only be used if this is scroll-pane or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_left View documentation} - */ - scroll_to_left(): void - /** - * Scrolls this scroll bar to the right. - * - * *Can only be used if this is scroll-pane or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.scroll_to_right View documentation} - */ - scroll_to_right(): void - /** - * Selects all the text in this textbox. - * - * *Can only be used if this is textfield or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.select_all View documentation} - */ - select_all(): void - /** - * Selects a range of text in this textbox. - * - * *Can only be used if this is textfield or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.select View documentation} - * - * @example - * Select the characters `amp` from `example`: - * - * ```lua - * textbox.select(3, 5) - * ``` - * - * @example - * Move the cursor to the start of the text box: - * - * ```lua - * textbox.select(1, 0) - * ``` - * - * @param start - The index of the first character to select - * @param end - The index of the last character to select - */ - select(start: int, end: int): void - /** - * The text contained in this textfield or text-box. - * - * *Can only be used if this is textfield or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.text View documentation} - */ - text: string - /** - * Whether the contents of this text-box are selectable. Defaults to `true`. - * - * *Can only be used if this is text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.selectable View documentation} - */ - selectable: boolean - /** - * Whether this text-box will word-wrap automatically. Defaults to `false`. - * - * *Can only be used if this is text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.word_wrap View documentation} - */ - word_wrap: boolean - /** - * Whether this text-box is read-only. Defaults to `false`. - * - * *Can only be used if this is text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.read_only View documentation} - */ - read_only: boolean - /** - * Makes it so right-clicking on this textfield clears and focuses it. - * - * *Can only be used if this is textfield or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.clear_and_focus_on_right_click View documentation} - */ - clear_and_focus_on_right_click: boolean -} - -type TextBoxGuiElement = TextBoxGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface ButtonGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "button" -} - -type ButtonGuiElement = ButtonGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface CameraGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "camera" -} - -type CameraGuiElement = CameraGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface CheckboxGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "checkbox" - /** - * Is this checkbox or radiobutton checked? - * - * *Can only be used if this is CheckBox or RadioButton* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.state View documentation} - */ - state: boolean -} - -type CheckboxGuiElement = CheckboxGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface FlowGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "flow" - /** - * Direction of this element's layout. May be either `"horizontal"` or `"vertical"`. - * - * *Can only be used if this is frame, flow or line* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.direction View documentation} - */ - readonly direction: "horizontal" | "vertical" -} - -type FlowGuiElement = FlowGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface FrameGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "frame" - /** - * Forces this frame to re-auto-center. Only works on frames stored directly in {@link LuaGui.screen LuaGui::screen}. - * - * *Can only be used if this is frame* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.force_auto_center View documentation} - */ - force_auto_center(): void - /** - * Direction of this element's layout. May be either `"horizontal"` or `"vertical"`. - * - * *Can only be used if this is frame, flow or line* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.direction View documentation} - */ - readonly direction: "horizontal" | "vertical" - /** - * Whether this frame auto-centers on window resize when stored in {@link LuaGui.screen LuaGui::screen}. - * - * *Can only be used if this is frame* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.auto_center View documentation} - */ - auto_center: boolean -} - -type FrameGuiElement = FrameGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface LabelGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "label" -} - -type LabelGuiElement = LabelGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface LineGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "line" - /** - * Direction of this element's layout. May be either `"horizontal"` or `"vertical"`. - * - * *Can only be used if this is frame, flow or line* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.direction View documentation} - */ - readonly direction: "horizontal" | "vertical" -} - -type LineGuiElement = LineGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface MinimapGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "minimap" - /** - * The player index this minimap is using. - * - * *Can only be used if this is minimap* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.minimap_player_index View documentation} - */ - minimap_player_index: uint -} - -type MinimapGuiElement = MinimapGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface ProgressbarGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "progressbar" - /** - * How much this progress bar is filled. It is a value in the range [0, 1]. - * - * *Can only be used if this is progressbar* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.value View documentation} - */ - value: double -} - -type ProgressbarGuiElement = ProgressbarGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface RadiobuttonGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "radiobutton" - /** - * Is this checkbox or radiobutton checked? - * - * *Can only be used if this is CheckBox or RadioButton* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.state View documentation} - */ - state: boolean -} - -type RadiobuttonGuiElement = RadiobuttonGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface SliderGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "slider" - /** - * The value of this slider element. - * - * *Can only be used if this is slider* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.slider_value View documentation} - */ - slider_value: double -} - -type SliderGuiElement = SliderGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface SpriteGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "sprite" -} - -type SpriteGuiElement = SpriteGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface SwitchGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "switch" - /** - * The switch state (left, none, right) for this switch. - * - * **Note**: If {@link LuaGuiElement.allow_none_state LuaGuiElement::allow_none_state} is false this can't be set to `"none"`. - * - * *Can only be used if this is switch* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.switch_state View documentation} - */ - switch_state: string - /** - * Whether the `"none"` state is allowed for this switch. - * - * **Note**: This can't be set to false if the current switch_state is 'none'. - * - * *Can only be used if this is switch* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.allow_none_state View documentation} - */ - allow_none_state: boolean - /** - * The text shown for the left switch label. - * - * *Can only be used if this is switch* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.left_label_caption View documentation} - */ - left_label_caption: LocalisedString - /** - * The tooltip shown on the left switch label. - * - * *Can only be used if this is switch* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.left_label_tooltip View documentation} - */ - left_label_tooltip: LocalisedString - /** - * The text shown for the right switch label. - * - * *Can only be used if this is switch* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.right_label_caption View documentation} - */ - right_label_caption: LocalisedString - /** - * The tooltip shown on the right switch label. - * - * *Can only be used if this is switch* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.right_label_tooltip View documentation} - */ - right_label_tooltip: LocalisedString -} - -type SwitchGuiElement = SwitchGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface TabGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "tab" - /** - * The text to display after the normal tab text (designed to work with numbers) - * - * *Can only be used if this is tab* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.badge_text View documentation} - */ - badge_text: LocalisedString -} - -type TabGuiElement = TabGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface TableGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "table" - /** - * Whether this table should draw vertical grid lines. - * - * *Can only be used if this is table* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.draw_vertical_lines View documentation} - */ - draw_vertical_lines: boolean - /** - * Whether this table should draw horizontal grid lines. - * - * *Can only be used if this is table* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.draw_horizontal_lines View documentation} - */ - draw_horizontal_lines: boolean - /** - * Whether this table should draw a horizontal grid line below the first table row. - * - * *Can only be used if this is table* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.draw_horizontal_line_after_headers View documentation} - */ - draw_horizontal_line_after_headers: boolean - /** - * The number of columns in this table. - * - * *Can only be used if this is table* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.column_count View documentation} - */ - readonly column_count: uint - /** - * Whether the content of this table should be vertically centered. Overrides - * {@link LuaStyle.column_alignments LuaStyle::column_alignments}. Defaults to `true`. - * - * *Can only be used if this is table* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.vertical_centering View documentation} - */ - vertical_centering: boolean -} - -type TableGuiElement = TableGuiElementMembers & GuiElementIndex - -/** @noSelf */ -interface TextfieldGuiElementMembers extends BaseGuiElement { - /** - * The type of this GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.type View documentation} - */ - readonly type: "textfield" - /** - * Selects all the text in this textbox. - * - * *Can only be used if this is textfield or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.select_all View documentation} - */ - select_all(): void - /** - * Selects a range of text in this textbox. - * - * *Can only be used if this is textfield or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.select View documentation} - * - * @example - * Select the characters `amp` from `example`: - * - * ```lua - * textbox.select(3, 5) - * ``` - * - * @example - * Move the cursor to the start of the text box: - * - * ```lua - * textbox.select(1, 0) - * ``` - * - * @param start - The index of the first character to select - * @param end - The index of the last character to select - */ - select(start: int, end: int): void - /** - * The text contained in this textfield or text-box. - * - * *Can only be used if this is textfield or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.text View documentation} - */ - text: string - /** - * Whether this textfield is limited to only numberic characters. - * - * *Can only be used if this is textfield* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.numeric View documentation} - */ - numeric: boolean - /** - * Whether this textfield (when in numeric mode) allows decimal numbers. - * - * *Can only be used if this is textfield* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.allow_decimal View documentation} - */ - allow_decimal: boolean - /** - * Whether this textfield (when in numeric mode) allows negative numbers. - * - * *Can only be used if this is textfield* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.allow_negative View documentation} - */ - allow_negative: boolean - /** - * Whether this textfield displays as a password field, which renders all characters as `*`. - * - * *Can only be used if this is textfield* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.is_password View documentation} - */ - is_password: boolean - /** - * Whether this textfield loses focus after {@link defines.events.on_gui_confirmed} is fired. - * - * *Can only be used if this is textfield* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.lose_focus_on_confirm View documentation} - */ - lose_focus_on_confirm: boolean - /** - * Makes it so right-clicking on this textfield clears and focuses it. - * - * *Can only be used if this is textfield or text-box* - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html#LuaGuiElement.clear_and_focus_on_right_click View documentation} - */ - clear_and_focus_on_right_click: boolean -} - -type TextfieldGuiElement = TextfieldGuiElementMembers & GuiElementIndex - -type GuiElementMembers = - | ChooseElemButtonGuiElementMembers - | DropDownGuiElementMembers - | EmptyWidgetGuiElementMembers - | EntityPreviewGuiElementMembers - | ListBoxGuiElementMembers - | ScrollPaneGuiElementMembers - | SpriteButtonGuiElementMembers - | TabbedPaneGuiElementMembers - | TextBoxGuiElementMembers - | ButtonGuiElementMembers - | CameraGuiElementMembers - | CheckboxGuiElementMembers - | FlowGuiElementMembers - | FrameGuiElementMembers - | LabelGuiElementMembers - | LineGuiElementMembers - | MinimapGuiElementMembers - | ProgressbarGuiElementMembers - | RadiobuttonGuiElementMembers - | SliderGuiElementMembers - | SpriteGuiElementMembers - | SwitchGuiElementMembers - | TabGuiElementMembers - | TableGuiElementMembers - | TextfieldGuiElementMembers - -/** - * An element of a custom GUI. This type is used to represent any kind of a GUI element - labels, buttons and frames are - * all instances of this type. Just like {@link LuaEntity}, different kinds of elements support different attributes; - * attempting to access an attribute on an element that doesn't support it (for instance, trying to access the - * `column_count` of a `textfield`) will result in a runtime error. - * - * The following types of GUI element are supported: - * - * - `"button"`: A clickable element. Relevant event: {@link OnGuiClickEvent on_gui_click} - * - `"sprite-button"`: A `button` that displays a sprite rather than text. Relevant event: {@link OnGuiClickEvent on_gui_click} - * - `"checkbox"`: A clickable element with a check mark that can be turned off or on. Relevant event: - * {@link OnGuiCheckedStateChangedEvent on_gui_checked_state_changed} - * - `"flow"`: An invisible container that lays out its children either horizontally or vertically. - * - `"frame"`: A non-transparent box that contains other elements. It can have a title (set via the `caption` attribute). - * Just like a `flow`, it lays out its children either horizontally or vertically. Relevant event: - * {@link OnGuiLocationChangedEvent on_gui_location_changed} - * - `"label"`: A piece of text. - * - `"line"`: A horizontal or vertical separation line. - * - `"progressbar"`: A partially filled bar that can be used to indicate progress. - * - `"table"`: An invisible container that lays out its children in a specific number of columns. The width of each - * column is determined by the widest element it contains. - * - `"textfield"`: A single-line box the user can type into. Relevant events: - * {@link OnGuiTextChangedEvent on_gui_text_changed}, {@link OnGuiConfirmedEvent on_gui_confirmed} - * - `"radiobutton"`: A clickable element that is functionally identical to a `checkbox`, but has a circular appearance. - * Relevant event: {@link OnGuiCheckedStateChangedEvent on_gui_checked_state_changed} - * - `"sprite"`: An element that shows an image. - * - `"scroll-pane"`: An invisible element that is similar to a `flow`, but has the ability to show and use scroll bars. - * - `"drop-down"`: A drop-down containing strings of text. Relevant event: - * {@link OnGuiSelectionStateChangedEvent on_gui_selection_state_changed} - * - `"list-box"`: A list of strings, only one of which can be selected at a time. Shows a scroll bar if necessary. - * Relevant event: {@link OnGuiSelectionStateChangedEvent on_gui_selection_state_changed} - * - `"camera"`: A camera that shows the game at the given position on the given surface. It can visually track an - * {@link LuaGuiElement.entity entity} that is set after the element has been created. - * - `"choose-elem-button"`: A button that lets the player pick from a certain kind of prototype, with optional filtering. - * Relevant event: {@link OnGuiElemChangedEvent on_gui_elem_changed} - * - `"text-box"`: A multi-line `textfield`. Relevant event: {@link OnGuiTextChangedEvent on_gui_text_changed} - * - `"slider"`: A horizontal number line which can be used to choose a number. Relevant event: - * {@link OnGuiValueChangedEvent on_gui_value_changed} - * - `"minimap"`: A minimap preview, similar to the normal player minimap. It can visually track an - * {@link LuaGuiElement.entity entity} that is set after the element has been created. - * - `"entity-preview"`: A preview of an entity. The {@link LuaGuiElement.entity entity} has to be set after the element - * has been created. - * - `"empty-widget"`: An empty element that just exists. The root GUI elements `screen` and `relative` are `empty-widget`s. - * - `"tabbed-pane"`: A collection of `tab`s and their contents. Relevant event: - * {@link OnGuiSelectedTabChangedEvent on_gui_selected_tab_changed} - * - `"tab"`: A tab for use in a `tabbed-pane`. - * - `"switch"`: A switch with three possible states. Can have labels attached to either side. Relevant event: - * {@link OnGuiSwitchStateChangedEvent on_gui_switch_state_changed} - * - * Each GUI element allows access to its children by having them as attributes. Thus, one can use the `parent.child` - * syntax to refer to children. Lua also supports the `parent["child"]` syntax to refer to the same element. This can be - * used in cases where the child has a name that isn't a valid Lua identifier. - * - * {@link https://lua-api.factorio.com/next/LuaGuiElement.html View documentation} - * - * @example - * This will add a label called `greeting` to the top flow. Immediately after, it will change its text to illustrate accessing child elements. - * - * ```lua - * game.player.gui.top.add{type="label", name="greeting", caption="Hi"} - * game.player.gui.top.greeting.caption = "Hello there!" - * game.player.gui.top["greeting"].caption = "Actually, never mind, I don't like your face" - * ``` - * - * @example - * This will add a tabbed-pane and 2 tabs with contents. - * - * ```lua - * local tabbed_pane = game.player.gui.top.add{type="tabbed-pane"} - * local tab1 = tabbed_pane.add{type="tab", caption="Tab 1"} - * local tab2 = tabbed_pane.add{type="tab", caption="Tab 2"} - * local label1 = tabbed_pane.add{type="label", caption="Label 1"} - * local label2 = tabbed_pane.add{type="label", caption="Label 2"} - * tabbed_pane.add_tab(tab1, label1) - * tabbed_pane.add_tab(tab2, label2) - * ``` - */ -type LuaGuiElement = GuiElementMembers & GuiElementIndex - -/** - * Prototype of a heat energy source. - * - * {@link https://lua-api.factorio.com/next/LuaHeatEnergySourcePrototype.html View documentation} - * - * @noSelf - */ -interface LuaHeatEnergySourcePrototype { - readonly emissions: double - readonly render_no_network_icon: boolean - readonly render_no_power_icon: boolean - readonly max_temperature: double - readonly default_temperature: double - readonly specific_heat: double - readonly max_transfer: double - readonly min_temperature_gradient: double - readonly min_working_temperature: double - readonly minimum_glow_temperature: double - readonly connections: HeatConnection[] - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaHeatEnergySourcePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for inserters. - * - * {@link https://lua-api.factorio.com/next/LuaInserterControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaInserterControlBehavior extends LuaGenericOnOffControlBehavior { - /** - * `true` if the contents of the inserter hand should be sent to the circuit network - * - * {@link https://lua-api.factorio.com/next/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_read_hand_contents View documentation} - */ - circuit_read_hand_contents: boolean - /** - * The circuit mode of operations for the inserter. - * - * {@link https://lua-api.factorio.com/next/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_mode_of_operation View documentation} - */ - circuit_mode_of_operation: defines.control_behavior.inserter.circuit_mode_of_operation - /** - * The hand read mode for the inserter. - * - * {@link https://lua-api.factorio.com/next/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_hand_read_mode View documentation} - */ - circuit_hand_read_mode: defines.control_behavior.inserter.hand_read_mode - /** - * If the stack size of the inserter is set through the circuit network or not. - * - * {@link https://lua-api.factorio.com/next/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_set_stack_size View documentation} - */ - circuit_set_stack_size: boolean - /** - * The signal used to set the stack size of the inserter. - * - * {@link https://lua-api.factorio.com/next/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_stack_control_signal View documentation} - */ - circuit_stack_control_signal: SignalID - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaInserterControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A storage of item stacks. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html View documentation} - * - * @noSelf - */ -interface LuaInventory extends ReadonlyArray { - /** - * Make this inventory empty. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.clear View documentation} - */ - clear(): void - /** - * Can at least some items be inserted? - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.can_insert View documentation} - * - * @param items - Items that would be inserted. - * @returns `true` if at least a part of the given items could be inserted into this inventory. - */ - can_insert(items: ItemStackIdentification): boolean - /** - * Insert items into this inventory. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.insert View documentation} - * - * @param items - Items to insert. - * @returns Number of items actually inserted. - */ - insert(items: ItemStackIdentification): uint - /** - * Remove items from this inventory. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.remove View documentation} - * - * @param items - Items to remove. - * @returns Number of items actually removed. - */ - remove(items: ItemStackIdentification): uint - /** - * Get the number of all or some items in this inventory. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.get_item_count View documentation} - * - * @param item - Prototype name of the item to count. If not specified, count all items. - */ - get_item_count(item?: string): uint - /** - * Does this inventory contain nothing? - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.is_empty View documentation} - */ - is_empty(): boolean - /** - * Get counts of all items in this inventory. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.get_contents View documentation} - * - * @returns The counts, indexed by item names. - */ - get_contents(): Record - /** - * Does this inventory support a bar? Bar is the draggable red thing, found for example on chests, that limits the - * portion of the inventory that may be manipulated by machines. - * - * **Note**: "Supporting a bar" doesn't mean that the bar is set to some nontrivial value. Supporting a bar means - * the inventory supports having this limit at all. The character's inventory is an example of an inventory without - * a bar; the wooden chest's inventory is an example of one with a bar. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.supports_bar View documentation} - */ - supports_bar(): boolean - /** - * Get the current bar. This is the index at which the red area starts. - * - * **Note**: Only useable if this inventory supports having a bar. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.get_bar View documentation} - */ - get_bar(): uint - /** - * Set the current bar. - * - * **Note**: Only useable if this inventory supports having a bar. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.set_bar View documentation} - * - * @param bar - The new limit. Omitting this parameter will clear the limit. - */ - set_bar(bar?: uint): void - /** - * If this inventory supports filters. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.supports_filters View documentation} - */ - supports_filters(): boolean - /** - * If this inventory supports filters and has at least 1 filter set. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.is_filtered View documentation} - */ - is_filtered(): boolean - /** - * If the given inventory slot filter can be set to the given filter. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.can_set_filter View documentation} - * - * @param index - The item stack index - * @param filter - The item name of the filter - */ - can_set_filter(index: uint, filter: string): boolean - /** - * Gets the filter for the given item stack index. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.get_filter View documentation} - * - * @param index - The item stack index - * @returns The current filter or nil if none. - */ - get_filter(index: uint): string | undefined - /** - * Sets the filter for the given item stack index. - * - * **Note**: Some inventory slots don't allow some filters (gun ammo can't be filtered for non-ammo). - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.set_filter View documentation} - * - * @param index - The item stack index - * @param filter - The new filter or nil to erase the filter - * @returns If the filter was allowed to be set. - */ - set_filter(index: uint, filter: string | undefined): boolean - /** - * Gets the first LuaItemStack in the inventory that matches the given item name. - * - * **Note**: This will also return the stack index if one is found that matches as a second return value. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.find_item_stack View documentation} - * - * @param item - The item name to find - * @returns The first matching stack, or `nil` if none match. - */ - find_item_stack(item: string): LuaMultiReturn<[undefined] | [LuaItemStack, uint]> - /** - * Finds the first empty stack. Filtered slots are excluded unless a filter item is given. - * - * **Note**: This will also return the stack index if one is found that matches as a second return value. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.find_empty_stack View documentation} - * - * @param item - If given, empty stacks that are filtered for this item will be included. - * @returns The first empty stack, or `nil` if there aren't any empty stacks. - */ - find_empty_stack(item?: string): LuaMultiReturn<[undefined] | [LuaItemStack, uint]> - /** - * Counts the number of empty stacks. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.count_empty_stacks View documentation} - * - * @param include_filtered - If true, filtered slots will be included. Defaults to false. - */ - count_empty_stacks(include_filtered?: boolean): uint - /** - * Gets the number of the given item that can be inserted into this inventory. - * - * **Note**: This is a "best guess" number; things like assembling machine filtered slots, module slots, items with - * durability, and items with mixed health will cause the result to be inaccurate. - * - * **Note**: The main use for this is in checking how many of a basic item can fit into a basic inventory. - * - * **Note**: This accounts for the 'bar' on the inventory. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.get_insertable_count View documentation} - * - * @param item - The item to check. - */ - get_insertable_count(item: string): void - /** - * Sorts and merges the items in this inventory. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.sort_and_merge View documentation} - */ - sort_and_merge(): void - /** - * Resizes the inventory. - * - * **Note**: Items in slots beyond the new capacity are deleted. - * - * **Note**: Only inventories created by {@link LuaGameScript.create_inventory LuaGameScript::create_inventory} can be resized. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.resize View documentation} - * - * @param size - New size of a inventory - */ - resize(size: uint16): void - /** - * Destroys this inventory. - * - * **Note**: Only inventories created by {@link LuaGameScript.create_inventory LuaGameScript::create_inventory} can - * be destroyed this way. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.destroy View documentation} - */ - destroy(): void - /** - * Get the number of slots in this inventory. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.operator%20# View documentation} - * - * @example - * Will print the number of slots in the player's main inventory. - * - * ```lua - * game.player.print(#game.player.get_main_inventory()) - * ``` - */ - readonly length: uint - /** - * The inventory index this inventory uses, or `nil` if the inventory doesn't have an index. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.index View documentation} - */ - readonly index: defines.inventory | undefined - /** - * The entity that owns this inventory or `nil` if this isn't owned by an entity. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.entity_owner View documentation} - */ - readonly entity_owner: LuaEntity | undefined - /** - * The player that owns this inventory or `nil` if this isn't owned by a player. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.player_owner View documentation} - */ - readonly player_owner: LuaPlayer | undefined - /** - * The equipment that owns this inventory or `nil` if this isn't owned by an equipment. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.equipment_owner View documentation} - */ - readonly equipment_owner: LuaEquipment | undefined - /** - * The mod that owns this inventory or `nil` if this isn't owned by a mod. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.mod_owner View documentation} - */ - readonly mod_owner: string | undefined - /** - * The indexing operator. - * - * {@link https://lua-api.factorio.com/next/LuaInventory.html#LuaInventory.operator%20[] View documentation} - * - * @example - * Will get the first item in the player's inventory. - * - * ```lua - * game.player.get_main_inventory()[1] - * ``` - */ - readonly [index: number]: LuaItemStack - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaInventory" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of an item. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html View documentation} - * - * @example - * ```lua - * game.item_prototypes["iron-plate"] - * ``` - * - * @noSelf - */ -interface LuaItemPrototype { - /** - * Does this prototype have a flag enabled? - * - * Any other value will cause an error. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.has_flag View documentation} - * - * @param flag - The flag to check. Can be one of {@link ItemPrototypeFlags} - */ - has_flag(flag: string): boolean - /** - * Type of this ammo prototype or `nil` if this is not an ammo prototype. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.get_ammo_type View documentation} - * - * @param ammo_source_type - "default", "player", "turret", or "vehicle" - */ - get_ammo_type(ammo_source_type?: "default" | "player" | "turret" | "vehicle"): AmmoType | undefined - /** - * Type of this prototype. E.g. `"gun"` or `"mining-tool"`. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.type View documentation} - */ - readonly type: "gun" | "mining-tool" - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.name View documentation} - */ - readonly name: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Order string. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.order View documentation} - */ - readonly order: string - /** - * Prototype of the entity that will be created by placing this item, or `nil` if there is no such entity. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.place_result View documentation} - */ - readonly place_result: LuaEntityPrototype | undefined - /** - * Prototype of the equipment that will be created by placing this item in an equipment grid or `nil` if there is no - * equipment defined. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.place_as_equipment_result View documentation} - */ - readonly place_as_equipment_result: LuaEquipmentPrototype | undefined - /** - * The place-as-tile result if one is defined, else `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.place_as_tile_result View documentation} - */ - readonly place_as_tile_result: PlaceAsTileResult | undefined - /** - * Is this item allowed to stack at all? - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.stackable View documentation} - */ - readonly stackable: boolean - /** - * The default request value. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.default_request_amount View documentation} - */ - readonly default_request_amount: uint - /** - * Maximum stack size of the item specified by this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.stack_size View documentation} - */ - readonly stack_size: uint - /** - * The number of items needed to connect 2 entities with this as wire. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.wire_count View documentation} - */ - readonly wire_count: uint - /** - * The fuel category or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.fuel_category View documentation} - */ - readonly fuel_category: string | undefined - /** - * The result of burning this item as fuel or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.burnt_result View documentation} - */ - readonly burnt_result: LuaItemPrototype | undefined - /** - * Fuel value when burned. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.fuel_value View documentation} - */ - readonly fuel_value: float - /** - * The acceleration multiplier when this item is used as fuel in a vehicle. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.fuel_acceleration_multiplier View documentation} - */ - readonly fuel_acceleration_multiplier: double - /** - * The fuel top speed multiplier when this item is used as fuel in a vehicle. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.fuel_top_speed_multiplier View documentation} - */ - readonly fuel_top_speed_multiplier: double - /** - * The emissions multiplier if this is used as fuel. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.fuel_emissions_multiplier View documentation} - */ - readonly fuel_emissions_multiplier: double - /** - * The subgroup this prototype belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.subgroup View documentation} - */ - readonly subgroup: LuaGroup - /** - * The group this prototype belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.group View documentation} - */ - readonly group: LuaGroup - /** - * The item prototype flags for this item prototype. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.flags View documentation} - */ - readonly flags: ItemPrototypeFlags - /** - * The results from launching this item in a rocket. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.rocket_launch_products View documentation} - */ - readonly rocket_launch_products: Product[] - /** - * If this item can be mod-opened. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.can_be_mod_opened View documentation} - */ - readonly can_be_mod_opened: boolean - /** - * Size of full magazine; `nil` if this is not an ammo item. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.magazine_size View documentation} - */ - readonly magazine_size: float | undefined - /** - * Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine or `nil` if this is - * not an ammo item. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.reload_time View documentation} - */ - readonly reload_time: float | undefined - /** - * The prototype of this armor equipment grid or `nil` if none or this is not an armor item. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.equipment_grid View documentation} - */ - readonly equipment_grid: LuaEquipmentGridPrototype | undefined - /** - * Resistances of this armour item, indexed by damage type name. `nil` if not an armor or the armor has no resistances. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.resistances View documentation} - */ - readonly resistances: Record | undefined - /** - * The inventory size bonus for this armor prototype. `nil` if this isn't an armor prototype. - * - * *Can only be used if this is ArmorPrototype* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.inventory_size_bonus View documentation} - */ - readonly inventory_size_bonus: uint | undefined - /** - * The capsule action for this capsule item prototype or `nil` if this isn't a capsule item prototype. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.capsule_action View documentation} - */ - readonly capsule_action: CapsuleAction | undefined - /** - * The gun attack parameters or `nil` if not a gun item prototype. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.attack_parameters View documentation} - */ - readonly attack_parameters: AttackParameters | undefined - /** - * The main inventory size for item-with-inventory-prototype. `nil` if not an item-with-inventory-prototype. - * - * *Can only be used if this is ItemWithInventoryPrototype* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.inventory_size View documentation} - */ - readonly inventory_size: uint | undefined - /** - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.item_filters View documentation} - */ - readonly item_filters: Record - /** - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.item_group_filters View documentation} - */ - readonly item_group_filters: Record - /** - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.item_subgroup_filters View documentation} - */ - readonly item_subgroup_filters: Record - /** - * The filter mode used by this item with inventory. - * - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.filter_mode View documentation} - */ - readonly filter_mode: string - /** - * The insertion priority mode used by this item with inventory. - * - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.insertion_priority_mode View documentation} - */ - readonly insertion_priority_mode: string - /** - * The localised string used when the player attempts to put items into this item with inventory that aren't allowed. - * - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.localised_filter_message View documentation} - */ - readonly localised_filter_message: LocalisedString - /** - * If this item with inventory extends the inventory it resides in by default. - * - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.extend_inventory_by_default View documentation} - */ - readonly extend_inventory_by_default: boolean - /** - * The default label color used for this item with label. `nil` if not defined or if this isn't an item with label. - * - * *Can only be used if this is ItemWithLabel* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.default_label_color View documentation} - */ - readonly default_label_color: ColorTable | undefined - /** - * If true, and this item with label has a label it is drawn in place of the normal number when held in the cursor. - * - * *Can only be used if this is ItemWithLabel* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.draw_label_for_cursor_render View documentation} - */ - readonly draw_label_for_cursor_render: boolean - /** - * The repairing speed if this is a repairing tool; otherwise `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.speed View documentation} - */ - readonly speed: float | undefined - /** - * Effects of this module; `nil` if this is not a module. - * - * *Can only be used if this is ModuleItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.module_effects View documentation} - */ - readonly module_effects: ModuleEffects | undefined - /** - * The name of a {@link LuaModuleCategoryPrototype}. Used when upgrading modules: Ctrl + click modules into an entity - * and it will replace lower tier modules of the same category with higher tier modules. - * - * *Can only be used if this is ModuleItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.category View documentation} - */ - readonly category: string - /** - * Tier of the module inside its category. Used when upgrading modules: Ctrl + click modules into an entity and it - * will replace lower tier modules with higher tier modules if they have the same category. - * - * *Can only be used if this is ModuleItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.tier View documentation} - */ - readonly tier: uint - /** - * An array of recipe names this module is allowed to work with. Empty when all recipes are allowed. - * - * *Can only be used if this is ModuleItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.limitations View documentation} - */ - readonly limitations: string[] - /** - * The limitation message key used when the player attempts to use this modules in some place it's not allowed. - * - * *Can only be used if this is ModuleItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.limitation_message_key View documentation} - */ - readonly limitation_message_key: string - /** - * The straight rail prototype used for this rail planner prototype. - * - * *Can only be used if this is RailPlanner* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.straight_rail View documentation} - */ - readonly straight_rail: LuaEntityPrototype - /** - * The curved rail prototype used for this rail planner prototype. - * - * *Can only be used if this is RailPlanner* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.curved_rail View documentation} - */ - readonly curved_rail: LuaEntityPrototype - /** - * The repair result of this repair tool prototype or `nil` if this isn't a repair tool prototype. - * - * *Can only be used if this is RepairTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.repair_result View documentation} - */ - readonly repair_result: TriggerItem[] | undefined - /** - * The color used when doing normal selection with this selection tool prototype. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.selection_border_color View documentation} - */ - readonly selection_border_color: ColorTable - /** - * The color used when doing alt selection with this selection tool prototype. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.alt_selection_border_color View documentation} - */ - readonly alt_selection_border_color: ColorTable - /** - * Flags that affect which entities will be selected. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.selection_mode_flags View documentation} - */ - readonly selection_mode_flags: SelectionModeFlags - /** - * Flags that affect which entities will be selected during alternate selection. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.alt_selection_mode_flags View documentation} - */ - readonly alt_selection_mode_flags: SelectionModeFlags - /** - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.selection_cursor_box_type View documentation} - */ - readonly selection_cursor_box_type: string - /** - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.alt_selection_cursor_box_type View documentation} - */ - readonly alt_selection_cursor_box_type: string - /** - * If tiles area always included when doing selection with this selection tool prototype. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.always_include_tiles View documentation} - */ - readonly always_include_tiles: boolean - /** - * The entity filter mode used by this selection tool. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.entity_filter_mode View documentation} - */ - readonly entity_filter_mode: string - /** - * The alt entity filter mode used by this selection tool. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.alt_entity_filter_mode View documentation} - */ - readonly alt_entity_filter_mode: string - /** - * The tile filter mode used by this selection tool. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.tile_filter_mode View documentation} - */ - readonly tile_filter_mode: string - /** - * The alt tile filter mode used by this selection tool. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.alt_tile_filter_mode View documentation} - */ - readonly alt_tile_filter_mode: string - /** - * The entity filters used by this selection tool indexed by entity name. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.entity_filters View documentation} - */ - readonly entity_filters: Record - /** - * The alt entity filters used by this selection tool indexed by entity name. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.alt_entity_filters View documentation} - */ - readonly alt_entity_filters: Record - /** - * The entity type filters used by this selection tool indexed by entity type. - * - * **Note**: The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.entity_type_filters View documentation} - */ - readonly entity_type_filters: Record - /** - * The alt entity type filters used by this selection tool indexed by entity type. - * - * **Note**: The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.alt_entity_type_filters View documentation} - */ - readonly alt_entity_type_filters: Record - /** - * The tile filters used by this selection tool indexed by tile name. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.tile_filters View documentation} - */ - readonly tile_filters: Record - /** - * The alt tile filters used by this selection tool indexed by tile name. - * - * *Can only be used if this is SelectionTool* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.alt_tile_filters View documentation} - */ - readonly alt_tile_filters: Record - /** - * The number of entity filters this deconstruction item has or `nil` if this isn't a deconstruction item prototype. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.entity_filter_slots View documentation} - */ - readonly entity_filter_slots: uint | undefined - /** - * The number of tile filters this deconstruction item has or `nil` if this isn't a deconstruction item prototype. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.tile_filter_slots View documentation} - */ - readonly tile_filter_slots: uint | undefined - /** - * The durability message key used when displaying the durability of this tool. - * - * *Can only be used if this is ToolItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.durability_description_key View documentation} - */ - readonly durability_description_key: string - /** - * The durability of this tool item or `nil` if not a tool item. - * - * *Can only be used if this is ToolItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.durability View documentation} - */ - readonly durability: double | undefined - /** - * If this tool item has infinite durability. `nil` if not a tool type item. - * - * *Can only be used if this is ToolItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.infinite View documentation} - */ - readonly infinite: boolean | undefined - /** - * How many filters an upgrade item has. `nil` if not a upgrade item. - * - * *Can only be used if this is UpgradeItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemPrototype.html#LuaItemPrototype.mapper_count View documentation} - */ - readonly mapper_count: uint | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaItemPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A reference to an item and count owned by some external entity. - * - * **Note**: In most instances this is a simple reference as in: it points at a specific slot in an inventory and not - * the item in the slot. - * - * **Note**: In the instance this references an item on a {@link LuaTransportLine} the reference is only guaranteed to - * stay valid (and refer to the same item) as long as nothing changes the transport line. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html View documentation} - * - * @noSelf - */ -interface LuaItemStack { - /** - * Is this blueprint item setup? I.e. is it a non-empty blueprint? - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_blueprint_setup View documentation} - */ - is_blueprint_setup(): boolean - /** - * The entities in this blueprint. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_blueprint_entities View documentation} - */ - get_blueprint_entities(): BlueprintEntity[] - /** - * Set new entities to be a part of this blueprint. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_blueprint_entities View documentation} - * - * @param entities - The new blueprint entities. - */ - set_blueprint_entities(entities: BlueprintEntity[]): void - /** - * Add ammo to this ammo item. - * - * *Can only be used if this is AmmoItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.add_ammo View documentation} - * - * @param amount - Amount of ammo to add. - */ - add_ammo(amount: float): void - /** - * Remove ammo from this ammo item. - * - * *Can only be used if this is AmmoItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.drain_ammo View documentation} - * - * @param amount - Amount of ammo to remove. - */ - drain_ammo(amount: float): void - /** - * Add durability to this tool item. - * - * *Can only be used if this is ToolItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.add_durability View documentation} - * - * @param amount - Amount of durability to add. - */ - add_durability(amount: double): void - /** - * Remove durability from this tool item. - * - * *Can only be used if this is ToolItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.drain_durability View documentation} - * - * @param amount - Amount of durability to remove. - */ - drain_durability(amount: double): void - /** - * Would a call to {@link LuaItemStack.set_stack LuaItemStack::set_stack} succeed? - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.can_set_stack View documentation} - * - * @param stack - Stack that would be set, possibly `nil`. - */ - can_set_stack(stack?: ItemStackIdentification): boolean - /** - * Set this item stack to another item stack. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_stack View documentation} - * - * @param stack - Item stack to set this one to. Omitting this parameter or passing `nil` will clear this item - * stack, as if by calling {@link LuaItemStack.clear LuaItemStack::clear}. - * @returns Was the stack set successfully? - */ - set_stack(stack?: ItemStackIdentification): boolean - /** - * Transfers the given item stack into this item stack. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.transfer_stack View documentation} - * - * @param stack - * @returns True if the full stack was transferred. - */ - transfer_stack(stack: ItemStackIdentification): boolean - /** - * Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.export_stack View documentation} - * - * @returns The exported string - */ - export_stack(): string - /** - * Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.import_stack View documentation} - * - * @param data - The string to import - * @returns 0 if the import succeeded with no errors. -1 if the import succeeded with errors. 1 if the import failed. - */ - import_stack(data: string): int - /** - * Swaps this item stack with the given item stack if allowed. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.swap_stack View documentation} - * - * @param stack - * @returns If the 2 stacks were swapped successfully. - */ - swap_stack(stack: LuaItemStack): boolean - /** - * Clear this item stack. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.clear View documentation} - */ - clear(): void - /** - * A list of the tiles in this blueprint. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_blueprint_tiles View documentation} - */ - get_blueprint_tiles(): Tile[] - /** - * Set specific tiles in this blueprint. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_blueprint_tiles View documentation} - * - * @param tiles - Tiles to be a part of the blueprint. - */ - set_blueprint_tiles(tiles: Tile[]): void - /** - * Access the inner inventory of an item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_inventory View documentation} - * - * @param inventory - Index of the inventory to access -- currently can only be {@link defines.inventory.item_main}. - * @returns Or `nil` if there is no inventory with the given index. - */ - get_inventory(inventory: defines.inventory): LuaInventory | undefined - /** - * Build this blueprint - * - * **Note**: Built entities can be come invalid between the building of the blueprint and the function returning if - * by_player or raise_built is used and one of those events invalidates the entity. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.build_blueprint View documentation} - * - * @returns Array of created ghosts - */ - build_blueprint(params: { - /** Surface to build on */ - readonly surface: SurfaceIdentification - /** Force to use for the building */ - readonly force: ForceIdentification - /** The position to build at */ - readonly position: Position - /** When true, anything that can be built is else nothing is built if any one thing can't be built */ - readonly force_build?: boolean - /** The direction to use when building */ - readonly direction?: defines.direction - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - /** - * The player to use if any. If provided {@link defines.events.on_built_entity} will also be fired on successful - * entity creation. - */ - readonly by_player?: PlayerIdentification - /** - * If true; {@link defines.events.script_raised_built} will be fired on successful entity creation. Note: this is - * ignored if by_player is provided. - */ - readonly raise_built?: boolean - }): LuaEntity[] - /** - * Deconstruct the given area with this deconstruction item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.deconstruct_area View documentation} - */ - deconstruct_area(params: { - /** Surface to deconstruct on */ - readonly surface: SurfaceIdentification - /** Force to use for the deconstruction */ - readonly force: ForceIdentification - /** The area to deconstruct */ - readonly area: BoundingBox - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - /** The player to use if any. */ - readonly by_player?: PlayerIdentification - }): void - /** - * Cancel deconstruct the given area with this deconstruction item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.cancel_deconstruct_area View documentation} - */ - cancel_deconstruct_area(params: { - /** Surface to cancel deconstruct on */ - readonly surface: SurfaceIdentification - /** Force to use for canceling deconstruction */ - readonly force: ForceIdentification - /** The area to deconstruct */ - readonly area: BoundingBox - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - /** The player to use if any. */ - readonly by_player?: PlayerIdentification - }): void - /** - * Sets up this blueprint using the found blueprintable entities/tiles on the surface. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.create_blueprint View documentation} - * - * @returns The blueprint entity index to source entity mapping. - */ - create_blueprint(params: { - /** Surface to create from */ - readonly surface: SurfaceIdentification - /** Force to use for the creation */ - readonly force: ForceIdentification - /** The bounding box */ - readonly area: BoundingBox - /** - * When true, blueprintable tiles are always included in the blueprint. When false they're only included if no - * entities exist in the setup area. - */ - readonly always_include_tiles?: boolean - /** When true, entities are included in the blueprint. Defaults to true. */ - readonly include_entities?: boolean - /** When true, modules are included in the blueprint. Defaults to true. */ - readonly include_modules?: boolean - /** When true, station names are included in the blueprint. Defaults to false. */ - readonly include_station_names?: boolean - /** When true, trains are included in the blueprint. Defaults to false. */ - readonly include_trains?: boolean - /** When true, train fuel is included in the blueprint, Defaults to true. */ - readonly include_fuel?: boolean - }): Record - /** - * Gets the tag with the given name or returns `nil` if it doesn't exist. - * - * *Can only be used if this is ItemWithTags* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_tag View documentation} - * - * @param tag_name - */ - get_tag(tag_name: string): AnyBasic | undefined - /** - * Sets the tag with the given name and value. - * - * *Can only be used if this is ItemWithTags* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_tag View documentation} - * - * @param tag_name - * @param tag - */ - set_tag(tag_name: string, tag: AnyBasic): AnyBasic - /** - * Removes a tag with the given name. - * - * *Can only be used if this is ItemWithTags* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.remove_tag View documentation} - * - * @param tag - * @returns If the tag existed and was removed. - */ - remove_tag(tag: string): boolean - /** - * Clears this blueprint item. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.clear_blueprint View documentation} - */ - clear_blueprint(): void - /** - * Gets the entity filter at the given index for this deconstruction item. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_entity_filter View documentation} - * - * @param index - */ - get_entity_filter(index: uint): string - /** - * Sets the entity filter at the given index for this deconstruction item. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_entity_filter View documentation} - * - * @param index - * @param filter - Setting to nil erases the filter. - * @returns If the new filter was set (was valid.) - */ - set_entity_filter(index: uint, filter: string | LuaEntityPrototype | LuaEntity | undefined): boolean - /** - * Gets the tile filter at the given index for this deconstruction item. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_tile_filter View documentation} - * - * @param index - */ - get_tile_filter(index: uint): string - /** - * Sets the tile filter at the given index for this deconstruction item. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_tile_filter View documentation} - * - * @param index - * @param filter - Setting to nil erases the filter. - * @returns If the new filter was set (was valid.) - */ - set_tile_filter(index: uint, filter: string | LuaTilePrototype | LuaTile | undefined): boolean - /** - * Clears all settings/filters on this deconstruction item resetting it to default values. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.clear_deconstruction_item View documentation} - */ - clear_deconstruction_item(): void - /** - * Clears all settings/filters on this upgrade item resetting it to default values. - * - * *Can only be used if this is UpgradeItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.clear_upgrade_item View documentation} - */ - clear_upgrade_item(): void - /** - * Gets the filter at the given index for this upgrade item. - * - * *Can only be used if this is UpgradeItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_mapper View documentation} - * - * @param index - The index of the mapper to read. - * @param type - 'from' or 'to'. - */ - get_mapper(index: uint, type: "from" | "to"): UpgradeFilter - /** - * Sets the module filter at the given index for this upgrade item. - * - * *Can only be used if this is UpgradeItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_mapper View documentation} - * - * @param index - The index of the mapper to set. - * @param type - `from` or `to`. - * @param filter - The filter to set or `nil` - */ - set_mapper(index: uint, type: string, filter: UpgradeFilter | undefined): void - /** - * Gets the number of entities in this blueprint item. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_blueprint_entity_count View documentation} - */ - get_blueprint_entity_count(): uint - /** - * Gets the tags for the given blueprint entity index in this blueprint item. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_blueprint_entity_tags View documentation} - * - * @param index - */ - get_blueprint_entity_tags(index: uint): Tags - /** - * Sets the tags on the given blueprint entity index in this blueprint item. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_blueprint_entity_tags View documentation} - * - * @param index - The entity index - * @param tags - */ - set_blueprint_entity_tags(index: uint, tags: Tags): void - /** - * Gets the given tag on the given blueprint entity index in this blueprint item. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.get_blueprint_entity_tag View documentation} - * - * @param index - The entity index. - * @param tag - The tag to get. - */ - get_blueprint_entity_tag(index: uint, tag: string): AnyBasic - /** - * Sets the given tag on the given blueprint entity index in this blueprint item. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.set_blueprint_entity_tag View documentation} - * - * @param index - The entity index. - * @param tag - The tag to set. - * @param value - The tag value to set or `nil` to clear the tag. - */ - set_blueprint_entity_tag(index: uint, tag: string, value: AnyBasic | undefined): void - /** - * Creates the equipment grid for this item if it doesn't exist and this is an item-with-entity-data that supports - * equipment grids. - * - * *Can only be used if this is ItemWithEntityData* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.create_grid View documentation} - */ - create_grid(): LuaEquipmentGrid - /** - * Is this valid for reading? Differs from the usual `valid` in that `valid` will be `true` even if the item stack - * is blank but the entity that holds it is still valid. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.valid_for_read View documentation} - */ - readonly valid_for_read: boolean - /** - * Prototype of the item held in this stack. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.prototype View documentation} - */ - readonly prototype: LuaItemPrototype - /** - * Prototype name of the item held in this stack. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.name View documentation} - */ - readonly name: string - /** - * Type of the item prototype. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.type View documentation} - */ - readonly type: string - /** - * Number of items in this stack. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.count View documentation} - */ - count: uint - /** - * The equipment grid of this item or `nil` if this item doesn't have a grid. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.grid View documentation} - */ - readonly grid: LuaEquipmentGrid | undefined - /** - * How much health the item has, as a number in range [0, 1]. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.health View documentation} - */ - health: float - /** - * Durability of the contained item. Automatically capped at the item's maximum durability. - * - * **Note**: When used on a non-tool item, the value of this attribute is `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.durability View documentation} - */ - durability: double | undefined - /** - * Number of bullets left in the magazine. - * - * *Can only be used if this is AmmoItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.ammo View documentation} - */ - ammo: uint - /** - * Icons of a blueprint item, blueprint book, deconstruction item or upgrade planner. An item that doesn't have - * icons returns nil on read and throws error on write. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.blueprint_icons View documentation} - */ - blueprint_icons: BlueprintSignalIcon[] | undefined - /** - * The snapping grid size in this blueprint item or nil if snapping is not enabled. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.blueprint_snap_to_grid View documentation} - */ - blueprint_snap_to_grid: Position | undefined - /** - * The offset from the absolute grid or nil if absolute snapping is not enabled. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.blueprint_position_relative_to_grid View documentation} - */ - blueprint_position_relative_to_grid: Position | undefined - /** - * If absolute snapping is enabled on this blueprint item. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.blueprint_absolute_snapping View documentation} - */ - blueprint_absolute_snapping: boolean - /** - * The current label for this item. Nil when none. - * - * *Can only be used if this is ItemWithLabel* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.label View documentation} - */ - label: string | undefined - /** - * The current label color for this item. Nil when none. - * - * *Can only be used if this is ItemWithLabel* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.label_color View documentation} - */ - label_color: Color | undefined - /** - * If the label for this item can be manually changed. When false the label can only be changed through the API. - * - * *Can only be used if this is ItemWithLabel* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.allow_manual_label_change View documentation} - */ - allow_manual_label_change: boolean - /** - * Raw materials required to build this blueprint. Result is a dictionary mapping each item prototype name to the - * required count. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.cost_to_build View documentation} - */ - readonly cost_to_build: Record - /** - * If this item extends the inventory it resides in (provides its contents for counts, crafting, insertion). Only - * callable on items with inventories. - * - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.extends_inventory View documentation} - */ - extends_inventory: boolean - /** - * The insertion mode priority this ItemWithInventory uses when items are inserted into an inventory it resides in. - * Only callable on items with inventories. - * - * *Can only be used if this is ItemWithInventory* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.prioritize_insertion_mode View documentation} - */ - prioritize_insertion_mode: string - /** - * The default icons for a blueprint item. - * - * *Can only be used if this is BlueprintItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.default_icons View documentation} - */ - readonly default_icons: BlueprintItemIcon[] - /** - * *Can only be used if this is ItemWithTags* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.tags View documentation} - */ - tags: Tags - /** - * The custom description this item-with-tags. This is shown over the normal item description if this is set to a - * non-empty value. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.custom_description View documentation} - */ - custom_description: LocalisedString - /** - * The entity filters for this deconstruction item. The attribute is a sparse array with the keys representing the - * index of the filter. All strings in this array must be entity prototype names that don't have the - * `"not-deconstructable"` flag set and are either a `cliff` or marked as `minable`. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.entity_filters View documentation} - */ - entity_filters: string[] - /** - * The tile filters for this deconstruction item. The attribute is a sparse array with the keys representing the - * index of the filter. All strings in this array must be tile prototype names. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.tile_filters View documentation} - */ - tile_filters: string[] - /** - * The blacklist/whitelist entity filter mode for this deconstruction item. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.entity_filter_mode View documentation} - */ - entity_filter_mode: defines.deconstruction_item.entity_filter_mode - /** - * The blacklist/whitelist tile filter mode for this deconstruction item. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.tile_filter_mode View documentation} - */ - tile_filter_mode: defines.deconstruction_item.tile_filter_mode - /** - * The tile selection mode for this deconstruction item. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.tile_selection_mode View documentation} - */ - tile_selection_mode: defines.deconstruction_item.tile_selection_mode - /** - * If this deconstruction item is set to allow trees and rocks only. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.trees_and_rocks_only View documentation} - */ - trees_and_rocks_only: boolean - /** - * The number of entity filters this deconstruction item supports. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.entity_filter_count View documentation} - */ - readonly entity_filter_count: uint - /** - * The number of tile filters this deconstruction item supports. - * - * *Can only be used if this is DeconstructionItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.tile_filter_count View documentation} - */ - readonly tile_filter_count: uint - /** - * The active blueprint index for this blueprint book. May be `nil`. - * - * *Can only be used if this is BlueprintBookItem* - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.active_index View documentation} - */ - active_index: uint | undefined - /** - * The unique identifier for this item if it has one, `nil` otherwise. Note that this ID stays the same no matter - * where the item is moved to. - * - * Only these types of items have unique IDs: - * - * - `"armor"` - * - `"spidertron-remote"` - * - `"selection-tool"` - * - `"copy-paste-tool"` - * - `"upgrade-item"` - * - `"deconstruction-item"` - * - `"blueprint"` - * - `"blueprint-book"` - * - `"item-with-entity-data"` - * - `"item-with-inventory"` - * - `"item-with-tags"` - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.item_number View documentation} - */ - readonly item_number: uint | undefined - /** - * If this item is a spidertron remote that has a spidertron bound to it, it returns the connected spider-vehicle - * entity, `nil` otherwise. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.connected_entity View documentation} - */ - connected_entity: LuaEntity | undefined - /** - * If this is a blueprint item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_blueprint View documentation} - */ - readonly is_blueprint: boolean - /** - * If this is a blueprint book item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_blueprint_book View documentation} - */ - readonly is_blueprint_book: boolean - /** - * If this is a module item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_module View documentation} - */ - readonly is_module: boolean - /** - * If this is a tool item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_tool View documentation} - */ - readonly is_tool: boolean - /** - * If this is a mining tool item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_mining_tool View documentation} - */ - readonly is_mining_tool: boolean - /** - * If this is an armor item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_armor View documentation} - */ - readonly is_armor: boolean - /** - * If this is a repair tool item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_repair_tool View documentation} - */ - readonly is_repair_tool: boolean - /** - * If this is an item with label item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_item_with_label View documentation} - */ - readonly is_item_with_label: boolean - /** - * If this is an item with inventory item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_item_with_inventory View documentation} - */ - readonly is_item_with_inventory: boolean - /** - * If this is an item with entity data item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_item_with_entity_data View documentation} - */ - readonly is_item_with_entity_data: boolean - /** - * If this is a selection tool item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_selection_tool View documentation} - */ - readonly is_selection_tool: boolean - /** - * If this is an item with tags item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_item_with_tags View documentation} - */ - readonly is_item_with_tags: boolean - /** - * If this is a deconstruction tool item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_deconstruction_item View documentation} - */ - readonly is_deconstruction_item: boolean - /** - * If this is a upgrade item. - * - * {@link https://lua-api.factorio.com/next/LuaItemStack.html#LuaItemStack.is_upgrade_item View documentation} - */ - readonly is_upgrade_item: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaItemStack" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for lamps. - * - * {@link https://lua-api.factorio.com/next/LuaLampControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaLampControlBehavior extends LuaGenericOnOffControlBehavior { - /** - * `true` if the lamp should set the color from the circuit network signals. - * - * {@link https://lua-api.factorio.com/next/LuaLampControlBehavior.html#LuaLampControlBehavior.use_colors View documentation} - */ - use_colors: boolean - /** - * The color the lamp is showing or `nil` if not using any color. - * - * {@link https://lua-api.factorio.com/next/LuaLampControlBehavior.html#LuaLampControlBehavior.color View documentation} - */ - readonly color: ColorTable | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaLampControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A lazily loaded value. For performance reasons, we sometimes return a custom lazily-loaded value type instead of the - * native Lua value. This custom type lazily constructs the necessary value when - * {@link LuaLazyLoadedValue.get LuaLazyLoadedValue::get} is called, therefore preventing its unnecessary construction in - * some cases. - * - * An instance of LuaLazyLoadedValue is only valid during the event it was created from and cannot be saved. - * - * {@link https://lua-api.factorio.com/next/LuaLazyLoadedValue.html View documentation} - * - * @noSelf - */ -interface LuaLazyLoadedValue { - /** - * Gets the value of this lazy loaded value. - * - * {@link https://lua-api.factorio.com/next/LuaLazyLoadedValue.html#LuaLazyLoadedValue.get View documentation} - */ - get(): T - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaLazyLoadedValue" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Logistic cell of a particular {@link LuaEntity}. A "Logistic Cell" is the given name for settings and properties used - * by what would normally be seen as a "Roboport". A logistic cell however doesn't have to be attached to the roboport - * entity (the character has one for the personal roboport). - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html View documentation} - * - * @noSelf - */ -interface LuaLogisticCell { - /** - * Is a given position within the logistic range of this cell? - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.is_in_logistic_range View documentation} - * - * @param position - */ - is_in_logistic_range(position: Position): boolean - /** - * Is a given position within the construction range of this cell? - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.is_in_construction_range View documentation} - * - * @param position - */ - is_in_construction_range(position: Position): boolean - /** - * Are two cells neighbours? - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.is_neighbour_with View documentation} - * - * @param other - */ - is_neighbour_with(other: LuaLogisticCell): boolean - /** - * Logistic radius of this cell. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.logistic_radius View documentation} - */ - readonly logistic_radius: float - /** - * Logistic connection distance of this cell. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.logistics_connection_distance View documentation} - */ - readonly logistics_connection_distance: float - /** - * Construction radius of this cell. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.construction_radius View documentation} - */ - readonly construction_radius: float - /** - * Number of stationed logistic robots in this cell. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.stationed_logistic_robot_count View documentation} - */ - readonly stationed_logistic_robot_count: uint - /** - * Number of stationed construction robots in this cell. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.stationed_construction_robot_count View documentation} - */ - readonly stationed_construction_robot_count: uint - /** - * `true` if this is a mobile cell. In vanilla, only the logistic cell created by a character's personal roboport is mobile. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.mobile View documentation} - */ - readonly mobile: boolean - /** - * `true` if this cell is active. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.transmitting View documentation} - */ - readonly transmitting: boolean - /** - * Radius at which the robots hover when waiting to be charged. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.charge_approach_distance View documentation} - */ - readonly charge_approach_distance: float - /** - * Number of robots currently charging. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.charging_robot_count View documentation} - */ - readonly charging_robot_count: uint - /** - * Number of robots waiting to charge. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.to_charge_robot_count View documentation} - */ - readonly to_charge_robot_count: uint - /** - * This cell's owner. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.owner View documentation} - */ - readonly owner: LuaEntity - /** - * The network that owns this cell or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.logistic_network View documentation} - */ - readonly logistic_network: LuaLogisticNetwork | undefined - /** - * Neighbouring cells. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.neighbours View documentation} - */ - readonly neighbours: LuaLogisticCell[] - /** - * Robots currently being charged. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.charging_robots View documentation} - */ - readonly charging_robots: LuaEntity[] - /** - * Robots waiting to charge. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticCell.html#LuaLogisticCell.to_charge_robots View documentation} - */ - readonly to_charge_robots: LuaEntity[] - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaLogisticCell" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for logistic chests. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticContainerControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaLogisticContainerControlBehavior extends LuaControlBehavior { - /** - * The circuit mode of operations for the logistic container. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticContainerControlBehavior.html#LuaLogisticContainerControlBehavior.circuit_mode_of_operation View documentation} - */ - circuit_mode_of_operation: defines.control_behavior.logistic_container.circuit_mode_of_operation - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaLogisticContainerControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A single logistic network of a given force on a given surface. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html View documentation} - * - * @noSelf - */ -interface LuaLogisticNetwork { - /** - * Count given or all items in the network or given members. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.get_item_count View documentation} - * - * @param item - Item name to count. If not given, gives counts of all items in the network. - * @param member - Logistic members to check, must be either `"storage"` or `"providers"`. If not given, gives count - * in the entire network. - */ - get_item_count(item?: string, member?: "storage" | "providers"): int - /** - * Get item counts for the entire network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.get_contents View documentation} - * - * @returns A mapping of item prototype names to the number available in the network. - * @see {@link LuaInventory.get_contents} - */ - get_contents(): Record - /** - * Remove items from the logistic network. This will actually remove the items from some logistic chests. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.remove_item View documentation} - * - * @param item - What to remove. - * @param members - Which logistic members to remove from. Must be `"storage"`, `"passive-provider"`, `"buffer"`, or - * `"active-provider"`. If not specified, removes from the network in the usual order. - * @returns Number of items removed. - */ - remove_item( - item: ItemStackIdentification, - members?: "storage" | "passive-provider" | "buffer" | "active-provider" - ): uint - /** - * Insert items into the logistic network. This will actually insert the items into some logistic chests. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.insert View documentation} - * - * @param item - What to insert. - * @param members - Which logistic members to insert the items to. Must be `"storage"`, `"storage-empty"` (storage - * chests that are completely empty), `"storage-empty-slot"` (storage chests that have an empty slot), or - * `"requester"`. If not specified, inserts items into the logistic network in the usual order. - * @returns Number of items actually inserted. - */ - insert( - item: ItemStackIdentification, - members?: "storage" | "storage-empty" | "storage-empty-slot" | "requester" - ): uint - /** - * Find logistic cell closest to a given position. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.find_cell_closest_to View documentation} - * - * @param position - * @returns May be `nil` if no cell was found. - */ - find_cell_closest_to(position: Position): LuaLogisticCell | undefined - /** - * Find the 'best' logistic point with this item ID and from the given position or from given chest type. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.select_pickup_point View documentation} - * - * @returns May be `nil` if no point was found. - */ - select_pickup_point(params: { - /** Name of the item to select. */ - readonly name: string - /** When given, it will find the storage 'best' storage point from this position. */ - readonly position?: Position - /** Whether to consider buffer chests or not. Defaults to false. Only considered if selecting with position. */ - readonly include_buffers?: boolean - /** - * When given, it will find from only the specific type of member. Must be `"storage"`, `"passive-provider"`, - * `"buffer"` or `"active-provider"`. If not specified, selects with normal priorities. Not considered if - * position is specified. - */ - readonly members?: "storage" | "passive-provider" | "buffer" | "active-provider" - }): LuaLogisticPoint | undefined - /** - * Find a logistic point to drop the specific item stack. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.select_drop_point View documentation} - * - * @returns May be `nil` if no point was found. - */ - select_drop_point(params: { - /** Name of the item to select. */ - readonly stack: ItemStackIdentification - /** - * When given, it will find from only the specific type of member. Must be `"storage"`, `"storage-empty"`, - * `"storage-empty-slot"` or `"requester"`. If not specified, selects with normal priorities. - */ - readonly members?: "storage" | "storage-empty" | "storage-empty-slot" | "requester" - }): LuaLogisticPoint | undefined - /** - * The force this logistic network belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.force View documentation} - */ - readonly force: LuaForce - /** - * Number of logistic robots available for a job. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.available_logistic_robots View documentation} - */ - readonly available_logistic_robots: uint - /** - * The total number of logistic robots in the network (idle and active + in roboports). - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.all_logistic_robots View documentation} - */ - readonly all_logistic_robots: uint - /** - * Number of construction robots available for a job. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.available_construction_robots View documentation} - */ - readonly available_construction_robots: uint - /** - * The total number of construction robots in the network (idle and active + in roboports). - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.all_construction_robots View documentation} - */ - readonly all_construction_robots: uint - /** - * Maximum number of robots the network can work with. Currently only used for the personal roboport. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.robot_limit View documentation} - */ - readonly robot_limit: uint - /** - * All cells in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.cells View documentation} - */ - readonly cells: LuaLogisticCell[] - /** - * All entities that have logistic provider points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.providers View documentation} - */ - readonly providers: LuaEntity[] - /** - * All entities that have empty logistic provider points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.empty_providers View documentation} - */ - readonly empty_providers: LuaEntity[] - /** - * All entities that have logistic requester points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.requesters View documentation} - */ - readonly requesters: LuaEntity[] - /** - * All entities that have logistic storage points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.storages View documentation} - */ - readonly storages: LuaEntity[] - /** - * All other entities that have logistic points in this network (inserters mostly). - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.logistic_members View documentation} - */ - readonly logistic_members: LuaEntity[] - /** - * All things that have provider points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.provider_points View documentation} - */ - readonly provider_points: LuaLogisticPoint[] - /** - * All passive provider points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.passive_provider_points View documentation} - */ - readonly passive_provider_points: LuaLogisticPoint[] - /** - * All active provider points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.active_provider_points View documentation} - */ - readonly active_provider_points: LuaLogisticPoint[] - /** - * All things that have empty provider points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.empty_provider_points View documentation} - */ - readonly empty_provider_points: LuaLogisticPoint[] - /** - * All things that have requester points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.requester_points View documentation} - */ - readonly requester_points: LuaLogisticPoint[] - /** - * All things that have storage points in this network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.storage_points View documentation} - */ - readonly storage_points: LuaLogisticPoint[] - /** - * All robots in this logistic network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.robots View documentation} - */ - readonly robots: LuaEntity[] - /** - * All construction robots in this logistic network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.construction_robots View documentation} - */ - readonly construction_robots: LuaEntity[] - /** - * All logistic robots in this logistic network. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticNetwork.html#LuaLogisticNetwork.logistic_robots View documentation} - */ - readonly logistic_robots: LuaEntity[] - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaLogisticNetwork" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Logistic point of a particular {@link LuaEntity}. A "Logistic point" is the name given for settings and properties - * used by requester, provider, and storage points in a given logistic network. These "points" don't have to be a - * logistic container but often are. One other entity that can own several points is the "character" character type entity. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html View documentation} - * - * @noSelf - */ -interface LuaLogisticPoint { - /** - * The {@link LuaEntity} owner of this {@link LuaLogisticPoint}. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html#LuaLogisticPoint.owner View documentation} - */ - readonly owner: LuaEntity - readonly logistic_network: LuaLogisticNetwork - /** - * The Logistic member index of this logistic point. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html#LuaLogisticPoint.logistic_member_index View documentation} - */ - readonly logistic_member_index: uint - /** - * The logistic filters for this logistic point or `nil` if this doesn't use logistic filters. - * - * **Note**: The returned array will always have an entry for each filter and will be indexed in sequence when not nil. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html#LuaLogisticPoint.filters View documentation} - */ - readonly filters: LogisticFilter[] | undefined - /** - * The logistic mode. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html#LuaLogisticPoint.mode View documentation} - */ - readonly mode: defines.logistic_mode - /** - * The force of this logistic point. - * - * **Note**: This will always be the same as the {@link LuaLogisticPoint.owner LuaLogisticPoint::owner} force. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html#LuaLogisticPoint.force View documentation} - */ - readonly force: LuaForce - /** - * Items targeted to be picked up from this logistic point by robots. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html#LuaLogisticPoint.targeted_items_pickup View documentation} - */ - readonly targeted_items_pickup: Record - /** - * Items targeted to be dropped off into this logistic point by robots. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html#LuaLogisticPoint.targeted_items_deliver View documentation} - */ - readonly targeted_items_deliver: Record - /** - * If this logistic point is using the exact mode. In exact mode robots never over-deliver requests. - * - * {@link https://lua-api.factorio.com/next/LuaLogisticPoint.html#LuaLogisticPoint.exact View documentation} - */ - readonly exact: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaLogisticPoint" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for mining drills. - * - * {@link https://lua-api.factorio.com/next/LuaMiningDrillControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaMiningDrillControlBehavior extends LuaGenericOnOffControlBehavior { - /** - * `true` if this drill is enabled or disabled using the logistics or circuit condition. - * - * {@link https://lua-api.factorio.com/next/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.circuit_enable_disable View documentation} - */ - circuit_enable_disable: boolean - /** - * `true` if this drill should send the resources in the field to the circuit network. Which resources depends on - * {@link LuaMiningDrillControlBehavior.resource_read_mode LuaMiningDrillControlBehavior::resource_read_mode} - * - * {@link https://lua-api.factorio.com/next/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.circuit_read_resources View documentation} - */ - circuit_read_resources: boolean - /** - * If the mining drill should send just the resources in its area or the entire field it's on to the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.resource_read_mode View documentation} - */ - resource_read_mode: defines.control_behavior.mining_drill.resource_read_mode - /** - * The resource entities that the mining drill will send information about to the circuit network or an empty array. - * - * {@link https://lua-api.factorio.com/next/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.resource_read_targets View documentation} - */ - readonly resource_read_targets: LuaEntity[] - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaMiningDrillControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a mod setting. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html View documentation} - * - * @noSelf - */ -interface LuaModSettingPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * The mod that owns this setting. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.mod View documentation} - */ - readonly mod: string - readonly setting_type: string - /** - * The default value of this setting. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.default_value View documentation} - */ - readonly default_value: boolean | double | int | string - /** - * The minimum value for this setting or `nil` if this setting type doesn't support a minimum. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.minimum_value View documentation} - */ - readonly minimum_value: double | int | undefined - /** - * The maximum value for this setting or `nil` if this setting type doesn't support a maximum. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.maximum_value View documentation} - */ - readonly maximum_value: double | int | undefined - /** - * The allowed values for this setting or `nil` if this setting doesn't use the a fixed set of values. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.allowed_values View documentation} - */ - readonly allowed_values: string[] | int[] | double[] | undefined - /** - * If this string setting allows blank values or `nil` if not a string setting. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.allow_blank View documentation} - */ - readonly allow_blank: boolean | undefined - /** - * If this string setting auto-trims values or `nil` if not a string setting. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.auto_trim View documentation} - */ - readonly auto_trim: boolean | undefined - /** - * If this setting is hidden from the GUI. - * - * {@link https://lua-api.factorio.com/next/LuaModSettingPrototype.html#LuaModSettingPrototype.hidden View documentation} - */ - readonly hidden: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaModSettingPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a module category. - * - * {@link https://lua-api.factorio.com/next/LuaModuleCategoryPrototype.html View documentation} - * - * @noSelf - */ -interface LuaModuleCategoryPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaModuleCategoryPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a named noise expression. - * - * {@link https://lua-api.factorio.com/next/LuaNamedNoiseExpression.html View documentation} - * - * @noSelf - */ -interface LuaNamedNoiseExpression { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Name of the property that this expression is intended to provide a value for, if any. - * - * {@link https://lua-api.factorio.com/next/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.intended_property View documentation} - */ - readonly intended_property: string - /** - * The expression itself. - * - * {@link https://lua-api.factorio.com/next/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.expression View documentation} - */ - readonly expression: NoiseExpression - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaNamedNoiseExpression" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a noise layer. - * - * {@link https://lua-api.factorio.com/next/LuaNoiseLayerPrototype.html View documentation} - * - * @noSelf - */ -interface LuaNoiseLayerPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaNoiseLayerPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of an optimized particle. - * - * {@link https://lua-api.factorio.com/next/LuaParticlePrototype.html View documentation} - * - * @noSelf - */ -interface LuaParticlePrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaParticlePrototype.html#LuaParticlePrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaParticlePrototype.html#LuaParticlePrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - readonly regular_trigger_effect: TriggerEffectItem - readonly ended_in_water_trigger_effect: TriggerEffectItem - readonly render_layer: RenderLayer - readonly render_layer_when_on_ground: RenderLayer - readonly life_time: uint - readonly regular_trigger_effect_frequency: uint - readonly movement_modifier_when_on_ground: float - readonly movement_modifier: float - readonly mining_particle_frame_speed: float - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaParticlePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A permission group that defines what players in this group are allowed to do. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html View documentation} - * - * @noSelf - */ -interface LuaPermissionGroup { - /** - * Adds the given player to this group. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html#LuaPermissionGroup.add_player View documentation} - * - * @param player - * @returns If the player was added. - */ - add_player(player: PlayerIdentification): boolean - /** - * Removes the given player from this group. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html#LuaPermissionGroup.remove_player View documentation} - * - * @param player - * @returns If the player was removed. - */ - remove_player(player: PlayerIdentification): boolean - /** - * Whether this group allows the given action. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html#LuaPermissionGroup.allows_action View documentation} - * - * @param action - The action in question. - */ - allows_action(action: defines.input_action): boolean - /** - * Sets whether this group allows the performance the given action. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html#LuaPermissionGroup.set_allows_action View documentation} - * - * @param action - The action in question. - * @param allow_action - Whether to allow the specified action. - * @returns Whether the value was successfully applied. - */ - set_allows_action(action: defines.input_action, allow_action: boolean): boolean - /** - * Destroys this group. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html#LuaPermissionGroup.destroy View documentation} - * - * @returns Whether the group was successfully destroyed. - */ - destroy(): boolean - /** - * The name of this group. - * - * **Note**: Setting the name to `nil` or an empty string sets the name to the default value. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html#LuaPermissionGroup.name View documentation} - */ - name: string - /** - * The players in this group. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html#LuaPermissionGroup.players View documentation} - */ - readonly players: LuaPlayer[] - /** - * The group ID - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroup.html#LuaPermissionGroup.group_id View documentation} - */ - readonly group_id: uint - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaPermissionGroup" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * All permission groups. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroups.html View documentation} - * - * @noSelf - */ -interface LuaPermissionGroups { - /** - * Creates a new permission group. - * - * **Note**: May return nil if the calling player doesn't have permission to make groups. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroups.html#LuaPermissionGroups.create_group View documentation} - * - * @param name - */ - create_group(name?: string): LuaPermissionGroup | undefined - /** - * Gets the permission group with the given name or group ID or `nil` if there is no matching group. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroups.html#LuaPermissionGroups.get_group View documentation} - * - * @param group - */ - get_group(group: string | uint): LuaPermissionGroup | undefined - /** - * All of the permission groups. - * - * {@link https://lua-api.factorio.com/next/LuaPermissionGroups.html#LuaPermissionGroups.groups View documentation} - */ - readonly groups: LuaPermissionGroup[] - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaPermissionGroups" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A player in the game. Pay attention that a player may or may not have a character, which is the {@link LuaEntity} of - * the little guy running around the world doing things. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html View documentation} - * - * @noSelf - */ -interface LuaPlayer extends LuaControl { - /** - * Setup the screen to be shown when the game is finished. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.set_ending_screen_data View documentation} - * - * @param message - Message to be shown. - * @param file - Path to image to be shown. - */ - set_ending_screen_data(message: LocalisedString, file?: string): void - /** - * Print text to the chat console. - * - * **Note**: Messages that are identical to a message sent in the last 60 ticks are not printed again. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.print View documentation} - * - * @param message - * @param color - */ - print(message: LocalisedString, color?: Color): void - /** - * Clear the chat console. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.clear_console View documentation} - */ - clear_console(): void - /** - * Get the current goal description, as a localised string. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.get_goal_description View documentation} - */ - get_goal_description(): LocalisedString - /** - * Set the text in the goal window (top left). - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.set_goal_description View documentation} - * - * @param text - The text to display. Lines can be delimited with `\n`. Passing an empty string or omitting this - * parameter entirely will make the goal window disappear. - * @param only_update - When `true`, won't play the "goal updated" sound. - */ - set_goal_description(text?: LocalisedString, only_update?: boolean): void - /** - * Set the controller type of the player. - * - * **Note**: Setting a player to {@link defines.controllers.editor} auto promotes the player to admin and enables cheat mode. - * - * **Note**: Setting a player to {@link defines.controllers.editor} also requires the calling player be an admin. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.set_controller View documentation} - */ - set_controller(params: { - /** Which controller to use. */ - readonly type: defines.controllers - /** Entity to control. Mandatory when `type` is {@link defines.controllers.character}, ignored otherwise. */ - readonly character?: LuaEntity - /** - * List of waypoints for the cutscene controller. This parameter is mandatory when `type` is - * {@link defines.controllers.cutscene}. - */ - readonly waypoints?: CutsceneWaypoint - /** - * If specified and `type` is {@link defines.controllers.cutscene}, the cutscene will start at this position. If - * not given the start position will be the player position. - */ - readonly start_position?: Position - /** - * If specified and `type` is {@link defines.controllers.cutscene}, the cutscene will start at this zoom level. - * If not given the start zoom will be the players zoom. - */ - readonly start_zoom?: double - /** - * If specified and `type` is {@link defines.controllers.cutscene}, it is the time in ticks it will take for the - * camera to pan from the final waypoint back to the starting position. If not given the camera will not pan - * back to the start position/zoom. - */ - readonly final_transition_time?: uint - /** - * If specified and `type` is {@link defines.controllers.cutscene}, the game will switch to chart-mode (map - * zoomed out) rendering when the zoom level is less than this value. - */ - readonly chart_mode_cutoff?: double - }): void - /** - * Start/end wire dragging at the specified location, wire type is based on the cursor contents - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.drag_wire View documentation} - * - * @returns `true` if the action did something - */ - drag_wire(params: { - /** - * Position at which cursor was clicked. Used only to decide which side of arithmetic combinator, decider - * combinator or power switch is to be connected. Entity itself to be connected is based on the player's selected entity. - */ - readonly position: Position - }): boolean - /** - * Disable recipe groups. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.disable_recipe_groups View documentation} - */ - disable_recipe_groups(): void - /** - * Enable recipe groups. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.enable_recipe_groups View documentation} - */ - enable_recipe_groups(): void - /** - * Disable recipe subgroups. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.disable_recipe_subgroups View documentation} - */ - disable_recipe_subgroups(): void - /** - * Enable recipe subgroups. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.enable_recipe_subgroups View documentation} - */ - enable_recipe_subgroups(): void - /** - * Print entity statistics to the player's console. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.print_entity_statistics View documentation} - * - * @param entities - Entity prototypes to get statistics for. If not specified or empty, display statistics for all entities. - */ - print_entity_statistics(entities?: string[]): void - /** - * Print construction robot job counts to the players console. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.print_robot_jobs View documentation} - */ - print_robot_jobs(): void - /** - * Print LuaObject counts per mod. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.print_lua_object_statistics View documentation} - */ - print_lua_object_statistics(): void - /** - * Logs a dictionary of chunks -> active entities for the surface this player is on. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.log_active_entity_chunk_counts View documentation} - */ - log_active_entity_chunk_counts(): void - /** - * Logs a dictionary of active entities -> count for the surface this player is on. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.log_active_entity_counts View documentation} - */ - log_active_entity_counts(): void - /** - * Unlock the achievements of the given player. This has any effect only when this is the local player, the - * achievement isn't unlocked so far and the achievement is of the type "achievement". - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.unlock_achievement View documentation} - * - * @param name - Name of the achievement to unlock - */ - unlock_achievement(name: string): void - /** - * Invokes the "clear cursor" action on the player as if the user pressed it. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.clear_cursor View documentation} - * - * @returns If the cursor is now empty. - */ - clear_cursor(): boolean - /** - * Creates and attaches a character entity to this player. - * - * **Note**: The player must not have a character already connected and must be online (see - * {@link LuaPlayer.connected LuaPlayer::connected}). - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.create_character View documentation} - * - * @param character - The character to create else the default is used. - * @returns Whether the character was created. - */ - create_character(character?: string): boolean - /** - * Adds an alert to this player for the given entity of the given alert type. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.add_alert View documentation} - * - * @param entity - * @param type - */ - add_alert(entity: LuaEntity, type: defines.alert_type): void - /** - * Adds a custom alert to this player. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.add_custom_alert View documentation} - * - * @param entity - If the alert is clicked, the map will open at the position of this entity. - * @param icon - * @param message - * @param show_on_map - */ - add_custom_alert(entity: LuaEntity, icon: SignalID, message: LocalisedString, show_on_map: boolean): void - /** - * Removes all alerts matching the given filters or if an empty filters table is given all alerts are removed. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.remove_alert View documentation} - */ - remove_alert(params: { - readonly entity?: LuaEntity - readonly prototype?: LuaEntityPrototype - readonly position?: Position - readonly type?: defines.alert_type - readonly surface?: SurfaceIdentification - readonly icon?: SignalID - readonly message?: LocalisedString - }): void - /** - * Get all alerts matching the given filters, or all alerts if no filters are given. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.get_alerts View documentation} - * - * @returns A mapping of surface index to an array of arrays of {@link Alert alerts} indexed by the - * {@link defines.alert_type alert type}. - */ - get_alerts(params: { - readonly entity?: LuaEntity - readonly prototype?: LuaEntityPrototype - readonly position?: Position - readonly type?: defines.alert_type - readonly surface?: SurfaceIdentification - }): Record> - /** - * Mutes alerts for the given alert category. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.mute_alert View documentation} - * - * @param alert_type - * @returns If the alert type was muted (false if it was already muted). - */ - mute_alert(alert_type: defines.alert_type): boolean - /** - * Unmutes alerts for the given alert category. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.unmute_alert View documentation} - * - * @param alert_type - * @returns If the alert type was unmuted (false if it was wasn't muted). - */ - unmute_alert(alert_type: defines.alert_type): boolean - /** - * If the given alert type is currently muted. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.is_alert_muted View documentation} - * - * @param alert_type - */ - is_alert_muted(alert_type: defines.alert_type): boolean - /** - * Enables alerts for the given alert category. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.enable_alert View documentation} - * - * @param alert_type - * @returns If the alert type was enabled (false if it was already enabled). - */ - enable_alert(alert_type: defines.alert_type): boolean - /** - * Disables alerts for the given alert category. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.disable_alert View documentation} - * - * @param alert_type - * @returns If the alert type was disabled (false if it was already disabled). - */ - disable_alert(alert_type: defines.alert_type): boolean - /** - * If the given alert type is currently enabled. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.is_alert_enabled View documentation} - * - * @param alert_type - */ - is_alert_enabled(alert_type: defines.alert_type): boolean - /** - * Invokes the "smart pipette" action on the player as if the user pressed it. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.pipette_entity View documentation} - * - * @param entity - * @returns If the smart pipette found something to place - */ - pipette_entity(entity: string | LuaEntity | LuaEntityPrototype): boolean - /** - * Checks if this player can build the give entity at the given location on the surface the player is on. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.can_place_entity View documentation} - */ - can_place_entity(params: { - /** Name of the entity to check */ - readonly name: string - /** Where the entity would be placed */ - readonly position: Position - /** Direction the entity would be placed */ - readonly direction?: defines.direction - }): boolean - /** - * Checks if this player can build what ever is in the cursor on the surface the player is on. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.can_build_from_cursor View documentation} - */ - can_build_from_cursor(params: { - /** Where the entity would be placed */ - readonly position: Position - /** Direction the entity would be placed */ - readonly direction?: defines.direction - /** If alt build should be used instead of normal build. Defaults to normal. */ - readonly alt?: boolean - /** The size for building terrain if building terrain. Defaults to 2. */ - readonly terrain_building_size?: uint - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - }): boolean - /** - * Builds what ever is in the cursor on the surface the player is on. - * - * **Note**: Anything built will fire normal player-built events. - * - * **Note**: The cursor stack will automatically be reduced as if the player built normally. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.build_from_cursor View documentation} - */ - build_from_cursor(params: { - /** Where the entity would be placed */ - readonly position: Position - /** Direction the entity would be placed */ - readonly direction?: defines.direction - /** If alt build should be used instead of normal build. Defaults to normal. */ - readonly alt?: boolean - /** The size for building terrain if building terrain. Defaults to 2. */ - readonly terrain_building_size?: uint - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - }): void - /** - * Uses the current item in the cursor if it's a capsule or does nothing if not. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.use_from_cursor View documentation} - * - * @param position - Where the item would be used. - */ - use_from_cursor(position: Position): void - /** - * Play a sound for this player. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.play_sound View documentation} - */ - play_sound(params: { - /** The sound to play. */ - readonly path: SoundPath - /** Where the sound should be played. If not given, it's played at the current position of the player. */ - readonly position?: Position - /** The volume of the sound to play. Must be between 0 and 1 inclusive. */ - readonly volume_modifier?: double - /** The volume mixer to play the sound through. Defaults to the default mixer for the given sound type. */ - readonly override_sound_type?: SoundType - }): void - /** - * The characters associated with this player. - * - * **Note**: The array will always be empty when the player is disconnected (see - * {@link LuaPlayer.connected LuaPlayer::connected}) regardless of there being associated characters. - * - * **Note**: Characters associated with this player will be logged off when this player disconnects but are not - * controlled by any player. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.get_associated_characters View documentation} - */ - get_associated_characters(): LuaEntity[] - /** - * Associates a character with this player. - * - * **Note**: The character must not be connected to any controller. - * - * **Note**: If this player is currently disconnected (see {@link LuaPlayer.connected LuaPlayer::connected}) the - * character will be immediately "logged off". - * - * **Note**: See {@link LuaPlayer.get_associated_characters LuaPlayer::get_associated_characters} for more information. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.associate_character View documentation} - * - * @param character - The character entity. - */ - associate_character(character: LuaEntity): void - /** - * Disassociates a character from this player. This is functionally the same as setting - * {@link LuaEntity.associated_player LuaEntity::associated_player} to `nil`. - * - * **Note**: See {@link LuaPlayer.get_associated_characters LuaPlayer::get_associated_characters} for more information. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.disassociate_character View documentation} - * - * @param character - The character entity - */ - disassociate_character(character: LuaEntity): void - /** - * Spawn flying text that is only visible to this player. Either `position` or `create_at_cursor` are required. When - * `create_at_cursor` is `true`, all parameters other than `text` are ignored. - * - * **Note**: If no custom `speed` is set and the text is longer than 25 characters, its `time_to_live` and `speed` - * are dynamically adjusted to give players more time to read it. - * - * **Note**: Local flying text is not saved, which means it will disappear after a save/load-cycle. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.create_local_flying_text View documentation} - */ - create_local_flying_text(params: { - /** The flying text to show. */ - readonly text: LocalisedString - /** The location on the map at which to show the flying text. */ - readonly position?: Position - /** If `true`, the flying text is created at the player's cursor. Defaults to `false`. */ - readonly create_at_cursor?: boolean - /** The color of the flying text. Defaults to white text. */ - readonly color?: Color - /** The amount of ticks that the flying text will be shown for. Defaults to `80`. */ - readonly time_to_live?: uint - /** The speed at which the text rises upwards in tiles/second. Can't be a negative value. */ - readonly speed?: double - }): void - /** - * Gets the quick bar filter for the given slot or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.get_quick_bar_slot View documentation} - * - * @param index - The slot index. 1 for the first slot of page one, 2 for slot two of page one, 11 for the first - * slot of page 2, etc. - */ - get_quick_bar_slot(index: uint): LuaItemPrototype | undefined - /** - * Sets the quick bar filter for the given slot. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.set_quick_bar_slot View documentation} - * - * @param index - The slot index. 1 for the first slot of page one, 2 for slot two of page one, 11 for the first - * slot of page 2, etc. - * @param filter - The filter or `nil`. - */ - set_quick_bar_slot(index: uint, filter: string | LuaItemPrototype | LuaItemStack | undefined): void - /** - * Gets which quick bar page is being used for the given screen page or `nil` if not known. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.get_active_quick_bar_page View documentation} - * - * @param index - The screen page. Index 1 is the top row in the gui. Index can go beyond the visible number of bars - * on the screen to account for the interface config setting change. - */ - get_active_quick_bar_page(index: uint): uint8 | undefined - /** - * Sets which quick bar page is being used for the given screen page. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.set_active_quick_bar_page View documentation} - * - * @param screen_index - The screen page. Index 1 is the top row in the gui. Index can go beyond the visible number - * of bars on the screen to account for the interface config setting change. - * @param page_index - The new quick bar page. - */ - set_active_quick_bar_page(screen_index: uint, page_index: uint): void - /** - * Jump to the specified cutscene waypoint. Only works when the player is viewing a cutscene. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.jump_to_cutscene_waypoint View documentation} - * - * @param waypoint_index - */ - jump_to_cutscene_waypoint(waypoint_index: uint): void - /** - * Exit the current cutscene. Errors if not in a cutscene. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.exit_cutscene View documentation} - */ - exit_cutscene(): void - /** - * Queues a request to open the map at the specified position. If the map is already opened, the request will simply - * set the position (and scale). Render mode change requests are processed before rendering of the next frame. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.open_map View documentation} - * - * @param position - * @param scale - */ - open_map(position: Position, scale?: double): void - /** - * Queues a request to zoom to world at the specified position. If the player is already zooming to world, the - * request will simply set the position (and scale). Render mode change requests are processed before rendering of - * the next frame. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.zoom_to_world View documentation} - * - * @param position - * @param scale - */ - zoom_to_world(position: Position, scale?: double): void - /** - * Queues request to switch to the normal game view from the map or zoom to world view. Render mode change requests - * are processed before rendering of the next frame. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.close_map View documentation} - */ - close_map(): void - /** - * Is a custom Lua shortcut currently toggled? - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.is_shortcut_toggled View documentation} - * - * @param prototype_name - Prototype name of the custom shortcut. - */ - is_shortcut_toggled(prototype_name: string): boolean - /** - * Is a custom Lua shortcut currently available? - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.is_shortcut_available View documentation} - * - * @param prototype_name - Prototype name of the custom shortcut. - */ - is_shortcut_available(prototype_name: string): boolean - /** - * Toggle or untoggle a custom Lua shortcut - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.set_shortcut_toggled View documentation} - * - * @param prototype_name - Prototype name of the custom shortcut. - * @param toggled - */ - set_shortcut_toggled(prototype_name: string, toggled: boolean): void - /** - * Make a custom Lua shortcut available or unavailable. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.set_shortcut_available View documentation} - * - * @param prototype_name - Prototype name of the custom shortcut. - * @param available - */ - set_shortcut_available(prototype_name: string, available: boolean): void - /** - * Asks the player if they would like to connect to the given server. - * - * **Note**: This only does anything when used on a multiplayer peer. Single player and server hosts will ignore the prompt. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.connect_to_server View documentation} - */ - connect_to_server(params: { - /** The server (address:port) if port is not given the default Factorio port is used. */ - readonly address: string - /** The name of the server. */ - readonly name?: LocalisedString - readonly description?: LocalisedString - /** - * The password if different from the one used to join this game. Note, if the current password is not empty but - * the one required to join the new server is an empty string should be given for this field. - */ - readonly password?: string - }): void - /** - * Toggles this player into or out of the map editor. Does nothing if this player isn't an admin or if the player - * doesn't have permission to use the map editor. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.toggle_map_editor View documentation} - */ - toggle_map_editor(): void - /** - * Requests a translation for the given localised string. If the request is successful the - * {@link OnStringTranslatedEvent on_string_translated} event will be fired at a later time with the results. - * - * **Note**: Does nothing if this player is not connected. (see {@link LuaPlayer.connected LuaPlayer::connected}). - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.request_translation View documentation} - * - * @param localised_string - * @returns If the request was sent or not. - */ - request_translation(localised_string: LocalisedString): boolean - /** - * Gets the filter for this map editor infinity filters at the given index or `nil` if the filter index doesn't - * exist or is empty. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.get_infinity_inventory_filter View documentation} - * - * @param index - The index to get. - */ - get_infinity_inventory_filter(index: uint): InfinityInventoryFilter | undefined - /** - * Sets the filter for this map editor infinity filters at the given index. - * - * *Can only be used if this is InfinityContainer* - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.set_infinity_inventory_filter View documentation} - * - * @param index - The index to set. - * @param filter - The new filter or `nil` to clear the filter. - */ - set_infinity_inventory_filter(index: uint, filter: InfinityInventoryFilter | undefined): void - /** - * Clears all recipe notifications for this player. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.clear_recipe_notifications View documentation} - */ - clear_recipe_notifications(): void - /** - * Adds the given recipe to the list of recipe notifications for this player. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.add_recipe_notification View documentation} - * - * @param recipe - Name of the recipe prototype to add. - */ - add_recipe_notification(recipe: string): void - /** - * Adds the given blueprint to this player's clipboard queue. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.add_to_clipboard View documentation} - * - * @param blueprint - The blueprint to add. - */ - add_to_clipboard(blueprint: LuaItemStack): void - /** - * Gets a copy of the currently selected blueprint in the clipboard queue into the player's cursor, as if the player - * activated Paste. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.activate_paste View documentation} - */ - activate_paste(): void - /** - * Starts selection with selection tool from the specified position. Does nothing if the players cursor is not a - * selection tool. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.start_selection View documentation} - * - * @param position - The position to start selection from. - * @param selection_mode - The type of selection to start. Can be `select`, `alternative-select`, `reverse-select`. - */ - start_selection(position: Position, selection_mode: string): void - /** - * Clears the players selection tool selection position. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.clear_selection View documentation} - */ - clear_selection(): void - /** - * The character attached to this player, or `nil` if no character. - * - * **Note**: Will also return `nil` when the player is disconnected (see {@link LuaPlayer.connected LuaPlayer::connected}). - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.character View documentation} - */ - character: LuaEntity | undefined - /** - * When in a cutscene; the character this player would be using once the cutscene is over. - * - * **Note**: Will also return `nil` when the player is disconnected (see {@link LuaPlayer.connected LuaPlayer::connected}). - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.cutscene_character View documentation} - */ - readonly cutscene_character: LuaEntity | undefined - /** - * This player's index in {@link LuaGameScript.players LuaGameScript::players}. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.index View documentation} - */ - readonly index: uint - readonly gui: LuaGui - /** - * `true` if the player opened itself. I.e. if they opened the character or god-controller GUI. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.opened_self View documentation} - */ - readonly opened_self: boolean - readonly controller_type: defines.controllers - /** - * The stashed controller type or `nil` if no controller is stashed. - * - * **Note**: This is mainly useful when a player is in the map editor. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.stashed_controller_type View documentation} - */ - readonly stashed_controller_type: defines.controllers | undefined - /** - * The player's game view settings. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.game_view_settings View documentation} - */ - game_view_settings: GameViewSettings - /** - * `true` if the minimap is visible. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.minimap_enabled View documentation} - */ - minimap_enabled: boolean - /** - * The color associated with the player. This will be used to tint the player's character as well as their buildings - * and vehicles. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.color View documentation} - */ - color: Color - /** - * The color used when this player talks in game. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.chat_color View documentation} - */ - chat_color: Color - /** - * The player's username. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.name View documentation} - */ - readonly name: string - /** - * The tag that is shown after the player in chat and on the map. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.tag View documentation} - */ - tag: string - /** - * `true` if the player is currently connected to the game. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.connected View documentation} - */ - readonly connected: boolean - /** - * `true` if the player is an admin. - * - * **Note**: Trying to change player admin status from the console when you aren't an admin does nothing. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.admin View documentation} - */ - admin: boolean - /** - * The source entity used during entity settings copy-paste if any. - * - * `nil` if there isn't currently a source entity. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.entity_copy_source View documentation} - */ - readonly entity_copy_source: LuaEntity | undefined - /** - * How many ticks since the last action of this player - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.afk_time View documentation} - */ - readonly afk_time: uint - /** - * How many ticks did this player spend playing this save (all sessions combined) - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.online_time View documentation} - */ - readonly online_time: uint - /** - * At what tick this player was last online. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.last_online View documentation} - */ - readonly last_online: uint - /** - * The permission group this player is part of or `nil` if not part of any group. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.permission_group View documentation} - */ - permission_group: LuaPermissionGroup | undefined - /** - * Gets the current per-player settings for the this player, indexed by prototype name. Returns the same structure - * as {@link LuaSettings.get_player_settings LuaSettings::get_player_settings}. - * - * **Note**: This can become invalid if during operation this player becomes invalid. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.mod_settings View documentation} - */ - readonly mod_settings: LuaCustomTable - /** - * The number of ticks until this player will respawn or `nil` if not waiting to respawn. - * - * **Note**: Set to `nil` to immediately respawn the player. - * - * **Note**: Set to any positive value to trigger the respawn state for this player. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.ticks_to_respawn View documentation} - */ - ticks_to_respawn: uint | undefined - /** - * The display resolution for this player. - * - * **Note**: During {@link OnPlayerCreatedEvent on_player_created}, this attribute will always return a resolution of - * `{width=1920, height=1080}`. To get the actual resolution, listen to the - * {@link OnPlayerDisplayResolutionChangedEvent on_player_display_resolution_changed} event raised shortly afterwards. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.display_resolution View documentation} - */ - readonly display_resolution: DisplayResolution - /** - * The display scale for this player. - * - * **Note**: During {@link OnPlayerCreatedEvent on_player_created}, this attribute will always return a scale of `1`. - * To get the actual scale, listen to the {@link OnPlayerDisplayScaleChangedEvent on_player_display_scale_changed} - * event raised shortly afterwards. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.display_scale View documentation} - */ - readonly display_scale: double - /** - * The item stack containing a blueprint to be setup. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.blueprint_to_setup View documentation} - */ - readonly blueprint_to_setup: LuaItemStack - /** - * The render mode of the player, like map or zoom to world. The render mode can be set using - * {@link LuaPlayer.open_map LuaPlayer::open_map}, {@link LuaPlayer.zoom_to_world LuaPlayer::zoom_to_world} and - * {@link LuaPlayer.close_map LuaPlayer::close_map}. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.render_mode View documentation} - */ - readonly render_mode: defines.render_mode - /** - * If `true`, zoom-to-world noise effect will be disabled and environmental sounds will be based on zoom-to-world - * view instead of position of player's character. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.spectator View documentation} - */ - spectator: boolean - /** - * If items not included in this map editor infinity inventory filters should be removed. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.remove_unfiltered_items View documentation} - */ - remove_unfiltered_items: boolean - /** - * The filters for this map editor infinity inventory settings. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.infinity_inventory_filters View documentation} - */ - infinity_inventory_filters: InfinityInventoryFilter[] - /** - * If the main inventory will be auto sorted. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.auto_sort_main_inventory View documentation} - */ - readonly auto_sort_main_inventory: boolean - /** - * The original location of the item in the cursor, marked with a hand. When writing, the specified inventory slot - * must be empty and the cursor stack must not be empty. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.hand_location View documentation} - */ - hand_location: ItemStackLocation - /** - * The player's zoom-level. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.zoom View documentation} - */ - set zoom(value: double) - /** - * The player's map view settings. To write to this, use a table containing the fields that should be changed. - * - * {@link https://lua-api.factorio.com/next/LuaPlayer.html#LuaPlayer.map_view_settings View documentation} - */ - set map_view_settings(value: MapViewSettings) - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaPlayer" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * An object used to measure script performance. - * - * **Note**: Since performance is non-deterministic these objects don't allow reading the raw time values from lua. They - * can be used anywhere a {@link LocalisedString} is used. - * - * {@link https://lua-api.factorio.com/next/LuaProfiler.html View documentation} - * - * @noSelf - */ -interface LuaProfiler { - /** - * Resets the clock, also restarting it. - * - * {@link https://lua-api.factorio.com/next/LuaProfiler.html#LuaProfiler.reset View documentation} - */ - reset(): void - /** - * Stops the clock. - * - * {@link https://lua-api.factorio.com/next/LuaProfiler.html#LuaProfiler.stop View documentation} - */ - stop(): void - /** - * Start the clock again, without resetting it. - * - * {@link https://lua-api.factorio.com/next/LuaProfiler.html#LuaProfiler.restart View documentation} - */ - restart(): void - /** - * Add the duration of another timer to this timer. Useful to reduce start/stop overhead when accumulating time onto - * many timers at once. - * - * **Note**: If other is running, the time to now will be added. - * - * {@link https://lua-api.factorio.com/next/LuaProfiler.html#LuaProfiler.add View documentation} - * - * @param other - The timer to add to this timer. - */ - add(other: LuaProfiler): void - /** - * Divides the current duration by a set value. Useful for calculating the average of many iterations. - * - * **Note**: Does nothing if this isn't stopped. - * - * {@link https://lua-api.factorio.com/next/LuaProfiler.html#LuaProfiler.divide View documentation} - * - * @param number - The number to divide by. Must be > 0. - */ - divide(number: double): void - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaProfiler" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for programmable speakers. - * - * {@link https://lua-api.factorio.com/next/LuaProgrammableSpeakerControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaProgrammableSpeakerControlBehavior extends LuaControlBehavior { - circuit_parameters: ProgrammableSpeakerCircuitParameters - circuit_condition: CircuitConditionDefinition - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaProgrammableSpeakerControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * An interface to send messages to the calling RCON interface. - * - * {@link https://lua-api.factorio.com/next/LuaRCON.html View documentation} - * - * @noSelf - */ -interface LuaRCON { - /** - * Print text to the calling RCON interface if any. - * - * {@link https://lua-api.factorio.com/next/LuaRCON.html#LuaRCON.print View documentation} - * - * @param message - */ - print(message: LocalisedString): void - /** This object's name. */ - readonly object_name: "LuaRCON" -} - -/** - * Control behavior for rail chain signals. - * - * {@link https://lua-api.factorio.com/next/LuaRailChainSignalControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaRailChainSignalControlBehavior extends LuaControlBehavior { - red_signal: SignalID - orange_signal: SignalID - green_signal: SignalID - blue_signal: SignalID - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaRailChainSignalControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A rail path. - * - * {@link https://lua-api.factorio.com/next/LuaRailPath.html View documentation} - * - * @noSelf - */ -interface LuaRailPath { - /** - * The total number of rails in this path. - * - * {@link https://lua-api.factorio.com/next/LuaRailPath.html#LuaRailPath.size View documentation} - */ - readonly size: uint - /** - * The current rail index. - * - * {@link https://lua-api.factorio.com/next/LuaRailPath.html#LuaRailPath.current View documentation} - */ - readonly current: uint - /** - * The total path distance. - * - * {@link https://lua-api.factorio.com/next/LuaRailPath.html#LuaRailPath.total_distance View documentation} - */ - readonly total_distance: double - /** - * The total distance travelled. - * - * {@link https://lua-api.factorio.com/next/LuaRailPath.html#LuaRailPath.travelled_distance View documentation} - */ - readonly travelled_distance: double - /** - * Array of the rails that this path travels over. - * - * {@link https://lua-api.factorio.com/next/LuaRailPath.html#LuaRailPath.rails View documentation} - */ - readonly rails: LuaCustomTable - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaRailPath" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for rail signals. - * - * {@link https://lua-api.factorio.com/next/LuaRailSignalControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaRailSignalControlBehavior extends LuaControlBehavior { - red_signal: SignalID - orange_signal: SignalID - green_signal: SignalID - /** - * If this will close the rail signal based off the circuit condition. - * - * {@link https://lua-api.factorio.com/next/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.close_signal View documentation} - */ - close_signal: boolean - /** - * If this will read the rail signal state. - * - * {@link https://lua-api.factorio.com/next/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.read_signal View documentation} - */ - read_signal: boolean - /** - * The circuit condition when controlling the signal through the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.circuit_condition View documentation} - */ - circuit_condition: CircuitConditionDefinition - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaRailSignalControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A deterministic random generator independent from the core games random generator that can be seeded and re-seeded at - * will. This random generator can be saved and loaded and will maintain its state. Note this is entirely different from - * calling {@link https://lua-api.factorio.com/next/Libraries.html#math.random math.random}() and you should be sure you - * actually want to use this over calling `math.random()`. If you aren't sure if you need to use this over calling - * `math.random()` then you probably don't need to use this. - * - * {@link https://lua-api.factorio.com/next/LuaRandomGenerator.html View documentation} - * - * @example - * Create a generator and use it to print a random number. - * - * ```lua - * global.generator = game.create_random_generator() - * game.player.print(global.generator()) - * ``` - * - * @noSelf - */ -interface LuaRandomGenerator { - /** - * Re-seeds the random generator with the given value. - * - * **Note**: Seeds that are close together will produce similar results. Seeds from 0 to 341 will produce the same results. - * - * {@link https://lua-api.factorio.com/next/LuaRandomGenerator.html#LuaRandomGenerator.re_seed View documentation} - * - * @param seed - */ - re_seed(seed: uint): void - /** - * Generates a random number. If no parameters are given a number in the [0, 1) range is returned. If a single - * parameter is given a floored number in the [1, N] range is returned. If 2 parameters are given a floored number - * in the [N1, N2] range is returned. - * - * {@link https://lua-api.factorio.com/next/LuaRandomGenerator.html#LuaRandomGenerator.operator%20() View documentation} - * - * @param lower - Inclusive lower bound on the result - * @param upper - Inclusive upper bound on the result - */ - (lower?: int, upper?: int): double - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaRandomGenerator" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A crafting recipe. Recipes belong to forces (see {@link LuaForce}) because some recipes are unlocked by research, and - * researches are per-force. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html View documentation} - * - * @noSelf - */ -interface LuaRecipe { - /** - * Reload the recipe from the prototype. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.reload View documentation} - */ - reload(): void - /** - * Name of the recipe. This can be different than the name of the result items as there could be more recipes to - * make the same item. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.name View documentation} - */ - readonly name: string - /** - * Localised name of the recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.localised_name View documentation} - */ - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * The prototype for this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.prototype View documentation} - */ - readonly prototype: LuaRecipePrototype - /** - * Can the recipe be used? - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.enabled View documentation} - */ - enabled: boolean - /** - * Category of the recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.category View documentation} - */ - readonly category: string - /** - * Ingredients for this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.ingredients View documentation} - * - * @example - * What the "steel-chest" recipe would return - * - * ```lua - * {{type="item", name="steel-plate", amount=8}} - * ``` - * - * @example - * What the "advanced-oil-processing" recipe would return - * - * ```lua - * {{type="fluid", name="crude-oil", amount=10}, {type="fluid", name="water", amount=5}} - * ``` - */ - readonly ingredients: Ingredient[] - /** - * The results of this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.products View documentation} - */ - readonly products: Product[] - /** - * Is the recipe hidden? Hidden recipe don't show up in the crafting menu. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.hidden View documentation} - */ - readonly hidden: boolean - /** - * Is the recipe hidden from flow statistics? - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.hidden_from_flow_stats View documentation} - */ - hidden_from_flow_stats: boolean - /** - * Energy required to execute this recipe. This directly affects the crafting time: Recipe's energy is exactly its - * crafting time in seconds, when crafted in an assembling machine with crafting speed exactly equal to one. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.energy View documentation} - */ - readonly energy: double - /** - * Order string. This is used to sort the crafting menu. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.order View documentation} - */ - readonly order: string - /** - * Group of this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.group View documentation} - */ - readonly group: LuaGroup - /** - * Subgroup of this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.subgroup View documentation} - */ - readonly subgroup: LuaGroup - /** - * The force that owns this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipe.html#LuaRecipe.force View documentation} - */ - readonly force: LuaForce - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaRecipe" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a recipe category. - * - * {@link https://lua-api.factorio.com/next/LuaRecipeCategoryPrototype.html View documentation} - * - * @noSelf - */ -interface LuaRecipeCategoryPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaRecipeCategoryPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A crafting recipe prototype. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html View documentation} - * - * @noSelf - */ -interface LuaRecipePrototype { - /** - * If this recipe prototype is enabled by default (enabled at the beginning of a game). - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.enabled View documentation} - */ - readonly enabled: boolean - /** - * Name of the recipe. This can be different than the name of the result items as there could be more recipes to - * make the same item. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.name View documentation} - */ - readonly name: string - /** - * Localised name of the recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.localised_name View documentation} - */ - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Category of the recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.category View documentation} - */ - readonly category: string - /** - * Ingredients for this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.ingredients View documentation} - */ - readonly ingredients: Ingredient[] - /** - * The results of this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.products View documentation} - */ - readonly products: Product[] - /** - * The main product of this recipe, `nil` if no main product is defined. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.main_product View documentation} - */ - readonly main_product: Product | undefined - /** - * Is the recipe hidden? Hidden recipe don't show up in the crafting menu. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.hidden View documentation} - */ - readonly hidden: boolean - /** - * Is the recipe hidden from flow statistics (item/fluid production statistics)? - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.hidden_from_flow_stats View documentation} - */ - readonly hidden_from_flow_stats: boolean - /** - * Is the recipe hidden from player crafting? The recipe will still show up for selection in machines. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.hidden_from_player_crafting View documentation} - */ - readonly hidden_from_player_crafting: boolean - /** - * Should this recipe always show "Made in" in the tooltip? - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.always_show_made_in View documentation} - */ - readonly always_show_made_in: boolean - /** - * Energy required to execute this recipe. This directly affects the crafting time: Recipe's energy is exactly its - * crafting time in seconds, when crafted in an assembling machine with crafting speed exactly equal to one. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.energy View documentation} - */ - readonly energy: double - /** - * Order string. This is used to sort the crafting menu. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.order View documentation} - */ - readonly order: string - /** - * Group of this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.group View documentation} - */ - readonly group: LuaGroup - /** - * Subgroup of this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.subgroup View documentation} - */ - readonly subgroup: LuaGroup - /** - * The multiplier used when this recipe is copied from an assembling machine to a requester chest. For each item in - * the recipe the item count * this value is set in the requester chest. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.request_paste_multiplier View documentation} - */ - readonly request_paste_multiplier: uint - /** - * Used to determine how many extra items are put into an assembling machine before it's considered "full enough". - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.overload_multiplier View documentation} - */ - readonly overload_multiplier: uint - /** - * If the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size). - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.allow_inserter_overload View documentation} - */ - readonly allow_inserter_overload: boolean - /** - * If this recipe is enabled for the purpose of intermediate hand-crafting. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.allow_as_intermediate View documentation} - */ - readonly allow_as_intermediate: boolean - /** - * If this recipe is allowed to use intermediate recipes when hand-crafting. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.allow_intermediates View documentation} - */ - readonly allow_intermediates: boolean - /** - * If the amount is shown in the recipe tooltip title when the recipe produces more than 1 product. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.show_amount_in_title View documentation} - */ - readonly show_amount_in_title: boolean - /** - * If the products are always shown in the recipe tooltip. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.always_show_products View documentation} - */ - readonly always_show_products: boolean - /** - * The emissions multiplier for this recipe. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.emissions_multiplier View documentation} - */ - readonly emissions_multiplier: double - /** - * Is this recipe allowed to be broken down for the recipe tooltip "Total raw" calculations? - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.allow_decomposition View documentation} - */ - readonly allow_decomposition: boolean - /** - * Is this recipe unlocks the result item(s) so they're shown in filter-select GUIs. - * - * {@link https://lua-api.factorio.com/next/LuaRecipePrototype.html#LuaRecipePrototype.unlock_results View documentation} - */ - readonly unlock_results: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaRecipePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Registry of interfaces between scripts. An interface is simply a dictionary mapping names to functions. A script or - * mod can then register an interface with {@link LuaRemote}, after that any script can call the registered functions, - * provided it knows the interface name and the desired function name. An instance of LuaRemote is available through the - * global object named `remote`. - * - * {@link https://lua-api.factorio.com/next/LuaRemote.html View documentation} - * - * @example - * Will register a remote interface containing two functions. Later, it will call these functions through `remote`. - * - * ```lua - * remote.add_interface("human interactor", - * {hello = function() game.player.print("Hi!") end, - * bye = function(name) game.player.print("Bye " .. name) end}) - * -- Some time later, possibly in a different mod... - * remote.call("human interactor", "hello") - * remote.call("human interactor", "bye", "dear reader") - * ``` - * - * @noSelf - */ -interface LuaRemote { - /** - * Add a remote interface. - * - * **Note**: It is an error if the given interface `name` is already registered. - * - * {@link https://lua-api.factorio.com/next/LuaRemote.html#LuaRemote.add_interface View documentation} - * - * @param name - Name of the interface. - * @param functions - List of functions that are members of the new interface. - */ - add_interface(name: string, functions: Record void>): void - /** - * Removes an interface with the given name. - * - * {@link https://lua-api.factorio.com/next/LuaRemote.html#LuaRemote.remove_interface View documentation} - * - * @param name - Name of the interface. - * @returns If the interface was removed. `False` if the interface didn't exist. - */ - remove_interface(name: string): boolean - /** - * Call a function of an interface. - * - * {@link https://lua-api.factorio.com/next/LuaRemote.html#LuaRemote.call View documentation} - * - * @param _interface - Interface to look up `function` in. - * @param _function - Function name that belongs to `interface`. - * @param args - Arguments to pass to the called function. - */ - call(_interface: string, _function: string, ...args: Any[]): Any - /** - * List of all registered interfaces. For each interface name, `remote.interfaces[name]` is a dictionary mapping the - * interface's registered functions to the value `true`. - * - * {@link https://lua-api.factorio.com/next/LuaRemote.html#LuaRemote.interfaces View documentation} - * - * @example - * Assuming the "human interactor" interface is registered as above - * - * ```lua - * game.player.print(tostring(remote.interfaces["human interactor"]["hello"])) -- prints true - * game.player.print(tostring(remote.interfaces["human interactor"]["nonexistent"])) -- prints nil - * ``` - */ - readonly interfaces: Record> - /** This object's name. */ - readonly object_name: "LuaRemote" -} - -/** - * Allows rendering of geometric shapes, text and sprites in the game world. Each render object is identified by an id - * that is universally unique for the lifetime of a whole game. - * - * **Note**: If an entity target of an object is destroyed or changes surface, then the object is also destroyed. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html View documentation} - * - * @noSelf - */ -interface LuaRendering { - /** - * Create a line. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_line View documentation} - * - * @example - * Draw a white and 2 pixel wide line from {0, 0} to {2, 2}. - * - * ```lua - * rendering.draw_line{surface = game.player.surface, from = {0, 0}, to = {2, 2}, color = {1, 1, 1}, width = 2} - * ``` - * - * @example - * Draw a red and 3 pixel wide line from {0, 0} to {0, 5}. The line has 1 tile long dashes and gaps. - * - * ```lua - * rendering.draw_line{surface = game.player.surface, from = {0, 0}, to = {0, 5}, color = {r = 1}, width = 3, gap_length = 1, dash_length = 1} - * ``` - * - * @returns Id of the render object - */ - draw_line(params: { - readonly color: Color - /** In pixels (32 per tile). */ - readonly width: float - /** Length of the gaps that this line has, in tiles. Default is 0. */ - readonly gap_length?: double - /** Length of the dashes that this line has. Used only if gap_length > 0. Default is 0. */ - readonly dash_length?: double - readonly from: Position | LuaEntity - /** Only used if `from` is a LuaEntity. */ - readonly from_offset?: Vector - readonly to: Position | LuaEntity - /** Only used if `to` is a LuaEntity. */ - readonly to_offset?: Vector - readonly surface: SurfaceIdentification - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should be drawn below sprites and entities. */ - readonly draw_on_ground?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Create a text. - * - * **Note**: Not all fonts support scaling. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_text View documentation} - * - * @returns Id of the render object - */ - draw_text(params: { - /** The text to display. */ - readonly text: LocalisedString - readonly surface: SurfaceIdentification - readonly target: Position | LuaEntity - /** Only used if `target` is a LuaEntity. */ - readonly target_offset?: Vector - readonly color: Color - readonly scale?: double - /** Name of font to use. Defaults to the same font as flying-text. */ - readonly font?: string - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should be drawn below sprites and entities. */ - readonly draw_on_ground?: boolean - /** The orientation of the text. Default is 0. */ - readonly orientation?: RealOrientation - /** Defaults to "left". Other options are "right" and "center". */ - readonly alignment?: "left" | "right" | "center" - /** Defaults to "top". Other options are "middle", "baseline" and "bottom". */ - readonly vertical_alignment?: "top" | "middle" | "baseline" | "bottom" - /** - * Defaults to false. If true, the text scales with player zoom, resulting in it always being the same size on - * screen, and the size compared to the game world changes. - */ - readonly scale_with_zoom?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Create a circle. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_circle View documentation} - * - * @returns Id of the render object - */ - draw_circle(params: { - readonly color: Color - /** In tiles. */ - readonly radius: double - /** Width of the outline, used only if filled = false. Value is in pixels (32 per tile). */ - readonly width?: float - /** If the circle should be filled. */ - readonly filled: boolean - readonly target: Position | LuaEntity - /** Only used if `target` is a LuaEntity. */ - readonly target_offset?: Vector - readonly surface: SurfaceIdentification - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should be drawn below sprites and entities. */ - readonly draw_on_ground?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Create a rectangle. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_rectangle View documentation} - * - * @returns Id of the render object - */ - draw_rectangle(params: { - readonly color: Color - /** Width of the outline, used only if filled = false. Value is in pixels (32 per tile). */ - readonly width?: float - /** If the rectangle should be filled. */ - readonly filled: boolean - readonly left_top: Position | LuaEntity - /** Only used if `left_top` is a LuaEntity. */ - readonly left_top_offset?: Vector - readonly right_bottom: Position | LuaEntity - /** Only used if `right_bottom` is a LuaEntity. */ - readonly right_bottom_offset?: Vector - readonly surface: SurfaceIdentification - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should be drawn below sprites and entities. */ - readonly draw_on_ground?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Create an arc. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_arc View documentation} - * - * @returns Id of the render object - */ - draw_arc(params: { - readonly color: Color - /** The radius of the outer edge of the arc, in tiles. */ - readonly max_radius: double - /** The radius of the inner edge of the arc, in tiles. */ - readonly min_radius: double - /** Where the arc starts, in radian. */ - readonly start_angle: float - /** The angle of the arc, in radian. */ - readonly angle: float - readonly target: Position | LuaEntity - /** Only used if `target` is a LuaEntity. */ - readonly target_offset?: Vector - readonly surface: SurfaceIdentification - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should be drawn below sprites and entities. */ - readonly draw_on_ground?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Create a triangle mesh defined by a triangle strip. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_polygon View documentation} - * - * @returns Id of the render object - */ - draw_polygon(params: { - readonly color: Color - readonly vertices: ScriptRenderVertexTarget[] - /** Acts like an offset applied to all vertices that are not set to an entity. */ - readonly target?: Position | LuaEntity - /** Only used if `target` is a LuaEntity. */ - readonly target_offset?: Vector - /** The orientation applied to all vertices. Default is 0. */ - readonly orientation?: RealOrientation - /** - * If given, the vertices (that are not set to an entity) rotate so that it faces this target. Note that - * `orientation` is still applied. - */ - readonly orientation_target?: Position | LuaEntity - /** Only used if `orientation_target` is a LuaEntity. */ - readonly orientation_target_offset?: Vector - readonly surface: SurfaceIdentification - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should be drawn below sprites and entities. */ - readonly draw_on_ground?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Create a sprite. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_sprite View documentation} - * - * @example - * This will draw an iron plate icon at the character's feet. The sprite will move together with the character. - * - * ```lua - * rendering.draw_sprite{sprite = "item.iron-plate", target = game.player.character, surface = game.player.surface} - * ``` - * - * @example - * This will draw an iron plate icon at the character's head. The sprite will move together with the character. - * - * ```lua - * rendering.draw_sprite{sprite = "item.iron-plate", target = game.player.character, target_offset = {0, -2}, surface = game.player.surface} - * ``` - * - * @returns Id of the render object - */ - draw_sprite(params: { - readonly sprite: SpritePath - /** The orientation of the sprite. Default is 0. */ - readonly orientation?: RealOrientation - /** Horizontal scale of the sprite. Default is 1. */ - readonly x_scale?: double - /** Vertical scale of the sprite. Default is 1. */ - readonly y_scale?: double - readonly tint?: Color - readonly render_layer?: RenderLayer - /** If given, the sprite rotates so that it faces this target. Note that `orientation` is still applied to the sprite. */ - readonly orientation_target?: Position | LuaEntity - /** Only used if `orientation_target` is a LuaEntity. */ - readonly orientation_target_offset?: Vector - /** Offsets the center of the sprite if `orientation_target` is given. This offset will rotate together with the sprite. */ - readonly oriented_offset?: Vector - /** Center of the sprite. */ - readonly target: Position | LuaEntity - /** Only used if `target` is a LuaEntity. */ - readonly target_offset?: Vector - readonly surface: SurfaceIdentification - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Create a light. - * - * **Note**: The base game uses the utility sprites `light_medium` and `light_small` for lights. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_light View documentation} - * - * @returns Id of the render object - */ - draw_light(params: { - readonly sprite: SpritePath - /** The orientation of the light. Default is 0. */ - readonly orientation?: RealOrientation - /** Default is 1. */ - readonly scale?: float - /** Default is 1. */ - readonly intensity?: float - /** The minimum darkness at which this light is rendered. Default is 0. */ - readonly minimum_darkness?: float - /** - * If this light has the same orientation as the entity target, default is false. Note that `orientation` is - * still applied to the sprite. - */ - readonly oriented?: boolean - /** Defaults to white (no tint). */ - readonly color?: Color - /** Center of the light. */ - readonly target: Position | LuaEntity - /** Only used if `target` is a LuaEntity. */ - readonly target_offset?: Vector - readonly surface: SurfaceIdentification - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Create an animation. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.draw_animation View documentation} - * - * @returns Id of the render object - */ - draw_animation(params: { - /** Name of an {@link https://wiki.factorio.com/Prototype/Animation animation prototype}. */ - readonly animation: string - /** The orientation of the animation. Default is 0. */ - readonly orientation?: RealOrientation - /** Horizontal scale of the animation. Default is 1. */ - readonly x_scale?: double - /** Vertical scale of the animation. Default is 1. */ - readonly y_scale?: double - readonly tint?: Color - readonly render_layer?: RenderLayer - /** How many frames the animation goes forward per tick. Default is 1. */ - readonly animation_speed?: double - /** Offset of the animation in frames. Default is 0. */ - readonly animation_offset?: double - /** - * If given, the animation rotates so that it faces this target. Note that `orientation` is still applied to the - * animation. - */ - readonly orientation_target?: Position | LuaEntity - /** Only used if `orientation_target` is a LuaEntity. */ - readonly orientation_target_offset?: Vector - /** - * Offsets the center of the animation if `orientation_target` is given. This offset will rotate together with - * the animation. - */ - readonly oriented_offset?: Vector - /** Center of the animation. */ - readonly target: Position | LuaEntity - /** Only used if `target` is a LuaEntity. */ - readonly target_offset?: Vector - readonly surface: SurfaceIdentification - /** In ticks. Defaults to living forever. */ - readonly time_to_live?: uint - /** The forces that this object is rendered to. */ - readonly forces?: ForceIdentification[] - /** The players that this object is rendered to. */ - readonly players?: PlayerIdentification[] - /** If this is rendered to anyone at all. Defaults to true. */ - readonly visible?: boolean - /** If this should only be rendered in alt mode. Defaults to false. */ - readonly only_in_alt_mode?: boolean - }): uint64 - /** - * Destroy the object with the given id. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.destroy View documentation} - * - * @param id - */ - destroy(id: uint64): void - /** - * Does a font with this name exist? - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.is_font_valid View documentation} - * - * @param font_name - */ - is_font_valid(font_name: string): boolean - /** - * Does a valid object with this id exist? - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.is_valid View documentation} - * - * @param id - */ - is_valid(id: uint64): boolean - /** - * Gets an array of all valid object ids. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_all_ids View documentation} - * - * @param mod_name - If provided, get only the render objects created by this mod. - */ - get_all_ids(mod_name?: string): uint64[] - /** - * Destroys all render objects. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.clear View documentation} - * - * @param mod_name - If provided, only the render objects created by this mod are destroyed. - */ - clear(mod_name?: string): void - /** - * Gets the type of the given object. The types are "text", "line", "circle", "rectangle", "arc", "polygon", - * "sprite", "light" and "animation". - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_type View documentation} - * - * @param id - */ - get_type(id: uint64): "text" | "line" | "circle" | "rectangle" | "arc" | "polygon" | "sprite" | "light" | "animation" - /** - * Reorder this object so that it is drawn in front of the already existing objects. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.bring_to_front View documentation} - * - * @param id - */ - bring_to_front(id: uint64): void - /** - * The surface the object with this id is rendered on. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_surface View documentation} - * - * @param id - */ - get_surface(id: uint64): LuaSurface - /** - * Get the time to live of the object with this id. This will be 0 if the object does not expire. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_time_to_live View documentation} - * - * @param id - */ - get_time_to_live(id: uint64): uint - /** - * Set the time to live of the object with this id. Set to 0 if the object should not expire. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_time_to_live View documentation} - * - * @param id - * @param time_to_live - */ - set_time_to_live(id: uint64, time_to_live: uint): void - /** - * Get the forces that the object with this id is rendered to or `nil` if visible to all forces. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_forces View documentation} - * - * @param id - */ - get_forces(id: uint64): LuaForce[] | undefined - /** - * Set the forces that the object with this id is rendered to. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_forces View documentation} - * - * @param id - * @param forces - Providing an empty array will set the object to be visible to all forces. - */ - set_forces(id: uint64, forces: ForceIdentification[]): void - /** - * Get the players that the object with this id is rendered to or `nil` if visible to all players. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_players View documentation} - * - * @param id - */ - get_players(id: uint64): LuaPlayer[] | undefined - /** - * Set the players that the object with this id is rendered to. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_players View documentation} - * - * @param id - * @param players - Providing an empty array will set the object to be visible to all players. - */ - set_players(id: uint64, players: PlayerIdentification[]): void - /** - * Get whether this is rendered to anyone at all. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_visible View documentation} - * - * @param id - */ - get_visible(id: uint64): boolean - /** - * Set whether this is rendered to anyone at all. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_visible View documentation} - * - * @param id - * @param visible - */ - set_visible(id: uint64, visible: boolean): void - /** - * Get whether this is being drawn on the ground, under most entities and sprites. - * - * *Can only be used if this is Text, Line, Circle, Rectangle, Arc or Polygon* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_draw_on_ground View documentation} - * - * @param id - */ - get_draw_on_ground(id: uint64): boolean - /** - * Set whether this is being drawn on the ground, under most entities and sprites. - * - * *Can only be used if this is Text, Line, Circle, Rectangle, Arc or Polygon* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_draw_on_ground View documentation} - * - * @param id - * @param draw_on_ground - */ - set_draw_on_ground(id: uint64, draw_on_ground: boolean): void - /** - * Get whether this is only rendered in alt-mode. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_only_in_alt_mode View documentation} - * - * @param id - */ - get_only_in_alt_mode(id: uint64): boolean - /** - * Set whether this is only rendered in alt-mode. - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_only_in_alt_mode View documentation} - * - * @param id - * @param only_in_alt_mode - */ - set_only_in_alt_mode(id: uint64, only_in_alt_mode: boolean): void - /** - * Get the color or tint of the object with this id. - * - * *Can only be used if this is Text, Line, Circle, Rectangle, Arc, Polygon, Sprite, Light or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_color View documentation} - * - * @param id - * @returns Or `nil` if the object does not support color. - */ - get_color(id: uint64): ColorTable | undefined - /** - * Set the color or tint of the object with this id. Does nothing if this object does not support color. - * - * *Can only be used if this is Text, Line, Circle, Rectangle, Arc, Polygon, Sprite, Light or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_color View documentation} - * - * @param id - * @param color - */ - set_color(id: uint64, color: Color): void - /** - * Get the width of the object with this id. Value is in pixels (32 per tile). - * - * *Can only be used if this is Line, Circle or Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_width View documentation} - * - * @param id - * @returns Or `nil` if the object does not support width. - */ - get_width(id: uint64): float | undefined - /** - * Set the width of the object with this id. Does nothing if this object does not support width. Value is in pixels - * (32 per tile). - * - * *Can only be used if this is Line, Circle or Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_width View documentation} - * - * @param id - * @param width - */ - set_width(id: uint64, width: float): void - /** - * Get from where the line with this id is drawn or `nil` if this object is not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_from View documentation} - * - * @param id - */ - get_from(id: uint64): ScriptRenderTarget | undefined - /** - * Set from where the line with this id is drawn. Does nothing if the object is not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_from View documentation} - * - * @param id - * @param from - * @param from_offset - */ - set_from(id: uint64, from: Position | LuaEntity, from_offset?: Vector): void - /** - * Get where the line with this id is drawn to or `nil` if the object is not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_to View documentation} - * - * @param id - */ - get_to(id: uint64): ScriptRenderTarget | undefined - /** - * Set where the line with this id is drawn to. Does nothing if this object is not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_to View documentation} - * - * @param id - * @param to - * @param to_offset - */ - set_to(id: uint64, to: Position | LuaEntity, to_offset?: Vector): void - /** - * Get the dash length of the line with this id or `nil` if the object is not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_dash_length View documentation} - * - * @param id - */ - get_dash_length(id: uint64): double | undefined - /** - * Set the dash length of the line with this id. Does nothing if this object is not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_dash_length View documentation} - * - * @param id - * @param dash_length - */ - set_dash_length(id: uint64, dash_length: double): void - /** - * Get the length of the gaps in the line with this id or `nil` if the object is not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_gap_length View documentation} - * - * @param id - */ - get_gap_length(id: uint64): double | undefined - /** - * Set the length of the gaps in the line with this id. Does nothing if this object is not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_gap_length View documentation} - * - * @param id - * @param gap_length - */ - set_gap_length(id: uint64, gap_length: double): void - /** - * Set the length of the dashes and the length of the gaps in the line with this id. Does nothing if this object is - * not a line. - * - * *Can only be used if this is Line* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_dashes View documentation} - * - * @param id - * @param dash_length - * @param gap_length - */ - set_dashes(id: uint64, dash_length: double, gap_length: double): void - /** - * Get where the object with this id is drawn or `nil` if the object does not support target. - * - * **Note**: Polygon vertices that are set to an entity will ignore this. - * - * *Can only be used if this is Text, Circle, Arc, Polygon, Sprite, Light or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_target View documentation} - * - * @param id - */ - get_target(id: uint64): ScriptRenderTarget | undefined - /** - * Set where the object with this id is drawn. Does nothing if this object does not support target. - * - * **Note**: Polygon vertices that are set to an entity will ignore this. - * - * *Can only be used if this is Text, Circle, Arc, Polygon, Sprite, Light or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_target View documentation} - * - * @param id - * @param target - * @param target_offset - */ - set_target(id: uint64, target: Position | LuaEntity, target_offset?: Vector): void - /** - * Get the orientation of the object with this id or `nil` if the object is not a text, polygon, sprite, light or animation. - * - * **Note**: Polygon vertices that are set to an entity will ignore this. - * - * *Can only be used if this is Text, Polygon, Sprite, Light or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_orientation View documentation} - * - * @param id - */ - get_orientation(id: uint64): RealOrientation | undefined - /** - * Set the orientation of the object with this id. Does nothing if this object is not a text, polygon, sprite, light - * or animation. - * - * **Note**: Polygon vertices that are set to an entity will ignore this. - * - * *Can only be used if this is Text, Polygon, Sprite, Light or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_orientation View documentation} - * - * @param id - * @param orientation - */ - set_orientation(id: uint64, orientation: RealOrientation): void - /** - * Get the scale of the text or light with this id or `nil` if the object is not a text or light. - * - * *Can only be used if this is Text or Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_scale View documentation} - * - * @param id - */ - get_scale(id: uint64): double | undefined - /** - * Set the scale of the text or light with this id. Does nothing if this object is not a text or light. - * - * *Can only be used if this is Text or Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_scale View documentation} - * - * @param id - * @param scale - */ - set_scale(id: uint64, scale: double): void - /** - * Get the text that is displayed by the text with this id or `nil` if the object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_text View documentation} - * - * @param id - */ - get_text(id: uint64): LocalisedString | undefined - /** - * Set the text that is displayed by the text with this id. Does nothing if this object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_text View documentation} - * - * @param id - * @param text - */ - set_text(id: uint64, text: LocalisedString): void - /** - * Get the font of the text with this id or `nil` if the object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_font View documentation} - * - * @param id - */ - get_font(id: uint64): string | undefined - /** - * Set the font of the text with this id. Does nothing if this object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_font View documentation} - * - * @param id - * @param font - */ - set_font(id: uint64, font: string): void - /** - * Get the alignment of the text with this id or `nil` if the object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_alignment View documentation} - * - * @param id - */ - get_alignment(id: uint64): string | undefined - /** - * Set the alignment of the text with this id. Does nothing if this object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_alignment View documentation} - * - * @param id - * @param alignment - "left", "right" or "center". - */ - set_alignment(id: uint64, alignment: "left" | "right" | "center"): void - /** - * Get the vertical alignment of the text with this id or `nil` if the object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_vertical_alignment View documentation} - * - * @param id - */ - get_vertical_alignment(id: uint64): string | undefined - /** - * Set the vertical alignment of the text with this id. Does nothing if this object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_vertical_alignment View documentation} - * - * @param id - * @param alignment - "top", "middle", "baseline" or "bottom" - */ - set_vertical_alignment(id: uint64, alignment: "top" | "middle" | "baseline" | "bottom"): void - /** - * Get if the text with this id scales with player zoom or `nil` if the object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_scale_with_zoom View documentation} - * - * @param id - */ - get_scale_with_zoom(id: uint64): boolean | undefined - /** - * Set if the text with this id scales with player zoom, resulting in it always being the same size on screen, and - * the size compared to the game world changes. Does nothing if this object is not a text. - * - * *Can only be used if this is Text* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_scale_with_zoom View documentation} - * - * @param id - * @param scale_with_zoom - */ - set_scale_with_zoom(id: uint64, scale_with_zoom: boolean): void - /** - * Get if the circle or rectangle with this id is filled or `nil` if the object is not a circle or rectangle. - * - * *Can only be used if this is Circle or Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_filled View documentation} - * - * @param id - */ - get_filled(id: uint64): boolean | undefined - /** - * Set if the circle or rectangle with this id is filled. Does nothing if this object is not a circle or rectangle. - * - * *Can only be used if this is Circle or Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_filled View documentation} - * - * @param id - * @param filled - */ - set_filled(id: uint64, filled: boolean): void - /** - * Get the radius of the circle with this id or `nil` if the object is not a circle. - * - * *Can only be used if this is Circle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_radius View documentation} - * - * @param id - */ - get_radius(id: uint64): double | undefined - /** - * Set the radius of the circle with this id. Does nothing if this object is not a circle. - * - * *Can only be used if this is Circle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_radius View documentation} - * - * @param id - * @param radius - */ - set_radius(id: uint64, radius: double): void - /** - * Get where top left corner of the rectangle with this id is drawn or `nil` if the object is not a rectangle. - * - * *Can only be used if this is Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_left_top View documentation} - * - * @param id - */ - get_left_top(id: uint64): ScriptRenderTarget | undefined - /** - * Set where top left corner of the rectangle with this id is drawn. Does nothing if this object is not a rectangle. - * - * *Can only be used if this is Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_left_top View documentation} - * - * @param id - * @param left_top - * @param left_top_offset - */ - set_left_top(id: uint64, left_top: Position | LuaEntity, left_top_offset?: Vector): void - /** - * Get where bottom right corner of the rectangle with this id is drawn or `nil` if the object is not a rectangle. - * - * *Can only be used if this is Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_right_bottom View documentation} - * - * @param id - */ - get_right_bottom(id: uint64): ScriptRenderTarget | undefined - /** - * Set where top bottom right of the rectangle with this id is drawn. Does nothing if this object is not a rectangle. - * - * *Can only be used if this is Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_right_bottom View documentation} - * - * @param id - * @param right_bottom - * @param right_bottom_offset - */ - set_right_bottom(id: uint64, right_bottom: Position | LuaEntity, right_bottom_offset?: Vector): void - /** - * Set the corners of the rectangle with this id. Does nothing if this object is not a rectangle. - * - * *Can only be used if this is Rectangle* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_corners View documentation} - * - * @param id - * @param left_top - * @param left_top_offset - * @param right_bottom - * @param right_bottom_offset - */ - set_corners( - id: uint64, - left_top: Position | LuaEntity, - left_top_offset: Vector, - right_bottom: Position | LuaEntity, - right_bottom_offset: Vector - ): void - /** - * Get the radius of the outer edge of the arc with this id or `nil` if the object is not a arc. - * - * *Can only be used if this is Arc* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_max_radius View documentation} - * - * @param id - */ - get_max_radius(id: uint64): double | undefined - /** - * Set the radius of the outer edge of the arc with this id. Does nothing if this object is not a arc. - * - * *Can only be used if this is Arc* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_max_radius View documentation} - * - * @param id - * @param max_radius - */ - set_max_radius(id: uint64, max_radius: double): void - /** - * Get the radius of the inner edge of the arc with this id or `nil` if the object is not a arc. - * - * *Can only be used if this is Arc* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_min_radius View documentation} - * - * @param id - */ - get_min_radius(id: uint64): double | undefined - /** - * Set the radius of the inner edge of the arc with this id. Does nothing if this object is not a arc. - * - * *Can only be used if this is Arc* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_min_radius View documentation} - * - * @param id - * @param min_radius - */ - set_min_radius(id: uint64, min_radius: double): void - /** - * Get where the arc with this id starts or `nil` if the object is not a arc. - * - * *Can only be used if this is Arc* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_start_angle View documentation} - * - * @param id - * @returns Angle in radian - */ - get_start_angle(id: uint64): float | undefined - /** - * Set where the arc with this id starts. Does nothing if this object is not a arc. - * - * *Can only be used if this is Arc* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_start_angle View documentation} - * - * @param id - * @param start_angle - Angle in radian - */ - set_start_angle(id: uint64, start_angle: float): void - /** - * Get the angle of the arc with this id or `nil` if the object is not a arc. - * - * *Can only be used if this is Arc* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_angle View documentation} - * - * @param id - * @returns Angle in radian - */ - get_angle(id: uint64): float | undefined - /** - * Set the angle of the arc with this id. Does nothing if this object is not a arc. - * - * *Can only be used if this is Arc* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_angle View documentation} - * - * @param id - * @param angle - Angle in radian - */ - set_angle(id: uint64, angle: float): void - /** - * Get the vertices of the polygon with this id or `nil` if the object is not a polygon. - * - * *Can only be used if this is Polygon* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_vertices View documentation} - * - * @param id - */ - get_vertices(id: uint64): ScriptRenderTarget[] | undefined - /** - * Set the vertices of the polygon with this id. Does nothing if this object is not a polygon. - * - * *Can only be used if this is Polygon* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_vertices View documentation} - * - * @param id - * @param vertices - */ - set_vertices(id: uint64, vertices: ScriptRenderVertexTarget[]): void - /** - * Get the sprite of the sprite or light with this id or `nil` if the object is not a sprite or light. - * - * *Can only be used if this is Sprite or Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_sprite View documentation} - * - * @param id - */ - get_sprite(id: uint64): SpritePath | undefined - /** - * Set the sprite of the sprite or light with this id. Does nothing if this object is not a sprite or light. - * - * *Can only be used if this is Sprite or Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_sprite View documentation} - * - * @param id - * @param sprite - */ - set_sprite(id: uint64, sprite: SpritePath): void - /** - * Get the horizontal scale of the sprite or animation with this id or `nil` if the object is not a sprite or animation. - * - * *Can only be used if this is Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_x_scale View documentation} - * - * @param id - */ - get_x_scale(id: uint64): double | undefined - /** - * Set the horizontal scale of the sprite or animation with this id. Does nothing if this object is not a sprite or animation. - * - * *Can only be used if this is Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_x_scale View documentation} - * - * @param id - * @param x_scale - */ - set_x_scale(id: uint64, x_scale: double): void - /** - * Get the vertical scale of the sprite or animation with this id or `nil` if the object is not a sprite or animation. - * - * *Can only be used if this is Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_y_scale View documentation} - * - * @param id - */ - get_y_scale(id: uint64): double | undefined - /** - * Set the vertical scale of the sprite or animation with this id. Does nothing if this object is not a sprite or animation. - * - * *Can only be used if this is Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_y_scale View documentation} - * - * @param id - * @param y_scale - */ - set_y_scale(id: uint64, y_scale: double): void - /** - * Get the render layer of the sprite or animation with this id or `nil` if the object is not a sprite or animation. - * - * *Can only be used if this is Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_render_layer View documentation} - * - * @param id - */ - get_render_layer(id: uint64): RenderLayer | undefined - /** - * Set the render layer of the sprite or animation with this id. Does nothing if this object is not a sprite or animation. - * - * *Can only be used if this is Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_render_layer View documentation} - * - * @param id - * @param render_layer - */ - set_render_layer(id: uint64, render_layer: RenderLayer): void - /** - * The object rotates so that it faces this target. Note that `orientation` is still applied to the object. Get the - * orientation_target of the object with this id or `nil` if no target or if this object is not a polygon, sprite, - * or animation. - * - * **Note**: Polygon vertices that are set to an entity will ignore this. - * - * *Can only be used if this is Polygon, Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_orientation_target View documentation} - * - * @param id - */ - get_orientation_target(id: uint64): ScriptRenderTarget | undefined - /** - * The object rotates so that it faces this target. Note that `orientation` is still applied to the object. Set the - * orientation_target of the object with this id. Does nothing if this object is not a polygon, sprite, or - * animation. Set to `nil` if the object should not have an orientation_target. - * - * **Note**: Polygon vertices that are set to an entity will ignore this. - * - * *Can only be used if this is Polygon, Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_orientation_target View documentation} - * - * @param id - * @param orientation_target - * @param orientation_target_offset - */ - set_orientation_target(id: uint64, orientation_target: Position | LuaEntity, orientation_target_offset?: Vector): void - /** - * Offsets the center of the sprite or animation if `orientation_target` is given. This offset will rotate together - * with the sprite or animation. Get the oriented_offset of the sprite or animation with this id or `nil` if this - * object is not a sprite or animation. - * - * *Can only be used if this is Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_oriented_offset View documentation} - * - * @param id - */ - get_oriented_offset(id: uint64): Vector | undefined - /** - * Offsets the center of the sprite or animation if `orientation_target` is given. This offset will rotate together - * with the sprite or animation. Set the oriented_offset of the sprite or animation with this id. Does nothing if - * this object is not a sprite or animation. - * - * *Can only be used if this is Sprite or Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_oriented_offset View documentation} - * - * @param id - * @param oriented_offset - */ - set_oriented_offset(id: uint64, oriented_offset: Vector): void - /** - * Get the intensity of the light with this id or `nil` if the object is not a light. - * - * *Can only be used if this is Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_intensity View documentation} - * - * @param id - */ - get_intensity(id: uint64): float | undefined - /** - * Set the intensity of the light with this id. Does nothing if this object is not a light. - * - * *Can only be used if this is Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_intensity View documentation} - * - * @param id - * @param intensity - */ - set_intensity(id: uint64, intensity: float): void - /** - * Get the minimum darkness at which the light with this id is rendered or `nil` if the object is not a light. - * - * *Can only be used if this is Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_minimum_darkness View documentation} - * - * @param id - */ - get_minimum_darkness(id: uint64): float | undefined - /** - * Set the minimum darkness at which the light with this id is rendered. Does nothing if this object is not a light. - * - * *Can only be used if this is Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_minimum_darkness View documentation} - * - * @param id - * @param minimum_darkness - */ - set_minimum_darkness(id: uint64, minimum_darkness: float): void - /** - * Get if the light with this id is rendered has the same orientation as the target entity or `nil` if the object is - * not a light. Note that `orientation` is still applied to the sprite. - * - * *Can only be used if this is Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_oriented View documentation} - * - * @param id - */ - get_oriented(id: uint64): boolean | undefined - /** - * Set if the light with this id is rendered has the same orientation as the target entity. Does nothing if this - * object is not a light. Note that `orientation` is still applied to the sprite. - * - * *Can only be used if this is Light* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_oriented View documentation} - * - * @param id - * @param oriented - */ - set_oriented(id: uint64, oriented: boolean): void - /** - * Get the animation prototype name of the animation with this id or `nil` if the object is not an animation. - * - * *Can only be used if this is Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_animation View documentation} - * - * @param id - */ - get_animation(id: uint64): string | undefined - /** - * Set the animation prototype name of the animation with this id. Does nothing if this object is not an animation. - * - * *Can only be used if this is Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_animation View documentation} - * - * @param id - * @param animation - */ - set_animation(id: uint64, animation: string): void - /** - * Get the animation speed of the animation with this id or `nil` if the object is not an animation. - * - * *Can only be used if this is Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_animation_speed View documentation} - * - * @param id - * @returns Animation speed in frames per tick. - */ - get_animation_speed(id: uint64): double | undefined - /** - * Set the animation speed of the animation with this id. Does nothing if this object is not an animation. - * - * *Can only be used if this is Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_animation_speed View documentation} - * - * @param id - * @param animation_speed - Animation speed in frames per tick. - */ - set_animation_speed(id: uint64, animation_speed: double): void - /** - * Get the animation offset of the animation with this id or `nil` if the object is not an animation. - * - * *Can only be used if this is Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.get_animation_offset View documentation} - * - * @param id - * @returns Animation offset in frames. - */ - get_animation_offset(id: uint64): double | undefined - /** - * Set the animation offset of the animation with this id. Does nothing if this object is not an animation. - * - * *Can only be used if this is Animation* - * - * {@link https://lua-api.factorio.com/next/LuaRendering.html#LuaRendering.set_animation_offset View documentation} - * - * @param id - * @param animation_offset - Animation offset in frames. - */ - set_animation_offset(id: uint64, animation_offset: double): void - /** This object's name. */ - readonly object_name: "LuaRendering" -} - -/** - * Prototype of a resource category. - * - * {@link https://lua-api.factorio.com/next/LuaResourceCategoryPrototype.html View documentation} - * - * @noSelf - */ -interface LuaResourceCategoryPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaResourceCategoryPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for roboports. - * - * {@link https://lua-api.factorio.com/next/LuaRoboportControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaRoboportControlBehavior extends LuaControlBehavior { - /** - * `true` if the roboport should report the logistics network content to the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.read_logistics View documentation} - */ - read_logistics: boolean - /** - * `true` if the roboport should report the robot statistics to the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.read_robot_stats View documentation} - */ - read_robot_stats: boolean - available_logistic_output_signal: SignalID - total_logistic_output_signal: SignalID - available_construction_output_signal: SignalID - total_construction_output_signal: SignalID - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaRoboportControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Object containing mod settings of three distinct types: `startup`, `global`, and `player`. An instance of LuaSettings - * is available through the global object named `settings`. - * - * {@link https://lua-api.factorio.com/next/LuaSettings.html View documentation} - * - * @noSelf - */ -interface LuaSettings { - /** - * Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure - * as {@link LuaPlayer.mod_settings LuaPlayer::mod_settings}. - * - * **Note**: This can become invalid if during operation if the given player becomes invalid. - * - * {@link https://lua-api.factorio.com/next/LuaSettings.html#LuaSettings.get_player_settings View documentation} - * - * @param player - */ - get_player_settings(player: PlayerIdentification): LuaCustomTable - /** - * The startup mod settings, indexed by prototype name. - * - * {@link https://lua-api.factorio.com/next/LuaSettings.html#LuaSettings.startup View documentation} - */ - readonly startup: LuaCustomTable - /** - * The current global mod settings, indexed by prototype name. - * - * Even though these are marked as read-only, they can be changed by overwriting individual {@link ModSetting} tables - * in the custom table. Mods can only change their own settings. Using the in-game console, all global settings can - * be changed. - * - * {@link https://lua-api.factorio.com/next/LuaSettings.html#LuaSettings.global View documentation} - */ - readonly global: LuaCustomTable - /** - * The default player mod settings for this map, indexed by prototype name. - * - * Even though these are marked as read-only, they can be changed by overwriting individual {@link ModSetting} tables - * in the custom table. Mods can only change their own settings. Using the in-game console, all player settings can - * be changed. - * - * {@link https://lua-api.factorio.com/next/LuaSettings.html#LuaSettings.player View documentation} - */ - readonly player: LuaCustomTable - /** This object's name. */ - readonly object_name: "LuaSettings" -} - -/** - * Prototype of a shortcut. - * - * {@link https://lua-api.factorio.com/next/LuaShortcutPrototype.html View documentation} - * - * @noSelf - */ -interface LuaShortcutPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaShortcutPrototype.html#LuaShortcutPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaShortcutPrototype.html#LuaShortcutPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - readonly action: string - readonly item_to_spawn: LuaItemPrototype - readonly technology_to_unlock: LuaTechnologyPrototype - readonly toggleable: boolean - readonly associated_control_input: string - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaShortcutPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for storage tanks. - * - * {@link https://lua-api.factorio.com/next/LuaStorageTankControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaStorageTankControlBehavior extends LuaControlBehavior { - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaStorageTankControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Style of a GUI element. All of the attributes listed here may be `nil` if not available for a particular GUI element. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html View documentation} - * - * @noSelf - */ -interface LuaStyle { - /** - * Gui of the {@link LuaGuiElement} of this style. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.gui View documentation} - */ - readonly gui: LuaGui - /** - * Name of this style. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.name View documentation} - */ - readonly name: string - /** - * Minimal width ensures, that the widget will never be smaller than than that size. It can't be squashed to be smaller. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.minimal_width View documentation} - */ - minimal_width: int - /** - * Maximal width ensures, that the widget will never be bigger than than that size. It can't be stretched to be bigger. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.maximal_width View documentation} - */ - maximal_width: int - /** - * Minimal height ensures, that the widget will never be smaller than than that size. It can't be squashed to be smaller. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.minimal_height View documentation} - */ - minimal_height: int - /** - * Maximal height ensures, that the widget will never be bigger than than that size. It can't be stretched to be bigger. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.maximal_height View documentation} - */ - maximal_height: int - /** - * Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a - * smaller or bigger size. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.natural_width View documentation} - */ - natural_width: int - /** - * Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have - * a smaller or bigger size. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.natural_height View documentation} - */ - natural_height: int - top_padding: int - right_padding: int - bottom_padding: int - left_padding: int - top_margin: int - right_margin: int - bottom_margin: int - left_margin: int - /** - * Horizontal align of the inner content of the widget, possible values are "left", "center" or "right" - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.horizontal_align View documentation} - */ - horizontal_align: "left" | "center" | "right" - /** - * Vertical align of the inner content of the widget, possible values are "top", "center" or "bottom" - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.vertical_align View documentation} - */ - vertical_align: "top" | "center" | "bottom" - font_color: Color - font: string - /** - * Space between the table cell contents top and border. - * - * *Can only be used if this is LuaTableStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.top_cell_padding View documentation} - */ - top_cell_padding: int - /** - * Space between the table cell contents right and border. - * - * *Can only be used if this is LuaTableStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.right_cell_padding View documentation} - */ - right_cell_padding: int - /** - * Space between the table cell contents bottom and border. - * - * *Can only be used if this is LuaTableStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.bottom_cell_padding View documentation} - */ - bottom_cell_padding: int - /** - * Space between the table cell contents left and border. - * - * *Can only be used if this is LuaTableStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.left_cell_padding View documentation} - */ - left_cell_padding: int - /** - * If the GUI element stretches its size horizontally to other elements. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.horizontally_stretchable View documentation} - */ - horizontally_stretchable: boolean - /** - * If the GUI element stretches its size vertically to other elements. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.vertically_stretchable View documentation} - */ - vertically_stretchable: boolean - /** - * If the GUI element can be squashed (by maximal width of some parent element) horizontally. This is mainly meant - * to be used for scroll-pane The default value is false. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.horizontally_squashable View documentation} - */ - horizontally_squashable: boolean - /** - * If the GUI element can be squashed (by maximal height of some parent element) vertically. This is mainly meant to - * be used for scroll-pane The default (parent) value for scroll pane is true, false otherwise. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.vertically_squashable View documentation} - */ - vertically_squashable: boolean - /** - * How this GUI element handles rich text. - * - * *Can only be used if this is LuaLabelStyle, LuaTextBoxStyle or LuaTextFieldStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.rich_text_setting View documentation} - */ - rich_text_setting: defines.rich_text_setting - /** - * *Can only be used if this is LuaButtonStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.hovered_font_color View documentation} - */ - hovered_font_color: Color - /** - * *Can only be used if this is LuaButtonStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.clicked_font_color View documentation} - */ - clicked_font_color: Color - /** - * *Can only be used if this is LuaButtonStyle or LuaTabStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.disabled_font_color View documentation} - */ - disabled_font_color: Color - /** - * *Can only be used if this is LuaButtonStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.pie_progress_color View documentation} - */ - pie_progress_color: Color - /** - * *Can only be used if this is LuaButtonStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.clicked_vertical_offset View documentation} - */ - clicked_vertical_offset: int - /** - * *Can only be used if this is LuaButtonStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.selected_font_color View documentation} - */ - selected_font_color: Color - /** - * *Can only be used if this is LuaButtonStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.selected_hovered_font_color View documentation} - */ - selected_hovered_font_color: Color - /** - * *Can only be used if this is LuaButtonStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.selected_clicked_font_color View documentation} - */ - selected_clicked_font_color: Color - /** - * *Can only be used if this is LuaButtonStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.strikethrough_color View documentation} - */ - strikethrough_color: Color - /** - * Horizontal space between individual cells. - * - * *Can only be used if this is LuaTableStyle, LuaFlowStyle or LuaHorizontalFlow* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.horizontal_spacing View documentation} - */ - horizontal_spacing: int - /** - * Vertical space between individual cells. - * - * *Can only be used if this is LuaTableStyle, LuaFlowStyle, LuaVerticalFlowStyle or LuaTabbedPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.vertical_spacing View documentation} - */ - vertical_spacing: int - /** - * *Can only be used if this is LuaFrameStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.use_header_filler View documentation} - */ - use_header_filler: boolean - /** - * *Can only be used if this is LuaProgressBarStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.color View documentation} - */ - color: Color - /** - * Array containing the alignment for every column of this table element. Even though this property is marked as - * read-only, the alignment can be changed by indexing the LuaCustomTable, like so: - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.column_alignments View documentation} - * - * @example - * ```lua - * table_element.style.column_alignments[1] = "center" - * ``` - */ - readonly column_alignments: LuaCustomTable - /** - * *Can only be used if this is LabelStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.single_line View documentation} - */ - single_line: boolean - /** - * *Can only be used if this is ScrollPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_top_padding_when_activated View documentation} - */ - extra_top_padding_when_activated: int - /** - * *Can only be used if this is ScrollPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_bottom_padding_when_activated View documentation} - */ - extra_bottom_padding_when_activated: int - /** - * *Can only be used if this is ScrollPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_left_padding_when_activated View documentation} - */ - extra_left_padding_when_activated: int - /** - * *Can only be used if this is ScrollPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_right_padding_when_activated View documentation} - */ - extra_right_padding_when_activated: int - /** - * *Can only be used if this is ScrollPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_top_margin_when_activated View documentation} - */ - extra_top_margin_when_activated: int - /** - * *Can only be used if this is ScrollPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_bottom_margin_when_activated View documentation} - */ - extra_bottom_margin_when_activated: int - /** - * *Can only be used if this is ScrollPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_left_margin_when_activated View documentation} - */ - extra_left_margin_when_activated: int - /** - * *Can only be used if this is ScrollPaneStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_right_margin_when_activated View documentation} - */ - extra_right_margin_when_activated: int - /** - * *Can only be used if this is ImageStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.stretch_image_to_widget_size View documentation} - */ - stretch_image_to_widget_size: boolean - /** - * *Can only be used if this is TabStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.badge_font View documentation} - */ - badge_font: string - /** - * *Can only be used if this is TabStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.badge_horizontal_spacing View documentation} - */ - badge_horizontal_spacing: int - /** - * *Can only be used if this is TabStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.default_badge_font_color View documentation} - */ - default_badge_font_color: Color - /** - * *Can only be used if this is TabStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.selected_badge_font_color View documentation} - */ - selected_badge_font_color: Color - /** - * *Can only be used if this is TabStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.disabled_badge_font_color View documentation} - */ - disabled_badge_font_color: Color - /** - * Sets both minimal and maximal width to the given value. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.width View documentation} - */ - set width(value: int) - /** - * Sets both minimal and maximal height to the given value. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.height View documentation} - */ - set height(value: int) - /** - * Sets both width and height to the given value. Also accepts an array with two values, setting width to the first - * and height to the second one. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.size View documentation} - */ - set size(value: int | int[]) - /** - * Sets top/right/bottom/left paddings to this value. An array with two values sets top/bottom padding to the first - * value and left/right padding to the second value. An array with four values sets top, right, bottom, left padding - * respectively. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.padding View documentation} - */ - set padding(value: int | int[]) - /** - * Sets top/right/bottom/left margins to this value. An array with two values sets top/bottom margin to the first - * value and left/right margin to the second value. An array with four values sets top, right, bottom, left margin - * respectively. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.margin View documentation} - */ - set margin(value: int | int[]) - /** - * Space between the table cell contents and border. Sets top/right/bottom/left cell paddings to this value. - * - * *Can only be used if this is LuaTableStyle* - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.cell_padding View documentation} - */ - set cell_padding(value: int) - /** - * Sets extra_top/right/bottom/left_padding_when_actived to this value. An array with two values sets top/bottom - * padding to the first value and left/right padding to the second value. An array with four values sets top, right, - * bottom, left padding respectively. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_padding_when_activated View documentation} - */ - set extra_padding_when_activated(value: int | int[]) - /** - * Sets extra_top/right/bottom/left_margin_when_activated to this value. An array with two values sets top/bottom - * margin to the first value and left/right margin to the second value. An array with four values sets top, right, - * bottom, left margin respectively. - * - * {@link https://lua-api.factorio.com/next/LuaStyle.html#LuaStyle.extra_margin_when_activated View documentation} - */ - set extra_margin_when_activated(value: int | int[]) - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaStyle" - /** All methods and properties that this object supports. */ - help(): string -} - -interface BaseSurfaceCreateEntity { - /** The entity prototype name to create. */ - readonly name: string - /** Where to create the entity. */ - readonly position: Position - /** Desired orientation of the entity after creation. */ - readonly direction?: defines.direction - /** Force of the entity, default is enemy. */ - readonly force?: ForceIdentification - /** Entity with health for the new entity to target. */ - readonly target?: LuaEntity - /** Source entity. Used for beams and highlight-boxes. */ - readonly source?: LuaEntity - /** If true, building will attempt to simulate fast-replace building. */ - readonly fast_replace?: boolean - /** If given set the last_user to this player. If fast_replace is true simulate fast replace using this player. */ - readonly player?: PlayerIdentification - /** - * If false while fast_replace is true and player is nil any items from fast-replacing will be deleted instead of - * dropped on the ground. - */ - readonly spill?: boolean - /** If true; {@link defines.events.script_raised_built} will be fired on successful entity creation. */ - readonly raise_built?: boolean - /** If false, the building effect smoke will not be shown around the new entity. */ - readonly create_build_effect_smoke?: boolean - /** If true, entity types that have spawn_decorations property will apply triggers defined in the property. */ - readonly spawn_decorations?: boolean - /** If true, any characters that are in the way of the entity are teleported out of the way. */ - readonly move_stuck_players?: boolean - /** - * If provided, the entity will attempt to pull stored values from this item (for example; creating a spidertron - * from a previously named and mined spidertron) - */ - readonly item?: LuaItemStack -} - -interface AssemblingMachineSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly recipe?: string -} - -interface BeamSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** - * Absolute target position that can be used instead of target entity (entity has precedence if both entity and - * position are defined). - */ - readonly target_position?: Position - /** - * Absolute source position that can be used instead of source entity (entity has precedence if both entity and - * position are defined). - */ - readonly source_position?: Position - /** If set, beam will be destroyed when distance between source and target is greater than this value. */ - readonly max_length?: uint - /** If set, beam will be destroyed after this value of ticks. */ - readonly duration?: uint - /** Source position will be offset by this value when rendering the beam. */ - readonly source_offset?: Vector -} - -interface ContainerSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** Inventory index where the red limiting bar should be set. */ - readonly bar?: uint -} - -interface CliffSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** If not specified, `direction` will be used instead. */ - readonly cliff_orientation?: CliffOrientation -} - -interface FlyingTextSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** The string to show. */ - readonly text: LocalisedString - /** Color of the displayed text. */ - readonly color?: Color - readonly render_player_index?: uint -} - -interface EntityGhostSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** The prototype name of the entity contained in the ghost. */ - readonly inner_name: string - /** If `false` the ghost entity will not expire. Default is `false`. */ - readonly expires?: boolean -} - -interface FireSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** With how many small flames should the fire on ground be created. Defaults to the initial flame count of the prototype. */ - readonly initial_ground_flame_count?: uint8 -} - -interface InserterSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly conditions: InserterCircuitConditions - readonly filters: InventoryFilter[] -} - -interface ItemEntitySurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** The stack of items to create. */ - readonly stack: SimpleItemStack -} - -interface ItemRequestProxySurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** The target items are to be delivered to. */ - readonly target: LuaEntity - /** The stacks of items to be delivered to target entity from logistic network. */ - readonly modules: Record -} - -interface RollingStockSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** The orientation of this rolling stock. */ - readonly orientation?: RealOrientation - /** The color of this rolling stock, if it supports colors. */ - readonly color?: Color -} - -interface LocomotiveSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** Whether the locomotive should snap to an adjacent train stop. Defaults to true. */ - readonly snap_to_train_stop?: boolean -} - -interface LogisticContainerSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly request_filters?: InventoryFilter[] -} - -interface ParticleSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly movement: Vector - readonly height: float - readonly vertical_speed: float - readonly frame_speed: float -} - -interface ArtilleryFlareSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly movement: Vector - readonly height: float - readonly vertical_speed: float - readonly frame_speed: float -} - -interface ProjectileSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly speed: double - readonly max_range: double -} - -interface ResourceSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly amount: uint - /** - * If colliding trees are removed normally for this resource entity based off the prototype tree removal values. - * Default is true. - */ - readonly enable_tree_removal?: boolean - /** If colliding cliffs are removed. Default is true. */ - readonly enable_cliff_removal?: boolean - /** - * If true, the resource entity will be placed to center of a tile as map generator would place it, otherwise - * standard non-resource grid alignment rules will apply. Default is true. - */ - readonly snap_to_tile_center?: boolean -} - -interface UndergroundBeltSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** `"output"` or `"input"`; default is `"input"`. */ - readonly type?: "output" | "input" -} - -interface ProgrammableSpeakerSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly parameters?: ProgrammableSpeakerParameters - readonly alert_parameters?: ProgrammableSpeakerAlertParameters -} - -interface CharacterCorpseSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly inventory_size?: uint - readonly player_index?: uint -} - -interface HighlightBoxSurfaceCreateEntity extends BaseSurfaceCreateEntity { - /** - * The bounding box defining the highlight box using absolute map coordinates. If specified, the `position` - * parameter is ignored, but needs to be present anyways. If not specified, the game falls back to the `source` - * parameter first, then the `target` parameter second. One of these three parameters need to be specified. - */ - readonly bounding_box?: BoundingBox - /** Specifies the graphical appearance (color) of the highlight box. Defaults to `"electricity"`. */ - readonly box_type?: CursorBoxRenderType - /** The player to render the highlight box for. If not provided, it will be rendered for all players. */ - readonly render_player_index?: uint - /** - * The blink interval for this highlight box. Makes it be shown every `blink_interval` ticks. Defaults to `0` - * (constantly shown). - */ - readonly blink_interval?: uint - /** The amount of time in ticks that the highlight box will exist for. Defaults to existing forever. */ - readonly time_to_live?: uint -} - -interface SpeechBubbleSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly text: LocalisedString - readonly lifetime?: uint -} - -interface SimpleEntityWithOwnerSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly render_player_index?: uint -} - -interface SimpleEntityWithForceSurfaceCreateEntity extends BaseSurfaceCreateEntity { - readonly render_player_index?: uint -} - -type SurfaceCreateEntity = - | AssemblingMachineSurfaceCreateEntity - | BeamSurfaceCreateEntity - | ContainerSurfaceCreateEntity - | CliffSurfaceCreateEntity - | FlyingTextSurfaceCreateEntity - | EntityGhostSurfaceCreateEntity - | FireSurfaceCreateEntity - | InserterSurfaceCreateEntity - | ItemEntitySurfaceCreateEntity - | ItemRequestProxySurfaceCreateEntity - | RollingStockSurfaceCreateEntity - | LocomotiveSurfaceCreateEntity - | LogisticContainerSurfaceCreateEntity - | ParticleSurfaceCreateEntity - | ArtilleryFlareSurfaceCreateEntity - | ProjectileSurfaceCreateEntity - | ResourceSurfaceCreateEntity - | UndergroundBeltSurfaceCreateEntity - | ProgrammableSpeakerSurfaceCreateEntity - | CharacterCorpseSurfaceCreateEntity - | HighlightBoxSurfaceCreateEntity - | SpeechBubbleSurfaceCreateEntity - | SimpleEntityWithOwnerSurfaceCreateEntity - | SimpleEntityWithForceSurfaceCreateEntity - -/** - * A "domain" of the world. Surfaces can only be created and deleted through the API. Surfaces are uniquely identified - * by their name. Every game contains at least the surface "nauvis". - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html View documentation} - * - * @noSelf - */ -interface LuaSurface { - /** - * Get the pollution for a given position. - * - * **Note**: Pollution is stored per chunk, so this will return the same value for all positions in one chunk. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_pollution View documentation} - * - * @example - * ```lua - * game.surfaces[1].get_pollution({1,2}) - * ``` - * - * @param position - */ - get_pollution(position: Position): double - /** - * Check for collisions with terrain or other entities. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.can_place_entity View documentation} - */ - can_place_entity(params: { - /** Name of the entity prototype to check. */ - readonly name: string - /** Where the entity would be placed. */ - readonly position: Position - /** Direction of the placed entity. */ - readonly direction?: defines.direction - /** The force that would place the entity. If not specified, the enemy force is assumed. */ - readonly force?: ForceIdentification - /** Which type of check should be carried out. */ - readonly build_check_type?: defines.build_check_type - /** - * If `true`, entities that can be marked for deconstruction are ignored. Only used if `build_check_type` is - * either `manual_ghost`, `script_ghost` or `blueprint_ghost`. - */ - readonly forced?: boolean - /** The prototype name of the entity contained in the ghost. Only used if `name` is `entity-ghost`. */ - readonly inner_name?: string - }): boolean - /** - * If there exists an entity at the given location that can be fast-replaced with the given entity parameters. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.can_fast_replace View documentation} - */ - can_fast_replace(params: { - /** Name of the entity to check */ - readonly name: string - /** Where the entity would be placed */ - readonly position: Position - /** Direction the entity would be placed */ - readonly direction?: defines.direction - /** The force that would place the entity. If not specified, the enemy force is assumed. */ - readonly force?: ForceIdentification - }): boolean - /** - * Find a specific entity at a specific position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_entity View documentation} - * - * @example - * ```lua - * game.player.selected.surface.find_entity('filter-inserter', {0,0}) - * ``` - * - * @param entity - Entity to look for - * @param position - Coordinates to look at - * @returns Will be `nil` if no such entity is found. - */ - find_entity(entity: string, position: Position): LuaEntity | undefined - /** - * Find entities in a given area. - * - * If no area is given all entities on the surface are returned. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_entities View documentation} - * - * @example - * Will evaluate to a list of all entities within given area. - * - * ```lua - * game.surfaces["nauvis"].find_entities({{-10, -10}, {10, 10}}) - * ``` - * - * @param area - */ - find_entities(area?: BoundingBox): LuaEntity[] - /** - * Find entities of given type or name in a given area. - * - * If no filters (`name`, `type`, `force`, etc.) are given, returns all entities in the search area. If multiple - * filters are specified, returns only entities matching all given filters. - * - * If no area or position are given, then the entire surface is searched. If position is given, returns entities - * colliding with that position (i.e the given position is within the entity's collision box). If position and - * radius are given, returns entities in that radius of the position. If area is specified, returns entities - * colliding with that area. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_entities_filtered View documentation} - * - * @example - * ```lua - * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, type = "resource"} -- gets all resources in the rectangle - * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, name = "iron-ore"} -- gets all iron ores in the rectangle - * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, name = {"iron-ore", "copper-ore"}} -- gets all iron ore and copper ore in the rectangle - * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, force = "player"} -- gets player owned entities in the rectangle - * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, limit = 5} -- gets the first 5 entities in the rectangle - * game.surfaces[1].find_entities_filtered{position = {0, 0}, radius = 10} -- gets all entities within 10 tiles of the position [0,0]. - * ``` - */ - find_entities_filtered(params: { - readonly area?: BoundingBox - /** Has precedence over area field. */ - readonly position?: Position - /** If given with position, will return all entities within the radius of the position. */ - readonly radius?: double - readonly name?: string | string[] - readonly type?: string | string[] - readonly ghost_name?: string | string[] - readonly ghost_type?: string | string[] - readonly direction?: defines.direction | defines.direction[] - readonly collision_mask?: CollisionMaskLayer | CollisionMaskLayer[] - readonly force?: ForceIdentification | ForceIdentification[] - readonly to_be_deconstructed?: boolean - readonly to_be_upgraded?: boolean - readonly limit?: uint - /** - * If the filters should be inverted. These filters are: name, type, ghost_name, ghost_type, direction, - * collision_mask, force. - */ - readonly invert?: boolean - }): LuaEntity[] - /** - * Find tiles of a given name in a given area. - * - * If no filters are given returns all tiles in the search area. - * - * If no area or position and radius is given, then the entire surface is searched. If position and radius are - * given, only tiles within the radius of the position are included. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_tiles_filtered View documentation} - */ - find_tiles_filtered(params: { - readonly area?: BoundingBox - /** Ignored if not given with radius. */ - readonly position?: Position - /** If given with position, will return all entities within the radius of the position. */ - readonly radius?: double - readonly name?: string | string[] - readonly limit?: uint - readonly has_hidden_tile?: boolean - readonly collision_mask?: CollisionMaskLayer | CollisionMaskLayer[] - }): LuaTile[] - /** - * Count entities of given type or name in a given area. Works just like - * {@link LuaSurface.find_entities_filtered LuaSurface::find_entities_filtered}, except this only returns the count. - * As it doesn't construct all the wrapper objects, this is more efficient if one is only interested in the number - * of entities. - * - * If no area or position are given, then the entire surface is searched. If position is given, returns entities - * colliding with that position (i.e the given position is within the entity's collision box). If position and - * radius are given, returns entities in that radius of the position. If area is specified, returns entities - * colliding with that area. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.count_entities_filtered View documentation} - */ - count_entities_filtered(params: { - readonly area?: BoundingBox - readonly position?: Position - /** If given with position, will count all entities within the radius of the position. */ - readonly radius?: double - readonly name?: string | string[] - readonly type?: string | string[] - readonly ghost_name?: string | string[] - readonly ghost_type?: string | string[] - readonly direction?: defines.direction | defines.direction[] - readonly collision_mask?: CollisionMaskLayer | CollisionMaskLayer[] - readonly force?: ForceIdentification | ForceIdentification[] - readonly to_be_deconstructed?: boolean - readonly to_be_upgraded?: boolean - readonly limit?: uint - /** - * If the filters should be inverted. These filters are: name, type, ghost_name, ghost_type, direction, - * collision_mask, force. - */ - readonly invert?: boolean - }): uint - /** - * Count tiles of a given name in a given area. Works just like - * {@link LuaSurface.find_tiles_filtered LuaSurface::find_tiles_filtered}, except this only returns the count. As it - * doesn't construct all the wrapper objects, this is more efficient if one is only interested in the number of tiles. - * - * If no area or position and radius is given, then the entire surface is searched. If position and radius are - * given, only tiles within the radius of the position are included. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.count_tiles_filtered View documentation} - */ - count_tiles_filtered(params: { - readonly area?: BoundingBox - /** Ignored if not given with radius. */ - readonly position?: Position - /** If given with position, will return all entities within the radius of the position. */ - readonly radius?: double - readonly name?: string | string[] - readonly limit?: uint - readonly has_hidden_tile?: boolean - readonly collision_mask?: CollisionMaskLayer | CollisionMaskLayer[] - }): uint - /** - * Find a non-colliding position within a given radius. - * - * **Note**: Special care needs to be taken when using a radius of `0`. The game will not stop searching until it - * finds a suitable position, so it is important to make sure such a position exists. One particular case where it - * would not be able to find a solution is running it before any chunks have been generated. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_non_colliding_position View documentation} - * - * @param name - Prototype name of the entity to find a position for. (The bounding box for the collision checking - * is taken from this prototype.) - * @param center - Center of the search area. - * @param radius - Max distance from `center` to search in. A radius of `0` means an infinitely-large search area. - * @param precision - The step length from the given position as it searches, in tiles. Minimum value is `0.01`. - * @param force_to_tile_center - Will only check tile centers. This can be useful when your intent is to place a - * building at the resulting position, as they must generally be placed at tile centers. Default false. - * @returns The non-colliding position. May be `nil` if no suitable position was found. - */ - find_non_colliding_position( - name: string, - center: Position, - radius: double, - precision: double, - force_to_tile_center?: boolean - ): PositionTable | undefined - /** - * Find a non-colliding position within a given rectangle. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_non_colliding_position_in_box View documentation} - * - * @param name - Prototype name of the entity to find a position for. (The bounding box for the collision checking - * is taken from this prototype.) - * @param search_space - The rectangle to search inside. - * @param precision - The step length from the given position as it searches, in tiles. Minimum value is 0.01. - * @param force_to_tile_center - Will only check tile centers. This can be useful when your intent is to place a - * building at the resulting position, as they must generally be placed at tile centers. Default false. - * @returns The non-colliding position. May be `nil` if no suitable position was found. - */ - find_non_colliding_position_in_box( - name: string, - search_space: BoundingBox, - precision: double, - force_to_tile_center?: boolean - ): PositionTable | undefined - /** - * Spill items on the ground centered at a given location. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.spill_item_stack View documentation} - * - * @param position - Center of the spillage - * @param items - Items to spill - * @param enable_looted - When true, each created item will be flagged with the - * {@link LuaEntity.to_be_looted LuaEntity::to_be_looted} flag. - * @param force - When provided (and not `nil`) the items will be marked for deconstruction by this force. - * @param allow_belts - Whether items can be spilled onto belts. Defaults to `true`. - * @returns The created item-on-ground entities. - */ - spill_item_stack( - position: Position, - items: ItemStackIdentification, - enable_looted?: boolean, - force?: LuaForce | string, - allow_belts?: boolean - ): LuaEntity[] - /** - * Find enemy units (entities with type "unit") of a given force within an area. - * - * **Note**: This is more efficient than {@link LuaSurface.find_entities LuaSurface::find_entities}. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_enemy_units View documentation} - * - * @example - * Find all units who would be interested to attack the player, within 100-tile area. - * - * ```lua - * local enemies = game.player.surface.find_enemy_units(game.player.position, 100) - * ``` - * - * @param center - Center of the search area - * @param radius - Radius of the circular search area - * @param force - Force to find enemies of. If not given, uses the player force. - */ - find_enemy_units(center: Position, radius: double, force?: LuaForce | string): LuaEntity[] - /** - * Find units (entities with type "unit") of a given force and force condition within a given area. - * - * **Note**: This is more efficient than {@link LuaSurface.find_entities LuaSurface::find_entities}. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_units View documentation} - * - * @example - * Find friendly units to "player" force - * - * ```lua - * local friendly_units = game.player.surface.find_units({area = {{-10, -10},{10, 10}}, force = "player", condition = "friend") - * ``` - * - * @example - * Find units of "player" force - * - * ```lua - * local units = game.player.surface.find_units({area = {{-10, -10},{10, 10}}, force = "player", condition = "same"}) - * ``` - */ - find_units(params: { - /** Box to find units within. */ - readonly area: BoundingBox - /** Force performing the search. */ - readonly force: LuaForce | string - /** Only forces which meet the condition will be included in the search. */ - readonly condition: ForceCondition - }): LuaEntity[] - /** - * Find the enemy entity-with-force ({@link https://wiki.factorio.com/Military_units_and_structures military entity}) - * closest to the given position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_nearest_enemy View documentation} - * - * @returns The nearest enemy entity-with-force or `nil` if no enemy could be found within the given area. - */ - find_nearest_enemy(params: { - /** Center of the search area. */ - readonly position: Position - /** Radius of the circular search area. */ - readonly max_distance: double - /** The force the result will be an enemy of. Uses the player force if not specified. */ - readonly force?: ForceIdentification - }): LuaEntity | undefined - /** - * Find the enemy entity-with-owner closest to the given position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_nearest_enemy_entity_with_owner View documentation} - * - * @returns The nearest enemy entity-with-owner or `nil` if no enemy could be found within the given area. - */ - find_nearest_enemy_entity_with_owner(params: { - /** Center of the search area. */ - readonly position: Position - /** Radius of the circular search area. */ - readonly max_distance: double - /** The force the result will be an enemy of. Uses the player force if not specified. */ - readonly force?: ForceIdentification - }): LuaEntity | undefined - /** - * Give a command to multiple units. This will automatically select suitable units for the task. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.set_multi_command View documentation} - * - * @returns Number of units actually sent. May be less than `count` if not enough units were available. - */ - set_multi_command(params: { - readonly command: Command - /** Number of units to give the command to. */ - readonly unit_count: uint - /** Force of the units this command is to be given to. If not specified, uses the enemy force. */ - readonly force?: ForceIdentification - /** Radius to search for units. The search area is centered on the destination of the command. */ - readonly unit_search_distance?: uint - }): uint - /** - * Create an entity on this surface. - * - * Other attributes may be specified depending on the type of entity: - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.create_entity View documentation} - * - * @example - * ```lua - * asm = game.surfaces[1].create_entity{name = "assembling-machine-1", position = {15, 3}, force = game.forces.player, recipe = "iron-stick"} - * ``` - * - * @example - * Creates a filter inserter with circuit conditions and a filter - * - * ```lua - * game.surfaces[1].create_entity{ - * name = "filter-inserter", position = {20, 15}, force = game.player.force, - * conditions = {red = {name = "wood", count = 3, operator = ">"}, - * green = {name = "iron-ore", count = 1, operator = "<"}, - * logistics = {name = "wood", count = 3, operator = "="}}, - * filters = {{index = 1, name = "iron-ore"}} - * } - * ``` - * - * @example - * Creates a requester chest already set to request 128 iron plates. - * - * ```lua - * game.surfaces[1].create_entity{ - * name = "logistic-chest-requester", position = {game.player.position.x+3, game.player.position.y}, - * force = game.player.force, request_filters = {{index = 1, name = "iron-plate", count = 128}} - * } - * ``` - * - * @example - * ```lua - * game.surfaces[1].create_entity{name = "big-biter", position = {15, 3}, force = game.forces.player} -- Friendly biter - * game.surfaces[1].create_entity{name = "medium-biter", position = {15, 3}, force = game.forces.enemy} -- Enemy biter - * ``` - * - * @example - * Creates a basic inserter at the player's location facing north - * - * ```lua - * game.surfaces[1].create_entity{name = "inserter", position = game.player.position, direction = defines.direction.north} - * ``` - * - * @returns The created entity or `nil` if the creation failed. - */ - create_entity(params: SurfaceCreateEntity): LuaEntity | undefined - create_trivial_smoke(params: { - /** The smoke prototype name to create. */ - readonly name: string - /** Where to create the smoke. */ - readonly position: Position - }): void - /** - * Creates a particle at the given location - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.create_particle View documentation} - */ - create_particle(params: { - /** The particle name. */ - readonly name: string - /** Where to create the particle. */ - readonly position: Position - readonly movement: Vector - readonly height: float - readonly vertical_speed: float - readonly frame_speed: float - }): void - /** - * Create a new unit group at a given position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.create_unit_group View documentation} - */ - create_unit_group(params: { - /** Initial position of the new unit group. */ - readonly position: Position - /** Force of the new unit group. Defaults to `"enemy"`. */ - readonly force?: ForceIdentification - }): LuaUnitGroup - /** - * Send a group to build a new base. - * - * **Note**: The specified force must be AI-controlled; i.e. `force.ai_controllable` must be `true`. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.build_enemy_base View documentation} - * - * @param position - Location of the new base. - * @param unit_count - Number of biters to send for the base-building task. - * @param force - Force the new base will belong to. Defaults to enemy. - */ - build_enemy_base(position: Position, unit_count: uint, force?: ForceIdentification): void - /** - * Get the tile at a given position. - * - * **Note**: The input position params can also be a single tile position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_tile View documentation} - * - * @param x - * @param y - */ - get_tile(x: int, y: int): LuaTile - /** - * Set tiles at specified locations. Can automatically correct the edges around modified tiles. - * - * Placing a {@link LuaTilePrototype.mineable_properties mineable} tile on top of a non-mineable one will turn the - * latter into the {@link LuaTile.hidden_tile LuaTile::hidden_tile} for that tile. Placing a mineable tile on a - * mineable one or a non-mineable tile on a non-mineable one will not modify the hidden tile. This restriction can - * however be circumvented by using {@link LuaSurface.set_hidden_tile LuaSurface::set_hidden_tile}. - * - * **Note**: It is recommended to call this method once for all the tiles you want to change rather than calling it - * individually for every tile. As the tile correction is used after every step, calling it one by one could cause - * the tile correction logic to redo some of the changes. Also, many small API calls are generally more performance - * intensive than one big one. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.set_tiles View documentation} - * - * @param tiles - * @param correct_tiles - If `false`, the correction logic is not applied to the changed tiles. Defaults to `true`. - * @param remove_colliding_entities - `true`, `false`, or `abort_on_collision`. Defaults to `true`. - * @param remove_colliding_decoratives - `true` or `false`. Defaults to `true`. - * @param raise_event - `true` or `false`. Defaults to `false`. - */ - set_tiles( - tiles: Tile[], - correct_tiles?: boolean, - remove_colliding_entities?: boolean | string, - remove_colliding_decoratives?: boolean, - raise_event?: boolean - ): void - /** - * Spawn pollution at the given position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.pollute View documentation} - * - * @param source - Where to spawn the pollution. - * @param amount - How much pollution to add. - */ - pollute(source: Position, amount: double): void - /** - * Get an iterator going over every chunk on this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_chunks View documentation} - */ - get_chunks(): LuaChunkIterator - /** - * Is a given chunk generated? - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.is_chunk_generated View documentation} - * - * @param position - The chunk's position. - */ - is_chunk_generated(position: ChunkPosition): boolean - /** - * Request that the game's map generator generate chunks at the given position for the given radius on this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.request_to_generate_chunks View documentation} - * - * @param position - Where to generate the new chunks. - * @param radius - The chunk radius from `position` to generate new chunks in. - */ - request_to_generate_chunks(position: Position, radius: uint): void - /** - * Blocks and generates all chunks that have been requested using all available threads. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.force_generate_chunk_requests View documentation} - */ - force_generate_chunk_requests(): void - /** - * Set generated status of a chunk. Useful when copying chunks. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.set_chunk_generated_status View documentation} - * - * @param position - The chunk's position. - * @param status - The chunk's new status. - */ - set_chunk_generated_status(position: ChunkPosition, status: defines.chunk_generated_status): void - /** - * Find the logistic network that covers a given position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_logistic_network_by_position View documentation} - * - * @param position - * @param force - Force the logistic network should belong to. - * @returns The found network or `nil` if no such network was found. - */ - find_logistic_network_by_position(position: Position, force: ForceIdentification): LuaLogisticNetwork | undefined - /** - * Finds all of the logistics networks whose construction area intersects with the given position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_logistic_networks_by_construction_area View documentation} - * - * @param position - * @param force - Force the logistic networks should belong to. - */ - find_logistic_networks_by_construction_area(position: Position, force: ForceIdentification): LuaLogisticNetwork[] - /** - * Place a deconstruction request. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.deconstruct_area View documentation} - */ - deconstruct_area(params: { - /** The area to mark for deconstruction. */ - readonly area: BoundingBox - /** The force whose bots should perform the deconstruction. */ - readonly force: ForceIdentification - /** The player to set the last_user to if any. */ - readonly player?: PlayerIdentification - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - /** The deconstruction item to use if any. */ - readonly item?: LuaItemStack - }): void - /** - * Cancel a deconstruction order. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.cancel_deconstruct_area View documentation} - */ - cancel_deconstruct_area(params: { - /** The area to cancel deconstruction orders in. */ - readonly area: BoundingBox - /** The force whose deconstruction orders to cancel. */ - readonly force: ForceIdentification - /** The player to set the last_user to if any. */ - readonly player?: PlayerIdentification - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - /** The deconstruction item to use if any. */ - readonly item?: LuaItemStack - }): void - /** - * Place an upgrade request. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.upgrade_area View documentation} - */ - upgrade_area(params: { - /** The area to mark for upgrade. */ - readonly area: BoundingBox - /** The force whose bots should perform the upgrade. */ - readonly force: ForceIdentification - /** The player to set the last_user to if any. */ - readonly player?: PlayerIdentification - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - /** The upgrade item to use. */ - readonly item: LuaItemStack - }): void - /** - * Cancel a upgrade order. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.cancel_upgrade_area View documentation} - */ - cancel_upgrade_area(params: { - /** The area to cancel upgrade orders in. */ - readonly area: BoundingBox - /** The force whose upgrade orders to cancel. */ - readonly force: ForceIdentification - /** The player to set the last_user to if any. */ - readonly player?: PlayerIdentification - /** If chunks covered by fog-of-war are skipped. */ - readonly skip_fog_of_war?: boolean - /** The upgrade item to use if any. */ - readonly item?: LuaItemStack - }): void - /** - * The hidden tile name or `nil` if there isn't one for the given position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_hidden_tile View documentation} - * - * @param position - The tile position. - */ - get_hidden_tile(position: TilePosition): string | undefined - /** - * Set the hidden tile for the specified position. While during normal gameplay only - * {@link LuaTilePrototype.mineable_properties non-mineable} tiles can become hidden, this method allows any kind of - * tile to be set as the hidden one. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.set_hidden_tile View documentation} - * - * @param position - The tile position. - * @param tile - The new hidden tile or `nil` to clear the hidden tile. - */ - set_hidden_tile(position: TilePosition, tile: string | LuaTilePrototype | undefined): void - /** - * Gets all tiles of the given types that are connected horizontally or vertically to the given tile position - * including the given tile position. - * - * **Note**: This won't find tiles in non-generated chunks. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_connected_tiles View documentation} - * - * @param position - The tile position to start at. - * @param tiles - The tiles to search for. - * @returns The resulting set of tiles. - */ - get_connected_tiles(position: Position, tiles: string[]): PositionTable[] - /** - * **Note**: This won't delete the chunk immediately. Chunks are deleted at the end of the current tick. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.delete_chunk View documentation} - * - * @param position - The chunk position to delete - */ - delete_chunk(position: ChunkPosition): void - /** - * Regenerate autoplacement of some entities on this surface. This can be used to autoplace newly-added entities. - * - * **Note**: All specified entity prototypes must be autoplacable. If nothing is given all entities are generated on - * all chunks. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.regenerate_entity View documentation} - * - * @param entities - Prototype names of entity or entities to autoplace. When `nil` all entities with an autoplace are used. - * @param chunks - The chunk positions to regenerate the entities on. If not given all chunks are regenerated. Note - * chunks with status < entities are ignored. - */ - regenerate_entity(entities?: string | string[], chunks?: ChunkPosition[]): void - /** - * Regenerate autoplacement of some decoratives on this surface. This can be used to autoplace newly-added decoratives. - * - * **Note**: All specified decorative prototypes must be autoplacable. If nothing is given all decoratives are - * generated on all chunks. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.regenerate_decorative View documentation} - * - * @param decoratives - Prototype names of decorative or decoratives to autoplace. When `nil` all decoratives with - * an autoplace are used. - * @param chunks - The chunk positions to regenerate the entities on. If not given all chunks are regenerated. Note - * chunks with status < entities are ignored. - */ - regenerate_decorative(decoratives?: string | string[], chunks?: ChunkPosition[]): void - /** - * Print text to the chat console of all players on this surface. - * - * **Note**: Messages that are identical to a message sent in the last 60 ticks are not printed again. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.print View documentation} - * - * @param message - * @param color - */ - print(message: LocalisedString, color?: Color): void - /** - * Removes all decoratives from the given area. If no area and no position are given, then the entire surface is searched. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.destroy_decoratives View documentation} - */ - destroy_decoratives(params: { - readonly area?: BoundingBox - readonly position?: TilePosition - readonly name?: string | string[] | LuaDecorativePrototype | LuaDecorativePrototype[] - readonly limit?: uint - /** If the filters should be inverted. */ - readonly invert?: boolean - }): void - /** - * Adds the given decoratives to the surface. - * - * **Note**: This will merge decoratives of the same type that already exist effectively increasing the "amount" field. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.create_decoratives View documentation} - */ - create_decoratives(params: { - /** If collision should be checked against entities/tiles. */ - readonly check_collision?: boolean - readonly decoratives: Decorative[] - }): void - /** - * Find decoratives of a given name in a given area. - * - * If no filters are given, returns all decoratives in the search area. If multiple filters are specified, returns - * only decoratives matching every given filter. If no area and no position are given, the entire surface is searched. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.find_decoratives_filtered View documentation} - * - * @example - * ```lua - * game.surfaces[1].find_decoratives_filtered{area = {{-10, -10}, {10, 10}}, name = "sand-decal"} -- gets all sand-decals in the rectangle - * game.surfaces[1].find_decoratives_filtered{area = {{-10, -10}, {10, 10}}, limit = 5} -- gets the first 5 decoratives in the rectangle - * ``` - */ - find_decoratives_filtered(params: { - readonly area?: BoundingBox - readonly position?: TilePosition - readonly name?: string | string[] | LuaDecorativePrototype | LuaDecorativePrototype[] - readonly limit?: uint - /** If the filters should be inverted. */ - readonly invert?: boolean - }): DecorativeResult[] - /** - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_trains View documentation} - * - * @param force - If given only trains matching this force are returned. - */ - get_trains(force?: ForceIdentification): LuaTrain[] - /** - * Clears all pollution on this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.clear_pollution View documentation} - */ - clear_pollution(): void - /** - * Play a sound for every player on this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.play_sound View documentation} - */ - play_sound(params: { - /** The sound to play. */ - readonly path: SoundPath - /** Where the sound should be played. If not given, it's played at the current position of each player. */ - readonly position?: Position - /** The volume of the sound to play. Must be between 0 and 1 inclusive. */ - readonly volume_modifier?: double - /** The volume mixer to play the sound through. Defaults to the default mixer for the given sound type. */ - readonly override_sound_type?: SoundType - }): void - /** - * Gets the resource amount of all resources on this surface - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_resource_counts View documentation} - */ - get_resource_counts(): Record - /** - * Gets a random generated chunk position or 0,0 if no chunks have been generated on this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_random_chunk View documentation} - */ - get_random_chunk(): ChunkPositionTable - /** - * Clones the given area. - * - * **Note**: {@link defines.events.on_entity_cloned} is raised for each entity, and then - * {@link defines.events.on_area_cloned} is raised. - * - * **Note**: Entities are cloned in an order such that they can always be created, eg rails before trains. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.clone_area View documentation} - */ - clone_area(params: { - readonly source_area: BoundingBox - readonly destination_area: BoundingBox - readonly destination_surface?: SurfaceIdentification - readonly destination_force?: LuaForce | string - /** If tiles should be cloned */ - readonly clone_tiles?: boolean - /** If entities should be cloned */ - readonly clone_entities?: boolean - /** If decoratives should be cloned */ - readonly clone_decoratives?: boolean - /** If the destination entities should be cleared */ - readonly clear_destination_entities?: boolean - /** If the destination decoratives should be cleared */ - readonly clear_destination_decoratives?: boolean - /** If the destination surface should be expanded when destination_area is outside current bounds. Default false. */ - readonly expand_map?: boolean - /** If true, the building effect smoke will be shown around the new entities. */ - readonly create_build_effect_smoke?: boolean - }): void - /** - * Clones the given area. - * - * **Note**: {@link defines.events.on_entity_cloned} is raised for each entity, and then - * {@link defines.events.on_area_cloned} is raised. - * - * **Note**: Entities are cloned in an order such that they can always be created, eg rails before trains. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.clone_brush View documentation} - */ - clone_brush(params: { - readonly source_offset: TilePosition - readonly destination_offset: TilePosition - readonly source_positions: TilePosition[] - readonly destination_surface?: SurfaceIdentification - readonly destination_force?: LuaForce | string - /** If tiles should be cloned */ - readonly clone_tiles?: boolean - /** If entities should be cloned */ - readonly clone_entities?: boolean - /** If decoratives should be cloned */ - readonly clone_decoratives?: boolean - /** If the destination entities should be cleared */ - readonly clear_destination_entities?: boolean - /** If the destination decoratives should be cleared */ - readonly clear_destination_decoratives?: boolean - /** If the destination surface should be expanded when destination_area is outside current bounds. Default false. */ - readonly expand_map?: boolean - /** If manual-style collision checks should be done. */ - readonly manual_collision_mode?: boolean - /** If true, the building effect smoke will be shown around the new entities. */ - readonly create_build_effect_smoke?: boolean - }): void - /** - * Clones the given entities. - * - * **Note**: {@link defines.events.on_entity_cloned} is raised for each entity. - * - * **Note**: Entities are cloned in an order such that they can always be created, eg rails before trains. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.clone_entities View documentation} - */ - clone_entities(params: { - readonly entities: LuaEntity[] - readonly destination_offset: Vector - readonly destination_surface?: SurfaceIdentification - readonly destination_force?: ForceIdentification - readonly snap_to_grid?: boolean - /** If true, the building effect smoke will be shown around the new entities. */ - readonly create_build_effect_smoke?: boolean - }): void - /** - * Clears this surface deleting all entities and chunks on it. - * - * **Note**: This won't clear the surface immediately. It will be cleared at the end of the current tick. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.clear View documentation} - * - * @param ignore_characters - Whether characters on this surface that are connected to or associated with players - * should be ignored (not destroyed). - */ - clear(ignore_characters?: boolean): void - /** - * Generates a path with the specified constraints (as an array of {@link PathfinderWaypoint PathfinderWaypoints}) - * using the unit pathfinding algorithm. This path can be used to emulate pathing behavior by script for non-unit - * entities. If you want to command actual units to move, use the - * {@link LuaEntity.set_command LuaEntity::set_command} functionality instead. - * - * The resulting path is ultimately returned asynchronously via - * {@link OnScriptPathRequestFinishedEvent on_script_path_request_finished}. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.request_path View documentation} - * - * @returns A unique handle to identify this call when - * {@link OnScriptPathRequestFinishedEvent on_script_path_request_finished} fires. - */ - request_path(params: { - /** The dimensions of the object that's supposed to travel the path. */ - readonly bounding_box: BoundingBox - /** The list of masks the `bounding_box` collides with. */ - readonly collision_mask: CollisionMask | string[] - /** The position from which to start pathfinding. */ - readonly start: Position - /** The position to find a path to. */ - readonly goal: Position - /** The force for which to generate the path, determining which gates can be opened for example. */ - readonly force: ForceIdentification - /** How close the pathfinder needs to get to its `goal` (in tiles). Defaults to `1`. */ - readonly radius?: double - /** Flags that affect pathfinder behavior. */ - readonly pathfind_flags?: PathfinderFlags - /** Whether the path request can open gates. Defaults to `false`. */ - readonly can_open_gates?: boolean - /** - * Defines how coarse the pathfinder's grid is. Smaller values mean a coarser grid (negative numbers allowed). - * Defaults to `0`. - */ - readonly path_resolution_modifier?: int - /** Makes the pathfinder ignore collisions with this entity if it is given. */ - readonly entity_to_ignore?: LuaEntity - }): uint - /** - * Gets the script areas that match the given name or if no name is given all areas are returned. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_script_areas View documentation} - * - * @param name - */ - get_script_areas(name?: string): ScriptArea[] - /** - * Gets the first script area by name or id. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_script_area View documentation} - * - * @param key - The name or id of the area to get. - */ - get_script_area(key?: string | uint): ScriptArea - /** - * Sets the given script area to the new values. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.edit_script_area View documentation} - * - * @param id - The area to edit. - * @param area - */ - edit_script_area(id: uint, area: ScriptArea): void - /** - * Adds the given script area. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.add_script_area View documentation} - * - * @param area - * @returns The id of the created area. - */ - add_script_area(area: ScriptArea): uint - /** - * Removes the given script area. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.remove_script_area View documentation} - * - * @param id - * @returns If the area was actually removed. False when it didn't exist. - */ - remove_script_area(id: uint): boolean - /** - * Gets the script positions that match the given name or if no name is given all positions are returned. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_script_positions View documentation} - * - * @param name - */ - get_script_positions(name?: string): ScriptPosition[] - /** - * Gets the first script position by name or id. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_script_position View documentation} - * - * @param key - The name or id of the position to get. - */ - get_script_position(key?: string | uint): ScriptPosition - /** - * Sets the given script position to the new values. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.edit_script_position View documentation} - * - * @param id - The position to edit. - * @param area - */ - edit_script_position(id: uint, area: ScriptPosition): void - /** - * Adds the given script position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.add_script_position View documentation} - * - * @param area - * @returns The id of the created position. - */ - add_script_position(area: ScriptPosition): uint - /** - * Removes the given script position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.remove_script_position View documentation} - * - * @param id - * @returns If the position was actually removed. False when it didn't exist. - */ - remove_script_position(id: uint): boolean - /** - * Gets the map exchange string for the current map generation settings of this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_map_exchange_string View documentation} - */ - get_map_exchange_string(): string - /** - * Gets the starting area radius of this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_starting_area_radius View documentation} - */ - get_starting_area_radius(): double - /** - * Gets the closest entity in the list to this position. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_closest View documentation} - * - * @param position - * @param entities - The Entities to check - */ - get_closest(position: Position, entities: LuaEntity[]): LuaEntity - /** - * Gets train stops matching the given filters. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_train_stops View documentation} - */ - get_train_stops(params?: { readonly name?: string | string[]; readonly force?: ForceIdentification }): LuaEntity[] - /** - * Gets the total amount of pollution on the surface by iterating over all of the chunks containing pollution. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_total_pollution View documentation} - */ - get_total_pollution(): double - /** - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.entity_prototype_collides View documentation} - * - * @param prototype - The entity prototype to check - * @param position - The position to check - * @param use_map_generation_bounding_box - If the map generation bounding box should be used instead of the - * collision bounding box - * @param direction - */ - entity_prototype_collides( - prototype: EntityPrototypeIdentification, - position: Position, - use_map_generation_bounding_box: boolean, - direction?: defines.direction - ): void - /** - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.decorative_prototype_collides View documentation} - * - * @param prototype - The decorative prototype to check - * @param position - The position to check - */ - decorative_prototype_collides(prototype: string, position: Position): void - /** - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.calculate_tile_properties View documentation} - * - * @param property_names - Names of properties (e.g. "elevation") to calculate - * @param positions - Positions for which to calculate property values - * @returns Table of property value lists, keyed by property name - */ - calculate_tile_properties(property_names: string[], positions: Position[]): Record - /** - * Returns all the entities with force on this chunk for the given force. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.get_entities_with_force View documentation} - * - * @param position - The chunk's position. - * @param force - Entities of this force will be returned. - */ - get_entities_with_force(position: ChunkPosition, force: LuaForce | string): LuaEntity[] - /** - * Sets the given area to the checkerboard lab tiles. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.build_checkerboard View documentation} - * - * @param area - The tile area. - */ - build_checkerboard(area: BoundingBox): void - /** - * The name of this surface. Names are unique among surfaces. - * - * **Note**: the default surface can't be renamed. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.name View documentation} - */ - name: string - /** - * Unique ID associated with this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.index View documentation} - */ - readonly index: uint - /** - * The generation settings for this surface. These can be modified to after surface generation, but note that this - * will not retroactively update the surface. To manually adjust it, - * {@link LuaSurface.regenerate_entity LuaSurface::regenerate_entity}, - * {@link LuaSurface.regenerate_decorative LuaSurface::regenerate_decorative} and - * {@link LuaSurface.delete_chunk LuaSurface::delete_chunk} can be used. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.map_gen_settings View documentation} - */ - map_gen_settings: MapGenSettings - /** - * When set to true, new chunks will be generated with lab tiles, instead of using the surface's map generation settings. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.generate_with_lab_tiles View documentation} - */ - generate_with_lab_tiles: boolean - /** - * When set to true, the sun will always shine. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.always_day View documentation} - */ - always_day: boolean - /** - * Current time of day, as a number in range [0, 1). - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.daytime View documentation} - */ - daytime: float - /** - * Amount of darkness at the current time. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.darkness View documentation} - */ - readonly darkness: float - /** - * Current wind speed. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.wind_speed View documentation} - */ - wind_speed: double - /** - * Current wind direction. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.wind_orientation View documentation} - */ - wind_orientation: RealOrientation - /** - * Change in wind orientation per tick. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.wind_orientation_change View documentation} - */ - wind_orientation_change: double - /** - * Is peaceful mode enabled on this surface? - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.peaceful_mode View documentation} - */ - peaceful_mode: boolean - /** - * True if daytime is currently frozen. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.freeze_daytime View documentation} - */ - freeze_daytime: boolean - /** - * The number of ticks per day for this surface. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.ticks_per_day View documentation} - */ - ticks_per_day: uint - /** - * The daytime when dusk starts. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.dusk View documentation} - */ - dusk: double - /** - * The daytime when dawn starts. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.dawn View documentation} - */ - dawn: double - /** - * The daytime when evening starts. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.evening View documentation} - */ - evening: double - /** - * The daytime when morning starts. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.morning View documentation} - */ - morning: double - /** - * The multiplier of solar power on this surface. Cannot be less than 0. - * - * **Note**: Solar equipment is still limited to its maximum power output. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.solar_power_multiplier View documentation} - */ - solar_power_multiplier: double - /** - * The minimal brightness during the night. Default is `0.15`. The value has an effect on the game simalution only, - * it doesn't have any effect on rendering. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.min_brightness View documentation} - */ - min_brightness: double - /** - * Defines how surface daytime brightness influences each color channel of the current color lookup table (LUT). - * - * The LUT is multiplied by `((1 - weight) + brightness * weight)` and result is clamped to range [0, 1]. - * - * Default is `{0, 0, 0}`, which means no influence. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.brightness_visual_weights View documentation} - * - * @example - * Makes night on the surface pitch black, assuming {@link LuaSurface.min_brightness LuaSurface::min_brightness} being set to default value `0.15`. - * - * ```lua - * game.surfaces[1].brightness_visual_weights = { 1 / 0.85, 1 / 0.85, 1 / 0.85 } - * ``` - */ - brightness_visual_weights: ColorModifier - /** - * If clouds are shown on this surface. - * - * **Note**: If false, clouds are never shown. If true the player must also have clouds enabled in graphics settings - * for them to be shown. - * - * {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.show_clouds View documentation} - */ - show_clouds: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaSurface" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * One research item. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html View documentation} - * - * @noSelf - */ -interface LuaTechnology { - /** - * Reload this technology from its prototype. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.reload View documentation} - */ - reload(): void - /** - * The force this technology belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.force View documentation} - */ - readonly force: LuaForce - /** - * Name of this technology. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.name View documentation} - */ - readonly name: string - /** - * Localised name of this technology. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.localised_name View documentation} - */ - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * The prototype of this technology. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.prototype View documentation} - */ - readonly prototype: LuaTechnologyPrototype - /** - * Can this technology be researched? - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.enabled View documentation} - */ - enabled: boolean - /** - * If this technology will be visible in the research GUI even though it is disabled. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.visible_when_disabled View documentation} - */ - visible_when_disabled: boolean - /** - * Is this an upgrade-type research? - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.upgrade View documentation} - */ - readonly upgrade: boolean - /** - * Has this technology been researched? Switching from `false` to `true` will trigger the technology advancement - * perks; switching from `true` to `false` will reverse them. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.researched View documentation} - */ - researched: boolean - /** - * Prerequisites of this technology. The result maps technology name to the {@link LuaTechnology} object. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.prerequisites View documentation} - */ - readonly prerequisites: Record - /** - * Ingredients labs will require to research this technology. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.research_unit_ingredients View documentation} - * - * @see {@link LuaTechnology.research_unit_count} - */ - readonly research_unit_ingredients: Ingredient[] - /** - * Effects applied when this technology is researched. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.effects View documentation} - */ - readonly effects: TechnologyModifier[] - /** - * Number of research units required for this technology. - * - * **Note**: This is multiplied by the current research cost multiplier, unless - * {@link LuaTechnologyPrototype.ignore_tech_cost_multiplier LuaTechnologyPrototype::ignore_tech_cost_multiplier} is `true`. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.research_unit_count View documentation} - * - * @see {@link LuaTechnology.research_unit_ingredients} - */ - readonly research_unit_count: uint - /** - * Amount of energy required to finish a unit of research. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.research_unit_energy View documentation} - */ - readonly research_unit_energy: double - /** - * Order string for this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.order View documentation} - */ - readonly order: string - /** - * The current level of this technology. For level-based technology writing to this is the same as researching the - * technology to the *previous* level. Writing the level will set - * {@link LuaTechnology.enabled LuaTechnology::enabled} to `true`. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.level View documentation} - */ - level: uint - /** - * The count formula used for this infinite research or nil if this isn't an infinite research. - * - * {@link https://lua-api.factorio.com/next/LuaTechnology.html#LuaTechnology.research_unit_count_formula View documentation} - * - * @see {@link LuaGameScript.evaluate_expression} - */ - readonly research_unit_count_formula: string | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTechnology" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A Technology prototype. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html View documentation} - * - * @noSelf - */ -interface LuaTechnologyPrototype { - /** - * Name of this technology. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.name View documentation} - */ - readonly name: string - /** - * Localised name of this technology. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.localised_name View documentation} - */ - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * If this technology prototype is enabled by default (enabled at the beginning of a game). - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.enabled View documentation} - */ - readonly enabled: boolean - /** - * If this technology prototype is hidden. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.hidden View documentation} - */ - readonly hidden: boolean - /** - * If this technology will be visible in the research GUI even though it is disabled. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.visible_when_disabled View documentation} - */ - readonly visible_when_disabled: boolean - /** - * If this technology ignores the technology cost multiplier setting. - * - * **Note**: {@link LuaTechnologyPrototype.research_unit_count LuaTechnologyPrototype::research_unit_count} will - * already take this setting into account. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.ignore_tech_cost_multiplier View documentation} - */ - readonly ignore_tech_cost_multiplier: boolean - /** - * If the is technology prototype is an upgrade to some other technology. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.upgrade View documentation} - */ - readonly upgrade: boolean - /** - * Prerequisites of this technology. The result maps technology name to the {@link LuaTechnologyPrototype} object. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.prerequisites View documentation} - */ - readonly prerequisites: Record - /** - * Ingredients labs will require to research this technology. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_ingredients View documentation} - * - * @see {@link LuaTechnologyPrototype.research_unit_count} - */ - readonly research_unit_ingredients: Ingredient[] - /** - * Effects applied when this technology is researched. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.effects View documentation} - */ - readonly effects: TechnologyModifier[] - /** - * Number of research units required for this technology. - * - * **Note**: This is multiplied by the current research cost multiplier, unless - * {@link LuaTechnologyPrototype.ignore_tech_cost_multiplier LuaTechnologyPrototype::ignore_tech_cost_multiplier} is `true`. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_count View documentation} - * - * @see {@link LuaTechnologyPrototype.research_unit_ingredients} - */ - readonly research_unit_count: uint - /** - * Amount of energy required to finish a unit of research. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_energy View documentation} - */ - readonly research_unit_energy: double - /** - * Order string for this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.order View documentation} - */ - readonly order: string - /** - * The level of this research. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.level View documentation} - */ - readonly level: uint - /** - * The max level of this research. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.max_level View documentation} - */ - readonly max_level: uint - /** - * The count formula used for this infinite research or nil if this isn't an infinite research. - * - * {@link https://lua-api.factorio.com/next/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_count_formula View documentation} - * - * @see {@link LuaGameScript.evaluate_expression} - */ - readonly research_unit_count_formula: string | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTechnologyPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A single "square" on the map. - * - * {@link https://lua-api.factorio.com/next/LuaTile.html View documentation} - * - * @noSelf - */ -interface LuaTile { - /** - * What type of things can collide with this tile? - * - * {@link https://lua-api.factorio.com/next/LuaTile.html#LuaTile.collides_with View documentation} - * - * @example - * Check if the character would collide with a tile - * - * ```lua - * game.player.print(tostring(game.player.surface.get_tile(1, 1).collides_with("player-layer"))) - * ``` - * - * @param layer - */ - collides_with(layer: CollisionMaskLayer): boolean - /** - * Is this tile marked for deconstruction? - * - * {@link https://lua-api.factorio.com/next/LuaTile.html#LuaTile.to_be_deconstructed View documentation} - */ - to_be_deconstructed(): boolean - /** - * Orders deconstruction of this tile by the given force. - * - * {@link https://lua-api.factorio.com/next/LuaTile.html#LuaTile.order_deconstruction View documentation} - * - * @param force - The force whose robots are supposed to do the deconstruction. - * @param player - The player to set the last_user to if any. - * @returns The deconstructible tile proxy created if any or `nil`. - */ - order_deconstruction(force: ForceIdentification, player?: PlayerIdentification): LuaEntity | undefined - /** - * Cancels deconstruction if it is scheduled, does nothing otherwise. - * - * {@link https://lua-api.factorio.com/next/LuaTile.html#LuaTile.cancel_deconstruction View documentation} - * - * @param force - The force who did the deconstruction order. - * @param player - The player to set the last_user to if any. - */ - cancel_deconstruction(force: ForceIdentification, player?: PlayerIdentification): void - /** - * Prototype name of this tile. E.g. `"sand-3"` or `"grass-2"`. - * - * {@link https://lua-api.factorio.com/next/LuaTile.html#LuaTile.name View documentation} - */ - readonly name: string - readonly prototype: LuaTilePrototype - /** - * The position this tile references. - * - * {@link https://lua-api.factorio.com/next/LuaTile.html#LuaTile.position View documentation} - */ - readonly position: PositionTable - /** - * The name of the {@link LuaTilePrototype} hidden under this tile or `nil` if there is no hidden tile. During normal - * gameplay, only {@link LuaTilePrototype.mineable_properties non-mineable} tiles can become hidden. This can however - * be circumvented with {@link LuaSurface.set_hidden_tile LuaSurface::set_hidden_tile}. - * - * {@link https://lua-api.factorio.com/next/LuaTile.html#LuaTile.hidden_tile View documentation} - */ - readonly hidden_tile: string | undefined - /** - * The surface this tile is on. - * - * {@link https://lua-api.factorio.com/next/LuaTile.html#LuaTile.surface View documentation} - */ - readonly surface: LuaSurface - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTile" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a tile. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html View documentation} - * - * @noSelf - */ -interface LuaTilePrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * The collision mask this tile uses - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.collision_mask View documentation} - */ - readonly collision_mask: CollisionMask - readonly collision_mask_with_flags: CollisionMaskWithFlags - readonly layer: uint - /** - * Autoplace specification for this prototype. `nil` if none. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.autoplace_specification View documentation} - */ - readonly autoplace_specification: AutoplaceSpecification | undefined - readonly walking_speed_modifier: float - readonly vehicle_friction_modifier: float - readonly map_color: ColorTable - /** - * The probability that decorative entities will be removed from on top of this tile when this tile is generated. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.decorative_removal_probability View documentation} - */ - readonly decorative_removal_probability: float - readonly automatic_neighbors: boolean - readonly allowed_neighbors: Record - /** - * If this tile needs correction logic applied when it's generated in the world.. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.needs_correction View documentation} - */ - readonly needs_correction: boolean - readonly mineable_properties: { - /** Is this tile mineable at all? */ - readonly minable: boolean - /** Energy required to mine a tile. */ - readonly miningtime: double - /** - * Prototype name of the particle produced when mining this tile. Will only be present if this tile produces any - * particle during mining. - */ - readonly miningparticle?: string - /** Products obtained by mining this tile. */ - readonly products: Product[] - } - /** - * The next direction of this tile or `nil` - used when a tile has multiple directions (such as hazard concrete) - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.next_direction View documentation} - */ - readonly next_direction: LuaTilePrototype | undefined - /** - * Items that when placed will produce this tile. It is a dictionary indexed by the item prototype name. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.items_to_place_this View documentation} - */ - readonly items_to_place_this: SimpleItemStack[] - /** - * False if this tile is not allowed in blueprints regardless of the ability to build it. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.can_be_part_of_blueprint View documentation} - */ - readonly can_be_part_of_blueprint: boolean - /** - * Amount of pollution emissions per second this tile will absorb. - * - * {@link https://lua-api.factorio.com/next/LuaTilePrototype.html#LuaTilePrototype.emissions_per_second View documentation} - */ - readonly emissions_per_second: double - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTilePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A train. Trains are a sequence of connected rolling stocks -- locomotives and wagons. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html View documentation} - * - * @noSelf - */ -interface LuaTrain { - /** - * Get the amount of a particular item stored in the train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.get_item_count View documentation} - * - * @param item - Item name to count. If not given, counts all items. - */ - get_item_count(item?: string): uint - /** - * Get a mapping of the train's inventory. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.get_contents View documentation} - * - * @returns The counts, indexed by item names. - */ - get_contents(): Record - /** - * Remove some items from the train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.remove_item View documentation} - * - * @param stack - The amount and type of items to remove - * @returns Number of items actually removed. - */ - remove_item(stack: ItemStackIdentification): uint - /** - * Insert a stack into the train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.insert View documentation} - * - * @param stack - */ - insert(stack: ItemStackIdentification): void - /** - * Clear all items in this train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.clear_items_inside View documentation} - */ - clear_items_inside(): void - /** - * Checks if the path is invalid and tries to re-path if it isn't. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.recalculate_path View documentation} - * - * @param force - Forces the train to re-path regardless of the current path being valid or not. - * @returns If the train has a path after the repath attempt. - */ - recalculate_path(force?: boolean): boolean - /** - * Get the amount of a particular fluid stored in the train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.get_fluid_count View documentation} - * - * @param fluid - Fluid name to count. If not given, counts all fluids. - */ - get_fluid_count(fluid?: string): double - /** - * Gets a mapping of the train's fluid inventory. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.get_fluid_contents View documentation} - * - * @returns The counts, indexed by fluid names. - */ - get_fluid_contents(): Record - /** - * Remove some fluid from the train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.remove_fluid View documentation} - * - * @param fluid - * @returns The amount of fluid actually removed. - */ - remove_fluid(fluid: Fluid): double - /** - * Inserts the given fluid into the first available location in this train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.insert_fluid View documentation} - * - * @param fluid - * @returns The amount inserted. - */ - insert_fluid(fluid: Fluid): double - /** - * Clears all fluids in this train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.clear_fluids_inside View documentation} - */ - clear_fluids_inside(): void - /** - * Go to the station specified by the index in the train's schedule. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.go_to_station View documentation} - * - * @param index - */ - go_to_station(index: uint): void - /** - * Gets all rails under the train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.get_rails View documentation} - */ - get_rails(): LuaEntity[] - /** - * When `true`, the train is explicitly controlled by the player or script. When `false`, the train moves - * autonomously according to its schedule. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.manual_mode View documentation} - */ - manual_mode: boolean - /** - * Current speed. - * - * **Note**: Changing the speed of the train is potentially an unsafe operation because train uses the speed for its - * internal calculations of break distances, etc. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.speed View documentation} - */ - speed: double - /** - * Current max speed when moving forward, depends on locomotive prototype and fuel. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.max_forward_speed View documentation} - */ - readonly max_forward_speed: double - /** - * Current max speed when moving backwards, depends on locomotive prototype and fuel. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.max_backward_speed View documentation} - */ - readonly max_backward_speed: double - /** - * The weight of this train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.weight View documentation} - */ - readonly weight: double - /** - * Rolling stocks the train is composed of. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.carriages View documentation} - */ - readonly carriages: LuaEntity[] - /** - * Arrays of locomotives. The result is two arrays, indexed by `"front_movers"` and `"back_movers"` containing the - * locomotives. E.g. `{front_movers={loco1, loco2}, back_movers={loco3}}`. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.locomotives View documentation} - */ - readonly locomotives: Record - /** - * The cargo carriages the train contains. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.cargo_wagons View documentation} - */ - readonly cargo_wagons: LuaEntity[] - /** - * The fluid carriages the train contains. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.fluid_wagons View documentation} - */ - readonly fluid_wagons: LuaEntity[] - /** - * The trains current schedule or `nil` if empty. Set to `nil` to clear. - * - * **Note**: The schedule can't be changed by modifying the returned table. Instead, changes must be made by - * assigning a new table to this attribute. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.schedule View documentation} - */ - schedule: TrainSchedule | undefined - /** - * This train's current state. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.state View documentation} - */ - readonly state: defines.train_state - /** - * The rail at the front end of the train, possibly `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.front_rail View documentation} - */ - readonly front_rail: LuaEntity | undefined - /** - * The rail at the back end of the train, possibly `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.back_rail View documentation} - */ - readonly back_rail: LuaEntity | undefined - readonly rail_direction_from_front_rail: defines.rail_direction - readonly rail_direction_from_back_rail: defines.rail_direction - /** - * The front stock of this train or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.front_stock View documentation} - */ - readonly front_stock: LuaEntity | undefined - /** - * The back stock of this train or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.back_stock View documentation} - */ - readonly back_stock: LuaEntity | undefined - /** - * The train stop this train is stopped at or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.station View documentation} - */ - readonly station: LuaEntity | undefined - /** - * If this train has a path. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.has_path View documentation} - */ - readonly has_path: boolean - /** - * The destination rail this train is currently pathing to or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.path_end_rail View documentation} - */ - readonly path_end_rail: LuaEntity | undefined - /** - * The destination train stop this train is currently pathing to or `nil`. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.path_end_stop View documentation} - */ - readonly path_end_stop: LuaEntity | undefined - /** - * The unique train ID. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.id View documentation} - */ - readonly id: uint - /** - * The player passengers on the train - * - * **Note**: This does *not* index using player index. See {@link LuaPlayer.index LuaPlayer::index} on each player - * instance for the player index. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.passengers View documentation} - */ - readonly passengers: LuaPlayer[] - /** - * The riding state of this train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.riding_state View documentation} - */ - readonly riding_state: RidingState - /** - * The players killed by this train. - * - * The keys are the player indexes, the values are how often this train killed that player. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.killed_players View documentation} - */ - readonly killed_players: Record - /** - * The total number of kills by this train. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.kill_count View documentation} - */ - readonly kill_count: uint - /** - * The path this train is using or `nil` if none. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.path View documentation} - */ - readonly path: LuaRailPath | undefined - /** - * The signal this train is arriving or waiting at or `nil` if none. - * - * {@link https://lua-api.factorio.com/next/LuaTrain.html#LuaTrain.signal View documentation} - */ - readonly signal: LuaEntity | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTrain" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for train stops. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaTrainStopControlBehavior extends LuaGenericOnOffControlBehavior { - /** - * `true` if the train stop should send the circuit network contents to the train to use. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.send_to_train View documentation} - */ - send_to_train: boolean - /** - * `true` if the train stop should send the train contents to the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.read_from_train View documentation} - */ - read_from_train: boolean - /** - * `true` if the train stop should send the stopped train id to the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.read_stopped_train View documentation} - */ - read_stopped_train: boolean - /** - * `true` if the trains_limit_signal is used to set a limit of trains incoming for train stop. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.set_trains_limit View documentation} - */ - set_trains_limit: boolean - /** - * `true` if the train stop should send amount of incoming trains to the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.read_trains_count View documentation} - */ - read_trains_count: boolean - /** - * `true` if the train stop is enabled/disabled through the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.enable_disable View documentation} - */ - enable_disable: boolean - /** - * The signal that will be sent when using the send-train-id option. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.stopped_train_signal View documentation} - */ - stopped_train_signal: SignalID - /** - * The signal that will be sent when using the read-trains-count option. - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.trains_count_signal View documentation} - */ - trains_count_signal: SignalID - /** - * The signal to be used by set-trains-limit to limit amount of incoming trains - * - * {@link https://lua-api.factorio.com/next/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.trains_limit_signal View documentation} - */ - trains_limit_signal: SignalID - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTrainStopControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for transport belts. - * - * {@link https://lua-api.factorio.com/next/LuaTransportBeltControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaTransportBeltControlBehavior extends LuaGenericOnOffControlBehavior { - /** - * If the belt will be enabled/disabled based off the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.enable_disable View documentation} - */ - enable_disable: boolean - /** - * If the belt will read the contents and send them to the circuit network. - * - * {@link https://lua-api.factorio.com/next/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.read_contents View documentation} - */ - read_contents: boolean - /** - * The read mode for the belt. - * - * {@link https://lua-api.factorio.com/next/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.read_contents_mode View documentation} - */ - read_contents_mode: defines.control_behavior.transport_belt.content_read_mode - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTransportBeltControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * One line on a transport belt. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html View documentation} - * - * @noSelf - */ -interface LuaTransportLine extends ReadonlyArray { - /** - * Remove all items from this transport line. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.clear View documentation} - */ - clear(): void - /** - * Count some or all items on this line. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.get_item_count View documentation} - * - * @param item - Prototype name of the item to count. If not specified, count all items. - * @see {@link LuaInventory.get_item_count} - */ - get_item_count(item?: string): uint - /** - * Remove some items from this line. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.remove_item View documentation} - * - * @param items - Items to remove. - * @returns Number of items actually removed. - */ - remove_item(items: ItemStackIdentification): uint - /** - * Can an item be inserted at a given position? - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.can_insert_at View documentation} - * - * @param position - Where to insert an item. - */ - can_insert_at(position: float): boolean - /** - * Can an item be inserted at the back of this line? - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.can_insert_at_back View documentation} - */ - can_insert_at_back(): boolean - /** - * Insert items at a given position. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.insert_at View documentation} - * - * @param position - Where on the line to insert the items. - * @param items - Items to insert. - * @returns Were the items inserted successfully? - */ - insert_at(position: float, items: ItemStackIdentification): boolean - /** - * Insert items at the back of this line. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.insert_at_back View documentation} - * - * @param items - * @returns Were the items inserted successfully? - */ - insert_at_back(items: ItemStackIdentification): boolean - /** - * Get counts of all items on this line. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.get_contents View documentation} - * - * @returns The counts, indexed by item names. - * @see {@link LuaInventory.get_contents} - */ - get_contents(): Record - /** - * Returns whether the associated internal transport line of this line is the same as the others associated internal - * transport line. - * - * **Note**: This can return true even when the {@link LuaTransportLine.owner LuaTransportLine::owner}s are different - * (so `this == other` is false), because the internal transport lines can span multiple tiles. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.line_equals View documentation} - * - * @param other - */ - line_equals(other: LuaTransportLine): boolean - /** - * Get the number of items on this transport line. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.operator%20# View documentation} - */ - readonly length: uint - /** - * The entity this transport line belongs to. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.owner View documentation} - */ - readonly owner: LuaEntity - /** - * The transport lines that this transport line outputs items to or an empty table if none. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.output_lines View documentation} - */ - readonly output_lines: LuaTransportLine[] - /** - * The transport lines that this transport line is fed by or an empty table if none. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.input_lines View documentation} - */ - readonly input_lines: LuaTransportLine[] - /** - * The indexing operator. - * - * {@link https://lua-api.factorio.com/next/LuaTransportLine.html#LuaTransportLine.operator%20[] View documentation} - */ - readonly [index: number]: LuaItemStack - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTransportLine" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a trivial smoke. - * - * {@link https://lua-api.factorio.com/next/LuaTrivialSmokePrototype.html View documentation} - * - * @noSelf - */ -interface LuaTrivialSmokePrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - readonly color: ColorTable - readonly start_scale: double - readonly end_scale: double - readonly movement_slow_down_factor: double - readonly duration: uint - readonly spread_duration: uint - readonly fade_away_duration: uint - readonly fade_in_duration: uint - readonly glow_fade_away_duration: uint - readonly cyclic: boolean - readonly affected_by_wind: boolean - readonly show_when_smoke_off: boolean - readonly glow_animation: boolean - readonly render_layer: RenderLayer - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaTrivialSmokePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * A collection of units moving and attacking together. The engine creates autonomous unit groups to attack polluted - * areas. The script can create and control such groups as well. Groups can accept commands in the same manner as regular units. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html View documentation} - * - * @noSelf - */ -interface LuaUnitGroup { - /** - * Make a unit a member of this group. Has the same effect as giving a `group_command` with this group to the unit. - * - * **Note**: The member must have the same force as the unit group. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.add_member View documentation} - * - * @param unit - */ - add_member(unit: LuaEntity): void - /** - * Give this group a command. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.set_command View documentation} - * - * @param command - * @see {@link LuaEntity.set_command} - */ - set_command(command: Command): void - /** - * Give this group a distraction command. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.set_distraction_command View documentation} - * - * @param command - * @see {@link LuaEntity.set_command} - */ - set_distraction_command(command: Command): void - /** - * Make this group autonomous. Autonomous groups will automatically attack polluted areas. Autonomous groups aren't - * considered to be script driven - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.set_autonomous View documentation} - * - * @see {@link LuaUnitGroup.is_script_driven} - */ - set_autonomous(): void - /** - * Make the group start moving even if some of its members haven't yet arrived. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.start_moving View documentation} - */ - start_moving(): void - /** - * Dissolve this group. Its members won't be destroyed, they will be merely unlinked from this group. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.destroy View documentation} - */ - destroy(): void - /** - * Members of this group. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.members View documentation} - */ - readonly members: LuaEntity[] - /** - * Group position. This can have different meanings depending on the group state. When the group is gathering, the - * position is the place of gathering. When the group is moving, the position is the expected position of its - * members along the path. When the group is attacking, it is the average position of its members. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.position View documentation} - */ - readonly position: PositionTable - /** - * Whether this group is gathering, moving or attacking. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.state View documentation} - */ - readonly state: defines.group_state - /** - * The force of this unit group. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.force View documentation} - */ - readonly force: LuaForce - /** - * The surface of this unit group. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.surface View documentation} - */ - readonly surface: LuaSurface - /** - * The group number for this unit group. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.group_number View documentation} - */ - readonly group_number: uint - /** - * Whether this unit group is controlled by a script or by the game engine. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.is_script_driven View documentation} - * - * @see {@link LuaUnitGroup.set_autonomous} - */ - readonly is_script_driven: boolean - /** - * The command given to this group or `nil` is the group has no command. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.command View documentation} - */ - readonly command: Command | undefined - /** - * The distraction command given to this group or `nil` is the group currently isn't distracted. - * - * {@link https://lua-api.factorio.com/next/LuaUnitGroup.html#LuaUnitGroup.distraction_command View documentation} - */ - readonly distraction_command: Command | undefined - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaUnitGroup" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a virtual signal. - * - * {@link https://lua-api.factorio.com/next/LuaVirtualSignalPrototype.html View documentation} - * - * @noSelf - */ -interface LuaVirtualSignalPrototype { - /** - * Name of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.name View documentation} - */ - readonly name: string - /** - * Order string of this prototype. - * - * {@link https://lua-api.factorio.com/next/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.order View documentation} - */ - readonly order: string - readonly localised_name: LocalisedString - readonly localised_description: LocalisedString - /** - * If this is a special signal - * - * {@link https://lua-api.factorio.com/next/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.special View documentation} - */ - readonly special: boolean - readonly subgroup: LuaGroup - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaVirtualSignalPrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Prototype of a void energy source. - * - * {@link https://lua-api.factorio.com/next/LuaVoidEnergySourcePrototype.html View documentation} - * - * @noSelf - */ -interface LuaVoidEnergySourcePrototype { - readonly emissions: double - readonly render_no_network_icon: boolean - readonly render_no_power_icon: boolean - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaVoidEnergySourcePrototype" - /** All methods and properties that this object supports. */ - help(): string -} - -/** - * Control behavior for walls. - * - * {@link https://lua-api.factorio.com/next/LuaWallControlBehavior.html View documentation} - * - * @noSelf - */ -interface LuaWallControlBehavior extends LuaControlBehavior { - /** - * The circuit condition. - * - * {@link https://lua-api.factorio.com/next/LuaWallControlBehavior.html#LuaWallControlBehavior.circuit_condition View documentation} - */ - circuit_condition: CircuitConditionDefinition - open_gate: boolean - read_sensor: boolean - output_signal: SignalID - /** - * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that - * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the - * object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any - * change to the game state might have occurred between the creation of the Lua object and its access. - */ - readonly valid: boolean - /** - * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be - * suffixed with a dotted path to a member of the struct. - */ - readonly object_name: "LuaWallControlBehavior" - /** All methods and properties that this object supports. */ - help(): string -} diff --git a/modules/mod2/typed-factorio/generated/concepts.d.ts b/modules/mod2/typed-factorio/generated/concepts.d.ts deleted file mode 100644 index e097d47..0000000 --- a/modules/mod2/typed-factorio/generated/concepts.d.ts +++ /dev/null @@ -1,5635 +0,0 @@ -/** @noSelfInFile */ - -/** - * Localised strings are a way to support translation of in-game text. It is an array where the first element is the key - * and the remaining elements are parameters that will be substituted for placeholders in the template designated by the key. - * - * The key identifies the string template. For example, `"gui-alert-tooltip.attack"` (for the template `"__1__ objects - * are being damaged"`; see the file `data/core/locale/en.cfg`). - * - * The template can contain placeholders such as `__1__` or `__2__`. These will be replaced by the respective parameter - * in the LocalisedString. The parameters themselves can be other localised strings, which will be processed recursively - * in the same fashion. Localised strings cannot be recursed deeper than 20 levels and cannot have more than 20 parameters. - * - * As a special case, when the key is just the empty string, all the parameters will be concatenated (after processing, - * if any are localised strings). If there is only one parameter, it will be used as is. - * - * Furthermore, when an API function expects a localised string, it will also accept a regular string (i.e. not a table) - * which will not be translated, or number which will be converted to its textual representation. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LocalisedString View documentation} - * - * @example - * In the English translation, this will print `"No ammo"`; in the Czech translation, it will print `"Bez munice"`: - * - * ```lua - * game.player.print({"description.no-ammo"}) - * ``` The `description.no-ammo` template contains no placeholders, so no further parameters are necessary. - * - * @example - * In the English translation, this will print `"Durability: 5/9"`; in the Japanese one, it will print `"耐久度: 5/9"`: - * - * ```lua - * game.player.print({"description.durability", 5, 9}) - * ``` - * - * @example - * This will print `"hello"` in all translations: - * - * ```lua - * game.player.print({"", "hello"}) - * ``` - * - * @example - * This will print `"Iron plate: 60"` in the English translation and `"Eisenplatte: 60"` in the German translation. - * - * ```lua - * game.print({"", {"item-name.iron-plate"}, ": ", 60}) - * ``` - */ -type LocalisedString = [string, ...LocalisedString[]] | string | number - -interface DisplayResolution { - readonly width: uint - readonly height: uint -} - -interface PersonalLogisticParameters { - /** The item. `nil` clears the filter. */ - readonly name?: string - readonly min?: uint - readonly max?: uint -} - -/** - * The smooth orientation. It is a {@link float} in the range `[0, 1)` that covers a full circle, starting at the top and - * going clockwise. This means a value of `0` indicates "north", a value of `0.5` indicates "south". - * - * For example then, a value of `0.625` would indicate "south-west", and a value of `0.875` would indicate "north-west". - * - * {@link https://lua-api.factorio.com/next/Concepts.html#RealOrientation View documentation} - */ -type RealOrientation = float - -interface PositionTable { - readonly x: int - readonly y: int -} - -type PositionArray = readonly [x: int, y: int] - -/** - * Coordinates of a tile in a map. Positions may be specified either as a dictionary with `x`, `y` as keys, or simply as - * an array with two elements. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Position View documentation} - * - * @example - * Explicit definition: - * - * ```lua - * {x = 50, y = 20} - * {y = 20, x = 50} - * ``` - * - * @example - * Shorthand: ```lua - * {10, 20} - * ``` - */ -type Position = PositionTable | PositionArray - -interface ChunkPositionTable { - readonly x: int - readonly y: int -} - -type ChunkPositionArray = readonly [x: int, y: int] - -/** - * Coordinates of a chunk in a {@link LuaSurface} where each integer `x`/`y` represents a different chunk. This uses the - * same format as {@link Position}, meaning it can be specified either with or without explicit keys. A {@link Position} - * can be translated to a ChunkPosition by dividing the `x`/`y` values by 32. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ChunkPosition View documentation} - */ -type ChunkPosition = ChunkPositionTable | ChunkPositionArray - -interface TilePositionTable { - readonly x: int - readonly y: int -} - -type TilePositionArray = readonly [x: int, y: int] - -/** - * Coordinates of a tile in a chunk on a {@link LuaSurface} where each integer `x`/`y` represents a different tile. This - * uses the same format as {@link Position} except it rounds any `x`/`y` down to whole numbers. It can be specified - * either with or without explicit keys. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#TilePosition View documentation} - */ -type TilePosition = TilePositionTable | TilePositionArray - -interface GuiLocationTable { - readonly x: int - readonly y: int -} - -type GuiLocationArray = readonly [x: int, y: int] - -/** - * Screen coordinates of a GUI element in a {@link LuaGui}. This uses the same format as {@link Position} except it rounds - * any `x`/`y` down to whole numbers. It can be specified either with or without explicit keys. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GuiLocation View documentation} - */ -type GuiLocation = GuiLocationTable | GuiLocationArray - -/** - * A {@link ChunkPosition} with an added bounding box for the area of the chunk. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ChunkPositionAndArea View documentation} - */ -interface ChunkPositionAndArea { - readonly x: int - readonly y: int - readonly area: BoundingBox -} - -/** - * A table used to define a manual shape for a piece of equipment. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#EquipmentPoint View documentation} - */ -interface EquipmentPoint { - readonly x: uint - readonly y: uint -} - -interface GuiAnchor { - readonly gui: defines.relative_gui_type - readonly position: defines.relative_gui_position - /** If provided, only anchors the GUI element when the opened things type matches the type. */ - readonly type?: string - /** If provided, only anchors the GUI element when the opened thing matches the name. `name` takes precedence over `names`. */ - readonly name?: string - /** - * If provided, only anchors the GUI element when the opened thing matches one of the names. When reading an anchor, - * `names` is always populated. - */ - readonly names?: string[] -} - -interface TabAndContent { - readonly tab: LuaGuiElement - readonly content: LuaGuiElement -} - -interface OldTileAndPosition { - readonly old_tile: LuaTilePrototype - readonly position: TilePosition -} - -/** - * A dictionary of string to the four basic Lua types: `string`, `boolean`, `number`, `table`. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Tags View documentation} - * - * @example - * ```lua - * {a = 1, b = true, c = "three", d = {e = "f"}} - * ``` - */ -type Tags = Record - -/** - * **Note**: The vectors for all 5 position attributes are a table with `x` and `y` keys instead of an array. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#SmokeSource View documentation} - */ -interface SmokeSource { - readonly name: string - readonly frequency: double - readonly offset: double - readonly position?: PositionTable - readonly north_position?: PositionTable - readonly east_position?: PositionTable - readonly south_position?: PositionTable - readonly west_position?: PositionTable - readonly deviation?: Position - readonly starting_frame_speed: uint16 - readonly starting_frame_speed_deviation: double - readonly starting_frame: uint16 - readonly starting_frame_deviation: double - readonly slow_down_factor: uint8 - readonly height: float - readonly height_deviation: float - readonly starting_vertical_speed: float - readonly starting_vertical_speed_deviation: float - readonly vertical_speed_slowdown: float -} - -/** - * A vector is a two-element array containing the `x` and `y` components. In some specific cases, the vector is a table - * with `x` and `y` keys instead, which the documentation will point out. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Vector View documentation} - * - * @example - * ```lua - * right = {1.0, 0.0} - * ``` - */ -type Vector = PositionArray - -interface BoundingBoxTable { - readonly left_top: Position - readonly right_bottom: Position - readonly orientation?: RealOrientation -} - -type BoundingBoxArray = readonly [left_top: Position, right_bottom: Position, orientation?: RealOrientation] - -/** - * Two positions, specifying the top-left and bottom-right corner of the box respectively. Like with {@link Position}, - * the names of the members may be omitted. When read from the game, the third member `orientation` is present if it is - * non-zero, however it is ignored when provided to the game. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#BoundingBox View documentation} - * - * @example - * Explicit definition: - * - * ```lua - * {left_top = {-2, -3}, right_bottom = {5, 8}} - * ``` - * - * @example - * Shorthand: ```lua - * {{-2, -3}, {5, 8}} - * ``` - */ -type BoundingBox = BoundingBoxTable | BoundingBoxArray - -/** - * An area defined using the map editor. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ScriptArea View documentation} - */ -interface ScriptArea { - readonly area: BoundingBox - readonly name: string - readonly color: Color - readonly id: uint -} - -/** - * A position defined using the map editor. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ScriptPosition View documentation} - */ -interface ScriptPosition { - readonly position: Position - readonly name: string - readonly color: Color - readonly id: uint -} - -interface ColorTable { - readonly r?: float - readonly g?: float - readonly b?: float - readonly a?: float -} - -type ColorArray = readonly [r?: float, g?: float, b?: float, a?: float] - -/** - * Red, green, blue and alpha values, all in range [0, 1] or all in range [0, 255] if any value is > 1. All values here - * are optional. Color channels default to `0`, the alpha channel defaults to `1`. - * - * Similar to {@link Position}, Color allows the short-hand notation of passing an array of exactly 3 or 4 numbers. The - * game usually expects colors to be in pre-multiplied form (color channels are pre-multiplied by alpha). - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Color View documentation} - * - * @example - * ```lua - * red1 = {r = 0.5, g = 0, b = 0, a = 0.5} -- Half-opacity red - * red2 = {r = 0.5, a = 0.5} -- Same color as red1 - * black = {} -- All channels omitted: black - * red1_short = {0.5, 0, 0, 0.5} -- Same color as red1 in short-hand notation - * ``` - */ -type Color = ColorTable | ColorArray - -interface ColorModifierTable { - readonly r?: float - readonly g?: float - readonly b?: float - readonly a?: float -} - -type ColorModifierArray = readonly [r?: float, g?: float, b?: float, a?: float] - -/** - * Same as {@link Color}, but red, green, blue and alpha values can be any floating point number, without any special - * handling of the range [1, 255]. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ColorModifier View documentation} - */ -type ColorModifier = ColorModifierTable | ColorModifierArray - -interface CraftingQueueItem { - /** The index of the item in the crafting queue. */ - readonly index: uint - /** The recipe being crafted. */ - readonly recipe: string - /** The amount of items being crafted. */ - readonly count: uint -} - -interface Alert { - /** The tick this alert was created. */ - readonly tick: uint - readonly target?: LuaEntity - readonly prototype?: LuaEntityPrototype - readonly position?: Position - /** The SignalID used for a custom alert. Only present for custom alerts. */ - readonly icon?: SignalID - /** The message for a custom alert. Only present for custom alerts. */ - readonly message?: LocalisedString -} - -/** - * One vertex of a ScriptRenderPolygon. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ScriptRenderVertexTarget View documentation} - */ -interface ScriptRenderVertexTarget { - readonly target: Position | LuaEntity - /** Only used if `target` is a LuaEntity. */ - readonly target_offset?: Vector -} - -interface PathfinderWaypoint { - /** The position of the waypoint on its surface. */ - readonly position: Position - /** `true` if the path from the previous waypoint to this one goes through an entity that must be destroyed. */ - readonly needs_destroy_to_reach: boolean -} - -interface CutsceneWaypoint { - /** Position to pan the camera to. */ - readonly position?: Position - /** Entity or unit group to pan the camera to. */ - readonly target?: LuaEntity | LuaUnitGroup - /** How many ticks it will take to reach this waypoint from the previous one. */ - readonly transition_time: uint - /** Time in ticks to wait before moving to the next waypoint. */ - readonly time_to_wait: uint - /** Zoom level to be set when the waypoint is reached. When not specified, the previous waypoint's zoom is used. */ - readonly zoom?: double -} - -interface Decorative { - /** The name of the decorative prototype. */ - readonly name: string - readonly position: Position - readonly amount: uint8 -} - -interface DecorativeResult { - readonly position: TilePosition - readonly decorative: LuaDecorativePrototype - readonly amount: uint -} - -/** - * **Note**: Either `icon`, `text`, or both must be provided. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ChartTagSpec View documentation} - */ -interface ChartTagSpec { - readonly position: Position - readonly icon?: SignalID - readonly text?: string - readonly last_user?: PlayerIdentification -} - -/** - * Parameters that affect the look and control of the game. Updating any of the member attributes here will immediately - * take effect in the game engine. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings View documentation} - */ -interface GameViewSettings { - /** - * Show the controller GUI elements. This includes the toolbar, the selected tool slot, the armour slot, and the gun - * and ammunition slots. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_controller_gui View documentation} - */ - show_controller_gui: boolean - /** - * Show the chart in the upper right-hand corner of the screen. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_minimap View documentation} - */ - show_minimap: boolean - /** - * Show research progress and name in the upper right-hand corner of the screen. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_research_info View documentation} - */ - show_research_info: boolean - /** - * Show overlay icons on entities. Also known as "alt-mode". - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_entity_info View documentation} - */ - show_entity_info: boolean - /** - * Show the flashing alert icons next to the player's toolbar. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_alert_gui View documentation} - */ - show_alert_gui: boolean - /** - * When `true` (the default), mousing over an entity will select it. Otherwise, moving the mouse won't update entity - * selection. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.update_entity_selection View documentation} - */ - update_entity_selection: boolean - /** - * When `true` (`false` is default), the rails will always show the rail block visualisation. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_rail_block_visualisation View documentation} - */ - show_rail_block_visualisation: boolean - /** - * Shows or hides the buttons row. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_side_menu View documentation} - */ - show_side_menu: boolean - /** - * Shows or hides the view options when map is opened. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_map_view_options View documentation} - */ - show_map_view_options: boolean - /** - * Shows or hides quickbar of shortcuts. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_quickbar View documentation} - */ - show_quickbar: boolean - /** - * Shows or hides the shortcut bar. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GameViewSettings#GameViewSettings.show_shortcut_bar View documentation} - */ - show_shortcut_bar: boolean -} - -/** - * What is shown in the map view. If a field is not given, that setting will not be changed. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#MapViewSettings View documentation} - */ -interface MapViewSettings { - readonly "show-logistic-network"?: boolean - readonly "show-electric-network"?: boolean - readonly "show-turret-range"?: boolean - readonly "show-pollution"?: boolean - readonly "show-train-station-names"?: boolean - readonly "show-player-names"?: boolean - readonly "show-networkless-logistic-members"?: boolean - readonly "show-non-standard-map-info"?: boolean -} - -/** - * These values are for the time frame of one second (60 ticks). - * - * {@link https://lua-api.factorio.com/next/Concepts.html#PollutionMapSettings View documentation} - */ -interface PollutionMapSettings { - /** Whether pollution is enabled at all. */ - readonly enabled: boolean - /** The amount that is diffused to a neighboring chunk (possibly repeated for other directions as well). Defaults to `0.02`. */ - readonly diffusion_ratio: double - /** The amount of PUs that need to be in a chunk for it to start diffusing. Defaults to `15`. */ - readonly min_to_diffuse: double - /** The amount of pollution eaten by a chunk's tiles as a percentage of 1. Defaults to `1`. */ - readonly aeging: double - /** Any amount of pollution larger than this value is visualized as this value instead. Defaults to `150`. */ - readonly expected_max_per_chunk: double - /** - * Any amount of pollution smaller than this value (but bigger than zero) is visualized as this value instead. - * Defaults to `50`. - */ - readonly min_to_show_per_chunk: double - /** Defaults to `60`. */ - readonly min_pollution_to_damage_trees: double - /** Defaults to `150`. */ - readonly pollution_with_max_forest_damage: double - /** Defaults to `50`. */ - readonly pollution_per_tree_damage: double - /** Defaults to `10`. */ - readonly pollution_restored_per_tree_damage: double - /** Defaults to `20`. */ - readonly max_pollution_to_restore_trees: double - /** Defaults to `1`. */ - readonly enemy_attack_pollution_consumption_modifier: double -} - -/** - * These values represent a percentual increase in evolution. This means a value of `0.1` would increase evolution by 10%. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#EnemyEvolutionMapSettings View documentation} - */ -interface EnemyEvolutionMapSettings { - /** Whether enemy evolution is enabled at all. */ - readonly enabled: boolean - /** The amount evolution naturally progresses by every second. Defaults to `0.000004`. */ - readonly time_factor: double - /** The amount evolution progresses for every destroyed spawner. Defaults to `0.002`. */ - readonly destroy_factor: double - /** The amount evolution progresses for every unit of pollution. Defaults to `0.0000009`. */ - readonly pollution_factor: double -} - -/** - * Candidate chunks are given scores to determine which one of them should be expanded into. This score takes into - * account various settings noted below. The iteration is over a square region centered around the chunk for which the - * calculation is done, and includes the central chunk as well. Distances are calculated as - * {@link https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance}. - * - * The pseudocode algorithm to determine a chunk's score is as follows: - * - * ```lua - * player = 0 - * for neighbour in all chunks within enemy_building_influence_radius from chunk: - * player += number of player buildings on neighbour - * * building_coefficient - * * neighbouring_chunk_coefficient^distance(chunk, neighbour) - * - * base = 0 - * for neighbour in all chunk within friendly_base_influence_radius from chunk: - * base += num of enemy bases on neighbour - * * other_base_coefficient - * * neighbouring_base_chunk_coefficient^distance(chunk, neighbour) - * - * score(chunk) = 1 / (1 + player + base) - * ``` - * - * {@link https://lua-api.factorio.com/next/Concepts.html#EnemyExpansionMapSettings View documentation} - */ -interface EnemyExpansionMapSettings { - /** Whether enemy expansion is enabled at all. */ - readonly enabled: boolean - /** - * Distance in chunks from the furthest base around to prevent expansions from reaching too far into the player's - * territory. Defaults to `7`. - */ - readonly max_expansion_distance: uint - /** Defaults to `2`. */ - readonly friendly_base_influence_radius: uint - /** Defaults to `2`. */ - readonly enemy_building_influence_radius: uint - /** Defaults to `0.1`. */ - readonly building_coefficient: double - /** Defaults to `2.0`. */ - readonly other_base_coefficient: double - /** Defaults to `0.5`. */ - readonly neighbouring_chunk_coefficient: double - /** Defaults to `0.4`. */ - readonly neighbouring_base_chunk_coefficient: double - /** - * A chunk has to have at most this high of a percentage of unbuildable tiles for it to be considered a candidate to - * avoid chunks full of water as candidates. Defaults to `0.9`, or 90%. - */ - readonly max_colliding_tiles_coefficient: double - /** - * The minimum size of a biter group that goes to build a new base. This is multiplied by the evolution factor. - * Defaults to `5`. - */ - readonly settler_group_min_size: uint - /** - * The maximum size of a biter group that goes to build a new base. This is multiplied by the evolution factor. - * Defaults to `20`. - */ - readonly settler_group_max_size: uint - /** - * The minimum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. - * Defaults to `4*3,600=14,400` ticks. - */ - readonly min_expansion_cooldown: uint - /** - * The maximum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. - * Defaults to `60*3,600=216,000` ticks. - */ - readonly max_expansion_cooldown: uint -} - -interface UnitGroupMapSettings { - /** - * The minimum amount of time in ticks a group will spend gathering before setting off. The actual time is a random - * time between the minimum and maximum times. Defaults to `3,600` ticks. - */ - readonly min_group_gathering_time: uint - /** - * The maximum amount of time in ticks a group will spend gathering before setting off. The actual time is a random - * time between the minimum and maximum times. Defaults to `10*3,600=36,000` ticks. - */ - readonly max_group_gathering_time: uint - /** - * After gathering has finished, the group is allowed to wait this long in ticks for delayed members. New members - * are not accepted anymore however. Defaults to `2*3,600=7,200` ticks. - */ - readonly max_wait_time_for_late_members: uint - /** The minimum group radius in tiles. The actual radius is adjusted based on the number of members. Defaults to `5.0`. */ - readonly min_group_radius: double - /** The maximum group radius in tiles. The actual radius is adjusted based on the number of members. Defaults to `30.0`. */ - readonly max_group_radius: double - /** - * The maximum speed a percentage of its regular speed that a group member can speed up to when catching up with the - * group. Defaults to `1.4`, or 140%. - */ - readonly max_member_speedup_when_behind: double - /** - * The minimum speed a percentage of its regular speed that a group member can slow down to when ahead of the group. - * Defaults to `0.6`, or 60%. - */ - readonly max_member_slowdown_when_ahead: double - /** - * The minimum speed as a percentage of its maximum speed that a group will slow down to so members that fell behind - * can catch up. Defaults to `0.3`, or 30%. - */ - readonly max_group_slowdown_factor: double - /** - * When a member of a group falls back more than this factor times the group radius, the group will slow down to its - * `max_group_slowdown_factor` speed to let them catch up. Defaults to `3`. - */ - readonly max_group_member_fallback_factor: double - /** - * When a member of a group falls back more than this factor times the group radius, it will be dropped from the - * group. Defaults to `10`. - */ - readonly member_disown_distance: double - readonly tick_tolerance_when_member_arrives: uint - /** The maximum number of automatically created unit groups gathering for attack at any time. Defaults to `30`. */ - readonly max_gathering_unit_groups: uint - /** - * The maximum number of members for an attack unit group. This only affects automatically created unit groups, - * manual groups created through the API are unaffected. Defaults to `200`. - */ - readonly max_unit_group_size: uint -} - -interface SteeringMapSetting { - /** Does not include the radius of the unit. */ - readonly radius: double - readonly separation_factor: double - readonly separation_force: double - /** Used to make steering look better for aesthetic purposes. */ - readonly force_unit_fuzzy_goto_behavior: boolean -} - -interface SteeringMapSettings { - readonly default: SteeringMapSetting - readonly moving: SteeringMapSetting -} - -interface PathFinderMapSettings { - /** Determines whether forwards (`>1`), backwards (`<-1`), or symmetrical (`1`) search is preferred. Defaults to `5`. */ - readonly fwd2bwd_ratio: uint - /** - * When looking at which node to check next, their heuristic value is multiplied by this ratio. The higher it is, - * the more the search is directed straight at the goal. Defaults to `2`. - */ - readonly goal_pressure_ratio: double - /** The maximum number of nodes that are expanded per tick. Defaults to `1,000`. */ - readonly max_steps_worked_per_tick: double - /** The maximum amount of work each pathfinding job is allowed to do per tick. Defaults to `8,000`. */ - readonly max_work_done_per_tick: uint - /** Whether to cache paths at all. Defaults to `true`. */ - readonly use_path_cache: boolean - /** Number of elements in the short cache. Defaults to `5`. */ - readonly short_cache_size: uint - /** Number of elements in the long cache. Defaults to `25`. */ - readonly long_cache_size: uint - /** The minimal distance to the goal in tiles required to be searched in the short path cache. Defaults to `10`. */ - readonly short_cache_min_cacheable_distance: double - /** The minimal number of nodes required to be searched in the short path cache. Defaults to `50`. */ - readonly short_cache_min_algo_steps_to_cache: uint - /** The minimal distance to the goal in tiles required to be searched in the long path cache. Defaults to `30`. */ - readonly long_cache_min_cacheable_distance: double - /** - * When looking for a connection to a cached path, search at most for this number of steps times the original - * estimate. Defaults to `100`. - */ - readonly cache_max_connect_to_cache_steps_multiplier: uint - /** - * When looking for a path from cache, make sure it doesn't start too far from the requested start in relative - * terms. Defaults to `0.2`. - */ - readonly cache_accept_path_start_distance_ratio: double - /** - * When looking for a path from cache, make sure it doesn't end too far from the requested end in relative terms. - * This is typically more lenient than the start ratio since the end target could be moving. Defaults to `0.15`. - */ - readonly cache_accept_path_end_distance_ratio: double - /** Same principle as `cache_accept_path_start_distance_ratio`, but used for negative cache queries. Defaults to `0.3`. */ - readonly negative_cache_accept_path_start_distance_ratio: double - /** Same principle as `cache_accept_path_end_distance_ratio`, but used for negative cache queries. Defaults to `0.3`. */ - readonly negative_cache_accept_path_end_distance_ratio: double - /** When assigning a rating to the best path, this multiplier times start distances is considered. Defaults to `10`. */ - readonly cache_path_start_distance_rating_multiplier: double - /** - * When assigning a rating to the best path, this multiplier times end distances is considered. This value is - * typically higher than the start multiplier as this results in better end path quality. Defaults to `20`. - */ - readonly cache_path_end_distance_rating_multiplier: double - /** - * A penalty that is applied for another unit that is on the way to the goal. This is mainly relevant for situations - * where a group of units has arrived at the target they are supposed to attack, making units further back circle - * around to reach the target. Defaults to `30`. - */ - readonly stale_enemy_with_same_destination_collision_penalty: double - /** The distance in tiles after which other moving units are not considered for pathfinding. Defaults to `5`. */ - readonly ignore_moving_enemy_collision_distance: double - /** - * A penalty that is applied for another unit that is too close and either not moving or has a different goal. - * Defaults to `30`. - */ - readonly enemy_with_different_destination_collision_penalty: double - /** The general collision penalty with other units. Defaults to `10`. */ - readonly general_entity_collision_penalty: double - /** The collision penalty for positions that require the destruction of an entity to get to. Defaults to `3`. */ - readonly general_entity_subsequent_collision_penalty: double - /** - * The collision penalty for collisions in the extended bounding box but outside the entity's actual bounding box. - * Defaults to `3`. - */ - readonly extended_collision_penalty: double - /** The amount of path finder requests accepted per tick regardless of the requested path's length. Defaults to `10`. */ - readonly max_clients_to_accept_any_new_request: uint - /** - * When the `max_clients_to_accept_any_new_request` amount is exhausted, only path finder requests with a short - * estimate will be accepted until this amount (per tick) is reached. Defaults to `100`. - */ - readonly max_clients_to_accept_short_new_request: uint - /** The maximum direct distance in tiles before a request is no longer considered short. Defaults to `100`. */ - readonly direct_distance_to_consider_short_request: uint - /** The maximum amount of nodes a short request will traverse before being rescheduled as a long request. Defaults to `1000`. */ - readonly short_request_max_steps: uint - /** - * The amount of steps that are allocated to short requests each tick, as a percentage of all available steps. - * Defaults to `0.5`, or 50%. - */ - readonly short_request_ratio: double - /** The minimum amount of steps that are guaranteed to be performed for every request. Defaults to `2000`. */ - readonly min_steps_to_check_path_find_termination: uint - /** - * If the actual amount of steps is higher than the initial estimate by this factor, pathfinding is terminated. - * Defaults to `2000.0`. - */ - readonly start_to_goal_cost_multiplier_to_terminate_path_find: double - /** - * The thresholds of waiting clients after each of which the per-tick work limit will be increased by the - * corresponding value in `overload_multipliers`. This is to avoid clients having to wait too long. Must have the - * same number of elements as `overload_multipliers`. Defaults to `{0, 100, 500}`. - */ - readonly overload_levels: uint[] - /** - * The multipliers to the amount of per-tick work applied after the corresponding thresholds in `overload_levels` - * have been reached. Must have the same number of elements as `overload_multipliers`. Defaults to `{2, 3, 4}`. - */ - readonly overload_multipliers: double[] - /** The delay in ticks between decrementing the score of all paths in the negative cache by one. Defaults to `20`. */ - readonly negative_path_cache_delay_interval: uint -} - -/** - * Various game-related settings. Updating any of the attributes will immediately take effect in the game engine. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#MapSettings View documentation} - * - * @example - * Increase the number of short paths the pathfinder can cache. - * - * ```lua - * game.map_settings.path_finder.short_cache_size = 15 - * ``` - */ -interface MapSettings { - readonly pollution: PollutionMapSettings - readonly enemy_evolution: EnemyEvolutionMapSettings - readonly enemy_expansion: EnemyExpansionMapSettings - readonly unit_group: UnitGroupMapSettings - readonly steering: SteeringMapSettings - readonly path_finder: PathFinderMapSettings - /** - * If a behavior fails this many times, the enemy (or enemy group) is destroyed. This solves biters getting stuck - * within their own base. - */ - readonly max_failed_behavior_count: uint -} - -/** - * Technology and recipe difficulty settings. Updating any of the attributes will immediately take effect in the game engine. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#DifficultySettings View documentation} - */ -interface DifficultySettings { - readonly recipe_difficulty: defines.difficulty_settings.recipe_difficulty - readonly technology_difficulty: defines.difficulty_settings.technology_difficulty - /** A value in range [0.001, 1000]. */ - readonly technology_price_multiplier: double - /** - * Either `"after-victory"`, `"always"` or `"never"`. Changing this to `"always"` or `"after-victory"` does not - * automatically unlock the research queue. See {@link LuaForce} for that. - */ - readonly research_queue_setting: "after-victory" | "always" | "never" -} - -/** - * The data that can be extracted from a map exchange string, as a plain table. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#MapExchangeStringData View documentation} - */ -interface MapExchangeStringData { - /** - * All the regular map settings plus an additional table called `difficulty_settings` that contains the - * {@link DifficultySettings}. - */ - readonly map_settings: MapSettings - readonly map_gen_settings: MapGenSettings -} - -interface BlueprintItemIcon { - /** Name of the item prototype whose icon should be used. */ - readonly name: string - /** Index of the icon in the blueprint icons slots. Has to be an integer in the range [1, 4]. */ - readonly index: uint -} - -interface BlueprintSignalIcon { - /** The icon to use. It can be any item icon as well as any virtual signal icon. */ - readonly signal: SignalID - /** Index of the icon in the blueprint icons slots. Has to be an integer in the range [1, 4]. */ - readonly index: uint -} - -/** - * Information about a single connection between two connection points. - * - * {@link https://wiki.factorio.com/Blueprint_string_format#Connection_data_object View Documentation} - */ -interface BlueprintConnectionData { - /** ID of the entity this connection is connected with. */ - entity_id: uint - /** The circuit connector id of the entity this connection is connected to, see {@link defines.circuit_connector_id} */ - circuit_id?: defines.circuit_connector_id -} - -/** - * The actual point where a wire is connected to. Contains information about where it is connected to. - * - * {@link https://wiki.factorio.com/Blueprint_string_format#Connection_point_object View Documentation} - */ -interface BlueprintConnectionPoint { - /** - * An array of {@link BlueprintConnectionData Connection data object} containing all the connections from this point - * created by red wire. - */ - red?: BlueprintConnectionData[] - /** - * An array of {@link BlueprintConnectionData Connection data object} containing all the connections from this point - * created by green wire. - */ - green?: BlueprintConnectionData[] -} - -/** - * Object containing information about the connections to other entities formed by red or green wires. - * - * {@link https://wiki.factorio.com/Blueprint_string_format#Connection_object View Documentation} - */ -interface BlueprintCircuitConnection { - /** First connection point. The default for everything that doesn't have multiple connection points. */ - "1"?: BlueprintConnectionPoint - /** Second connection point. For example, the "output" part of an arithmetic combinator. */ - "2"?: BlueprintConnectionPoint -} - -/** - * The representation of an entity inside of a blueprint. It has at least these fields, but can contain additional ones - * depending on the kind of entity. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#BlueprintEntity View documentation} - */ -interface BlueprintEntity { - /** The entity's unique identifier in the blueprint. */ - readonly entity_number: uint - /** The prototype name of the entity. */ - readonly name: string - /** The position of the entity. */ - readonly position: Position - /** - * The direction the entity is facing. Only present for entities that can face in different directions and when the - * entity is not facing north. - */ - readonly direction?: defines.direction - /** The entity tags of the entity, if there are any. Only relevant for entity ghosts. */ - readonly tags?: Tags - /** - * The items that the entity will request when revived, if there are any. It's a mapping of prototype names to - * amounts. Only relevant for entity ghosts. - */ - readonly items?: Record - /** - * The circuit network connections of the entity, if there are any. Only relevant for entities that support circuit - * connections. - */ - readonly connections?: BlueprintCircuitConnection - /** - * The control behavior of the entity, if it has one. The format of the control behavior depends on the entity's - * type. Only relevant for entities that support control behaviors. - */ - readonly control_behavior?: BlueprintControlBehavior - /** The schedule of the entity, if it has one. Only relevant for locomotives. */ - readonly schedule?: TrainScheduleRecord[] -} - -interface Tile { - /** The position of the tile. */ - readonly position: Position - /** The prototype name of the tile. */ - readonly name: string -} - -interface Fluid { - /** Fluid prototype name of the fluid. */ - readonly name: string - /** Amount of the fluid. */ - readonly amount: double - /** - * The temperature. When reading from {@link LuaFluidBox}, this field will always be present. It is not necessary to - * specify it when writing, however. When not specified, the fluid will be set to the fluid's default temperature as - * specified in the fluid's prototype. - */ - readonly temperature?: double -} - -interface BaseIngredient { - /** `"item"` or `"fluid"`. */ - readonly type: "item" | "fluid" - /** Prototype name of the required item or fluid. */ - readonly name: string - /** Amount of the item or fluid. */ - readonly amount: double - /** How much of this ingredient is a catalyst. */ - readonly catalyst_amount?: uint | double -} - -interface FluidIngredient extends BaseIngredient { - readonly type: "fluid" - /** The minimum fluid temperature required. */ - readonly minimum_temperature?: double - /** The maximum fluid temperature allowed. */ - readonly maximum_temperature?: double -} - -interface OtherIngredient extends BaseIngredient { - readonly type: "item" -} - -/** - * Other attributes may be specified depending on `type`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Ingredient View documentation} - */ -type Ingredient = FluidIngredient | OtherIngredient - -interface BaseProduct { - /** `"item"` or `"fluid"`. */ - readonly type: "item" | "fluid" - /** Prototype name of the result. */ - readonly name: string - /** Amount of the item or fluid to give. If not specified, `amount_min`, `amount_max` and `probability` must all be specified. */ - readonly amount?: double - /** Minimal amount of the item or fluid to give. Has no effect when `amount` is specified. */ - readonly amount_min?: uint | double - /** Maximum amount of the item or fluid to give. Has no effect when `amount` is specified. */ - readonly amount_max?: uint | double - /** A value in range [0, 1]. Item or fluid is only given with this probability; otherwise no product is produced. */ - readonly probability?: double - /** How much of this product is a catalyst. */ - readonly catalyst_amount?: uint | double -} - -interface FluidProduct extends BaseProduct { - readonly type: "fluid" - /** The fluid temperature of this product. */ - readonly temperature?: double -} - -interface OtherProduct extends BaseProduct { - readonly type: "item" -} - -/** - * Other attributes may be specified depending on `type`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Product View documentation} - * - * @example - * Products of the "steel-chest" recipe (an array of Product): - * - * ```lua - * {{type="item", name="steel-chest", amount=1}} - * ``` - * - * @example - * Products of the "advanced-oil-processing" recipe: - * - * ```lua - * {{type="fluid", name="heavy-oil", amount=1}, - * {type="fluid", name="light-oil", amount=4.5}, - * {type="fluid", name="petroleum-gas", amount=5.5}} - * ``` - * - * @example - * What a custom recipe would look like that had a probability of 0.5 to return a minimum amount of 1 and a maximum amount of 5: - * - * ```lua - * {{type=0, name="custom-item", probability=0.5, amount_min=1, amount_max=5}} - * ``` - * - * @see {@link LuaRecipe.products} - */ -type Product = FluidProduct | OtherProduct - -interface Loot { - /** Item prototype name of the result. */ - readonly item: string - /** Probability that any loot at all will drop, as a number in range [0, 1]. */ - readonly probability: double - /** Minimum amount of loot to drop. */ - readonly count_min: double - /** Maximum amount of loot to drop. */ - readonly count_max: double -} - -interface BaseTechnologyModifier { - /** - * Modifier type. Specifies which of the other fields will be available. Possible values are: - * `"inserter-stack-size-bonus"`, `"stack-inserter-capacity-bonus"`, `"laboratory-speed"`, - * `"character-logistic-trash-slots"`, `"maximum-following-robots-count"`, `"worker-robot-speed"`, - * `"worker-robot-storage"`, `"ghost-time-to-live"`, `"turret-attack"`, `"ammo-damage"`, `"give-item"`, - * `"gun-speed"`, `"unlock-recipe"`, `"character-crafting-speed"`, `"character-mining-speed"`, - * `"character-running-speed"`, `"character-build-distance"`, `"character-item-drop-distance"`, - * `"character-reach-distance"`, `"character-resource-reach-distance"`, `"character-item-pickup-distance"`, - * `"character-loot-pickup-distance"`, `"character-inventory-slots-bonus"`, `"deconstruction-time-to-live"`, - * `"max-failed-attempts-per-tick-per-construction-queue"`, - * `"max-successful-attempts-per-tick-per-construction-queue"`, `"character-health-bonus"`, - * `"mining-drill-productivity-bonus"`, `"train-braking-force-bonus"`, `"zoom-to-world-enabled"`, - * `"zoom-to-world-ghost-building-enabled"`, `"zoom-to-world-blueprint-enabled"`, - * `"zoom-to-world-deconstruction-planner-enabled"`, `"zoom-to-world-upgrade-planner-enabled"`, - * `"zoom-to-world-selection-tool-enabled"`, `"worker-robot-battery"`, `"laboratory-productivity"`, - * `"follower-robot-lifetime"`, `"artillery-range"`, `"nothing"`, `"character-additional-mining-categories"`, - * `"character-logistic-requests"`. - */ - readonly type: - | "inserter-stack-size-bonus" - | "stack-inserter-capacity-bonus" - | "laboratory-speed" - | "character-logistic-trash-slots" - | "maximum-following-robots-count" - | "worker-robot-speed" - | "worker-robot-storage" - | "ghost-time-to-live" - | "turret-attack" - | "ammo-damage" - | "give-item" - | "gun-speed" - | "unlock-recipe" - | "character-crafting-speed" - | "character-mining-speed" - | "character-running-speed" - | "character-build-distance" - | "character-item-drop-distance" - | "character-reach-distance" - | "character-resource-reach-distance" - | "character-item-pickup-distance" - | "character-loot-pickup-distance" - | "character-inventory-slots-bonus" - | "deconstruction-time-to-live" - | "max-failed-attempts-per-tick-per-construction-queue" - | "max-successful-attempts-per-tick-per-construction-queue" - | "character-health-bonus" - | "mining-drill-productivity-bonus" - | "train-braking-force-bonus" - | "zoom-to-world-enabled" - | "zoom-to-world-ghost-building-enabled" - | "zoom-to-world-blueprint-enabled" - | "zoom-to-world-deconstruction-planner-enabled" - | "zoom-to-world-upgrade-planner-enabled" - | "zoom-to-world-selection-tool-enabled" - | "worker-robot-battery" - | "laboratory-productivity" - | "follower-robot-lifetime" - | "artillery-range" - | "nothing" - | "character-additional-mining-categories" - | "character-logistic-requests" -} - -interface GunSpeedTechnologyModifier extends BaseTechnologyModifier { - readonly type: "gun-speed" - /** Prototype name of the ammunition category that is affected */ - readonly ammo_category: string - /** Modification value. This will be added to the current gun speed modifier upon researching. */ - readonly modifier: double -} - -interface AmmoDamageTechnologyModifier extends BaseTechnologyModifier { - readonly type: "ammo-damage" - /** Prototype name of the ammunition category that is affected */ - readonly ammo_category: string - /** Modification value. This will be added to the current ammo damage modifier upon researching. */ - readonly modifier: double -} - -interface GiveItemTechnologyModifier extends BaseTechnologyModifier { - readonly type: "give-item" - /** Item prototype name to give. */ - readonly item: string - /** Number of items to give. Defaults to `1`. */ - readonly count?: uint -} - -interface TurretAttackTechnologyModifier extends BaseTechnologyModifier { - readonly type: "turret-attack" - /** Turret prototype name this modifier will affect. */ - readonly turret_id: string - /** Modification value. This will be added to the current turret damage modifier upon researching. */ - readonly modifier: double -} - -interface UnlockRecipeTechnologyModifier extends BaseTechnologyModifier { - readonly type: "unlock-recipe" - /** Recipe prototype name to unlock. */ - readonly recipe: string -} - -interface NothingTechnologyModifier extends BaseTechnologyModifier { - readonly type: "nothing" - /** Description of this nothing modifier. */ - readonly effect_description: LocalisedString -} - -interface OtherTechnologyModifier extends BaseTechnologyModifier { - readonly type: - | "inserter-stack-size-bonus" - | "stack-inserter-capacity-bonus" - | "laboratory-speed" - | "character-logistic-trash-slots" - | "maximum-following-robots-count" - | "worker-robot-speed" - | "worker-robot-storage" - | "ghost-time-to-live" - | "character-crafting-speed" - | "character-mining-speed" - | "character-running-speed" - | "character-build-distance" - | "character-item-drop-distance" - | "character-reach-distance" - | "character-resource-reach-distance" - | "character-item-pickup-distance" - | "character-loot-pickup-distance" - | "character-inventory-slots-bonus" - | "deconstruction-time-to-live" - | "max-failed-attempts-per-tick-per-construction-queue" - | "max-successful-attempts-per-tick-per-construction-queue" - | "character-health-bonus" - | "mining-drill-productivity-bonus" - | "train-braking-force-bonus" - | "zoom-to-world-enabled" - | "zoom-to-world-ghost-building-enabled" - | "zoom-to-world-blueprint-enabled" - | "zoom-to-world-deconstruction-planner-enabled" - | "zoom-to-world-upgrade-planner-enabled" - | "zoom-to-world-selection-tool-enabled" - | "worker-robot-battery" - | "laboratory-productivity" - | "follower-robot-lifetime" - | "artillery-range" - | "character-additional-mining-categories" - | "character-logistic-requests" - /** Modification value. This value will be added to the variable it modifies. */ - readonly modifier: double -} - -/** - * The effect that is applied when a technology is researched. It is a table that contains at least the field `type`. - * - * Other attributes may be specified depending on `type`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#TechnologyModifier View documentation} - */ -type TechnologyModifier = - | GunSpeedTechnologyModifier - | AmmoDamageTechnologyModifier - | GiveItemTechnologyModifier - | TurretAttackTechnologyModifier - | UnlockRecipeTechnologyModifier - | NothingTechnologyModifier - | OtherTechnologyModifier - -/** - * A single offer on a market entity. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Offer View documentation} - */ -interface Offer { - /** List of prices. */ - readonly price: Ingredient[] - /** The action that will take place when a player accepts the offer. Usually a `"give-item"` modifier. */ - readonly offer: TechnologyModifier -} - -/** - * Specifies how probability and richness are calculated when placing something on the map. Can be specified either - * using `probability_expression` and `richness_expression` or by using all the other fields. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#AutoplaceSpecification View documentation} - */ -interface AutoplaceSpecification { - readonly probability_expression: NoiseExpression - readonly richness_expression: NoiseExpression - readonly coverage: double - readonly sharpness: double - readonly max_probability: double - readonly placement_density: uint - readonly richness_base: double - readonly richness_multiplier: double - readonly richness_multiplier_distance_bonus: double - readonly starting_area_size: uint - readonly order: string - readonly default_enabled: boolean - readonly peaks?: AutoplaceSpecificationPeak[] - /** Control prototype name. */ - readonly control?: string - readonly tile_restriction?: AutoplaceSpecificationRestriction[] - readonly force: string - readonly random_probability_penalty: double -} - -/** - * A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain - * generation. These can only be meaningfully written/modified during the data load phase. More detailed information is - * found on the {@link https://wiki.factorio.com/Types/NoiseExpression wiki}. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#NoiseExpression View documentation} - */ -interface NoiseExpression { - /** Names the type of the expression and determines what other fields are required. */ - readonly type: string -} - -interface AutoplaceSpecificationPeak { - readonly influence: double - readonly max_influence: double - readonly min_influence: double - readonly richness_influence: double - readonly noisePersistence: double - /** Prototype name of the noise layer. */ - readonly noise_layer?: string - readonly noise_octaves_difference: double - readonly water_optimal: double - readonly water_range: double - readonly water_max_range: double - readonly water_top_property_limit: double - readonly elevation_optimal: double - readonly elevation_range: double - readonly elevation_max_range: double - readonly elevation_top_property_limit: double - readonly temperature_optimal: double - readonly temperature_range: double - readonly temperature_max_range: double - readonly temperature_top_property_limit: double - readonly starting_area_weight_optimal: double - readonly starting_area_weight_range: double - readonly starting_area_weight_max_range: double - readonly starting_area_weight_top_property_limit: double - readonly tier_from_start_optimal: double - readonly tier_from_start_range: double - readonly tier_from_start_max_range: double - readonly tier_from_start_top_property_limit: double - readonly distance_optimal: double - readonly distance_range: double - readonly distance_max_range: double - readonly distance_top_property_limit: double - readonly aux_optimal: double - readonly aux_range: double - readonly aux_max_range: double - readonly aux_top_property_limit: double -} - -interface AutoplaceSpecificationRestriction { - /** Tile prototype name */ - readonly first?: string - /** Second prototype name */ - readonly second?: string -} - -interface Resistance { - /** Absolute damage decrease */ - readonly decrease: float - /** Percentual damage decrease */ - readonly percent: float -} - -/** - * A floating point number specifying an amount. - * - * For backwards compatibility, MapGenSizes can also be specified as one of the following strings, which will be - * converted to a number (when queried, a number will always be returned): - * - * - `"none"` - equivalent to `0` - * - `"very-low"`, `"very-small"`, `"very-poor"` - equivalent to `1/2` - * - `"low"`, `"small"`, `"poor"` - equivalent to `1/sqrt(2)` - * - `"normal"`, `"medium"`, `"regular"` - equivalent to `1` - * - `"high"`, `"big"`, `"good"` - equivalent to `sqrt(2)` - * - `"very-high"`, `"very-big"`, `"very-good"` - equivalent to `2` - * - * **Note**: The map generation algorithm officially supports the range of values the in-game map generation screen - * shows (specifically `0` and values from `1/6` to `6`). Values outside this range are not guaranteed to work as expected. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#MapGenSize View documentation} - */ -type MapGenSize = - | number - | "none" - | "very-low" - | "very-small" - | "very-poor" - | "low" - | "small" - | "poor" - | "normal" - | "medium" - | "regular" - | "high" - | "big" - | "good" - | "very-high" - | "very-big" - | "very-good" - -interface AutoplaceSetting { - readonly frequency: MapGenSize - readonly size: MapGenSize - readonly richness: MapGenSize -} - -interface AutoplaceSettings { - /** Whether missing autoplace names for this type should be default enabled. */ - readonly treat_missing_as_default: boolean - readonly settings: Record -} - -interface AutoplaceControl { - /** - * For things that are placed as spots such as ores and enemy bases, frequency is generally proportional to number - * of spots placed per unit area. For continuous features such as forests, frequency is how compressed the - * probability function is over distance, i.e. the inverse of 'scale' (similar to terrain_segmentation). When the - * {@link LuaAutoplaceControlPrototype} is of the category `"terrain"`, then scale is shown in the map generator GUI - * instead of frequency. - */ - readonly frequency: MapGenSize - /** - * For things that are placed as spots, size is proportional to the area of each spot. For continuous features, size - * affects how much of the map is covered with the thing, and is called 'coverage' in the GUI. - */ - readonly size: MapGenSize - /** - * Has different effects for different things, but generally affects the 'health' or density of a thing that is - * placed without affecting where it is placed. For trees, richness affects tree health. For ores, richness - * multiplies the amount of ore at any given tile in a patch. Metadata about autoplace controls (such as whether or - * not 'richness' does anything for them) can be found in the {@link LuaAutoplaceControlPrototype} by looking up - * `game.autoplace_control_prototypes[(control prototype name)]`, e.g. - * `game.autoplace_control_prototypes["enemy-base"].richness` is false, because enemy base autoplacement doesn't use - * richness. - */ - readonly richness: MapGenSize -} - -interface CliffPlacementSettings { - /** Name of the cliff prototype. */ - readonly name: string - /** - * Elevation at which the first row of cliffs is placed. The default is `10`, and this cannot be set from the map - * generation GUI. - */ - readonly cliff_elevation_0: float - /** - * Elevation difference between successive rows of cliffs. This is inversely proportional to 'frequency' in the map - * generation GUI. Specifically, when set from the GUI the value is `40 / frequency`. - */ - readonly cliff_elevation_interval: float - /** - * Corresponds to 'continuity' in the GUI. This value is not used directly, but is used by the 'cliffiness' noise - * expression, which in combination with elevation and the two cliff elevation properties drives cliff placement - * (cliffs are placed when elevation crosses the elevation contours defined by `cliff_elevation_0` and - * `cliff_elevation_interval` when 'cliffiness' is greater than `0.5`). The default 'cliffiness' expression - * interprets this value such that larger values result in longer unbroken walls of cliffs, and smaller values - * (between `0` and `1`) result in larger gaps in cliff walls. - */ - readonly richness: MapGenSize -} - -/** - * The 'map type' dropdown in the map generation GUI is actually a selector for elevation generator. The base game sets - * `property_expression_names.elevation` to `"0_16-elevation"` to reproduce terrain from 0.16 or to `"0_17-island"` for - * the island preset. If generators are available for other properties, the 'map type' dropdown in the GUI will be - * renamed to 'elevation' and shown along with selectors for the other selectable properties. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#MapGenSettings View documentation} - * - * @example - * Assuming a NamedNoiseExpression with the name "my-alternate-grass1-probability" is defined - * - * ```lua - * local surface = game.player.surface - * local mgs = surface.map_gen_settings - * mgs.property_expression_names["tile:grass1:probability"] = "my-alternate-grass1-probability" - * surface.map_gen_settings = mgs - * ``` would override the probability of grass1 being placed at any given point on the current surface. - * - * @example - * To make there be no deep water on (newly generated chunks) a surface: - * - * ```lua - * local surface = game.player.surface - * local mgs = surface.map_gen_settings - * mgs.property_expression_names["tile:deepwater:probability"] = -1000 - * surface.map_gen_settings = mgs - * ``` This does not require a NamedNoiseExpression to be defined, since literal numbers (and strings naming literal numbers, e.g. `"123"`) are understood to stand for constant value expressions. - */ -interface MapGenSettings { - /** - * The inverse of 'water scale' in the map generator GUI. Lower `terrain_segmentation` increases the scale of - * elevation features (lakes, continents, etc). This behavior can be overridden with alternate elevation generators - * (see `property_expression_names`, below). - */ - readonly terrain_segmentation: MapGenSize - /** - * The equivalent to 'water coverage' in the map generator GUI. Specifically, when this value is non-zero, - * `water_level = 10 * log2` (the value of this field), and the elevation generator subtracts water level from - * elevation before adding starting lakes. If water is set to 'none', elevation is clamped to a small positive value - * before adding starting lakes. This behavior can be overridden with alternate elevation generators (see - * `property_expression_names`, below). - */ - readonly water: MapGenSize - /** Indexed by autoplace control prototype name. */ - readonly autoplace_controls: Record - /** Whether undefined `autoplace_controls` should fall back to the default controls or not. Defaults to `true`. */ - readonly default_enable_all_autoplace_controls: boolean - /** - * Each setting in this dictionary maps the string type to the settings for that type. Valid types are `"entity"`, - * `"tile"` and `"decorative"`. - */ - readonly autoplace_settings: Record - /** Map generation settings for entities of the type "cliff". */ - readonly cliff_settings: CliffPlacementSettings - /** The random seed used to generated this map. */ - readonly seed: uint - /** - * Width in tiles. If `0`, the map has 'infinite' width, with the actual limitation being one million tiles in each - * direction from the center. - */ - readonly width: uint - /** - * Height in tiles. If `0`, the map has 'infinite' height, with the actual limitation being one million tiles in - * each direction from the center. - */ - readonly height: uint - /** Size of the starting area. */ - readonly starting_area: MapGenSize - /** Positions of the starting areas. */ - readonly starting_points: Position[] - /** Whether peaceful mode is enabled for this map. */ - readonly peaceful_mode: boolean - /** - * Overrides for tile property value generators. Values either name a NamedNoiseExpression or can be literal - * numbers, stored as strings (e.g. `"5"`). All other controls can be overridden by a property expression names. - * Notable properties: - * - * - `moisture` - a value between 0 and 1 that determines whether a tile becomes sandy (low moisture) or grassy (high moisture). - * - `aux` - a value between 0 and 1 that determines whether low-moisture tiles become sand or red desert. - * - `temperature` - provides a value (vaguely representing degrees Celsius, varying between -20 and 50) that is used - * (together with moisture and aux) as part of tree and decorative placement. - * - `elevation` - tiles values less than zero become water. Cliffs are placed along certain contours according to - * {@link CliffPlacementSettings}. - * - `cliffiness` - determines whether (when >0.5) or not (when <0.5) a cliff will be placed at an otherwise suitable - * (according to {@link CliffPlacementSettings}) location. - * - `enemy-base-intensity` - a number that is referenced by both `enemy-base-frequency` and `enemy-base-radius`. i.e. - * if this is overridden, enemy base frequency and size will both be affected and do something reasonable. By - * default, this expression returns a value proportional to distance from any starting point, clamped at about 7. - * - `enemy-base-frequency` - a number representing average number of enemy bases per tile for a region, by default in - * terms of `enemy-base-intensity`. - * - `enemy-base-radius` - a number representing the radius of an enemy base, if one were to be placed on the given - * tile, by default proportional to a constant plus `enemy-base-intensity`. Climate controls ('Moisture' and - * 'Terrain type' at the bottom of the Terrain tab in the map generator GUI) don't have their own dedicated - * structures in MapGenSettings. Instead, their values are stored as property expression overrides with long names: - * - `control-setting:moisture:frequency:multiplier` - frequency (inverse of scale) multiplier for moisture noise. Default is 1. - * - `control-setting:moisture:bias` - global bias for moisture (which normally varies between 0 and 1). Default is 0. - * - `control-setting:aux:frequency:multiplier` - frequency (inverse of scale) multiplier for aux (called 'terrain - * type' in the GUI) noise. Default is 1. - * - `control-setting:aux:bias` - global bias for aux/terrain type (which normally varies between 0 and 1). Default is - * 0. All other MapGenSettings feed into named noise expressions, and therefore placement can be overridden by - * including the name of a property in this dictionary. The probability and richness functions for placing - * specific tiles, entities, and decoratives can be overridden by including an entry named - * `{tile|entity|decorative}:(prototype name):{probability|richness}`. - */ - readonly property_expression_names: Record -} - -interface SignalID { - /** `"item"`, `"fluid"`, or `"virtual"`. */ - readonly type: "item" | "fluid" | "virtual" - /** Name of the item, fluid or virtual signal. */ - readonly name?: string -} - -/** - * An actual signal transmitted by the network. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Signal View documentation} - */ -interface Signal { - /** ID of the signal. */ - readonly signal: SignalID - /** Value of the signal. */ - readonly count: int -} - -interface UpgradeFilter { - /** `"item"`, or `"entity"`. */ - readonly type: "item" | "entity" - /** Name of the item, or entity. */ - readonly name?: string -} - -/** - * A single filter used by an infinity-filters instance. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#InfinityInventoryFilter View documentation} - */ -interface InfinityInventoryFilter { - /** Name of the item. */ - readonly name: string - /** The count of the filter. */ - readonly count?: uint - /** `"at-least"`, `"at-most"`, or `"exactly"`. Defaults to `"at-least"`. */ - readonly mode?: "at-least" | "at-most" | "exactly" - /** The index of this filter in the filters list. */ - readonly index: uint -} - -/** - * A single filter used by an infinity-pipe type entity. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#InfinityPipeFilter View documentation} - */ -interface InfinityPipeFilter { - /** Name of the fluid. */ - readonly name: string - /** The fill percentage the pipe (e.g. 0.5 for 50%). Can't be negative. */ - readonly percentage?: double - /** The temperature of the fluid. Defaults to the default/minimum temperature of the fluid. */ - readonly temperature?: double - /** `"at-least"`, `"at-most"`, `"exactly"`, `"add"`, or `"remove"`. Defaults to `"at-least"`. */ - readonly mode?: "at-least" | "at-most" | "exactly" | "add" | "remove" -} - -interface FluidBoxFilter { - /** Fluid prototype name of the filtered fluid. */ - readonly name: string - /** The minimum temperature allowed into the fluidbox. */ - readonly minimum_temperature: double - /** The maximum temperature allowed into the fluidbox. */ - readonly maximum_temperature: double -} - -interface FluidBoxFilterSpec { - /** Fluid prototype name of the filtered fluid. */ - readonly name: string - /** The minimum temperature allowed into the fluidbox. */ - readonly minimum_temperature?: double - /** The maximum temperature allowed into the fluidbox. */ - readonly maximum_temperature?: double - /** Force the filter to be set, regardless of current fluid content. */ - readonly force?: boolean -} - -/** - * The settings used by a heat-interface type entity. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#HeatSetting View documentation} - */ -interface HeatSetting { - /** The target temperature. Defaults to the minimum temperature of the heat buffer. */ - readonly temperature?: double - /** `"at-least"`, `"at-most"`, `"exactly"`, `"add"`, or `"remove"`. Defaults to `"at-least"`. */ - readonly mode?: "at-least" | "at-most" | "exactly" | "add" | "remove" -} - -interface HeatConnection { - readonly position: Vector - readonly direction: defines.direction -} - -/** - * A definition of a fluidbox connection point. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#FluidBoxConnection View documentation} - */ -interface FluidBoxConnection { - /** The connection type: "input", "output", or "input-output". */ - readonly type: "input" | "output" | "input-output" - /** The 4 cardinal direction connection points for this pipe. This vector is a table with `x` and `y` keys instead of an array. */ - readonly positions: PositionTable[] - /** The maximum tile distance this underground connection can connect at if this is an underground pipe. */ - readonly max_underground_distance?: uint -} - -interface ArithmeticCombinatorParameters { - /** First signal to use in an operation. If not specified, the second argument will be the value of `first_constant`. */ - readonly first_signal?: SignalID - /** Second signal to use in an operation. If not specified, the second argument will be the value of `second_constant`. */ - readonly second_signal?: SignalID - /** Constant to use as the first argument of the operation. Has no effect when `first_signal` is set. Defaults to `0`. */ - readonly first_constant?: int - /** Constant to use as the second argument of the operation. Has no effect when `second_signal` is set. Defaults to `0`. */ - readonly second_constant?: int - /** - * Must be one of `"*"`, `"/"`, `"+"`, `"-"`, `"%"`, `"^"`, `"<<"`, `">>"`, `"AND"`, `"OR"`, `"XOR"`. When not - * specified, defaults to `"*"`. - */ - readonly operation?: "*" | "/" | "+" | "-" | "%" | "^" | "<<" | ">>" | "AND" | "OR" | "XOR" - /** Specifies the signal to output. */ - readonly output_signal?: SignalID -} - -interface ConstantCombinatorParameters { - /** Signal to emit. */ - readonly signal: SignalID - /** Value of the signal to emit. */ - readonly count: int - /** Index of the constant combinator's slot to set this signal to. */ - readonly index: uint -} - -/** - * A {@link string} that specifies how the inputs should be compared. - * - * **Note**: While the API accepts both versions for `"less/greater than or equal to"` and `"not equal"`, it'll always - * return `"≥"`, `"≤"` or `"≠"` respectively when reading them back. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ComparatorString View documentation} - */ -type ComparatorString /** "equal to" */ = - | "=" /** "greater than" */ - | ">" /** "lesser than" */ - | "<" /** "greater than or equal to" */ - | "\u2265" /** "greater than or equal to" */ - | ">=" /** "lesser than or equal to" */ - | "\u2264" /** "lesser than or equal to" */ - | "<=" /** "not equal to" */ - | "\u2260" /** "not equal to" */ - | "!=" - -interface DeciderCombinatorParameters { - /** Defaults to blank. */ - readonly first_signal?: SignalID - /** - * Second signal to use in an operation, if any. If this is not specified, the second argument to a decider - * combinator's operation is assumed to be the value of `constant`. - */ - readonly second_signal?: SignalID - /** Constant to use as the second argument of operation. Defaults to `0`. */ - readonly constant?: uint - /** Specifies how the inputs should be compared. If not specified, defaults to `"<"`. */ - readonly comparator?: ComparatorString - /** Defaults to blank. */ - readonly output_signal?: SignalID - /** Defaults to `true`. When `false`, will output a value of `1` for the given `output_signal`. */ - readonly copy_count_from_input?: boolean -} - -interface InserterCircuitConditions { - readonly circuit?: CircuitCondition - readonly logistics?: CircuitCondition -} - -interface CircuitCondition { - /** Specifies how the inputs should be compared. If not specified, defaults to `"<"`. */ - readonly comparator?: ComparatorString - /** Defaults to blank */ - readonly first_signal?: SignalID - /** What to compare `first_signal` to. If not specified, `first_signal` will be compared to `constant`. */ - readonly second_signal?: SignalID - /** - * Constant to compare `first_signal` to. Has no effect when `second_signal` is set. When neither `second_signal` - * nor `constant` are specified, the effect is as though `constant` were specified with the value `0`. - */ - readonly constant?: int -} - -interface CircuitConditionDefinition { - readonly condition: CircuitCondition - /** Whether the condition is currently fulfilled */ - readonly fulfilled?: boolean -} - -interface CircuitConnectionDefinition { - /** Wire color, either {@link defines.wire_type.red} or {@link defines.wire_type.green}. */ - readonly wire: defines.wire_type - readonly target_entity: LuaEntity - readonly source_circuit_id: defines.circuit_connector_id - readonly target_circuit_id: defines.circuit_connector_id -} - -interface WireConnectionDefinition { - /** Wire color, either {@link defines.wire_type.red} or {@link defines.wire_type.green}. */ - readonly wire: defines.wire_type - /** The entity to (dis)connect the source entity with. */ - readonly target_entity: LuaEntity - /** Mandatory if the source entity has more than one circuit connection using circuit wire. */ - readonly source_circuit_id?: defines.circuit_connector_id - /** Mandatory if the target entity has more than one circuit connection using circuit wire. */ - readonly target_circuit_id?: defines.circuit_connector_id - /** Mandatory if the source entity has more than one wire connection using copper wire. */ - readonly source_wire_id?: defines.circuit_connector_id - /** Mandatory if the target entity has more than one wire connection using copper wire. */ - readonly target_wire_id?: defines.circuit_connector_id -} - -interface InventoryFilter { - /** Position of the corresponding filter slot. */ - readonly index: uint - /** Item prototype name of the item to filter. */ - readonly name: string -} - -interface PlaceAsTileResult { - /** The tile prototype. */ - readonly result: LuaTilePrototype - readonly condition_size: uint - readonly condition: CollisionMask -} - -interface BaseCommand { - /** Type of command. The remaining fields depend on the value of this field. */ - readonly type: defines.command -} - -interface AttackCommand extends BaseCommand { - readonly type: defines.command.attack - readonly target: LuaEntity - /** Defaults to `defines.distraction.by_enemy`. */ - readonly distraction?: defines.distraction -} - -interface GoToLocationCommand extends BaseCommand { - readonly type: defines.command.go_to_location - /** - * The position to path to. Either this or `destination_entity` need to be specified. If both are, - * `destination_entity` is used. - */ - readonly destination?: Position - /** The entity to path to. Either this or `destination` need to be specified. If both are, `destination_entity` is used. */ - readonly destination_entity?: LuaEntity - /** Defaults to `defines.distraction.by_enemy`. */ - readonly distraction?: defines.distraction - /** Flags that affect pathfinder behavior. */ - readonly pathfind_flags?: PathfinderFlags - /** How close the pathfinder needs to get to its destination (in tiles). Defaults to `3`. */ - readonly radius?: double -} - -interface CompoundCommand extends BaseCommand { - readonly type: defines.command.compound - /** How the commands should be chained together. */ - readonly structure_type: defines.compound_command - /** The sub-commands. */ - readonly commands: Command[] -} - -interface GroupCommand extends BaseCommand { - readonly type: defines.command.group - /** The group whose command to follow. */ - readonly group: LuaUnitGroup - /** Defaults to `defines.distraction.by_enemy`. */ - readonly distraction?: defines.distraction - /** Whether the unit will use the group distraction or the commands distraction. Defaults to true. */ - readonly use_group_distraction?: boolean -} - -interface AttackAreaCommand extends BaseCommand { - readonly type: defines.command.attack_area - /** Center of the attack area. */ - readonly destination: Position - /** Radius of the attack area. */ - readonly radius: double - /** Defaults to `defines.distraction.by_enemy`. */ - readonly distraction?: defines.distraction -} - -interface WanderCommand extends BaseCommand { - readonly type: defines.command.wander - /** Defaults to `defines.distraction.by_enemy`. */ - readonly distraction?: defines.distraction - /** Defaults to 10. Does not apply when `wander_in_group` is `true`. */ - readonly radius?: double - /** - * When commanding a group, defines how the group will wander. When `true`, the units in the group will wander - * around inside the group's radius, just like gathering biters. When `false`, the units will wander as a group, ie - * they will all walk together in the same random direction. Default is true for groups. Passing true for a single - * unit is an error. - */ - readonly wander_in_group?: boolean - /** Ticks to wander before successfully completing the command. Default is max uint, which means wander forever. */ - readonly ticks_to_wait?: uint -} - -interface StopCommand extends BaseCommand { - readonly type: defines.command.stop - /** Defaults to `defines.distraction.by_enemy`. */ - readonly distraction?: defines.distraction - /** Ticks to wander before successfully completing the command. Default is max uint, which means stop forever. */ - readonly ticks_to_wait?: uint -} - -interface FleeCommand extends BaseCommand { - readonly type: defines.command.flee - /** The entity to flee from */ - readonly from: LuaEntity - /** Defaults to `defines.distraction.by_enemy`. */ - readonly distraction?: defines.distraction -} - -interface BuildBaseCommand extends BaseCommand { - readonly type: defines.command.build_base - /** Where to build the base. */ - readonly destination: Position - /** Defaults to `defines.distraction.by_enemy`. */ - readonly distraction?: defines.distraction - /** - * Whether the units should ignore expansion candidate chunks. When `false`, they will obey and not build a base in - * a non-candidate chunk. Defaults to `false`. - */ - readonly ignore_planner?: boolean -} - -/** - * Commands can be given to enemies and unit groups. - * - * Other attributes may be specified depending on `type`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Command View documentation} - */ -type Command = - | AttackCommand - | GoToLocationCommand - | CompoundCommand - | GroupCommand - | AttackAreaCommand - | WanderCommand - | StopCommand - | FleeCommand - | BuildBaseCommand - -interface PathfinderFlags { - /** Allows pathing through friendly entities. Defaults to `false`. */ - readonly allow_destroy_friendly_entities?: boolean - /** Allows the pathfinder to path through entities of the same force. Defaults to `false`. */ - readonly allow_paths_through_own_entities?: boolean - /** - * Enables path caching. This can be more efficient, but might fail to respond to changes in the environment. - * Defaults to `true`. - */ - readonly cache?: boolean - /** Makes the pathfinder try to path in straight lines. Defaults to `false`. */ - readonly prefer_straight_paths?: boolean - /** - * Sets lower priority on the path request, meaning it might take longer to find a path at the expense of speeding - * up others. Defaults to `false`. - */ - readonly low_priority?: boolean - /** - * Makes the pathfinder not break in the middle of processing this pathfind, no matter how much work is needed. - * Defaults to `false`. - */ - readonly no_break?: boolean -} - -interface UnitSpawnDefinition { - /** Prototype name of the unit that would be spawned. */ - readonly unit: string - /** The points at which to spawn the unit. */ - readonly spawn_points: SpawnPointDefinition[] -} - -interface SpawnPointDefinition { - /** Evolution factor for which this weight applies. */ - readonly evolution_factor: double - /** Probability of spawning this unit at this evolution factor. */ - readonly weight: double -} - -interface ItemStackDefinition { - /** Prototype name of the item the stack holds. */ - readonly name: string - /** Number of items the stack holds. If not specified, defaults to `1`. */ - readonly count?: uint - /** Health of the items in the stack. Defaults to `1.0`. */ - readonly health?: float - /** Durability of the tool items in the stack. */ - readonly durability?: double - /** Amount of ammo in the ammo items in the stack. */ - readonly ammo?: double - /** Tags of the items with tags in the stack. */ - readonly tags?: string[] -} - -/** - * - String: The name of the item, which represents a full stack of that item. - * - ItemStackDefinition: The detailed definition of an item stack. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#SimpleItemStack View documentation} - * - * @example - * Both of these lines specify an item stack of one iron plate: - * - * ```lua - * {name="iron-plate"} - * ``` - * - * ```lua - * {name="iron-plate", count=1} - * ``` - * - * @example - * This is a stack of 47 copper plates: - * - * ```lua - * {name="copper-plate", count=47} - * ``` - * - * @example - * These are both full stacks of iron plates (for iron-plate, a full stack is 100 plates): - * - * ```lua - * "iron-plate" - * ``` - * - * ```lua - * {name="iron-plate", count=100} - * ``` - */ -type SimpleItemStack = string | ItemStackDefinition - -/** - * - String: The fluid name. - * - LuaFluidPrototype: The fluid prototype. - * - Fluid: The fluid. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#FluidIdentification View documentation} - */ -type FluidIdentification = string | LuaFluidPrototype | Fluid - -/** - * - String: The force name. - * - LuaForce: A reference to {@link LuaForce} may be passed directly. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ForceIdentification View documentation} - */ -type ForceIdentification = string | LuaForce - -/** - * - String: The technology name. - * - LuaTechnology: A reference to {@link LuaTechnology} may be passed directly. - * - LuaTechnologyPrototype: A reference to {@link LuaTechnologyPrototype} may be passed directly. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#TechnologyIdentification View documentation} - */ -type TechnologyIdentification = string | LuaTechnology | LuaTechnologyPrototype - -/** - * - Uint: It will be the index of the surface. `nauvis` has index `1`, the first surface-created surface will have index - * `2` and so on. - * - String: It will be the surface name. E.g. `"nauvis"`. - * - LuaSurface: A reference to {@link LuaSurface} may be passed directly. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#SurfaceIdentification View documentation} - */ -type SurfaceIdentification = uint | string | LuaSurface - -/** - * - Uint: The player index. - * - String: The player name. - * - LuaPlayer: A reference to {@link LuaPlayer} may be passed directly. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#PlayerIdentification View documentation} - */ -type PlayerIdentification = uint | string | LuaPlayer - -type ItemStackIdentification = SimpleItemStack | LuaItemStack - -/** - * - LuaEntity: The entity. - * - LuaEntityPrototype: The entity prototype. - * - String: The prototype name. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#EntityPrototypeIdentification View documentation} - */ -type EntityPrototypeIdentification = LuaEntity | LuaEntityPrototype | string - -/** - * - LuaItemStack: The item. - * - LuaItemPrototype: The item prototype. - * - String: The prototype name. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ItemPrototypeIdentification View documentation} - */ -type ItemPrototypeIdentification = LuaItemStack | LuaItemPrototype | string - -interface WaitCondition { - /** - * One of `"time"`, `"inactivity"`, `"full"`, `"empty"`, `"item_count"`, `"circuit"`, `"robots_inactive"`, - * `"fluid_count"`, `"passenger_present"`, `"passenger_not_present"`. - */ - readonly type: - | "time" - | "inactivity" - | "full" - | "empty" - | "item_count" - | "circuit" - | "robots_inactive" - | "fluid_count" - | "passenger_present" - | "passenger_not_present" - /** - * Either `"and"`, or `"or"`. Tells how this condition is to be compared with the preceding conditions in the - * corresponding `wait_conditions` array. - */ - readonly compare_type: "and" | "or" - /** Number of ticks to wait or of inactivity. Only present when `type` is `"time"` or `"inactivity"`. */ - readonly ticks?: uint - /** Only present when `type` is `"item_count"`, `"circuit"` or `"fluid_count"`. */ - readonly condition?: CircuitCondition -} - -interface TrainScheduleRecord { - /** Name of the station. */ - readonly station?: string - /** Rail to path to. Ignored if `station` is present. */ - readonly rail?: LuaEntity - readonly wait_conditions?: WaitCondition[] - /** Only present when the station is temporary, the value is then always `true`. */ - readonly temporary?: boolean -} - -interface TrainSchedule { - /** Index of the currently active record */ - readonly current: uint - readonly records: TrainScheduleRecord[] -} - -interface BaseGuiArrowSpecification { - /** - * This determines which of the following fields will be required. Must be one of `"nowhere"` (will remove the arrow - * entirely), `"goal"` (will point to the current goal), `"entity_info"`, `"active_window"`, `"entity"`, - * `"position"`, `"crafting_queue"` or `"item_stack"` (will point to a given item stack in an inventory). Depending - * on this value, other fields may have to be specified. - */ - readonly type: - | "nowhere" - | "goal" - | "entity_info" - | "active_window" - | "entity" - | "position" - | "crafting_queue" - | "item_stack" -} - -interface EntityGuiArrowSpecification extends BaseGuiArrowSpecification { - readonly type: "entity" - readonly entity: LuaEntity -} - -interface PositionGuiArrowSpecification extends BaseGuiArrowSpecification { - readonly type: "position" - readonly position: Position -} - -interface CraftingQueueGuiArrowSpecification extends BaseGuiArrowSpecification { - readonly type: "crafting_queue" - /** Index in the crafting queue to point to. */ - readonly crafting_queueindex: uint -} - -interface ItemStackGuiArrowSpecification extends BaseGuiArrowSpecification { - readonly type: "item_stack" - /** Which inventory the stack is in. */ - readonly inventory_index: defines.inventory - /** Which stack to point to. */ - readonly item_stack_index: uint - /** Must be either `"player"`, `"target"`, `"player-quickbar"` or `"player-equipment-bar"`. */ - readonly source: "player" | "target" | "player-quickbar" | "player-equipment-bar" -} - -interface OtherGuiArrowSpecification extends BaseGuiArrowSpecification { - readonly type: "nowhere" | "goal" | "entity_info" | "active_window" -} - -/** - * Used for specifying where a GUI arrow should point to. - * - * Other attributes may be specified depending on `type`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#GuiArrowSpecification View documentation} - */ -type GuiArrowSpecification = - | EntityGuiArrowSpecification - | PositionGuiArrowSpecification - | CraftingQueueGuiArrowSpecification - | ItemStackGuiArrowSpecification - | OtherGuiArrowSpecification - -interface AmmoType { - readonly action?: TriggerItem[] - /** - * One of `"entity"` (fires at an entity), `"position"` (fires directly at a position), or `"direction"` (fires in a - * direction). - */ - readonly target_type: "entity" | "position" | "direction" - /** - * When `true`, the gun will be able to shoot even when the target is out of range. Only applies when `target_type` - * is `position`. The gun will fire at the maximum range in the direction of the target position. Defaults to `false`. - */ - readonly clamp_position?: boolean - /** Ammo category of this ammo. */ - readonly category: string - /** Energy consumption of a single shot, if applicable. Defaults to `0`. */ - readonly energy_consumption?: double -} - -interface BeamTarget { - /** The target entity. */ - readonly entity?: LuaEntity - /** The target position. */ - readonly position?: Position -} - -interface RidingState { - readonly acceleration: defines.riding.acceleration - readonly direction: defines.riding.direction -} - -type SpriteType = - | "item" - | "entity" - | "technology" - | "recipe" - | "item-group" - | "fluid" - | "tile" - | "virtual-signal" - | "achievement" - | "equipment" - | "file" - | "utility" - -/** - * It is specified by {@link string}. It can be either the name of a - * {@link https://wiki.factorio.com/Prototype/Sprite sprite prototype} defined in the data stage or a path in form "type/name". - * - * The supported types are: - * - * - `"item"` - for example "item/iron-plate" is the icon sprite of iron plate - * - `"entity"` - for example "entity/small-biter" is the icon sprite of the small biter - * - `"technology"` - * - `"recipe"` - * - `"item-group"` - * - `"fluid"` - * - `"tile"` - * - `"virtual-signal"` - * - `"achievement"` - * - `"equipment"` - * - `"file"` - path to an image file located inside the current scenario. This file is not preloaded so it will be - * slower; for frequently used sprites, it is better to define sprite prototype and use it instead. - * - `"utility"` - sprite defined in the utility-sprites object, these are the pictures used by the game internally for the UI. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#SpritePath View documentation} - */ -type SpritePath = string | `${SpriteType}/${string}` - -/** - * A sound defined by a {@link string}. It can be either the name of a - * {@link https://wiki.factorio.com/Prototype/Sound sound prototype} defined in the data stage or a path in the form - * `"type/name"`. The latter option can be sorted into three categories. - * - * The utility and ambient types each contain general use sound prototypes defined by the game itself. - * - * - `"utility"` - Uses the {@link https://wiki.factorio.com/Prototype/UtilitySounds UtilitySounds} prototype. Example: - * `"utility/wire_connect_pole"` - * - `"ambient"` - Uses {@link https://wiki.factorio.com/Prototype/AmbientSound AmbientSound} prototypes. Example: - * `"ambient/resource-deficiency"` - * - * The following types can be combined with any tile name as long as its prototype defines the - * - * corresponding sound. - * - * - `"tile-walking"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#walking_sound Tile::walking_sound}. Example: - * `"tile-walking/concrete"` - * - `"tile-mined"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#mined_sound Tile::mined_sound} - * - `"tile-build-small"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}. Example: - * `"tile-build-small/concrete"` - * - `"tile-build-medium"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound} - * - `"tile-build-large"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound} - * - * The following types can be combined with any entity name as long as its prototype defines the - * - * corresponding sound. - * - * - `"entity-build"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#build_sound Entity::build_sound}. Example: - * `"entity-build/wooden-chest"` - * - `"entity-mined"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#mined_sound Entity::mined_sound} - * - `"entity-mining"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#mining_sound Entity::mining_sound} - * - `"entity-vehicle_impact"` - Uses - * {@link https://wiki.factorio.com/Prototype/Entity#vehicle_impact_sound Entity::vehicle_impact_sound} - * - `"entity-rotated"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#rotated_sound Entity::rotated_sound} - * - `"entity-open"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#open_sound Entity::open_sound} - * - `"entity-close"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#close_sound Entity::close_sound} - * - * {@link https://lua-api.factorio.com/next/Concepts.html#SoundPath View documentation} - */ -type SoundPath = string | `${SoundType}/${string}` - -interface ModuleEffectValue { - /** The percentual increase of the attribute. A value of `0.6` means a 60% increase. */ - readonly bonus: float -} - -/** - * {@link https://lua-api.factorio.com/next/Concepts.html#ModuleEffects View documentation} - * - * @example - * These are the effects of the vanilla Productivity Module 3 (up to floating point imprecisions): - * - * ```lua - * {consumption={bonus=0.6}, - * speed={bonus=-0.15}, - * productivity={bonus=0.06}, - * pollution={bonus=0.075}} - * ``` - */ -interface ModuleEffects { - readonly consumption?: ModuleEffectValue - readonly speed?: ModuleEffectValue - readonly productivity?: ModuleEffectValue - readonly pollution?: ModuleEffectValue -} - -/** - * This is a set of flags given as a dictionary[{@link string} → {@link boolean}]. When a flag is set, it is present in - * the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. So, the boolean value is - * meaningless and exists just for easy table lookup if a flag is set. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#EntityPrototypeFlags View documentation} - */ -interface EntityPrototypeFlags { - readonly "not-rotatable"?: boolean - readonly "placeable-neutral"?: boolean - readonly "placeable-player"?: boolean - readonly "placeable-enemy"?: boolean - readonly "placeable-off-grid"?: boolean - readonly "player-creation"?: boolean - readonly "building-direction-8-way"?: boolean - readonly "filter-directions"?: boolean - readonly "fast-replaceable-no-build-while-moving"?: boolean - readonly "breaths-air"?: boolean - readonly "not-repairable"?: boolean - readonly "not-on-map"?: boolean - readonly "not-deconstructable"?: boolean - readonly "not-blueprintable"?: boolean - readonly hidden?: boolean - readonly "hide-alt-info"?: boolean - readonly "fast-replaceable-no-cross-type-while-moving"?: boolean - readonly "no-gap-fill-while-building"?: boolean - readonly "not-flammable"?: boolean - readonly "no-automated-item-removal"?: boolean - readonly "no-automated-item-insertion"?: boolean - readonly "no-copy-paste"?: boolean - readonly "not-selectable-in-game"?: boolean - readonly "not-upgradable"?: boolean -} - -/** - * This is a set of flags given as dictionary[{@link string} → {@link boolean}]. When a flag is set, it is present in the - * dictionary with the value `true`. Unset flags aren't present in the dictionary at all. So, the boolean value is - * meaningless and exists just for easy table lookup if a flag is set. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ItemPrototypeFlags View documentation} - */ -interface ItemPrototypeFlags { - readonly "draw-logistic-overlay"?: boolean - readonly hidden?: boolean - readonly "always-show"?: boolean - readonly "hide-from-bonus-gui"?: boolean - readonly "hide-from-fuel-tooltip"?: boolean - readonly "not-stackable"?: boolean - readonly "can-extend-inventory"?: boolean - readonly "primary-place-result"?: boolean - readonly "mod-openable"?: boolean - readonly "only-in-cursor"?: boolean -} - -/** - * A {@link string} specifying a collision mask layer. - * - * Possible values for the string are: - * - * - `"ground-tile"` - * - `"water-tile"` - * - `"resource-layer"` - * - `"doodad-layer"` - * - `"floor-layer"` - * - `"item-layer"` - * - `"ghost-layer"` - * - `"object-layer"` - * - `"player-layer"` - * - `"train-layer"` - * - `"rail-layer"` - * - `"transport-belt-layer"` - * - `"not-setup"` - * - * Additionally the values `"layer-13"` through `"layer-55"`. These layers are currently unused by the game but may - * change. If a mod is going to use one of the unused layers it's recommended to start at the higher layers because the - * base game will take from the lower ones. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#CollisionMaskLayer View documentation} - */ -type CollisionMaskLayer = - | "ground-tile" - | "water-tile" - | "resource-layer" - | "doodad-layer" - | "floor-layer" - | "item-layer" - | "ghost-layer" - | "object-layer" - | "player-layer" - | "train-layer" - | "rail-layer" - | "transport-belt-layer" - | "not-setup" - | `layer-${number}` - -/** - * This is a set of masks given as a dictionary[{@link CollisionMaskLayer} → {@link boolean}]. Only set masks are present - * in the dictionary and they have the value `true`. Unset flags aren't present at all. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#CollisionMask View documentation} - */ -type CollisionMask = { - readonly [P in CollisionMaskLayer]?: true -} - -/** - * A {@link CollisionMask} but also includes any flags this mask has. - * - * Flags such as: - * - * - `"not-colliding-with-itself"` - * - `"consider-tile-transitions"` - * - `"colliding-with-tiles-only"` - * - * {@link https://lua-api.factorio.com/next/Concepts.html#CollisionMaskWithFlags View documentation} - */ -type CollisionMaskWithFlags = { - readonly [P in - | CollisionMaskLayer - | "not-colliding-with-itself" - | "consider-tile-transitions" - | "colliding-with-tiles-only"]?: true -} - -/** - * This is a set of trigger target masks given as a dictionary[{@link string} → {@link boolean}]. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#TriggerTargetMask View documentation} - */ -type TriggerTargetMask = { - readonly [P in string]?: true -} - -interface TriggerEffectItem { - /** - * One of`"damage"`, `"create-entity"`, `"create-explosion"`, `"create-fire"`, `"create-smoke"`, - * `"create-trivial-smoke"`, `"create-particle"`, `"create-sticker"`, `"nested-result"`, `"play-sound"`, - * `"push-back"`, `"destroy-cliffs"`, `"show-explosion-on-chart"`, `"insert-item"`, `"script"`. - */ - readonly type: - | "damage" - | "create-entity" - | "create-explosion" - | "create-fire" - | "create-smoke" - | "create-trivial-smoke" - | "create-particle" - | "create-sticker" - | "nested-result" - | "play-sound" - | "push-back" - | "destroy-cliffs" - | "show-explosion-on-chart" - | "insert-item" - | "script" - readonly repeat_count: uint - readonly affects_target: boolean - readonly show_in_tooltip: boolean -} - -interface TriggerDelivery { - /** One of `"instant"`, `"projectile"`, `"flame-thrower"`, `"beam"`, `"stream"`, `"artillery"`. */ - readonly type: "instant" | "projectile" | "flame-thrower" | "beam" | "stream" | "artillery" - readonly source_effects: TriggerEffectItem[] - readonly target_effects: TriggerEffectItem[] -} - -interface TriggerItem { - /** One of `"direct"`, `"area"`, `"line"`, `"cluster"`. */ - readonly type: "direct" | "area" | "line" | "cluster" - readonly action_delivery?: TriggerDelivery[] - /** The trigger will only affect entities that contain any of these flags. */ - readonly entity_flags?: EntityPrototypeFlags - readonly ignore_collision_condition: boolean - /** The trigger will only affect entities that would collide with given collision mask. */ - readonly collision_mask: CollisionMask - readonly trigger_target_mask: TriggerTargetMask - /** - * If `"enemy"`, the trigger will only affect entities whose force is different from the attacker's and for which - * there is no cease-fire set. `"ally"` is the opposite of `"enemy"`. - */ - readonly force: ForceCondition - readonly repeat_count: uint -} - -interface CircularParticleCreationSpecification { - /** Name of the {@link LuaEntityPrototype} */ - readonly name: string - readonly direction: float - readonly direction_deviation: float - readonly speed: float - readonly speed_deviation: float - readonly starting_frame_speed: float - readonly starting_frame_speed_deviation: float - readonly height: float - readonly height_deviation: float - readonly vertical_speed: float - readonly vertical_speed_deviation: float - /** This vector is a table with `x` and `y` keys instead of an array. */ - readonly center: PositionTable - readonly creation_distance: double - readonly creation_distance_orientation: double - readonly use_source_position: boolean -} - -/** - * An array with the following members: - * - * - A {@link RealOrientation} - * - A {@link Vector} - * - * {@link https://lua-api.factorio.com/next/Concepts.html#CircularProjectileCreationSpecification View documentation} - */ -type CircularProjectileCreationSpecification = [RealOrientation, Vector] - -interface AttackParameterFluid { - /** Name of the {@link LuaFluidPrototype}. */ - readonly type: string - /** Multiplier applied to the damage of an attack. */ - readonly damage_modifier: double -} - -interface BaseAttackParameters { - /** The type of AttackParameter. One of `'projectile'`, `'stream'` or `'beam'`. */ - readonly type: "projectile" | "stream" | "beam" - /** Maximum range of attack. */ - readonly range: float - /** Minimum range of attack. Used with flamethrower turrets to prevent self-immolation. */ - readonly min_range: float - /** Defines how the range is determined. Either `'center-to-center'` or `'bounding-box-to-bounding-box'`. */ - readonly range_mode: "center-to-center" | "bounding-box-to-bounding-box" - /** When searching for the nearest enemy to attack, `fire_penalty` is added to the enemy's distance if they are on fire. */ - readonly fire_penalty: float - /** - * When searching for an enemy to attack, a higher `rotate_penalty` will discourage targeting enemies that would - * take longer to turn to face. - */ - readonly rotate_penalty: float - /** - * When searching for an enemy to attack, a higher `health_penalty` will discourage targeting enemies with high - * health. A negative penalty will do the opposite. - */ - readonly health_penalty: float - /** - * If less than `range`, the entity will choose a random distance between `range` and `min_attack_distance` and - * attack from that distance. Used for spitters. - */ - readonly min_attack_distance: float - /** The arc that the entity can attack in as a fraction of a circle. A value of `1` means the full 360 degrees. */ - readonly turn_range: float - /** Multiplier applied to the damage of an attack. */ - readonly damage_modifier: float - /** Multiplier applied to the ammo consumption of an attack. */ - readonly ammo_consumption_modifier: float - /** Minimum amount of ticks between shots. If this is less than `1`, multiple shots can be performed per tick. */ - readonly cooldown: float - /** Number of ticks it takes for the weapon to actually shoot after it has been ordered to do so. */ - readonly warmup: uint - readonly movement_slow_down_factor: double - readonly movement_slow_down_cooldown: float - readonly ammo_type?: AmmoType - /** List of the names of compatible {@link LuaAmmoCategoryPrototype LuaAmmoCategoryPrototypes}. */ - readonly ammo_categories?: string[] -} - -interface ProjectileAttackParameters extends BaseAttackParameters { - readonly type: "projectile" - readonly projectile_center: Vector - readonly projectile_creation_distance: float - readonly projectile_orientation_offset: float - readonly shell_particle?: CircularParticleCreationSpecification - readonly projectile_creation_parameters?: CircularProjectileCreationSpecification[] -} - -interface StreamAttackParameters extends BaseAttackParameters { - readonly type: "stream" - readonly gun_barrel_length: float - readonly gun_center_shift: Record - readonly fluid_consumption: float - readonly fluids?: AttackParameterFluid[] - readonly projectile_creation_parameters?: CircularProjectileCreationSpecification[] -} - -interface OtherAttackParameters extends BaseAttackParameters { - readonly type: "beam" -} - -/** - * Other attributes may be specified depending on `type`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#AttackParameters View documentation} - */ -type AttackParameters = ProjectileAttackParameters | StreamAttackParameters | OtherAttackParameters - -interface CapsuleAction { - /** One of `"throw"`, `"equipment-remote"`, `"use-on-self"`. */ - readonly type: "throw" | "equipment-remote" | "use-on-self" - /** Only present when `type` is `"throw"` or `"use-on-self"`. */ - readonly attack_parameters?: AttackParameters - /** Only present when `type` is `"equipment-remote"`. It is the equipment prototype name. */ - readonly equipment?: string -} - -/** - * This is a set of flags given as a dictionary[{@link string} → {@link boolean}]. Set flags are present in the dictionary - * with the value `true`; unset flags aren't present at all. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#SelectionModeFlags View documentation} - */ -interface SelectionModeFlags { - /** Entities that can be selected for blueprint. */ - readonly blueprint?: boolean - /** Entities that can be marked for deconstruction. */ - readonly deconstruct?: boolean - /** Entities that can be marked for deconstruction cancelling. */ - readonly "cancel-deconstruct"?: boolean - readonly items?: boolean - readonly trees?: boolean - /** Buildable entities. */ - readonly "buildable-type"?: boolean - /** Only select an area. */ - readonly nothing?: boolean - /** Entities that can be placed using an item. */ - readonly "items-to-place"?: boolean - readonly "any-entity"?: boolean - readonly "any-tile"?: boolean - /** Entities with the same force as the selector. */ - readonly "same-force"?: boolean - readonly "not-same-force"?: boolean - readonly friend?: boolean - readonly enemy?: boolean - readonly upgrade?: boolean - readonly "cancel-upgrade"?: boolean - readonly "entity-with-health"?: boolean - readonly "entity-with-force"?: boolean - readonly "entity-with-owner"?: boolean -} - -interface LogisticFilter { - /** The index this filter applies to. */ - readonly index: uint - /** The item name for this filter. */ - readonly name: string - /** The count for this filter. */ - readonly count: uint -} - -/** - * **Note**: Runtime settings can be changed through console commands and by the mod that owns the settings by writing a - * new table to the ModSetting. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ModSetting View documentation} - */ -interface ModSetting { - /** The value of the mod setting. The type depends on the setting. */ - readonly value: uint | double | boolean | string -} - -/** - * Any basic type (string, number, boolean) or table. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#AnyBasic View documentation} - */ -type AnyBasic = string | number | boolean | table - -/** - * Any basic type (string, number, boolean), table, or LuaObject. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Any View documentation} - */ -type Any = any - -interface ProgrammableSpeakerParameters { - readonly playback_volume: double - readonly playback_globally: boolean - readonly allow_polyphony: boolean -} - -interface ProgrammableSpeakerAlertParameters { - readonly show_alert: boolean - readonly show_on_map: boolean - readonly icon_signal_id: SignalID - readonly alert_message: string -} - -interface ProgrammableSpeakerCircuitParameters { - readonly signal_value_is_pitch: boolean - readonly instrument_id: uint - readonly note_id: uint -} - -interface ProgrammableSpeakerInstrument { - readonly name: string - readonly notes: string[] -} - -/** - * A {@link string} that specifies where a gui element should be. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#Alignment View documentation} - */ -type Alignment = - | "top-left" - | "middle-left" /** The same as `"middle-left"` */ - | "left" - | "bottom-left" - | "top-center" - | "middle-center" /** The same as `"middle-center"` */ - | "center" - | "bottom-center" - | "top-right" /** The same as `"middle-right"` */ - | "right" - | "bottom-right" - -/** - * Information about the event that has been raised. The table can also contain other fields depending on the type of - * event. See {@link https://lua-api.factorio.com/next/events.html the list of Factorio events} for more information on these. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#EventData View documentation} - */ -interface EventData { - /** The identifier of the event this handler was registered to. */ - readonly name: EventId - /** The tick during which the event happened. */ - readonly tick: uint - /** The name of the mod that raised the event if it was raised using {@link LuaBootstrap.raise_event LuaBootstrap::raise_event}. */ - readonly mod_name?: string -} - -interface NthTickEventData { - /** The tick during which the event happened. */ - readonly tick: uint - /** The nth tick this handler was registered to. */ - readonly nth_tick: uint -} - -interface ModChangeData { - /** Old version of the mod. May be `nil` if the mod wasn't previously present (i.e. it was just added). */ - readonly old_version: string | undefined - /** New version of the mod. May be `nil` if the mod is no longer present (i.e. it was just removed). */ - readonly new_version: string | undefined -} - -interface ConfigurationChangedData { - /** Old version of the map. Present only when loading map version other than the current version. */ - readonly old_version?: string - /** New version of the map. Present only when loading map version other than the current version. */ - readonly new_version?: string - /** Dictionary of mod changes. It is indexed by mod name. */ - readonly mod_changes: Record - /** `true` when mod startup settings have changed since the last time this save was loaded. */ - readonly mod_startup_settings_changed: boolean - /** `true` when mod prototype migrations have been applied since the last time this save was loaded. */ - readonly migration_applied: boolean -} - -interface CustomCommandData { - /** The name of the command. */ - readonly name: string - /** The tick the command was used in. */ - readonly tick: uint - /** The player who issued the command, or `nil` if it was issued from the server console. */ - readonly player_index?: uint - /** The parameter passed after the command, if there is one. */ - readonly parameter?: string -} - -interface SelectedPrototypeData { - /** E.g. `"entity"`. */ - readonly base_type: string - /** E.g. `"tree"`. */ - readonly derived_type: string - /** E.g. `"tree-05"`. */ - readonly name: string -} - -interface ScriptRenderTarget { - readonly entity?: LuaEntity - readonly entity_offset?: Vector - readonly position?: Position -} - -type MouseButtonFlag = - | "left" - | "right" - | "middle" - | "button-4" - | "button-5" - | "button-6" - | "button-7" - | "button-8" - | "button-9" - -type MouseButtonFlagsTable = { - readonly [P in MouseButtonFlag]?: true -} - -type MouseButtonFlagsArray = readonly (MouseButtonFlag | "left-and-right")[] - -/** - * This is a set of flags given as a dictionary[{@link string} → {@link boolean}]. When a flag is set, it is present in - * the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. - * - * To write to this, use an array[{@link string}] of the mouse buttons that should be possible to use with on button. - * - * When setting flags, the flag `"left-and-right"` can also be set which will set `"left"` and `"right"` true. - * - * Possible flags when reading are: - * - * - `"left"` - * - `"right"` - * - `"middle"` - * - `"button-4"` - * - `"button-5"` - * - `"button-6"` - * - `"button-7"` - * - `"button-8"` - * - `"button-9"` - * - * {@link https://lua-api.factorio.com/next/Concepts.html#MouseButtonFlags View documentation} - */ -type MouseButtonFlags = MouseButtonFlagsTable | MouseButtonFlagsArray - -/** - * It is specified by {@link string}. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#CursorBoxRenderType View documentation} - */ -type CursorBoxRenderType /** Yellow box. */ = - | "entity" /** Red box. */ - | "not-allowed" /** Light blue box. */ - | "electricity" /** Light blue box. */ - | "pair" /** Green box. */ - | "copy" /** White box. */ - | "train-visualization" /** Light blue box. */ - | "logistics" /** Green box. */ - | "blueprint-snap-rectangle" - -/** - * It is specified by {@link string}. - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ForceCondition View documentation} - */ -type ForceCondition /** All forces pass. */ = - | "all" /** Forces which will attack pass. */ - | "enemy" /** Forces which won't attack pass. */ - | "ally" /** Forces which are friends pass. */ - | "friend" /** Forces which are not friends pass. */ - | "not-friend" /** The same force pass. */ - | "same" /** The non-same forces pass. */ - | "not-same" - -/** - * A value between 0 and 255 inclusive represented by one of the following named {@link string} or string version of the - * value (for example `"27"` and `"decals"` are both valid). Higher values are rendered on top of lower values. - * - * - `"water-tile"`: 15 - * - `"ground-tile"`: 25 - * - `"tile-transition"`: 26 - * - `"decals"`: 27 - * - `"lower-radius-visualization"`: 29 - * - `"radius-visualization"`: 30 - * - `"transport-belt-integration"`: 65 - * - `"resource"`:66 - * - `"building-smoke"`:67 - * - `"decorative"`: 92 - * - `"ground-patch"`: 93 - * - `"ground-patch-higher"`: 94 - * - `"ground-patch-higher2"`: 95 - * - `"remnants"`: 112 - * - `"floor"`: 113 - * - `"transport-belt"`: 114 - * - `"transport-belt-endings"`: 115 - * - `"floor-mechanics-under-corpse"`: 120 - * - `"corpse"`: 121 - * - `"floor-mechanics"`: 122 - * - `"item"`: 123 - * - `"lower-object"`: 124 - * - `"transport-belt-circuit-connector"`: 126 - * - `"lower-object-above-shadow"`: 127 - * - `"object"`: 129 - * - `"higher-object-under"`: 131 - * - `"higher-object-above"`: 132 - * - `"item-in-inserter-hand"`: 134 - * - `"wires"`: 135 - * - `"wires-above"`: 136 - * - `"entity-info-icon"`: 138 - * - `"entity-info-icon-above"`: 139 - * - `"explosion"`: 142 - * - `"projectile"`: 143 - * - `"smoke"`: 144 - * - `"air-object"`: 145 - * - `"air-entity-info-icon"`: 147 - * - `"light-effect"`: 148 - * - `"selection-box"`: 187 - * - `"higher-selection-box"`: 188 - * - `"collision-selection-box"`: 189 - * - `"arrow"`: 190 - * - `"cursor"`: 210 - * - * {@link https://lua-api.factorio.com/next/Concepts.html#RenderLayer View documentation} - */ -type RenderLayer = - | number - | `${number}` - | "water-tile" - | "ground-tile" - | "tile-transition" - | "decals" - | "lower-radius-visualization" - | "radius-visualization" - | "transport-belt-integration" - | "resource" - | "building-smoke" - | "decorative" - | "ground-patch" - | "ground-patch-higher" - | "remnants" - | "floor" - | "transport-belt" - | "transport-belt-endings" - | "floor-mechanics-under-corpse" - | "corpse" - | "floor-mechanics" - | "item" - | "lower-object" - | "transport-belt-circuit-connector" - | "lower-object-above-shadow" - | "object" - | "higher-object-under" - | "higher-object-above" - | "item-in-inserter-hand" - | "wires" - | "wires-above" - | "entity-info-icon" - | "entity-info-icon-above" - | "explosion" - | "projectile" - | "smoke" - | "air-object" - | "air-entity-info-icon" - | "light-effect" - | "selection-box" - | "higher-selection-box" - | "collision-selection-box" - | "arrow" - | "cursor" - -type CliffOrientation = - | "west-to-east" - | "north-to-south" - | "east-to-west" - | "south-to-north" - | "west-to-north" - | "north-to-east" - | "east-to-south" - | "south-to-west" - | "west-to-south" - | "north-to-west" - | "east-to-north" - | "south-to-east" - | "west-to-none" - | "none-to-east" - | "east-to-none" - | "none-to-west" - | "north-to-none" - | "none-to-south" - | "south-to-none" - | "none-to-north" - -interface ItemStackLocation { - readonly inventory: defines.inventory - readonly slot: uint -} - -interface VehicleAutomaticTargetingParameters { - readonly auto_target_without_gunner: boolean - readonly auto_target_with_gunner: boolean -} - -type SoundType = "game-effect" | "gui-effect" | "ambient" | "environment" | "walking" | "alert" | "wind" - -interface BaseItemPrototypeFilter { - /** - * The condition to filter on. One of `"tool"`, `"mergeable"`, `"item-with-inventory"`, `"selection-tool"`, - * `"item-with-label"`, `"has-rocket-launch-products"`, `"fuel"`, `"place-result"`, `"burnt-result"`, - * `"place-as-tile"`, `"placed-as-equipment-result"`, `"name"`, `"type"`, `"flag"`, `"subgroup"`, `"fuel-category"`, - * `"stack-size"`, `"default-request-amount"`, `"wire-count"`, `"fuel-value"`, `"fuel-acceleration-multiplier"`, - * `"fuel-top-speed-multiplier"`, `"fuel-emissions-multiplier"` - */ - readonly filter: - | "tool" - | "mergeable" - | "item-with-inventory" - | "selection-tool" - | "item-with-label" - | "has-rocket-launch-products" - | "fuel" - | "place-result" - | "burnt-result" - | "place-as-tile" - | "placed-as-equipment-result" - | "name" - | "type" - | "flag" - | "subgroup" - | "fuel-category" - | "stack-size" - | "default-request-amount" - | "wire-count" - | "fuel-value" - | "fuel-acceleration-multiplier" - | "fuel-top-speed-multiplier" - | "fuel-emissions-multiplier" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface PlaceResultItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "place-result" - /** Filters for the place result. */ - readonly elem_filters?: EntityPrototypeFilter[] -} - -interface BurntResultItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "burnt-result" - /** Filters for the burnt result. */ - readonly elem_filters?: ItemPrototypeFilter[] -} - -interface PlaceAsTileItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "place-as-tile" - /** Filters for the placed tile. */ - readonly elem_filters?: TilePrototypeFilter[] -} - -interface PlacedAsEquipmentResultItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "placed-as-equipment-result" - /** Filters for the placed equipment. */ - readonly elem_filters?: EquipmentPrototypeFilter[] -} - -/** - * For use within nested filters such as the `has-product-item` filter of array[{@link RecipePrototypeFilter}]. To get a - * specific prototype by name, see {@link LuaGameScript.item_prototypes LuaGameScript::item_prototypes}. - */ -interface NameItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "name" - /** The prototype name, or list of acceptable names. */ - readonly name: string | string[] -} - -/** - * Usage example: - * - * ```lua - * game.get_filtered_item_prototypes({{filter = "type", type = "armor"}}) - * ``` - */ -interface TypeItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface FlagItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "flag" - /** One of the values in {@link ItemPrototypeFlags}. */ - readonly flag: string -} - -interface SubgroupItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "subgroup" - /** A {@link LuaGroup} (subgroup) name */ - readonly subgroup: string -} - -interface FuelCategoryItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "fuel-category" - /** A {@link LuaFuelCategoryPrototype} name */ - readonly "fuel-category": string -} - -/** - * Usage example: - * - * ```lua - * game.get_filtered_item_prototypes({{filter = "stack-size", comparison = ">", value = 20}, {filter = "stack-size", comparison = "<", value = 100, mode = "and"}}) - * ``` - */ -interface StackSizeItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "stack-size" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint -} - -interface DefaultRequestAmountItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "default-request-amount" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint -} - -interface WireCountItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "wire-count" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint -} - -interface FuelValueItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "fuel-value" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface FuelAccelerationMultiplierItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "fuel-acceleration-multiplier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface FuelTopSpeedMultiplierItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "fuel-top-speed-multiplier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface FuelEmissionsMultiplierItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: "fuel-emissions-multiplier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface OtherItemPrototypeFilter extends BaseItemPrototypeFilter { - readonly filter: - | "tool" - | "mergeable" - | "item-with-inventory" - | "selection-tool" - | "item-with-label" - | "has-rocket-launch-products" - | "fuel" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ItemPrototypeFilter View documentation} - */ -type ItemPrototypeFilter = - | PlaceResultItemPrototypeFilter - | BurntResultItemPrototypeFilter - | PlaceAsTileItemPrototypeFilter - | PlacedAsEquipmentResultItemPrototypeFilter - | NameItemPrototypeFilter - | TypeItemPrototypeFilter - | FlagItemPrototypeFilter - | SubgroupItemPrototypeFilter - | FuelCategoryItemPrototypeFilter - | StackSizeItemPrototypeFilter - | DefaultRequestAmountItemPrototypeFilter - | WireCountItemPrototypeFilter - | FuelValueItemPrototypeFilter - | FuelAccelerationMultiplierItemPrototypeFilter - | FuelTopSpeedMultiplierItemPrototypeFilter - | FuelEmissionsMultiplierItemPrototypeFilter - | OtherItemPrototypeFilter - -interface BaseModSettingPrototypeFilter { - /** The condition to filter on. One of `"type"`, `"mod"`, `"setting-type"` */ - readonly filter: "type" | "mod" | "setting-type" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeModSettingPrototypeFilter extends BaseModSettingPrototypeFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface ModModSettingPrototypeFilter extends BaseModSettingPrototypeFilter { - readonly filter: "mod" - /** The mod name */ - readonly mod: string -} - -interface SettingTypeModSettingPrototypeFilter extends BaseModSettingPrototypeFilter { - readonly filter: "setting-type" - /** The setting scope type (startup, runtime-global, or runtime-per-user) */ - readonly type: string -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#ModSettingPrototypeFilter View documentation} - */ -type ModSettingPrototypeFilter = - | TypeModSettingPrototypeFilter - | ModModSettingPrototypeFilter - | SettingTypeModSettingPrototypeFilter - -interface BaseTechnologyPrototypeFilter { - /** - * The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, - * `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"level"`, `"max-level"`, `"time"` - */ - readonly filter: - | "enabled" - | "hidden" - | "upgrade" - | "visible-when-disabled" - | "has-effects" - | "has-prerequisites" - | "research-unit-ingredient" - | "level" - | "max-level" - | "time" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface ResearchUnitIngredientTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter { - readonly filter: "research-unit-ingredient" - /** The research ingredient to check. */ - readonly ingredient: string -} - -interface LevelTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter { - readonly filter: "level" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint -} - -interface MaxLevelTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter { - readonly filter: "max-level" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint -} - -interface TimeTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter { - readonly filter: "time" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint -} - -interface OtherTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter { - readonly filter: "enabled" | "hidden" | "upgrade" | "visible-when-disabled" | "has-effects" | "has-prerequisites" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#TechnologyPrototypeFilter View documentation} - */ -type TechnologyPrototypeFilter = - | ResearchUnitIngredientTechnologyPrototypeFilter - | LevelTechnologyPrototypeFilter - | MaxLevelTechnologyPrototypeFilter - | TimeTechnologyPrototypeFilter - | OtherTechnologyPrototypeFilter - -interface BaseDecorativePrototypeFilter { - /** The condition to filter on. One of `"decal"`, `"autoplace"`, `"collision-mask"` */ - readonly filter: "decal" | "autoplace" | "collision-mask" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface CollisionMaskDecorativePrototypeFilter extends BaseDecorativePrototypeFilter { - readonly filter: "collision-mask" - readonly mask: CollisionMask | CollisionMaskWithFlags - /** How to filter: `"collides"` or `"layers-equals"` */ - readonly mask_mode: "collides" | "layers-equals" -} - -interface OtherDecorativePrototypeFilter extends BaseDecorativePrototypeFilter { - readonly filter: "decal" | "autoplace" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#DecorativePrototypeFilter View documentation} - */ -type DecorativePrototypeFilter = CollisionMaskDecorativePrototypeFilter | OtherDecorativePrototypeFilter - -interface BaseAchievementPrototypeFilter { - /** The condition to filter on. One of `"allowed-without-fight"`, `"type"` */ - readonly filter: "allowed-without-fight" | "type" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeAchievementPrototypeFilter extends BaseAchievementPrototypeFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface OtherAchievementPrototypeFilter extends BaseAchievementPrototypeFilter { - readonly filter: "allowed-without-fight" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#AchievementPrototypeFilter View documentation} - */ -type AchievementPrototypeFilter = TypeAchievementPrototypeFilter | OtherAchievementPrototypeFilter - -interface BaseFluidPrototypeFilter { - /** - * The condition to filter on. One of `"hidden"`, `"name"`, `"subgroup"`, `"default-temperature"`, - * `"max-temperature"`, `"heat-capacity"`, `"fuel-value"`, `"emissions-multiplier"`, `"gas-temperature"` - */ - readonly filter: - | "hidden" - | "name" - | "subgroup" - | "default-temperature" - | "max-temperature" - | "heat-capacity" - | "fuel-value" - | "emissions-multiplier" - | "gas-temperature" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -/** - * For use within nested filters such as the `has-product-fluid` filter of array[{@link RecipePrototypeFilter}]. To get a - * specific prototype by name, see {@link LuaGameScript.fluid_prototypes LuaGameScript::fluid_prototypes}. - */ -interface NameFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "name" - /** The prototype name, or list of acceptable names. */ - readonly name: string | string[] -} - -interface SubgroupFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "subgroup" - /** A {@link LuaGroup} (subgroup) name */ - readonly subgroup: string -} - -interface DefaultTemperatureFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "default-temperature" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface MaxTemperatureFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "max-temperature" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface HeatCapacityFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "heat-capacity" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface FuelValueFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "fuel-value" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface EmissionsMultiplierFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "emissions-multiplier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface GasTemperatureFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "gas-temperature" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface OtherFluidPrototypeFilter extends BaseFluidPrototypeFilter { - readonly filter: "hidden" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#FluidPrototypeFilter View documentation} - */ -type FluidPrototypeFilter = - | NameFluidPrototypeFilter - | SubgroupFluidPrototypeFilter - | DefaultTemperatureFluidPrototypeFilter - | MaxTemperatureFluidPrototypeFilter - | HeatCapacityFluidPrototypeFilter - | FuelValueFluidPrototypeFilter - | EmissionsMultiplierFluidPrototypeFilter - | GasTemperatureFluidPrototypeFilter - | OtherFluidPrototypeFilter - -interface BaseEquipmentPrototypeFilter { - /** The condition to filter on. One of `"item-to-place"`, `"type"` */ - readonly filter: "item-to-place" | "type" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeEquipmentPrototypeFilter extends BaseEquipmentPrototypeFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface OtherEquipmentPrototypeFilter extends BaseEquipmentPrototypeFilter { - readonly filter: "item-to-place" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#EquipmentPrototypeFilter View documentation} - */ -type EquipmentPrototypeFilter = TypeEquipmentPrototypeFilter | OtherEquipmentPrototypeFilter - -interface BaseTilePrototypeFilter { - /** - * The condition to filter on. One of `"minable"`, `"autoplace"`, `"blueprintable"`, `"item-to-place"`, - * `"collision-mask"`, `"walking-speed-modifier"`, `"vehicle-friction-modifier"`, - * `"decorative-removal-probability"`, `"emissions"` - */ - readonly filter: - | "minable" - | "autoplace" - | "blueprintable" - | "item-to-place" - | "collision-mask" - | "walking-speed-modifier" - | "vehicle-friction-modifier" - | "decorative-removal-probability" - | "emissions" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface CollisionMaskTilePrototypeFilter extends BaseTilePrototypeFilter { - readonly filter: "collision-mask" - readonly mask: CollisionMask | CollisionMaskWithFlags - /** How to filter: `"collides"` or `"layers-equals"` */ - readonly mask_mode: "collides" | "layers-equals" -} - -interface WalkingSpeedModifierTilePrototypeFilter extends BaseTilePrototypeFilter { - readonly filter: "walking-speed-modifier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface VehicleFrictionModifierTilePrototypeFilter extends BaseTilePrototypeFilter { - readonly filter: "vehicle-friction-modifier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface DecorativeRemovalProbabilityTilePrototypeFilter extends BaseTilePrototypeFilter { - readonly filter: "decorative-removal-probability" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: float -} - -interface EmissionsTilePrototypeFilter extends BaseTilePrototypeFilter { - readonly filter: "emissions" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface OtherTilePrototypeFilter extends BaseTilePrototypeFilter { - readonly filter: "minable" | "autoplace" | "blueprintable" | "item-to-place" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#TilePrototypeFilter View documentation} - */ -type TilePrototypeFilter = - | CollisionMaskTilePrototypeFilter - | WalkingSpeedModifierTilePrototypeFilter - | VehicleFrictionModifierTilePrototypeFilter - | DecorativeRemovalProbabilityTilePrototypeFilter - | EmissionsTilePrototypeFilter - | OtherTilePrototypeFilter - -interface BaseRecipePrototypeFilter { - /** - * The condition to filter on. One of `"enabled"`, `"hidden"`, `"hidden-from-flow-stats"`, - * `"hidden-from-player-crafting"`, `"allow-as-intermediate"`, `"allow-intermediates"`, `"allow-decomposition"`, - * `"always-show-made-in"`, `"always-show-products"`, `"show-amount-in-title"`, `"has-ingredients"`, - * `"has-products"`, `"has-ingredient-item"`, `"has-ingredient-fluid"`, `"has-product-item"`, `"has-product-fluid"`, - * `"subgroup"`, `"category"`, `"energy"`, `"emissions-multiplier"`, `"request-paste-multiplier"`, `"overload-multiplier"` - */ - readonly filter: - | "enabled" - | "hidden" - | "hidden-from-flow-stats" - | "hidden-from-player-crafting" - | "allow-as-intermediate" - | "allow-intermediates" - | "allow-decomposition" - | "always-show-made-in" - | "always-show-products" - | "show-amount-in-title" - | "has-ingredients" - | "has-products" - | "has-ingredient-item" - | "has-ingredient-fluid" - | "has-product-item" - | "has-product-fluid" - | "subgroup" - | "category" - | "energy" - | "emissions-multiplier" - | "request-paste-multiplier" - | "overload-multiplier" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface HasIngredientItemRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "has-ingredient-item" - /** Matches if at least 1 ingredient is an item that matches these filters. */ - readonly elem_filters?: ItemPrototypeFilter[] -} - -/** - * Usage example: - * - * ```lua - * -- selects recipes that consume sulfuric acid - * {{filter = "has-ingredient-fluid", elem_filters = {{filter = "name", name = "sulfuric-acid"}}}} - * ``` - */ -interface HasIngredientFluidRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "has-ingredient-fluid" - /** Matches if at least 1 ingredient is a fluid that matches these filters. */ - readonly elem_filters?: FluidPrototypeFilter[] -} - -/** - * Usage example: - * - * ```lua - * -- selects recipes that produce an item - * {{filter = "has-product-item"}} - * -- selects recipes that produce iron plates - * {{filter = "has-product-item", elem_filters = {{filter = "name", name = "iron-plate"}}}} - * -- selects recipes that produce items that place furnaces - * {{filter = "has-product-item", elem_filters = {{filter = "place-result", elem_filters = {{filter = "type", type = "furnace"}}}}}} - * ``` - */ -interface HasProductItemRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "has-product-item" - /** Matches if at least 1 product is an item that matches these filters. */ - readonly elem_filters?: ItemPrototypeFilter[] -} - -interface HasProductFluidRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "has-product-fluid" - /** Matches if at least 1 product is a fluid that matches these filters. */ - readonly elem_filters?: FluidPrototypeFilter[] -} - -interface SubgroupRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "subgroup" - /** A {@link LuaGroup} (subgroup) name */ - readonly subgroup: string -} - -interface CategoryRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "category" - /** A {@link LuaRecipeCategoryPrototype} name */ - readonly category: string -} - -interface EnergyRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "energy" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface EmissionsMultiplierRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "emissions-multiplier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface RequestPasteMultiplierRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "request-paste-multiplier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint -} - -interface OverloadMultiplierRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: "overload-multiplier" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint -} - -interface OtherRecipePrototypeFilter extends BaseRecipePrototypeFilter { - readonly filter: - | "enabled" - | "hidden" - | "hidden-from-flow-stats" - | "hidden-from-player-crafting" - | "allow-as-intermediate" - | "allow-intermediates" - | "allow-decomposition" - | "always-show-made-in" - | "always-show-products" - | "show-amount-in-title" - | "has-ingredients" - | "has-products" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#RecipePrototypeFilter View documentation} - */ -type RecipePrototypeFilter = - | HasIngredientItemRecipePrototypeFilter - | HasIngredientFluidRecipePrototypeFilter - | HasProductItemRecipePrototypeFilter - | HasProductFluidRecipePrototypeFilter - | SubgroupRecipePrototypeFilter - | CategoryRecipePrototypeFilter - | EnergyRecipePrototypeFilter - | EmissionsMultiplierRecipePrototypeFilter - | RequestPasteMultiplierRecipePrototypeFilter - | OverloadMultiplierRecipePrototypeFilter - | OtherRecipePrototypeFilter - -interface BaseEntityPrototypeFilter { - /** - * The condition to filter on. One of `"flying-robot"`, `"robot-with-logistics-interface"`, `"rail"`, `"ghost"`, - * `"explosion"`, `"vehicle"`, `"crafting-machine"`, `"rolling-stock"`, `"turret"`, `"transport-belt-connectable"`, - * `"wall-connectable"`, `"buildable"`, `"placable-in-editor"`, `"clonable"`, `"selectable"`, `"hidden"`, - * `"entity-with-health"`, `"building"`, `"fast-replaceable"`, `"uses-direction"`, `"minable"`, - * `"circuit-connectable"`, `"autoplace"`, `"blueprintable"`, `"item-to-place"`, `"name"`, `"type"`, - * `"collision-mask"`, `"flag"`, `"build-base-evolution-requirement"`, `"selection-priority"`, `"emissions"`, - * `"crafting-category"` - */ - readonly filter: - | "flying-robot" - | "robot-with-logistics-interface" - | "rail" - | "ghost" - | "explosion" - | "vehicle" - | "crafting-machine" - | "rolling-stock" - | "turret" - | "transport-belt-connectable" - | "wall-connectable" - | "buildable" - | "placable-in-editor" - | "clonable" - | "selectable" - | "hidden" - | "entity-with-health" - | "building" - | "fast-replaceable" - | "uses-direction" - | "minable" - | "circuit-connectable" - | "autoplace" - | "blueprintable" - | "item-to-place" - | "name" - | "type" - | "collision-mask" - | "flag" - | "build-base-evolution-requirement" - | "selection-priority" - | "emissions" - | "crafting-category" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -/** - * For use within nested filters such as the `place-result` filter of array[{@link ItemPrototypeFilter}]. To get a - * specific prototype by name, see {@link LuaGameScript.entity_prototypes LuaGameScript::entity_prototypes}. - */ -interface NameEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: "name" - /** The prototype name, or list of acceptable names. */ - readonly name: string | string[] -} - -/** - * Usage example: - * - * ```lua - * game.get_filtered_entity_prototypes({{filter = "type", type = "unit"}}) - * ``` - */ -interface TypeEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -/** - * Usage example: - * - * ```lua - * game.get_filtered_entity_prototypes({{filter = "collision-mask", mask = "player-layer", mask_mode = "collides"}}) - * ``` - */ -interface CollisionMaskEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: "collision-mask" - readonly mask: CollisionMask | CollisionMaskWithFlags - /** How to filter: `"collides"` or `"layers-equals"` */ - readonly mask_mode: "collides" | "layers-equals" -} - -/** - * Usage example: - * - * ```lua - * game.get_filtered_entity_prototypes({{filter = "flag", flag = "placeable-player"}, {filter = "flag", flag = "placeable-enemy", mode = "and"}}) - * ``` - */ -interface FlagEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: "flag" - /** One of the values in {@link EntityPrototypeFlags}. */ - readonly flag: string -} - -interface BuildBaseEvolutionRequirementEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: "build-base-evolution-requirement" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface SelectionPriorityEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: "selection-priority" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: uint8 -} - -interface EmissionsEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: "emissions" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: double -} - -interface CraftingCategoryEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: "crafting-category" - /** Matches if the prototype is for a crafting machine with this crafting category. */ - readonly crafting_category: string -} - -interface OtherEntityPrototypeFilter extends BaseEntityPrototypeFilter { - readonly filter: - | "flying-robot" - | "robot-with-logistics-interface" - | "rail" - | "ghost" - | "explosion" - | "vehicle" - | "crafting-machine" - | "rolling-stock" - | "turret" - | "transport-belt-connectable" - | "wall-connectable" - | "buildable" - | "placable-in-editor" - | "clonable" - | "selectable" - | "hidden" - | "entity-with-health" - | "building" - | "fast-replaceable" - | "uses-direction" - | "minable" - | "circuit-connectable" - | "autoplace" - | "blueprintable" - | "item-to-place" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#EntityPrototypeFilter View documentation} - */ -type EntityPrototypeFilter = - | NameEntityPrototypeFilter - | TypeEntityPrototypeFilter - | CollisionMaskEntityPrototypeFilter - | FlagEntityPrototypeFilter - | BuildBaseEvolutionRequirementEntityPrototypeFilter - | SelectionPriorityEntityPrototypeFilter - | EmissionsEntityPrototypeFilter - | CraftingCategoryEntityPrototypeFilter - | OtherEntityPrototypeFilter - -interface BaseScriptRaisedReviveEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeScriptRaisedReviveEventFilter extends BaseScriptRaisedReviveEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameScriptRaisedReviveEventFilter extends BaseScriptRaisedReviveEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeScriptRaisedReviveEventFilter extends BaseScriptRaisedReviveEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameScriptRaisedReviveEventFilter extends BaseScriptRaisedReviveEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherScriptRaisedReviveEventFilter extends BaseScriptRaisedReviveEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaScriptRaisedReviveEventFilter View documentation} - */ -type LuaScriptRaisedReviveEventFilter = - | TypeScriptRaisedReviveEventFilter - | NameScriptRaisedReviveEventFilter - | GhostTypeScriptRaisedReviveEventFilter - | GhostNameScriptRaisedReviveEventFilter - | OtherScriptRaisedReviveEventFilter - -interface BaseEntityDiedEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeEntityDiedEventFilter extends BaseEntityDiedEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameEntityDiedEventFilter extends BaseEntityDiedEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeEntityDiedEventFilter extends BaseEntityDiedEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameEntityDiedEventFilter extends BaseEntityDiedEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherEntityDiedEventFilter extends BaseEntityDiedEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaEntityDiedEventFilter View documentation} - */ -type LuaEntityDiedEventFilter = - | TypeEntityDiedEventFilter - | NameEntityDiedEventFilter - | GhostTypeEntityDiedEventFilter - | GhostNameEntityDiedEventFilter - | OtherEntityDiedEventFilter - -interface BaseEntityMarkedForDeconstructionEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeEntityMarkedForDeconstructionEventFilter extends BaseEntityMarkedForDeconstructionEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameEntityMarkedForDeconstructionEventFilter extends BaseEntityMarkedForDeconstructionEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeEntityMarkedForDeconstructionEventFilter extends BaseEntityMarkedForDeconstructionEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameEntityMarkedForDeconstructionEventFilter extends BaseEntityMarkedForDeconstructionEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherEntityMarkedForDeconstructionEventFilter extends BaseEntityMarkedForDeconstructionEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaEntityMarkedForDeconstructionEventFilter View documentation} - */ -type LuaEntityMarkedForDeconstructionEventFilter = - | TypeEntityMarkedForDeconstructionEventFilter - | NameEntityMarkedForDeconstructionEventFilter - | GhostTypeEntityMarkedForDeconstructionEventFilter - | GhostNameEntityMarkedForDeconstructionEventFilter - | OtherEntityMarkedForDeconstructionEventFilter - -interface BasePreGhostDeconstructedEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypePreGhostDeconstructedEventFilter extends BasePreGhostDeconstructedEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NamePreGhostDeconstructedEventFilter extends BasePreGhostDeconstructedEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypePreGhostDeconstructedEventFilter extends BasePreGhostDeconstructedEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNamePreGhostDeconstructedEventFilter extends BasePreGhostDeconstructedEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherPreGhostDeconstructedEventFilter extends BasePreGhostDeconstructedEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaPreGhostDeconstructedEventFilter View documentation} - */ -type LuaPreGhostDeconstructedEventFilter = - | TypePreGhostDeconstructedEventFilter - | NamePreGhostDeconstructedEventFilter - | GhostTypePreGhostDeconstructedEventFilter - | GhostNamePreGhostDeconstructedEventFilter - | OtherPreGhostDeconstructedEventFilter - -interface BaseScriptRaisedDestroyEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeScriptRaisedDestroyEventFilter extends BaseScriptRaisedDestroyEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameScriptRaisedDestroyEventFilter extends BaseScriptRaisedDestroyEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeScriptRaisedDestroyEventFilter extends BaseScriptRaisedDestroyEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameScriptRaisedDestroyEventFilter extends BaseScriptRaisedDestroyEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherScriptRaisedDestroyEventFilter extends BaseScriptRaisedDestroyEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaScriptRaisedDestroyEventFilter View documentation} - */ -type LuaScriptRaisedDestroyEventFilter = - | TypeScriptRaisedDestroyEventFilter - | NameScriptRaisedDestroyEventFilter - | GhostTypeScriptRaisedDestroyEventFilter - | GhostNameScriptRaisedDestroyEventFilter - | OtherScriptRaisedDestroyEventFilter - -interface BaseUpgradeCancelledEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeUpgradeCancelledEventFilter extends BaseUpgradeCancelledEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameUpgradeCancelledEventFilter extends BaseUpgradeCancelledEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeUpgradeCancelledEventFilter extends BaseUpgradeCancelledEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameUpgradeCancelledEventFilter extends BaseUpgradeCancelledEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherUpgradeCancelledEventFilter extends BaseUpgradeCancelledEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaUpgradeCancelledEventFilter View documentation} - */ -type LuaUpgradeCancelledEventFilter = - | TypeUpgradeCancelledEventFilter - | NameUpgradeCancelledEventFilter - | GhostTypeUpgradeCancelledEventFilter - | GhostNameUpgradeCancelledEventFilter - | OtherUpgradeCancelledEventFilter - -interface BasePlayerRepairedEntityEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypePlayerRepairedEntityEventFilter extends BasePlayerRepairedEntityEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NamePlayerRepairedEntityEventFilter extends BasePlayerRepairedEntityEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypePlayerRepairedEntityEventFilter extends BasePlayerRepairedEntityEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNamePlayerRepairedEntityEventFilter extends BasePlayerRepairedEntityEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherPlayerRepairedEntityEventFilter extends BasePlayerRepairedEntityEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaPlayerRepairedEntityEventFilter View documentation} - */ -type LuaPlayerRepairedEntityEventFilter = - | TypePlayerRepairedEntityEventFilter - | NamePlayerRepairedEntityEventFilter - | GhostTypePlayerRepairedEntityEventFilter - | GhostNamePlayerRepairedEntityEventFilter - | OtherPlayerRepairedEntityEventFilter - -interface BaseEntityMarkedForUpgradeEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeEntityMarkedForUpgradeEventFilter extends BaseEntityMarkedForUpgradeEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameEntityMarkedForUpgradeEventFilter extends BaseEntityMarkedForUpgradeEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeEntityMarkedForUpgradeEventFilter extends BaseEntityMarkedForUpgradeEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameEntityMarkedForUpgradeEventFilter extends BaseEntityMarkedForUpgradeEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherEntityMarkedForUpgradeEventFilter extends BaseEntityMarkedForUpgradeEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaEntityMarkedForUpgradeEventFilter View documentation} - */ -type LuaEntityMarkedForUpgradeEventFilter = - | TypeEntityMarkedForUpgradeEventFilter - | NameEntityMarkedForUpgradeEventFilter - | GhostTypeEntityMarkedForUpgradeEventFilter - | GhostNameEntityMarkedForUpgradeEventFilter - | OtherEntityMarkedForUpgradeEventFilter - -interface BasePostEntityDiedEventFilter { - /** The condition to filter on. One of `"type"` */ - readonly filter: "type" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypePostEntityDiedEventFilter extends BasePostEntityDiedEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaPostEntityDiedEventFilter View documentation} - */ -type LuaPostEntityDiedEventFilter = TypePostEntityDiedEventFilter - -interface BasePreRobotMinedEntityEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypePreRobotMinedEntityEventFilter extends BasePreRobotMinedEntityEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NamePreRobotMinedEntityEventFilter extends BasePreRobotMinedEntityEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypePreRobotMinedEntityEventFilter extends BasePreRobotMinedEntityEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNamePreRobotMinedEntityEventFilter extends BasePreRobotMinedEntityEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherPreRobotMinedEntityEventFilter extends BasePreRobotMinedEntityEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaPreRobotMinedEntityEventFilter View documentation} - */ -type LuaPreRobotMinedEntityEventFilter = - | TypePreRobotMinedEntityEventFilter - | NamePreRobotMinedEntityEventFilter - | GhostTypePreRobotMinedEntityEventFilter - | GhostNamePreRobotMinedEntityEventFilter - | OtherPreRobotMinedEntityEventFilter - -interface BaseEntityClonedEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeEntityClonedEventFilter extends BaseEntityClonedEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameEntityClonedEventFilter extends BaseEntityClonedEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeEntityClonedEventFilter extends BaseEntityClonedEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameEntityClonedEventFilter extends BaseEntityClonedEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherEntityClonedEventFilter extends BaseEntityClonedEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaEntityClonedEventFilter View documentation} - */ -type LuaEntityClonedEventFilter = - | TypeEntityClonedEventFilter - | NameEntityClonedEventFilter - | GhostTypeEntityClonedEventFilter - | GhostNameEntityClonedEventFilter - | OtherEntityClonedEventFilter - -interface BaseScriptRaisedBuiltEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeScriptRaisedBuiltEventFilter extends BaseScriptRaisedBuiltEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameScriptRaisedBuiltEventFilter extends BaseScriptRaisedBuiltEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeScriptRaisedBuiltEventFilter extends BaseScriptRaisedBuiltEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameScriptRaisedBuiltEventFilter extends BaseScriptRaisedBuiltEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherScriptRaisedBuiltEventFilter extends BaseScriptRaisedBuiltEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaScriptRaisedBuiltEventFilter View documentation} - */ -type LuaScriptRaisedBuiltEventFilter = - | TypeScriptRaisedBuiltEventFilter - | NameScriptRaisedBuiltEventFilter - | GhostTypeScriptRaisedBuiltEventFilter - | GhostNameScriptRaisedBuiltEventFilter - | OtherScriptRaisedBuiltEventFilter - -interface BaseRobotMinedEntityEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeRobotMinedEntityEventFilter extends BaseRobotMinedEntityEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameRobotMinedEntityEventFilter extends BaseRobotMinedEntityEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeRobotMinedEntityEventFilter extends BaseRobotMinedEntityEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameRobotMinedEntityEventFilter extends BaseRobotMinedEntityEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherRobotMinedEntityEventFilter extends BaseRobotMinedEntityEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaRobotMinedEntityEventFilter View documentation} - */ -type LuaRobotMinedEntityEventFilter = - | TypeRobotMinedEntityEventFilter - | NameRobotMinedEntityEventFilter - | GhostTypeRobotMinedEntityEventFilter - | GhostNameRobotMinedEntityEventFilter - | OtherRobotMinedEntityEventFilter - -interface BasePrePlayerMinedEntityEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypePrePlayerMinedEntityEventFilter extends BasePrePlayerMinedEntityEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NamePrePlayerMinedEntityEventFilter extends BasePrePlayerMinedEntityEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypePrePlayerMinedEntityEventFilter extends BasePrePlayerMinedEntityEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNamePrePlayerMinedEntityEventFilter extends BasePrePlayerMinedEntityEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherPrePlayerMinedEntityEventFilter extends BasePrePlayerMinedEntityEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaPrePlayerMinedEntityEventFilter View documentation} - */ -type LuaPrePlayerMinedEntityEventFilter = - | TypePrePlayerMinedEntityEventFilter - | NamePrePlayerMinedEntityEventFilter - | GhostTypePrePlayerMinedEntityEventFilter - | GhostNamePrePlayerMinedEntityEventFilter - | OtherPrePlayerMinedEntityEventFilter - -interface BaseRobotBuiltEntityEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, - * `"ghost_name"`, `"force"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - | "force" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeRobotBuiltEntityEventFilter extends BaseRobotBuiltEntityEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameRobotBuiltEntityEventFilter extends BaseRobotBuiltEntityEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeRobotBuiltEntityEventFilter extends BaseRobotBuiltEntityEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameRobotBuiltEntityEventFilter extends BaseRobotBuiltEntityEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface ForceRobotBuiltEntityEventFilter extends BaseRobotBuiltEntityEventFilter { - readonly filter: "force" - /** The entity force */ - readonly force: string -} - -interface OtherRobotBuiltEntityEventFilter extends BaseRobotBuiltEntityEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaRobotBuiltEntityEventFilter View documentation} - */ -type LuaRobotBuiltEntityEventFilter = - | TypeRobotBuiltEntityEventFilter - | NameRobotBuiltEntityEventFilter - | GhostTypeRobotBuiltEntityEventFilter - | GhostNameRobotBuiltEntityEventFilter - | ForceRobotBuiltEntityEventFilter - | OtherRobotBuiltEntityEventFilter - -interface BaseEntityDeconstructionCancelledEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeEntityDeconstructionCancelledEventFilter extends BaseEntityDeconstructionCancelledEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameEntityDeconstructionCancelledEventFilter extends BaseEntityDeconstructionCancelledEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeEntityDeconstructionCancelledEventFilter extends BaseEntityDeconstructionCancelledEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameEntityDeconstructionCancelledEventFilter extends BaseEntityDeconstructionCancelledEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherEntityDeconstructionCancelledEventFilter extends BaseEntityDeconstructionCancelledEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaEntityDeconstructionCancelledEventFilter View documentation} - */ -type LuaEntityDeconstructionCancelledEventFilter = - | TypeEntityDeconstructionCancelledEventFilter - | NameEntityDeconstructionCancelledEventFilter - | GhostTypeEntityDeconstructionCancelledEventFilter - | GhostNameEntityDeconstructionCancelledEventFilter - | OtherEntityDeconstructionCancelledEventFilter - -interface BasePlayerBuiltEntityEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, - * `"ghost_name"`, `"force"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - | "force" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypePlayerBuiltEntityEventFilter extends BasePlayerBuiltEntityEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NamePlayerBuiltEntityEventFilter extends BasePlayerBuiltEntityEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypePlayerBuiltEntityEventFilter extends BasePlayerBuiltEntityEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNamePlayerBuiltEntityEventFilter extends BasePlayerBuiltEntityEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface ForcePlayerBuiltEntityEventFilter extends BasePlayerBuiltEntityEventFilter { - readonly filter: "force" - /** The entity force */ - readonly force: string -} - -interface OtherPlayerBuiltEntityEventFilter extends BasePlayerBuiltEntityEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaPlayerBuiltEntityEventFilter View documentation} - */ -type LuaPlayerBuiltEntityEventFilter = - | TypePlayerBuiltEntityEventFilter - | NamePlayerBuiltEntityEventFilter - | GhostTypePlayerBuiltEntityEventFilter - | GhostNamePlayerBuiltEntityEventFilter - | ForcePlayerBuiltEntityEventFilter - | OtherPlayerBuiltEntityEventFilter - -interface BasePlayerMinedEntityEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypePlayerMinedEntityEventFilter extends BasePlayerMinedEntityEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NamePlayerMinedEntityEventFilter extends BasePlayerMinedEntityEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypePlayerMinedEntityEventFilter extends BasePlayerMinedEntityEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNamePlayerMinedEntityEventFilter extends BasePlayerMinedEntityEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherPlayerMinedEntityEventFilter extends BasePlayerMinedEntityEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaPlayerMinedEntityEventFilter View documentation} - */ -type LuaPlayerMinedEntityEventFilter = - | TypePlayerMinedEntityEventFilter - | NamePlayerMinedEntityEventFilter - | GhostTypePlayerMinedEntityEventFilter - | GhostNamePlayerMinedEntityEventFilter - | OtherPlayerMinedEntityEventFilter - -interface BaseEntityDamagedEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, - * `"ghost_name"`, `"original-damage-amount"`, `"final-damage-amount"`, `"damage-type"`, `"final-health"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - | "original-damage-amount" - | "final-damage-amount" - | "damage-type" - | "final-health" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OriginalDamageAmountEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: "original-damage-amount" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: float -} - -interface FinalDamageAmountEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: "final-damage-amount" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: float -} - -interface DamageTypeEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: "damage-type" - /** A {@link LuaDamagePrototype} name */ - readonly type: string -} - -interface FinalHealthEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: "final-health" - readonly comparison: ComparatorString - /** The value to compare against. */ - readonly value: float -} - -interface OtherEntityDamagedEventFilter extends BaseEntityDamagedEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaEntityDamagedEventFilter View documentation} - */ -type LuaEntityDamagedEventFilter = - | TypeEntityDamagedEventFilter - | NameEntityDamagedEventFilter - | GhostTypeEntityDamagedEventFilter - | GhostNameEntityDamagedEventFilter - | OriginalDamageAmountEntityDamagedEventFilter - | FinalDamageAmountEntityDamagedEventFilter - | DamageTypeEntityDamagedEventFilter - | FinalHealthEntityDamagedEventFilter - | OtherEntityDamagedEventFilter - -interface BaseSectorScannedEventFilter { - /** - * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, - * `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, - * `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` - */ - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" - | "type" - | "name" - | "ghost_type" - | "ghost_name" - /** - * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the - * filters, `"and"` has higher precedence than `"or"`. - */ - readonly mode?: "or" | "and" - /** Inverts the condition. Default is `false`. */ - readonly invert?: boolean -} - -interface TypeSectorScannedEventFilter extends BaseSectorScannedEventFilter { - readonly filter: "type" - /** The prototype type */ - readonly type: string -} - -interface NameSectorScannedEventFilter extends BaseSectorScannedEventFilter { - readonly filter: "name" - /** The prototype name */ - readonly name: string -} - -interface GhostTypeSectorScannedEventFilter extends BaseSectorScannedEventFilter { - readonly filter: "ghost_type" - /** The ghost prototype type */ - readonly type: string -} - -interface GhostNameSectorScannedEventFilter extends BaseSectorScannedEventFilter { - readonly filter: "ghost_name" - /** The ghost prototype name */ - readonly name: string -} - -interface OtherSectorScannedEventFilter extends BaseSectorScannedEventFilter { - readonly filter: - | "ghost" - | "rail" - | "rail-signal" - | "rolling-stock" - | "robot-with-logistics-interface" - | "vehicle" - | "turret" - | "crafting-machine" - | "wall-connectable" - | "transport-belt-connectable" - | "circuit-network-connectable" -} - -/** - * Other attributes may be specified depending on `filter`: - * - * {@link https://lua-api.factorio.com/next/Concepts.html#LuaSectorScannedEventFilter View documentation} - */ -type LuaSectorScannedEventFilter = - | TypeSectorScannedEventFilter - | NameSectorScannedEventFilter - | GhostTypeSectorScannedEventFilter - | GhostNameSectorScannedEventFilter - | OtherSectorScannedEventFilter - -/** - * A map gen preset. Used in {@link https://wiki.factorio.com/Prototype/MapGenPresets Prototype/MapGenPresets}. - * - * {@link https://wiki.factorio.com/Types/MapGenPreset View Documentation} - */ -interface MapGenPreset { - /** Specifies the ordering the map generator gui. */ - order: string - /** - * Whether this is the default preset. If set to boolean, this preset may not have any other properties besides this - * and order. - */ - default?: boolean - /** - * This is a table with the below key/value pairs. All key/value pairs are optional. If not set they will just use - * the default values. - */ - basic_settings: Partial - /** - * This is a table with the below key/value pairs. All key/value pairs are optional, if not set they will just use - * the existing values. - */ - readonly advanced_settings: { - readonly pollution?: { - enabled?: boolean - /** Must be <= 0.25. */ - diffusion_ratio?: double - /** Also known as dissipation rate. Must be >= 0.5. */ - ageing?: double - enemy_attack_pollution_consumption_modifier?: double - min_pollution_to_damage_trees?: double - pollution_restored_per_tree_damage?: double - } - readonly enemy_evolution?: { - enabled?: boolean - time_factor?: double - destroy_factor?: double - pollution_factor?: double - } - readonly enemy_expansion?: { - enabled?: boolean - max_expansion_distance?: double - settler_group_min_size?: double - settler_group_max_size?: double - /** In ticks. */ - min_expansion_cooldown?: double - /** In ticks. */ - max_expansion_cooldown?: double - } - readonly difficulty_settings?: { - recipe_difficulty?: defines.difficulty_settings.recipe_difficulty - technology_difficulty?: defines.difficulty_settings.technology_difficulty - technology_price_multiplier?: double - research_queue_setting?: "after-victory" | "always" | "never" - } - } -} - -interface BlueprintControlBehavior { - readonly condition?: CircuitCondition - readonly circuit_condition?: CircuitCondition - readonly filters?: Signal[] - readonly is_on?: boolean - readonly arithmetic_conditions?: ArithmeticCombinatorParameters - readonly decider_conditions?: DeciderCombinatorParameters - readonly circuit_enable_disable?: boolean - readonly circuit_read_resources?: boolean - readonly circuit_resource_read_mode?: defines.control_behavior.mining_drill.resource_read_mode - readonly read_stopped_train?: boolean - readonly train_stopped_signal?: SignalID - readonly read_from_train?: boolean - readonly send_to_train?: boolean - readonly circuit_mode_of_operation?: number - readonly circuit_read_hand_contents?: boolean - readonly circuit_hand_read_mode?: defines.control_behavior.inserter.hand_read_mode - readonly circuit_set_stack_size?: boolean - readonly stack_control_input_signal?: SignalID - readonly use_colors?: boolean - readonly read_robot_stats?: boolean - readonly read_logistics?: boolean - readonly available_logistic_output_signal?: boolean - readonly total_logistic_output_signal?: boolean - readonly available_construction_output_signal?: boolean - readonly total_construction_output_signal?: boolean - readonly circuit_contents_read_mode?: defines.control_behavior.transport_belt.content_read_mode - readonly output_signal?: SignalID - readonly circuit_close_signal?: boolean - readonly circuit_read_signal?: boolean - readonly red_output_signal?: SignalID - readonly orange_output_signal?: SignalID - readonly green_output_signal?: SignalID - readonly blue_output_signal?: SignalID - readonly circuit_open_gate?: boolean - readonly circuit_read_sensor?: boolean - readonly circuit_parameters?: ProgrammableSpeakerCircuitParameters -} diff --git a/modules/mod2/typed-factorio/generated/defines.d.ts b/modules/mod2/typed-factorio/generated/defines.d.ts deleted file mode 100644 index db30ab0..0000000 --- a/modules/mod2/typed-factorio/generated/defines.d.ts +++ /dev/null @@ -1,1642 +0,0 @@ -/** @noSelfInFile */ - -declare namespace defines { - enum alert_type { - entity_destroyed, - entity_under_attack, - not_enough_construction_robots, - no_material_for_construction, - not_enough_repair_packs, - turret_fire, - custom, - no_storage, - train_out_of_fuel, - } - /** - * AI command exit status. See {@link LuaEntity.set_command LuaEntity::set_command} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.behavior_result View documentation} - */ - enum behavior_result { - in_progress, - fail, - success, - deleted, - } - enum build_check_type { - script, - manual, - manual_ghost, - script_ghost, - blueprint_ghost, - ghost_revive, - } - /** - * State of a chain signal. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.chain_signal_state View documentation} - */ - enum chain_signal_state { - none, - all_open, - partially_open, - none_open, - } - enum chunk_generated_status { - nothing, - custom_tiles, - basic_tiles, - corrected_tiles, - tiles, - entities, - } - enum circuit_condition_index { - inserter_circuit, - inserter_logistic, - lamp, - arithmetic_combinator, - decider_combinator, - constant_combinator, - offshore_pump, - pump, - } - enum circuit_connector_id { - accumulator, - constant_combinator, - container, - programmable_speaker, - rail_signal, - rail_chain_signal, - roboport, - storage_tank, - wall, - electric_pole, - inserter, - lamp, - combinator_input, - combinator_output, - offshore_pump, - pump, - } - /** - * Command given to units describing what they should do. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command View documentation} - */ - enum command { - /** - * Attack another entity. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.attack View documentation} - */ - attack = 0, - /** - * Go to a specific position. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.go_to_location View documentation} - */ - go_to_location = 1, - /** - * Chain commands together, see {@link defines.compound_command}. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.compound View documentation} - */ - compound = 2, - /** - * Do what your group wants you to do. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.group View documentation} - */ - group = 3, - /** - * Go to a place and attack what you see. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.attack_area View documentation} - */ - attack_area = 4, - /** - * Chill. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.wander View documentation} - */ - wander = 5, - /** - * Flee from another entity. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.flee View documentation} - */ - flee = 6, - /** - * Stop moving and stay where you are. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.stop View documentation} - */ - stop = 7, - /** - * Go to a position and build a base there. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.command.build_base View documentation} - */ - build_base = 8, - } - /** - * How commands are joined together in a compound command (see {@link defines.command.compound}). - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.compound_command View documentation} - */ - enum compound_command { - /** - * Fail on first failure. Only succeeds if all commands (executed one after another) succeed. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.compound_command.logical_and View documentation} - */ - logical_and, - /** - * Succeed on first success. Only fails if all commands (executed one after another) fail. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.compound_command.logical_or View documentation} - */ - logical_or, - /** - * Execute all commands in sequence and fail or succeed depending on the return status of the last command. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.compound_command.return_last View documentation} - */ - return_last, - } - namespace control_behavior { - namespace inserter { - enum circuit_mode_of_operation { - none, - enable_disable, - set_filters, - read_hand_contents, - set_stack_size, - } - enum hand_read_mode { - hold, - pulse, - } - } - namespace logistic_container { - enum circuit_mode_of_operation { - send_contents, - set_requests, - } - } - namespace lamp { - enum circuit_mode_of_operation { - use_colors, - } - } - namespace mining_drill { - enum resource_read_mode { - this_miner, - entire_patch, - } - } - namespace transport_belt { - enum content_read_mode { - pulse, - hold, - } - } - enum type { - /** - * {@link LuaContainerControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.container View documentation} - */ - container, - /** - * {@link LuaGenericOnOffControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.generic_on_off View documentation} - */ - generic_on_off, - /** - * {@link LuaInserterControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.inserter View documentation} - */ - inserter, - /** - * {@link LuaLampControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.lamp View documentation} - */ - lamp, - /** - * {@link LuaLogisticContainerControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.logistic_container View documentation} - */ - logistic_container, - /** - * {@link LuaRoboportControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.roboport View documentation} - */ - roboport, - /** - * {@link LuaStorageTankControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.storage_tank View documentation} - */ - storage_tank, - /** - * {@link LuaTrainStopControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.train_stop View documentation} - */ - train_stop, - /** - * {@link LuaDeciderCombinatorControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.decider_combinator View documentation} - */ - decider_combinator, - /** - * {@link LuaArithmeticCombinatorControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.arithmetic_combinator View documentation} - */ - arithmetic_combinator, - /** - * {@link LuaConstantCombinatorControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.constant_combinator View documentation} - */ - constant_combinator, - /** - * {@link LuaTransportBeltControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.transport_belt View documentation} - */ - transport_belt, - /** - * {@link LuaAccumulatorControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.accumulator View documentation} - */ - accumulator, - /** - * {@link LuaRailSignalControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.rail_signal View documentation} - */ - rail_signal, - /** - * {@link LuaRailChainSignalControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.rail_chain_signal View documentation} - */ - rail_chain_signal, - /** - * {@link LuaWallControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.wall View documentation} - */ - wall, - /** - * {@link LuaMiningDrillControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.mining_drill View documentation} - */ - mining_drill, - /** - * {@link LuaProgrammableSpeakerControlBehavior} - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.control_behavior.type.programmable_speaker View documentation} - */ - programmable_speaker, - } - } - enum controllers { - /** - * Can't interact with the world, can only observe. Used in the multiplayer waiting-to-respawn screen. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.controllers.ghost View documentation} - */ - ghost, - /** - * The controller controls a character. This is the default controller in freeplay. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.controllers.character View documentation} - */ - character, - /** - * The controller isn't tied to a character. This is the default controller in sandbox. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.controllers.god View documentation} - */ - god, - /** - * The Editor Controller near ultimate power to do almost anything in the game. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.controllers.editor View documentation} - */ - editor, - /** - * The player can't interact with the world, and the camera pans around in a predefined manner. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.controllers.cutscene View documentation} - */ - cutscene, - /** - * Can't change anything in the world but can view anything. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.controllers.spectator View documentation} - */ - spectator, - } - namespace deconstruction_item { - enum entity_filter_mode { - whitelist, - blacklist, - } - enum tile_filter_mode { - whitelist, - blacklist, - } - enum tile_selection_mode { - normal, - always, - never, - only, - } - } - enum difficulty { - easy, - normal, - hard, - } - namespace difficulty_settings { - enum recipe_difficulty { - normal, - expensive, - } - enum technology_difficulty { - normal, - expensive, - } - } - enum direction { - north = 0, - northeast = 1, - east = 2, - southeast = 3, - south = 4, - southwest = 5, - west = 6, - northwest = 7, - } - enum disconnect_reason { - quit, - dropped, - reconnect, - wrong_input, - desync_limit_reached, - cannot_keep_up, - afk, - kicked, - kicked_and_deleted, - banned, - switching_servers, - } - enum distraction { - /** - * Perform command even if someone attacks the unit. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.distraction.none View documentation} - */ - none, - /** - * Attack closer enemy entities with force. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.distraction.by_enemy View documentation} - */ - by_enemy, - /** - * Attack closer enemy entities, including entities "built" by player (belts, inserters, chests). - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.distraction.by_anything View documentation} - */ - by_anything, - /** - * Attack when attacked. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.distraction.by_damage View documentation} - */ - by_damage, - } - enum entity_status { - working, - normal, - no_power, - low_power, - no_fuel, - disabled_by_control_behavior, - opened_by_circuit_network, - closed_by_circuit_network, - disabled_by_script, - marked_for_deconstruction, - /** - * Used by generators and solar panels. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.not_plugged_in_electric_network View documentation} - */ - not_plugged_in_electric_network, - /** - * Used by power switches. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.networks_connected View documentation} - */ - networks_connected, - /** - * Used by power switches. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.networks_disconnected View documentation} - */ - networks_disconnected, - /** - * Used by accumulators. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.charging View documentation} - */ - charging, - /** - * Used by accumulators. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.discharging View documentation} - */ - discharging, - /** - * Used by accumulators. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.fully_charged View documentation} - */ - fully_charged, - /** - * Used by logistic containers. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.out_of_logistic_network View documentation} - */ - out_of_logistic_network, - /** - * Used by assembling machines. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.no_recipe View documentation} - */ - no_recipe, - /** - * Used by furnaces. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.no_ingredients View documentation} - */ - no_ingredients, - /** - * Used by boilers, fluid turrets and fluid energy sources: Boiler has no fluid to work with. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.no_input_fluid View documentation} - */ - no_input_fluid, - /** - * Used by labs. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.no_research_in_progress View documentation} - */ - no_research_in_progress, - /** - * Used by mining drills. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.no_minable_resources View documentation} - */ - no_minable_resources, - /** - * Used by boilers and fluid turrets: Boiler still has some fluid but is about to run out. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.low_input_fluid View documentation} - */ - low_input_fluid, - /** - * Used by crafting machines. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.fluid_ingredient_shortage View documentation} - */ - fluid_ingredient_shortage, - /** - * Used by crafting machines, boilers, burner energy sources and reactors: Reactor/burner has full burnt result - * inventory, boiler has full output fluidbox. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.full_output View documentation} - */ - full_output, - /** - * Used by crafting machines. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.item_ingredient_shortage View documentation} - */ - item_ingredient_shortage, - /** - * Used by mining drills when the mining fluid is missing. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.missing_required_fluid View documentation} - */ - missing_required_fluid, - /** - * Used by labs. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.missing_science_packs View documentation} - */ - missing_science_packs, - /** - * Used by inserters. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.waiting_for_source_items View documentation} - */ - waiting_for_source_items, - /** - * Used by inserters and mining drills. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.waiting_for_space_in_destination View documentation} - */ - waiting_for_space_in_destination, - /** - * Used by the rocket silo. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.preparing_rocket_for_launch View documentation} - */ - preparing_rocket_for_launch, - /** - * Used by the rocket silo. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.waiting_to_launch_rocket View documentation} - */ - waiting_to_launch_rocket, - /** - * Used by the rocket silo. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.launching_rocket View documentation} - */ - launching_rocket, - /** - * Used by beacons. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.no_modules_to_transmit View documentation} - */ - no_modules_to_transmit, - /** - * Used by roboports. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.recharging_after_power_outage View documentation} - */ - recharging_after_power_outage, - /** - * Used by inserters targeting entity ghosts. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.waiting_for_target_to_be_built View documentation} - */ - waiting_for_target_to_be_built, - /** - * Used by inserters targeting rails. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.waiting_for_train View documentation} - */ - waiting_for_train, - /** - * Used by ammo turrets. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.no_ammo View documentation} - */ - no_ammo, - /** - * Used by heat energy sources. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.low_temperature View documentation} - */ - low_temperature, - /** - * Used by constant combinators: Combinator is turned off via switch in GUI. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.disabled View documentation} - */ - disabled, - /** - * Used by lamps. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.turned_off_during_daytime View documentation} - */ - turned_off_during_daytime, - /** - * Used by rail signals. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.not_connected_to_rail View documentation} - */ - not_connected_to_rail, - /** - * Used by rail signals. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.entity_status.cant_divide_segments View documentation} - */ - cant_divide_segments, - } - /** - * See the {@link https://lua-api.factorio.com/next/events.html events page} for more info on what events contain and - * when they get raised. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.events View documentation} - */ - namespace events { - /** Event type: {@link OnTickEvent} */ - const on_tick: EventId - /** Event type: {@link OnGuiClickEvent} */ - const on_gui_click: EventId - /** Event type: {@link OnGuiConfirmedEvent} */ - const on_gui_confirmed: EventId - /** Event type: {@link OnGuiTextChangedEvent} */ - const on_gui_text_changed: EventId - /** Event type: {@link OnGuiCheckedStateChangedEvent} */ - const on_gui_checked_state_changed: EventId - /** - * Event type: {@link OnEntityDiedEvent} - * - * Event filter: {@link LuaEntityDiedEventFilter} - */ - const on_entity_died: EventId - /** - * Event type: {@link OnPostEntityDiedEvent} - * - * Event filter: {@link LuaPostEntityDiedEventFilter} - */ - const on_post_entity_died: EventId - /** - * Event type: {@link OnEntityDamagedEvent} - * - * Event filter: {@link LuaEntityDamagedEventFilter} - */ - const on_entity_damaged: EventId - /** Event type: {@link OnPickedUpItemEvent} */ - const on_picked_up_item: EventId - /** - * Event type: {@link OnBuiltEntityEvent} - * - * Event filter: {@link LuaPlayerBuiltEntityEventFilter} - */ - const on_built_entity: EventId - /** - * Event type: {@link OnSectorScannedEvent} - * - * Event filter: {@link LuaSectorScannedEventFilter} - */ - const on_sector_scanned: EventId - /** Event type: {@link OnPlayerMinedItemEvent} */ - const on_player_mined_item: EventId - /** Event type: {@link OnPreBuildEvent} */ - const on_pre_build: EventId - /** Event type: {@link OnRocketLaunchedEvent} */ - const on_rocket_launched: EventId - /** - * Event type: {@link OnPrePlayerMinedItemEvent} - * - * Event filter: {@link LuaPrePlayerMinedEntityEventFilter} - */ - const on_pre_player_mined_item: EventId - /** Event type: {@link OnChunkGeneratedEvent} */ - const on_chunk_generated: EventId - /** Event type: {@link OnPlayerCraftedItemEvent} */ - const on_player_crafted_item: EventId - /** - * Event type: {@link OnRobotBuiltEntityEvent} - * - * Event filter: {@link LuaRobotBuiltEntityEventFilter} - */ - const on_robot_built_entity: EventId - /** - * Event type: {@link OnRobotPreMinedEvent} - * - * Event filter: {@link LuaPreRobotMinedEntityEventFilter} - */ - const on_robot_pre_mined: EventId - /** Event type: {@link OnRobotMinedEvent} */ - const on_robot_mined: EventId - /** Event type: {@link OnResearchStartedEvent} */ - const on_research_started: EventId - /** Event type: {@link OnResearchFinishedEvent} */ - const on_research_finished: EventId - /** Event type: {@link OnResearchReversedEvent} */ - const on_research_reversed: EventId - /** Event type: {@link OnPlayerRotatedEntityEvent} */ - const on_player_rotated_entity: EventId - /** - * Event type: {@link OnMarkedForDeconstructionEvent} - * - * Event filter: {@link LuaEntityMarkedForDeconstructionEventFilter} - */ - const on_marked_for_deconstruction: EventId< - OnMarkedForDeconstructionEvent, - LuaEntityMarkedForDeconstructionEventFilter - > - /** - * Event type: {@link OnCancelledDeconstructionEvent} - * - * Event filter: {@link LuaEntityDeconstructionCancelledEventFilter} - */ - const on_cancelled_deconstruction: EventId< - OnCancelledDeconstructionEvent, - LuaEntityDeconstructionCancelledEventFilter - > - /** Event type: {@link OnTriggerCreatedEntityEvent} */ - const on_trigger_created_entity: EventId - /** Event type: {@link OnTriggerFiredArtilleryEvent} */ - const on_trigger_fired_artillery: EventId - /** Event type: {@link OnTrainChangedStateEvent} */ - const on_train_changed_state: EventId - /** Event type: {@link OnPlayerCreatedEvent} */ - const on_player_created: EventId - /** Event type: {@link OnResourceDepletedEvent} */ - const on_resource_depleted: EventId - /** Event type: {@link OnPlayerDrivingChangedStateEvent} */ - const on_player_driving_changed_state: EventId - /** Event type: {@link OnForceCreatedEvent} */ - const on_force_created: EventId - /** Event type: {@link OnForcesMergingEvent} */ - const on_forces_merging: EventId - /** Event type: {@link OnPlayerCursorStackChangedEvent} */ - const on_player_cursor_stack_changed: EventId - /** Event type: {@link OnPreEntitySettingsPastedEvent} */ - const on_pre_entity_settings_pasted: EventId - /** Event type: {@link OnEntitySettingsPastedEvent} */ - const on_entity_settings_pasted: EventId - /** Event type: {@link OnPlayerMainInventoryChangedEvent} */ - const on_player_main_inventory_changed: EventId - /** Event type: {@link OnPlayerArmorInventoryChangedEvent} */ - const on_player_armor_inventory_changed: EventId - /** Event type: {@link OnPlayerAmmoInventoryChangedEvent} */ - const on_player_ammo_inventory_changed: EventId - /** Event type: {@link OnPlayerGunInventoryChangedEvent} */ - const on_player_gun_inventory_changed: EventId - /** Event type: {@link OnPlayerPlacedEquipmentEvent} */ - const on_player_placed_equipment: EventId - /** Event type: {@link OnPlayerRemovedEquipmentEvent} */ - const on_player_removed_equipment: EventId - /** Event type: {@link OnPrePlayerDiedEvent} */ - const on_pre_player_died: EventId - /** Event type: {@link OnPlayerDiedEvent} */ - const on_player_died: EventId - /** Event type: {@link OnPlayerRespawnedEvent} */ - const on_player_respawned: EventId - /** Event type: {@link OnPlayerJoinedGameEvent} */ - const on_player_joined_game: EventId - /** Event type: {@link OnPlayerLeftGameEvent} */ - const on_player_left_game: EventId - /** Event type: {@link OnPlayerBuiltTileEvent} */ - const on_player_built_tile: EventId - /** Event type: {@link OnPlayerMinedTileEvent} */ - const on_player_mined_tile: EventId - /** Event type: {@link OnRobotBuiltTileEvent} */ - const on_robot_built_tile: EventId - /** Event type: {@link OnRobotMinedTileEvent} */ - const on_robot_mined_tile: EventId - /** Event type: {@link OnPlayerSelectedAreaEvent} */ - const on_player_selected_area: EventId - /** Event type: {@link OnPlayerAltSelectedAreaEvent} */ - const on_player_alt_selected_area: EventId - /** Event type: {@link OnPlayerChangedSurfaceEvent} */ - const on_player_changed_surface: EventId - /** Event type: {@link OnSelectedEntityChangedEvent} */ - const on_selected_entity_changed: EventId - /** Event type: {@link OnMarketItemPurchasedEvent} */ - const on_market_item_purchased: EventId - /** Event type: {@link OnPlayerDroppedItemEvent} */ - const on_player_dropped_item: EventId - /** Event type: {@link OnBiterBaseBuiltEvent} */ - const on_biter_base_built: EventId - /** Event type: {@link OnPlayerChangedForceEvent} */ - const on_player_changed_force: EventId - /** Event type: {@link OnEntityRenamedEvent} */ - const on_entity_renamed: EventId - /** Event type: {@link OnGuiSelectionStateChangedEvent} */ - const on_gui_selection_state_changed: EventId - /** Event type: {@link OnRuntimeModSettingChangedEvent} */ - const on_runtime_mod_setting_changed: EventId - /** Event type: {@link OnDifficultySettingsChangedEvent} */ - const on_difficulty_settings_changed: EventId - /** Event type: {@link OnSurfaceCreatedEvent} */ - const on_surface_created: EventId - /** Event type: {@link OnSurfaceDeletedEvent} */ - const on_surface_deleted: EventId - /** Event type: {@link OnPreSurfaceDeletedEvent} */ - const on_pre_surface_deleted: EventId - /** - * Event type: {@link OnPlayerMinedEntityEvent} - * - * Event filter: {@link LuaPlayerMinedEntityEventFilter} - */ - const on_player_mined_entity: EventId - /** - * Event type: {@link OnRobotMinedEntityEvent} - * - * Event filter: {@link LuaRobotMinedEntityEventFilter} - */ - const on_robot_mined_entity: EventId - /** Event type: {@link OnTrainCreatedEvent} */ - const on_train_created: EventId - /** Event type: {@link OnGuiElemChangedEvent} */ - const on_gui_elem_changed: EventId - /** Event type: {@link OnPlayerSetupBlueprintEvent} */ - const on_player_setup_blueprint: EventId - /** Event type: {@link OnPlayerDeconstructedAreaEvent} */ - const on_player_deconstructed_area: EventId - /** Event type: {@link OnPlayerConfiguredBlueprintEvent} */ - const on_player_configured_blueprint: EventId - /** Event type: {@link OnConsoleChatEvent} */ - const on_console_chat: EventId - /** Event type: {@link OnConsoleCommandEvent} */ - const on_console_command: EventId - /** Event type: {@link OnPlayerRemovedEvent} */ - const on_player_removed: EventId - /** Event type: {@link OnPrePlayerRemovedEvent} */ - const on_pre_player_removed: EventId - /** Event type: {@link OnPlayerUsedCapsuleEvent} */ - const on_player_used_capsule: EventId - /** - * Event type: {@link ScriptRaisedBuiltEvent} - * - * Event filter: {@link LuaScriptRaisedBuiltEventFilter} - */ - const script_raised_built: EventId - /** - * Event type: {@link ScriptRaisedDestroyEvent} - * - * Event filter: {@link LuaScriptRaisedDestroyEventFilter} - */ - const script_raised_destroy: EventId - /** - * Event type: {@link ScriptRaisedReviveEvent} - * - * Event filter: {@link LuaScriptRaisedReviveEventFilter} - */ - const script_raised_revive: EventId - /** Event type: {@link ScriptRaisedSetTilesEvent} */ - const script_raised_set_tiles: EventId - /** Event type: {@link OnPlayerPromotedEvent} */ - const on_player_promoted: EventId - /** Event type: {@link OnPlayerDemotedEvent} */ - const on_player_demoted: EventId - /** Event type: {@link OnCombatRobotExpiredEvent} */ - const on_combat_robot_expired: EventId - /** Event type: {@link OnWorkerRobotExpiredEvent} */ - const on_worker_robot_expired: EventId - /** Event type: {@link OnPlayerChangedPositionEvent} */ - const on_player_changed_position: EventId - /** Event type: {@link OnModItemOpenedEvent} */ - const on_mod_item_opened: EventId - /** Event type: {@link OnGuiOpenedEvent} */ - const on_gui_opened: EventId - /** Event type: {@link OnGuiClosedEvent} */ - const on_gui_closed: EventId - /** Event type: {@link OnGuiValueChangedEvent} */ - const on_gui_value_changed: EventId - /** Event type: {@link OnPlayerMutedEvent} */ - const on_player_muted: EventId - /** Event type: {@link OnPlayerUnmutedEvent} */ - const on_player_unmuted: EventId - /** Event type: {@link OnPlayerCheatModeEnabledEvent} */ - const on_player_cheat_mode_enabled: EventId - /** Event type: {@link OnPlayerCheatModeDisabledEvent} */ - const on_player_cheat_mode_disabled: EventId - /** Event type: {@link OnCharacterCorpseExpiredEvent} */ - const on_character_corpse_expired: EventId - /** - * Event type: {@link OnPreGhostDeconstructedEvent} - * - * Event filter: {@link LuaPreGhostDeconstructedEventFilter} - */ - const on_pre_ghost_deconstructed: EventId - /** Event type: {@link OnPlayerPipetteEvent} */ - const on_player_pipette: EventId - /** Event type: {@link OnPlayerDisplayResolutionChangedEvent} */ - const on_player_display_resolution_changed: EventId - /** Event type: {@link OnPlayerDisplayScaleChangedEvent} */ - const on_player_display_scale_changed: EventId - /** Event type: {@link OnPrePlayerCraftedItemEvent} */ - const on_pre_player_crafted_item: EventId - /** Event type: {@link OnPlayerCancelledCraftingEvent} */ - const on_player_cancelled_crafting: EventId - /** Event type: {@link OnChunkChartedEvent} */ - const on_chunk_charted: EventId - /** Event type: {@link OnTechnologyEffectsResetEvent} */ - const on_technology_effects_reset: EventId - /** Event type: {@link OnForceResetEvent} */ - const on_force_reset: EventId - /** Event type: {@link OnLandMineArmedEvent} */ - const on_land_mine_armed: EventId - /** Event type: {@link OnForcesMergedEvent} */ - const on_forces_merged: EventId - /** Event type: {@link OnPlayerTrashInventoryChangedEvent} */ - const on_player_trash_inventory_changed: EventId - /** Event type: {@link OnPrePlayerLeftGameEvent} */ - const on_pre_player_left_game: EventId - /** Event type: {@link OnPreSurfaceClearedEvent} */ - const on_pre_surface_cleared: EventId - /** Event type: {@link OnSurfaceClearedEvent} */ - const on_surface_cleared: EventId - /** Event type: {@link OnChunkDeletedEvent} */ - const on_chunk_deleted: EventId - /** Event type: {@link OnPreChunkDeletedEvent} */ - const on_pre_chunk_deleted: EventId - /** Event type: {@link OnTrainScheduleChangedEvent} */ - const on_train_schedule_changed: EventId - /** Event type: {@link OnPlayerBannedEvent} */ - const on_player_banned: EventId - /** Event type: {@link OnPlayerKickedEvent} */ - const on_player_kicked: EventId - /** Event type: {@link OnPlayerUnbannedEvent} */ - const on_player_unbanned: EventId - /** Event type: {@link OnRocketLaunchOrderedEvent} */ - const on_rocket_launch_ordered: EventId - /** Event type: {@link OnScriptPathRequestFinishedEvent} */ - const on_script_path_request_finished: EventId - /** Event type: {@link OnAiCommandCompletedEvent} */ - const on_ai_command_completed: EventId - /** - * Event type: {@link OnMarkedForUpgradeEvent} - * - * Event filter: {@link LuaEntityMarkedForUpgradeEventFilter} - */ - const on_marked_for_upgrade: EventId - /** - * Event type: {@link OnCancelledUpgradeEvent} - * - * Event filter: {@link LuaUpgradeCancelledEventFilter} - */ - const on_cancelled_upgrade: EventId - /** Event type: {@link OnPlayerToggledMapEditorEvent} */ - const on_player_toggled_map_editor: EventId - /** - * Event type: {@link OnEntityClonedEvent} - * - * Event filter: {@link LuaEntityClonedEventFilter} - */ - const on_entity_cloned: EventId - /** Event type: {@link OnAreaClonedEvent} */ - const on_area_cloned: EventId - /** Event type: {@link OnBrushClonedEvent} */ - const on_brush_cloned: EventId - /** Event type: {@link OnGameCreatedFromScenarioEvent} */ - const on_game_created_from_scenario: EventId - /** Event type: {@link OnSurfaceImportedEvent} */ - const on_surface_imported: EventId - /** Event type: {@link OnSurfaceRenamedEvent} */ - const on_surface_renamed: EventId - /** Event type: {@link OnPlayerToggledAltModeEvent} */ - const on_player_toggled_alt_mode: EventId - /** - * Event type: {@link OnPlayerRepairedEntityEvent} - * - * Event filter: {@link LuaPlayerRepairedEntityEventFilter} - */ - const on_player_repaired_entity: EventId - /** Event type: {@link OnPlayerFastTransferredEvent} */ - const on_player_fast_transferred: EventId - /** Event type: {@link OnPreRobotExplodedCliffEvent} */ - const on_pre_robot_exploded_cliff: EventId - /** Event type: {@link OnRobotExplodedCliffEvent} */ - const on_robot_exploded_cliff: EventId - /** Event type: {@link OnEntitySpawnedEvent} */ - const on_entity_spawned: EventId - /** Event type: {@link OnCutsceneWaypointReachedEvent} */ - const on_cutscene_waypoint_reached: EventId - /** Event type: {@link OnUnitGroupCreatedEvent} */ - const on_unit_group_created: EventId - /** Event type: {@link OnUnitAddedToGroupEvent} */ - const on_unit_added_to_group: EventId - /** Event type: {@link OnUnitRemovedFromGroupEvent} */ - const on_unit_removed_from_group: EventId - /** Event type: {@link OnUnitGroupFinishedGatheringEvent} */ - const on_unit_group_finished_gathering: EventId - /** Event type: {@link OnBuildBaseArrivedEvent} */ - const on_build_base_arrived: EventId - /** Event type: {@link OnChartTagAddedEvent} */ - const on_chart_tag_added: EventId - /** Event type: {@link OnChartTagModifiedEvent} */ - const on_chart_tag_modified: EventId - /** Event type: {@link OnChartTagRemovedEvent} */ - const on_chart_tag_removed: EventId - /** Event type: {@link OnLuaShortcutEvent} */ - const on_lua_shortcut: EventId - /** Event type: {@link OnGuiLocationChangedEvent} */ - const on_gui_location_changed: EventId - /** Event type: {@link OnGuiSelectedTabChangedEvent} */ - const on_gui_selected_tab_changed: EventId - /** Event type: {@link OnGuiSwitchStateChangedEvent} */ - const on_gui_switch_state_changed: EventId - /** Event type: {@link OnForceCeaseFireChangedEvent} */ - const on_force_cease_fire_changed: EventId - /** Event type: {@link OnForceFriendsChangedEvent} */ - const on_force_friends_changed: EventId - /** Event type: {@link OnStringTranslatedEvent} */ - const on_string_translated: EventId - /** Event type: {@link OnScriptTriggerEffectEvent} */ - const on_script_trigger_effect: EventId - /** Event type: {@link OnPlayerSetQuickBarSlotEvent} */ - const on_player_set_quick_bar_slot: EventId - /** Event type: {@link OnPrePlayerToggledMapEditorEvent} */ - const on_pre_player_toggled_map_editor: EventId - /** Event type: {@link OnPreScriptInventoryResizedEvent} */ - const on_pre_script_inventory_resized: EventId - /** Event type: {@link OnScriptInventoryResizedEvent} */ - const on_script_inventory_resized: EventId - /** Event type: {@link OnEntityDestroyedEvent} */ - const on_entity_destroyed: EventId - /** Event type: {@link OnPlayerClickedGpsTagEvent} */ - const on_player_clicked_gps_tag: EventId - /** Event type: {@link OnPlayerFlushedFluidEvent} */ - const on_player_flushed_fluid: EventId - /** Event type: {@link OnPermissionGroupEditedEvent} */ - const on_permission_group_edited: EventId - /** Event type: {@link OnPrePermissionStringImportedEvent} */ - const on_pre_permission_string_imported: EventId - /** Event type: {@link OnPermissionStringImportedEvent} */ - const on_permission_string_imported: EventId - /** Event type: {@link OnPrePermissionGroupDeletedEvent} */ - const on_pre_permission_group_deleted: EventId - /** Event type: {@link OnPermissionGroupDeletedEvent} */ - const on_permission_group_deleted: EventId - /** Event type: {@link OnPermissionGroupAddedEvent} */ - const on_permission_group_added: EventId - /** Event type: {@link OnCutsceneCancelledEvent} */ - const on_cutscene_cancelled: EventId - /** Event type: {@link OnPlayerConfiguredSpiderRemoteEvent} */ - const on_player_configured_spider_remote: EventId - /** Event type: {@link OnPlayerUsedSpiderRemoteEvent} */ - const on_player_used_spider_remote: EventId - /** Event type: {@link OnSpiderCommandCompletedEvent} */ - const on_spider_command_completed: EventId - /** Event type: {@link OnEntityLogisticSlotChangedEvent} */ - const on_entity_logistic_slot_changed: EventId - /** Event type: {@link OnEquipmentInsertedEvent} */ - const on_equipment_inserted: EventId - /** Event type: {@link OnEquipmentRemovedEvent} */ - const on_equipment_removed: EventId - } - /** - * See the {@link https://lua-api.factorio.com/next/events.html events page} for more info on what events contain and - * when they get raised. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.events View documentation} - */ - type events = typeof events[keyof typeof events] - enum flow_precision_index { - five_seconds, - one_minute, - ten_minutes, - one_hour, - ten_hours, - fifty_hours, - two_hundred_fifty_hours, - one_thousand_hours, - } - enum group_state { - gathering, - moving, - attacking_distraction, - attacking_target, - finished, - pathfinding, - wander_in_group, - } - enum gui_type { - none, - entity, - research, - controller, - production, - item, - bonus, - trains, - achievement, - blueprint_library, - equipment, - logistic, - other_player, - permissions, - tutorials, - custom, - server_management, - player_management, - tile, - } - enum input_action { - activate_copy, - activate_cut, - activate_paste, - add_permission_group, - add_train_station, - admin_action, - alt_select_area, - alt_select_blueprint_entities, - alternative_copy, - begin_mining, - begin_mining_terrain, - build, - build_rail, - build_terrain, - cancel_craft, - cancel_deconstruct, - cancel_new_blueprint, - cancel_research, - cancel_upgrade, - change_active_character_tab, - change_active_item_group_for_crafting, - change_active_item_group_for_filters, - change_active_quick_bar, - change_arithmetic_combinator_parameters, - change_decider_combinator_parameters, - change_entity_label, - change_item_description, - change_item_label, - change_multiplayer_config, - change_picking_state, - change_programmable_speaker_alert_parameters, - change_programmable_speaker_circuit_parameters, - change_programmable_speaker_parameters, - change_riding_state, - change_shooting_state, - change_train_stop_station, - change_train_wait_condition, - change_train_wait_condition_data, - clear_cursor, - connect_rolling_stock, - copy, - copy_entity_settings, - copy_opened_blueprint, - copy_opened_item, - craft, - cursor_split, - cursor_transfer, - custom_input, - cycle_blueprint_book_backwards, - cycle_blueprint_book_forwards, - deconstruct, - delete_blueprint_library, - delete_blueprint_record, - delete_custom_tag, - delete_permission_group, - destroy_item, - destroy_opened_item, - disconnect_rolling_stock, - drag_train_schedule, - drag_train_wait_condition, - drop_blueprint_record, - drop_item, - edit_blueprint_tool_preview, - edit_custom_tag, - edit_permission_group, - export_blueprint, - fast_entity_split, - fast_entity_transfer, - flush_opened_entity_fluid, - flush_opened_entity_specific_fluid, - go_to_train_station, - grab_blueprint_record, - gui_checked_state_changed, - gui_click, - gui_confirmed, - gui_elem_changed, - gui_location_changed, - gui_selected_tab_changed, - gui_selection_state_changed, - gui_switch_state_changed, - gui_text_changed, - gui_value_changed, - import_blueprint, - import_blueprint_string, - import_blueprints_filtered, - import_permissions_string, - inventory_split, - inventory_transfer, - launch_rocket, - lua_shortcut, - map_editor_action, - market_offer, - mod_settings_changed, - open_achievements_gui, - open_blueprint_library_gui, - open_blueprint_record, - open_bonus_gui, - open_character_gui, - open_current_vehicle_gui, - open_equipment, - open_gui, - open_item, - open_logistic_gui, - open_mod_item, - open_parent_of_opened_item, - open_production_gui, - open_technology_gui, - open_tips_and_tricks_gui, - open_train_gui, - open_train_station_gui, - open_trains_gui, - paste_entity_settings, - place_equipment, - quick_bar_pick_slot, - quick_bar_set_selected_page, - quick_bar_set_slot, - reassign_blueprint, - remove_cables, - remove_train_station, - reset_assembling_machine, - reset_item, - rotate_entity, - select_area, - select_blueprint_entities, - select_entity_slot, - select_item, - select_mapper_slot, - select_next_valid_gun, - select_tile_slot, - send_spidertron, - set_auto_launch_rocket, - set_autosort_inventory, - set_behavior_mode, - set_car_weapons_control, - set_circuit_condition, - set_circuit_mode_of_operation, - set_controller_logistic_trash_filter_item, - set_deconstruction_item_tile_selection_mode, - set_deconstruction_item_trees_and_rocks_only, - set_entity_color, - set_entity_energy_property, - set_entity_logistic_trash_filter_item, - set_filter, - set_flat_controller_gui, - set_heat_interface_mode, - set_heat_interface_temperature, - set_infinity_container_filter_item, - set_infinity_container_remove_unfiltered_items, - set_infinity_pipe_filter, - set_inserter_max_stack_size, - set_inventory_bar, - set_linked_container_link_i_d, - set_logistic_filter_item, - set_logistic_filter_signal, - set_player_color, - set_recipe_notifications, - set_request_from_buffers, - set_research_finished_stops_game, - set_signal, - set_splitter_priority, - set_train_stopped, - set_trains_limit, - set_vehicle_automatic_targeting_parameters, - setup_assembling_machine, - setup_blueprint, - setup_single_blueprint_record, - smart_pipette, - spawn_item, - stack_split, - stack_transfer, - start_repair, - start_research, - start_walking, - stop_building_by_moving, - switch_connect_to_logistic_network, - switch_constant_combinator_state, - switch_inserter_filter_mode_state, - switch_power_switch_state, - switch_to_rename_stop_gui, - take_equipment, - toggle_deconstruction_item_entity_filter_mode, - toggle_deconstruction_item_tile_filter_mode, - toggle_driving, - toggle_enable_vehicle_logistics_while_moving, - toggle_entity_logistic_requests, - toggle_equipment_movement_bonus, - toggle_map_editor, - toggle_personal_logistic_requests, - toggle_personal_roboport, - toggle_show_entity_info, - translate_string, - undo, - upgrade, - upgrade_opened_blueprint_by_item, - upgrade_opened_blueprint_by_record, - use_artillery_remote, - use_item, - wire_dragging, - write_to_console, - } - enum inventory { - fuel, - burnt_result, - chest, - furnace_source, - furnace_result, - furnace_modules, - character_main, - character_guns, - character_ammo, - character_armor, - character_vehicle, - character_trash, - god_main, - editor_main, - editor_guns, - editor_ammo, - editor_armor, - roboport_robot, - roboport_material, - robot_cargo, - robot_repair, - assembling_machine_input, - assembling_machine_output, - assembling_machine_modules, - lab_input, - lab_modules, - mining_drill_modules, - item_main, - rocket_silo_rocket, - rocket_silo_result, - rocket, - car_trunk, - car_ammo, - cargo_wagon, - turret_ammo, - beacon_modules, - character_corpse, - artillery_turret_ammo, - artillery_wagon_ammo, - spider_trunk, - spider_ammo, - spider_trash, - } - enum logistic_member_index { - logistic_container, - vehicle_storage, - character_requester, - character_storage, - character_provider, - generic_on_off_behavior, - } - enum logistic_mode { - none, - active_provider, - storage, - requester, - passive_provider, - buffer, - } - enum mouse_button_type { - none, - left, - right, - middle, - } - /** - * A dictionary mapping all top-level prototypes by name to a list of their associated subtypes. This list is - * organized as a lookup table, meaning it maps the sub-prototype names to `0`. As an example, - * `defines.prototypes['entity']` looks like this: `{furnace=0, inserter=0, container=0, ...}`. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.prototypes View documentation} - */ - const prototypes: { - readonly [Type in string]?: { - readonly [Name in string]?: 0 & { - _notFalsyBrand: any - } - } - } - enum rail_connection_direction { - left, - straight, - right, - none, - } - enum rail_direction { - front, - back, - } - enum relative_gui_position { - top, - bottom, - left, - right, - } - enum relative_gui_type { - accumulator_gui, - achievement_gui, - additional_entity_info_gui, - admin_gui, - arithmetic_combinator_gui, - armor_gui, - assembling_machine_gui, - assembling_machine_select_recipe_gui, - beacon_gui, - blueprint_book_gui, - blueprint_library_gui, - blueprint_setup_gui, - bonus_gui, - burner_equipment_gui, - car_gui, - constant_combinator_gui, - container_gui, - controller_gui, - decider_combinator_gui, - deconstruction_item_gui, - electric_energy_interface_gui, - electric_network_gui, - entity_variations_gui, - entity_with_energy_source_gui, - equipment_grid_gui, - furnace_gui, - generic_on_off_entity_gui, - heat_interface_gui, - infinity_pipe_gui, - inserter_gui, - item_with_inventory_gui, - lab_gui, - lamp_gui, - linked_container_gui, - loader_gui, - logistic_gui, - market_gui, - mining_drill_gui, - other_player_gui, - permissions_gui, - pipe_gui, - power_switch_gui, - production_gui, - programmable_speaker_gui, - rail_chain_signal_gui, - rail_signal_gui, - reactor_gui, - rename_stop_gui, - resource_entity_gui, - roboport_gui, - rocket_silo_gui, - server_config_gui, - spider_vehicle_gui, - splitter_gui, - standalone_character_gui, - storage_tank_gui, - tile_variations_gui, - train_gui, - train_stop_gui, - trains_gui, - transport_belt_gui, - upgrade_item_gui, - wall_gui, - } - enum render_mode { - game, - chart, - chart_zoomed_in, - } - enum rich_text_setting { - enabled, - disabled, - highlight, - } - namespace riding { - enum acceleration { - nothing, - accelerating, - braking, - reversing, - } - enum direction { - left, - straight, - right, - } - } - enum shooting { - not_shooting, - shooting_enemies, - shooting_selected, - } - /** - * State of an ordinary rail signal. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.signal_state View documentation} - */ - enum signal_state { - /** - * Green. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.signal_state.open View documentation} - */ - open, - /** - * Red. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.signal_state.closed View documentation} - */ - closed, - /** - * Orange. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.signal_state.reserved View documentation} - */ - reserved, - /** - * Red - From circuit network. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.signal_state.reserved_by_circuit_network View documentation} - */ - reserved_by_circuit_network, - } - enum train_state { - /** - * Normal state -- following the path. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.on_the_path View documentation} - */ - on_the_path, - /** - * Had path and lost it -- must stop. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.path_lost View documentation} - */ - path_lost, - /** - * Doesn't have anywhere to go. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.no_schedule View documentation} - */ - no_schedule, - /** - * Has no path and is stopped. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.no_path View documentation} - */ - no_path, - /** - * Braking before a rail signal. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.arrive_signal View documentation} - */ - arrive_signal, - /** - * Waiting at a signal. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.wait_signal View documentation} - */ - wait_signal, - /** - * Braking before a station. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.arrive_station View documentation} - */ - arrive_station, - /** - * Waiting at a station. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.wait_station View documentation} - */ - wait_station, - /** - * Switched to manual control and has to stop. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.manual_control_stop View documentation} - */ - manual_control_stop, - /** - * Can move if user explicitly sits in and rides the train. - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.manual_control View documentation} - */ - manual_control, - /** - * Same as no_path but all candidate train stops are full - * - * {@link https://lua-api.factorio.com/next/defines.html#defines.train_state.destination_full View documentation} - */ - destination_full, - } - enum transport_line { - left_line, - right_line, - left_underground_line, - right_underground_line, - secondary_left_line, - secondary_right_line, - left_split_line, - right_split_line, - secondary_left_split_line, - secondary_right_split_line, - } - enum wire_connection_id { - electric_pole, - power_switch_left, - power_switch_right, - } - enum wire_type { - red, - green, - copper, - } -} diff --git a/modules/mod2/typed-factorio/generated/events.d.ts b/modules/mod2/typed-factorio/generated/events.d.ts deleted file mode 100644 index b65e09a..0000000 --- a/modules/mod2/typed-factorio/generated/events.d.ts +++ /dev/null @@ -1,2976 +0,0 @@ -/** @noSelfInFile */ - -/** - * Called when a {@link https://wiki.factorio.com/Prototype/CustomInput CustomInput} is activated. - * - * {@link https://lua-api.factorio.com/next/Events.html#CustomInputEvent View documentation} - */ -interface CustomInputEvent { - /** The player that activated the custom input. */ - readonly player_index: uint - /** The prototype name of the custom input that was activated. */ - readonly input_name: string - /** The mouse cursor position when the custom input was activated. */ - readonly cursor_position: Position - /** Information about the prototype that is selected when the custom input is used. `nil` if none is selected. */ - readonly selected_prototype?: SelectedPrototypeData - /** Identifier of the event */ - readonly name: string - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a unit/group completes a command. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_ai_command_completed View documentation} - */ -interface OnAiCommandCompletedEvent { - /** Unit_number/group_number of the unit/group which just completed a command. */ - readonly unit_number: uint - readonly result: defines.behavior_result - /** Was this command generated by a distraction. */ - readonly was_distracted: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_ai_command_completed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an area of the map is cloned. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_area_cloned View documentation} - */ -interface OnAreaClonedEvent { - readonly source_surface: LuaSurface - readonly source_area: BoundingBox - readonly destination_surface: LuaSurface - readonly destination_area: BoundingBox - readonly destination_force?: LuaForce - readonly clone_tiles: boolean - readonly clone_entities: boolean - readonly clone_decoratives: boolean - readonly clear_destination_entities: boolean - readonly clear_destination_decoratives: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_area_cloned - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a biter migration builds a base. - * - * **Note**: This will be called multiple times for each migration, once for every biter that is sacrificed to build - * part of the new base. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_biter_base_built View documentation} - */ -interface OnBiterBaseBuiltEvent { - /** The entity that was built. */ - readonly entity: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_biter_base_built - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a set of positions on the map is cloned. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_brush_cloned View documentation} - */ -interface OnBrushClonedEvent { - readonly source_offset: TilePosition - readonly destination_offset: TilePosition - readonly source_surface: LuaSurface - readonly source_positions: TilePosition[] - readonly destination_surface: LuaSurface - readonly destination_force?: LuaForce - readonly clone_tiles: boolean - readonly clone_entities: boolean - readonly clone_decoratives: boolean - readonly clear_destination_entities: boolean - readonly clear_destination_decoratives: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_brush_cloned - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a {@link defines.command.build_base} command reaches its destination, and before building starts. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_build_base_arrived View documentation} - */ -interface OnBuildBaseArrivedEvent { - /** The unit the command was assigned to. */ - readonly unit?: LuaEntity - /** The unit group the command was assigned to. */ - readonly group?: LuaUnitGroup - /** Identifier of the event */ - readonly name: typeof defines.events.on_build_base_arrived - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when player builds something. Can be filtered using {@link LuaPlayerBuiltEntityEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_built_entity View documentation} - */ -interface OnBuiltEntityEvent { - readonly created_entity: LuaEntity - readonly player_index: uint - readonly stack: LuaItemStack - /** The item prototype used to build the entity. Note this won't exist in some situations (built from blueprint, undo, etc). */ - readonly item?: LuaItemPrototype - /** The tags associated with this entity if any. */ - readonly tags?: Tags - /** Identifier of the event */ - readonly name: typeof defines.events.on_built_entity - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the deconstruction of an entity is canceled. Can be filtered using - * {@link LuaEntityDeconstructionCancelledEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_cancelled_deconstruction View documentation} - */ -interface OnCancelledDeconstructionEvent { - readonly entity: LuaEntity - readonly player_index?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_cancelled_deconstruction - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the upgrade of an entity is canceled. Can be filtered using {@link LuaUpgradeCancelledEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_cancelled_upgrade View documentation} - */ -interface OnCancelledUpgradeEvent { - readonly entity: LuaEntity - readonly player_index?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_cancelled_upgrade - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a character corpse expires due to timeout or all of the items being removed from it. - * - * **Note**: this is not called if the corpse is mined. See {@link defines.events.on_pre_player_mined_item} to detect that. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_character_corpse_expired View documentation} - */ -interface OnCharacterCorpseExpiredEvent { - /** The corpse. */ - readonly corpse: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_character_corpse_expired - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a chart tag is created. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_chart_tag_added View documentation} - */ -interface OnChartTagAddedEvent { - readonly tag: LuaCustomChartTag - readonly force: LuaForce - readonly player_index?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_chart_tag_added - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a chart tag is modified by a player. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_chart_tag_modified View documentation} - */ -interface OnChartTagModifiedEvent { - readonly tag: LuaCustomChartTag - readonly player_index?: uint - readonly force: LuaForce - readonly old_text: string - readonly old_icon?: SignalID - readonly old_player?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_chart_tag_modified - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called just before a chart tag is deleted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_chart_tag_removed View documentation} - */ -interface OnChartTagRemovedEvent { - readonly tag: LuaCustomChartTag - readonly force: LuaForce - readonly player_index?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_chart_tag_removed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a chunk is charted or re-charted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_chunk_charted View documentation} - */ -interface OnChunkChartedEvent { - readonly surface_index: uint - readonly position: ChunkPosition - /** Area of the chunk. */ - readonly area: BoundingBox - readonly force: LuaForce - /** Identifier of the event */ - readonly name: typeof defines.events.on_chunk_charted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when one or more chunks are deleted using {@link LuaSurface.delete_chunk LuaSurface::delete_chunk}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_chunk_deleted View documentation} - */ -interface OnChunkDeletedEvent { - readonly surface_index: uint - /** The chunks deleted. */ - readonly positions: ChunkPosition[] - /** Identifier of the event */ - readonly name: typeof defines.events.on_chunk_deleted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a chunk is generated. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_chunk_generated View documentation} - */ -interface OnChunkGeneratedEvent { - /** Area of the chunk. */ - readonly area: BoundingBox - /** Position of the chunk. */ - readonly position: ChunkPosition - /** The surface the chunk is on. */ - readonly surface: LuaSurface - /** Identifier of the event */ - readonly name: typeof defines.events.on_chunk_generated - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a combat robot expires through a lack of energy, or timeout. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_combat_robot_expired View documentation} - */ -interface OnCombatRobotExpiredEvent { - readonly robot: LuaEntity - /** The entity that owns the robot if any. */ - readonly owner?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_combat_robot_expired - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a message is sent to the in-game console, either by a player or through the server interface. - * - * **Note**: This event only fires for plain messages, not for any commands (including `/shout` or `/whisper`). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_console_chat View documentation} - */ -interface OnConsoleChatEvent { - /** The player doing the chatting, if any. */ - readonly player_index?: uint - /** The chat message that was sent. */ - readonly message: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_console_chat - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when someone enters a command-like message regardless of it being a valid command. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_console_command View documentation} - */ -interface OnConsoleCommandEvent { - /** The player if any. */ - readonly player_index?: uint - /** The command as typed without the preceding forward slash ('/'). */ - readonly command: string - /** The parameters provided if any. */ - readonly parameters: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_console_command - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a cutscene is cancelled by the player or by script. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_cutscene_cancelled View documentation} - */ -interface OnCutsceneCancelledEvent { - /** The player the cutscene was shown to. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_cutscene_cancelled - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a cutscene is playing, each time it reaches a waypoint in that cutscene. - * - * This refers to an index in the table previously passed to set_controller which started the cutscene. - * - * **Note**: Due to implementation omission, waypoint_index is 0-based. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_cutscene_waypoint_reached View documentation} - */ -interface OnCutsceneWaypointReachedEvent { - /** The player index of the player viewing the cutscene. */ - readonly player_index: uint - /** The index of the waypoint we just completed. */ - readonly waypoint_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_cutscene_waypoint_reached - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the map difficulty settings are changed. - * - * **Note**: It's not guaranteed that both settings are changed - just that at least one has been changed. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_difficulty_settings_changed View documentation} - */ -interface OnDifficultySettingsChangedEvent { - readonly old_recipe_difficulty: uint - readonly old_technology_difficulty: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_difficulty_settings_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity is cloned. Can be filtered for the source entity using {@link LuaEntityClonedEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_entity_cloned View documentation} - */ -interface OnEntityClonedEvent { - readonly source: LuaEntity - readonly destination: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_entity_cloned - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity is damaged. Can be filtered using {@link LuaEntityDamagedEventFilter}. - * - * **Note**: This is not called when an entities health is set directly by another mod. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_entity_damaged View documentation} - */ -interface OnEntityDamagedEvent { - readonly entity: LuaEntity - readonly damage_type: LuaDamagePrototype - /** The damage amount before resistances. */ - readonly original_damage_amount: float - /** The damage amount after resistances. */ - readonly final_damage_amount: float - /** The health of the entity after the damage was applied. */ - readonly final_health: float - /** The entity that did the attacking if available. */ - readonly cause?: LuaEntity - /** The force that did the attacking if any. */ - readonly force?: LuaForce - /** Identifier of the event */ - readonly name: typeof defines.events.on_entity_damaged - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after an entity is destroyed that has been registered with - * {@link LuaBootstrap.register_on_entity_destroyed LuaBootstrap::register_on_entity_destroyed} - * - * **Note**: Depending on when a given entity is destroyed this will be fired at the end of the current tick or end of - * the next tick. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_entity_destroyed View documentation} - */ -interface OnEntityDestroyedEvent { - readonly registration_number: uint64 - readonly unit_number?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_entity_destroyed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity dies. Can be filtered using {@link LuaEntityDiedEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_entity_died View documentation} - */ -interface OnEntityDiedEvent { - /** The entity that died. */ - readonly entity: LuaEntity - /** The entity that did the killing if available. */ - readonly cause?: LuaEntity - /** The loot generated by this entity if any. */ - readonly loot: LuaInventory - /** The force that did the killing if any. */ - readonly force?: LuaForce - /** The damage type if any. */ - readonly damage_type?: LuaDamagePrototype - /** Identifier of the event */ - readonly name: typeof defines.events.on_entity_died - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when one of an entity's personal logistic slots changes. - * - * **Note**: "Personal logistic slot" refers to a character or vehicle's personal request / auto-trash slots, not the - * request slots on logistic chests. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_entity_logistic_slot_changed View documentation} - */ -interface OnEntityLogisticSlotChangedEvent { - /** The player who changed the slot, or `nil` if changed by script. */ - readonly player_index?: uint - /** The entity for whom a logistic slot was changed. */ - readonly entity: LuaEntity - /** The slot index that was changed. */ - readonly slot_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_entity_logistic_slot_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after an entity has been renamed either by the player or through script. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_entity_renamed View documentation} - */ -interface OnEntityRenamedEvent { - /** If by_script is true this will not be included. */ - readonly player_index?: uint - readonly by_script: boolean - readonly entity: LuaEntity - readonly old_name: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_entity_renamed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after entity copy-paste is done. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_entity_settings_pasted View documentation} - */ -interface OnEntitySettingsPastedEvent { - readonly player_index: uint - /** The source entity settings were copied from. */ - readonly source: LuaEntity - /** The destination entity settings were copied to. */ - readonly destination: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_entity_settings_pasted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity is spawned by a EnemySpawner - * - * {@link https://lua-api.factorio.com/next/Events.html#on_entity_spawned View documentation} - */ -interface OnEntitySpawnedEvent { - readonly spawner: LuaEntity - readonly entity: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_entity_spawned - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after equipment is inserted into an equipment grid. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_equipment_inserted View documentation} - */ -interface OnEquipmentInsertedEvent { - /** The equipment grid inserted into. */ - readonly grid: LuaEquipmentGrid - /** The equipment inserted. */ - readonly equipment: LuaEquipment - /** Identifier of the event */ - readonly name: typeof defines.events.on_equipment_inserted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after equipment is removed from an equipment grid. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_equipment_removed View documentation} - */ -interface OnEquipmentRemovedEvent { - /** The equipment grid removed from. */ - readonly grid: LuaEquipmentGrid - /** The equipment removed. */ - readonly equipment: string - /** The count of equipment removed. */ - readonly count: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_equipment_removed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the a forces cease fire values change. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_force_cease_fire_changed View documentation} - */ -interface OnForceCeaseFireChangedEvent { - /** The force who's cease fire changed. */ - readonly force: LuaForce - /** Which force was added or removed. */ - readonly other_force: LuaForce - /** If the other force was added or removed. */ - readonly added: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_force_cease_fire_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a new force is created using `game.create_force()` - * - * **Note**: This is not called when the default forces (`'player'`, `'enemy'`, `'neutral'`) are created as they will - * always exist. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_force_created View documentation} - */ -interface OnForceCreatedEvent { - /** The newly created force. */ - readonly force: LuaForce - /** Identifier of the event */ - readonly name: typeof defines.events.on_force_created - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the a forces friends change. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_force_friends_changed View documentation} - */ -interface OnForceFriendsChangedEvent { - /** The force who's friends changed. */ - readonly force: LuaForce - /** Which force was added or removed. */ - readonly other_force: LuaForce - /** If the other force was added or removed. */ - readonly added: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_force_friends_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaForce.reset LuaForce::reset} is finished. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_force_reset View documentation} - */ -interface OnForceResetEvent { - readonly force: LuaForce - /** Identifier of the event */ - readonly name: typeof defines.events.on_force_reset - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after two forces have been merged using `game.merge_forces()`. - * - * **Note**: The source force is invalidated before this event is called and the name can be re-used in this event if desired. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_forces_merged View documentation} - */ -interface OnForcesMergedEvent { - /** The force destroyed. */ - readonly source_name: string - /** The index of the destroyed force. */ - readonly source_index: uint - /** The force entities where reassigned to. */ - readonly destination: LuaForce - /** Identifier of the event */ - readonly name: typeof defines.events.on_forces_merged - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when two forces are about to be merged using `game.merge_forces()`. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_forces_merging View documentation} - */ -interface OnForcesMergingEvent { - /** The force to be destroyed */ - readonly source: LuaForce - /** The force to reassign entities to. */ - readonly destination: LuaForce - /** Identifier of the event */ - readonly name: typeof defines.events.on_forces_merging - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a game is created from a scenario. This is fired for every mod, even when the scenario's save data - * already includes it. In those cases however, {@link LuaBootstrap.on_init LuaBootstrap::on_init} is not fired. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_game_created_from_scenario View documentation} - */ -interface OnGameCreatedFromScenarioEvent { - /** Identifier of the event */ - readonly name: typeof defines.events.on_game_created_from_scenario - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} checked state is changed (related to checkboxes and radio buttons). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_checked_state_changed View documentation} - */ -interface OnGuiCheckedStateChangedEvent { - /** The element whose checked state changed. */ - readonly element: LuaGuiElement - /** The player who did the change. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_checked_state_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} is clicked. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_click View documentation} - */ -interface OnGuiClickEvent { - /** The clicked element. */ - readonly element: LuaGuiElement - /** The player who did the clicking. */ - readonly player_index: uint - /** The mouse button used if any. */ - readonly button: defines.mouse_button_type - /** If alt was pressed. */ - readonly alt: boolean - /** If control was pressed. */ - readonly control: boolean - /** If shift was pressed. */ - readonly shift: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_click - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the player closes the GUI they have open. - * - * **Note**: This is only called if the player explicitly closed the GUI. - * - * **Note**: It's not advised to open any other GUI during this event because if this is run as a request to open a - * different GUI the game will force close the new opened GUI without notice to ensure the original requested GUI is opened. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_closed View documentation} - */ -interface OnGuiClosedEvent { - /** The player. */ - readonly player_index: uint - /** The GUI type that was open. */ - readonly gui_type: defines.gui_type - /** The entity that was open */ - readonly entity?: LuaEntity - /** The item that was open */ - readonly item?: LuaItemStack - /** The equipment that was open */ - readonly equipment?: LuaEquipment - /** The other player that was open */ - readonly other_player?: LuaPlayer - /** The custom GUI element that was open */ - readonly element?: LuaGuiElement - /** The technology that was automatically selected when opening the research GUI */ - readonly technology?: LuaTechnology - /** The tile position that was open */ - readonly tile_position?: TilePosition - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_closed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a {@link LuaGuiElement} is confirmed, for example by pressing Enter in a textfield. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_confirmed View documentation} - */ -interface OnGuiConfirmedEvent { - /** The confirmed element. */ - readonly element: LuaGuiElement - /** The player who did the confirming. */ - readonly player_index: uint - /** If alt was pressed. */ - readonly alt: boolean - /** If control was pressed. */ - readonly control: boolean - /** If shift was pressed. */ - readonly shift: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_confirmed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} element value is changed (related to choose element buttons). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_elem_changed View documentation} - */ -interface OnGuiElemChangedEvent { - /** The element whose element value changed. */ - readonly element: LuaGuiElement - /** The player who did the change. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_elem_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} element location is changed (related to frames in `player.gui.screen`). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_location_changed View documentation} - */ -interface OnGuiLocationChangedEvent { - /** The element whose location changed. */ - readonly element: LuaGuiElement - /** The player who did the change. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_location_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the player opens a GUI. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_opened View documentation} - */ -interface OnGuiOpenedEvent { - /** The player. */ - readonly player_index: uint - /** The GUI type that was opened. */ - readonly gui_type: defines.gui_type - /** The entity that was opened */ - readonly entity?: LuaEntity - /** The item that was opened */ - readonly item?: LuaItemStack - /** The equipment that was opened */ - readonly equipment?: LuaEquipment - /** The other player that was opened */ - readonly other_player?: LuaPlayer - /** The custom GUI element that was opened */ - readonly element?: LuaGuiElement - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_opened - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} selected tab is changed (related to tabbed-panes). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_selected_tab_changed View documentation} - */ -interface OnGuiSelectedTabChangedEvent { - /** The tabbed pane whose selected tab changed. */ - readonly element: LuaGuiElement - /** The player who did the change. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_selected_tab_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} selection state is changed (related to drop-downs and listboxes). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_selection_state_changed View documentation} - */ -interface OnGuiSelectionStateChangedEvent { - /** The element whose selection state changed. */ - readonly element: LuaGuiElement - /** The player who did the change. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_selection_state_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} switch state is changed (related to switches). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_switch_state_changed View documentation} - */ -interface OnGuiSwitchStateChangedEvent { - /** The switch whose switch state changed. */ - readonly element: LuaGuiElement - /** The player who did the change. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_switch_state_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} text is changed by the player. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_text_changed View documentation} - */ -interface OnGuiTextChangedEvent { - /** The edited element. */ - readonly element: LuaGuiElement - /** The player who did the edit. */ - readonly player_index: uint - /** The new text in the element. */ - readonly text: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_text_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaGuiElement} slider value is changed (related to the slider element). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_gui_value_changed View documentation} - */ -interface OnGuiValueChangedEvent { - /** The element whose value changed. */ - readonly element: LuaGuiElement - /** The player who did the change. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_gui_value_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a land mine is armed. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_land_mine_armed View documentation} - */ -interface OnLandMineArmedEvent { - readonly mine: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_land_mine_armed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a custom Lua shortcut is pressed. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_lua_shortcut View documentation} - */ -interface OnLuaShortcutEvent { - readonly player_index: uint - /** Shortcut prototype name of the shortcut that was clicked. */ - readonly prototype_name: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_lua_shortcut - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity is marked for deconstruction with the Deconstruction planner or via script. Can be filtered - * using {@link LuaEntityMarkedForDeconstructionEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_marked_for_deconstruction View documentation} - */ -interface OnMarkedForDeconstructionEvent { - readonly entity: LuaEntity - readonly player_index?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_marked_for_deconstruction - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity is marked for upgrade with the Upgrade planner or via script. Can be filtered using - * {@link LuaEntityMarkedForUpgradeEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_marked_for_upgrade View documentation} - */ -interface OnMarkedForUpgradeEvent { - readonly entity: LuaEntity - readonly target: LuaEntityPrototype - readonly player_index?: uint - /** The new direction (if any) */ - readonly direction?: defines.direction - /** Identifier of the event */ - readonly name: typeof defines.events.on_marked_for_upgrade - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player purchases some offer from a `market` entity. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_market_item_purchased View documentation} - */ -interface OnMarketItemPurchasedEvent { - /** The player who did the purchasing. */ - readonly player_index: uint - /** The market entity. */ - readonly market: LuaEntity - /** The index of the offer purchased. */ - readonly offer_index: uint - /** The amount of offers purchased. */ - readonly count: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_market_item_purchased - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the player uses the 'Open item GUI' control on an item defined with the 'mod-openable' flag - * - * {@link https://lua-api.factorio.com/next/Events.html#on_mod_item_opened View documentation} - */ -interface OnModItemOpenedEvent { - /** The player. */ - readonly player_index: uint - /** The item clicked on. */ - readonly item: LuaItemPrototype - /** Identifier of the event */ - readonly name: typeof defines.events.on_mod_item_opened - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called directly after a permission group is added. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_permission_group_added View documentation} - */ -interface OnPermissionGroupAddedEvent { - /** The player that added the group. */ - readonly player_index: uint - /** The group added. */ - readonly group: LuaPermissionGroup - /** Identifier of the event */ - readonly name: typeof defines.events.on_permission_group_added - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called directly after a permission group is deleted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_permission_group_deleted View documentation} - */ -interface OnPermissionGroupDeletedEvent { - /** The player doing the deletion. */ - readonly player_index: uint - /** The group that was deleted. */ - readonly group_name: string - /** The group id that was deleted. */ - readonly id: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_permission_group_deleted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called directly after a permission group is edited in some way. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_permission_group_edited View documentation} - */ -interface OnPermissionGroupEditedEvent { - /** The player that did the editing. */ - readonly player_index: uint - /** The group being edited. */ - readonly group: LuaPermissionGroup - /** The edit type: "add-permission", "remove-permission", "enable-all", "disable-all", "add-player", "remove-player", "rename". */ - readonly type: - | "add-permission" - | "remove-permission" - | "enable-all" - | "disable-all" - | "add-player" - | "remove-player" - | "rename" - /** The action when the `type` is "add-permission" or "remove-permission". */ - readonly action: defines.input_action - /** The other player when the `type` is "add-player" or "remove-player". */ - readonly other_player_index: uint - /** The old group name when the `type` is "rename". */ - readonly old_name: string - /** The new group name when the `type` is "rename". */ - readonly new_name: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_permission_group_edited - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called directly after a permission string is imported. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_permission_string_imported View documentation} - */ -interface OnPermissionStringImportedEvent { - /** The player that imported the string. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_permission_string_imported - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player picks up an item. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_picked_up_item View documentation} - */ -interface OnPickedUpItemEvent { - readonly item_stack: SimpleItemStack - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_picked_up_item - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player alt-selects an area with a selection-tool item. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_alt_selected_area View documentation} - */ -interface OnPlayerAltSelectedAreaEvent { - /** The player doing the selection. */ - readonly player_index: uint - /** The surface selected. */ - readonly surface: LuaSurface - /** The area selected. */ - readonly area: BoundingBox - /** The item used to select the area. */ - readonly item: string - /** The entities selected. */ - readonly entities: LuaEntity[] - /** The tiles selected. */ - readonly tiles: LuaTile[] - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_alt_selected_area - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a players ammo inventory changed in some way. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_ammo_inventory_changed View documentation} - */ -interface OnPlayerAmmoInventoryChangedEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_ammo_inventory_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a players armor inventory changed in some way. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_armor_inventory_changed View documentation} - */ -interface OnPlayerArmorInventoryChangedEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_armor_inventory_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player is banned. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_banned View documentation} - */ -interface OnPlayerBannedEvent { - /** The player banned. */ - readonly player_index?: uint - /** The banned player name. */ - readonly player_name: string - /** The player that did the banning if any. */ - readonly by_player?: uint - /** The reason given if any. */ - readonly reason?: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_banned - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player builds tiles. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_built_tile View documentation} - */ -interface OnPlayerBuiltTileEvent { - readonly player_index: uint - /** The surface the tile(s) were built on. */ - readonly surface_index: uint - /** The position data. */ - readonly tiles: OldTileAndPosition[] - /** The tile prototype that was placed. */ - readonly tile: LuaTilePrototype - /** The item type used to build the tiles */ - readonly item?: LuaItemPrototype - /** The stack used to build the tiles (may be empty if all of the items where used to build the tiles). */ - readonly stack?: LuaItemStack - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_built_tile - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player cancels crafting. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_cancelled_crafting View documentation} - */ -interface OnPlayerCancelledCraftingEvent { - /** The player that did the crafting. */ - readonly player_index: uint - /** The crafting items returned to the player's inventory. */ - readonly items: LuaInventory - /** The recipe that has been cancelled. */ - readonly recipe: LuaRecipe - /** The number of crafts that have been cancelled. */ - readonly cancel_count: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_cancelled_crafting - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player changes forces. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_changed_force View documentation} - */ -interface OnPlayerChangedForceEvent { - /** The player who changed forces. */ - readonly player_index: uint - /** The old force. */ - readonly force: LuaForce - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_changed_force - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the tile position a player is located at changes. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_changed_position View documentation} - */ -interface OnPlayerChangedPositionEvent { - /** The player. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_changed_position - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player changes surfaces. - * - * **Note**: In the instance a player is moved off a surface due to it being deleted this is not called. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_changed_surface View documentation} - */ -interface OnPlayerChangedSurfaceEvent { - /** The player who changed surfaces. */ - readonly player_index: uint - /** The surface index the player was on. */ - readonly surface_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_changed_surface - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when cheat mode is disabled on a player. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_cheat_mode_disabled View documentation} - */ -interface OnPlayerCheatModeDisabledEvent { - /** The player. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_cheat_mode_disabled - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when cheat mode is enabled on a player. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_cheat_mode_enabled View documentation} - */ -interface OnPlayerCheatModeEnabledEvent { - /** The player. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_cheat_mode_enabled - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player clicks a gps tag - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_clicked_gps_tag View documentation} - */ -interface OnPlayerClickedGpsTagEvent { - /** Index of the player */ - readonly player_index: uint - /** Map position contained in gps tag */ - readonly position: Position - /** Surface name contained in gps tag, even when such surface does not exists */ - readonly surface: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_clicked_gps_tag - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player clicks the "confirm" button in the configure Blueprint GUI. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_configured_blueprint View documentation} - */ -interface OnPlayerConfiguredBlueprintEvent { - /** The player. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_configured_blueprint - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player configures spidertron remote to be connected with a given spidertron - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_configured_spider_remote View documentation} - */ -interface OnPlayerConfiguredSpiderRemoteEvent { - /** The player that configured the remote. */ - readonly player_index: uint - /** Spider vehicle to which remote was connected to. */ - readonly vehicle: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_configured_spider_remote - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the player finishes crafting an item. This event fires just before the results are inserted into the - * player's inventory, not when the crafting is queued (see {@link OnPrePlayerCraftedItemEvent on_pre_player_crafted_item}). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_crafted_item View documentation} - */ -interface OnPlayerCraftedItemEvent { - /** The item that has been crafted. */ - readonly item_stack: LuaItemStack - /** The player doing the crafting. */ - readonly player_index: uint - /** The recipe used to craft this item. */ - readonly recipe: LuaRecipe - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_crafted_item - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after the player was created. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_created View documentation} - */ -interface OnPlayerCreatedEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_created - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a players cursorstack changed in some way. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_cursor_stack_changed View documentation} - */ -interface OnPlayerCursorStackChangedEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_cursor_stack_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player selects an area with a deconstruction planner. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_deconstructed_area View documentation} - */ -interface OnPlayerDeconstructedAreaEvent { - /** The player doing the selection. */ - readonly player_index: uint - /** The surface selected. */ - readonly surface: LuaSurface - /** The area selected. */ - readonly area: BoundingBox - /** The item used to select the area. */ - readonly item: string - /** If normal selection or alt selection was used. */ - readonly alt: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_deconstructed_area - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player is demoted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_demoted View documentation} - */ -interface OnPlayerDemotedEvent { - /** The player. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_demoted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player dies. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_died View documentation} - */ -interface OnPlayerDiedEvent { - readonly player_index: uint - readonly cause?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_died - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the display resolution changes for a given player. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_display_resolution_changed View documentation} - */ -interface OnPlayerDisplayResolutionChangedEvent { - /** The player */ - readonly player_index: uint - /** The old display resolution */ - readonly old_resolution: DisplayResolution - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_display_resolution_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the display scale changes for a given player. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_display_scale_changed View documentation} - */ -interface OnPlayerDisplayScaleChangedEvent { - /** The player */ - readonly player_index: uint - /** The old display scale */ - readonly old_scale: double - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_display_scale_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the player's driving state has changed, this means a player has either entered or left a vehicle. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_driving_changed_state View documentation} - */ -interface OnPlayerDrivingChangedStateEvent { - readonly player_index: uint - /** The vehicle if any. */ - readonly entity?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_driving_changed_state - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player drops an item on the ground. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_dropped_item View documentation} - */ -interface OnPlayerDroppedItemEvent { - readonly player_index: uint - /** The item-on-ground entity. */ - readonly entity: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_dropped_item - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player fast-transfers something to or from an entity. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_fast_transferred View documentation} - */ -interface OnPlayerFastTransferredEvent { - /** The player transferred from or to. */ - readonly player_index: uint - /** The entity transferred from or to. */ - readonly entity: LuaEntity - /** Whether the transfer was from player to entity. If `false`, the transfer was from entity to player. */ - readonly from_player: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_fast_transferred - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after player flushed fluid - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_flushed_fluid View documentation} - */ -interface OnPlayerFlushedFluidEvent { - /** Index of the player */ - readonly player_index: uint - /** Name of a fluid that was flushed */ - readonly fluid: string - /** Amount of fluid that was removed */ - readonly amount: double - /** Entity from which flush was performed */ - readonly entity: LuaEntity - /** True if flush was requested only on this entity */ - readonly only_this_entity: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_flushed_fluid - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a players gun inventory changed in some way. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_gun_inventory_changed View documentation} - */ -interface OnPlayerGunInventoryChangedEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_gun_inventory_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player joins the game. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_joined_game View documentation} - */ -interface OnPlayerJoinedGameEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_joined_game - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player is kicked. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_kicked View documentation} - */ -interface OnPlayerKickedEvent { - /** The player kicked. */ - readonly player_index: uint - /** The player that did the kicking if any. */ - readonly by_player?: uint - /** The reason given if any. */ - readonly reason?: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_kicked - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player leaves the game. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_left_game View documentation} - */ -interface OnPlayerLeftGameEvent { - readonly player_index: uint - readonly reason: defines.disconnect_reason - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_left_game - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a players main inventory changed in some way. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_main_inventory_changed View documentation} - */ -interface OnPlayerMainInventoryChangedEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_main_inventory_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after the results of an entity being mined are collected just before the entity is destroyed. After this event - * any items in the buffer will be transferred into the player as if they came from mining the entity. Can be filtered - * using {@link LuaPlayerMinedEntityEventFilter}. - * - * **Note**: The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding - * as more items are transferred into it. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_mined_entity View documentation} - */ -interface OnPlayerMinedEntityEvent { - /** The index of the player doing the mining. */ - readonly player_index: uint - /** The entity that has been mined. */ - readonly entity: LuaEntity - /** The temporary inventory that holds the result of mining the entity. */ - readonly buffer: LuaInventory - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_mined_entity - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the player mines something. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_mined_item View documentation} - */ -interface OnPlayerMinedItemEvent { - /** The item given to the player */ - readonly item_stack: SimpleItemStack - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_mined_item - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player mines tiles. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_mined_tile View documentation} - */ -interface OnPlayerMinedTileEvent { - readonly player_index: uint - /** The surface the tile(s) were mined from. */ - readonly surface_index: uint - /** The position data. */ - readonly tiles: OldTileAndPosition[] - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_mined_tile - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player is muted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_muted View documentation} - */ -interface OnPlayerMutedEvent { - /** The player. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_muted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player invokes the "smart pipette" over an entity. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_pipette View documentation} - */ -interface OnPlayerPipetteEvent { - /** The player */ - readonly player_index: uint - /** The item put in the cursor */ - readonly item: LuaItemPrototype - /** If cheat mode was used to give a free stack of the item. */ - readonly used_cheat_mode: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_pipette - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after the player puts equipment in an equipment grid - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_placed_equipment View documentation} - */ -interface OnPlayerPlacedEquipmentEvent { - readonly player_index: uint - /** The equipment put in the equipment grid. */ - readonly equipment: LuaEquipment - /** The equipment grid the equipment was put in. */ - readonly grid: LuaEquipmentGrid - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_placed_equipment - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player is promoted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_promoted View documentation} - */ -interface OnPlayerPromotedEvent { - /** The player. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_promoted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player is removed (deleted) from the game. Not to be confused with the player logging of this is - * different in that the player is deleted as if he never existed in the save file. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_removed View documentation} - */ -interface OnPlayerRemovedEvent { - /** The player index that was removed */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_removed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after the player removes equipment from an equipment grid - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_removed_equipment View documentation} - */ -interface OnPlayerRemovedEquipmentEvent { - readonly player_index: uint - /** The equipment grid removed from. */ - readonly grid: LuaEquipmentGrid - /** The equipment removed. */ - readonly equipment: string - /** The count of equipment removed. */ - readonly count: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_removed_equipment - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player repairs an entity. Can be filtered using {@link LuaPlayerRepairedEntityEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_repaired_entity View documentation} - */ -interface OnPlayerRepairedEntityEvent { - readonly player_index: uint - readonly entity: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_repaired_entity - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player respawns. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_respawned View documentation} - */ -interface OnPlayerRespawnedEvent { - readonly player_index: uint - /** The player port used to respawn if one was used. */ - readonly player_port?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_respawned - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the player rotates an entity. This event is only fired when the entity actually changes its orientation - * -- pressing the rotate key on an entity that can't be rotated won't fire this event. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_rotated_entity View documentation} - */ -interface OnPlayerRotatedEntityEvent { - /** The rotated entity. */ - readonly entity: LuaEntity - /** The previous direction */ - readonly previous_direction: defines.direction - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_rotated_entity - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a player selects an area with a selection-tool item. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_selected_area View documentation} - */ -interface OnPlayerSelectedAreaEvent { - /** The player doing the selection. */ - readonly player_index: uint - /** The surface selected. */ - readonly surface: LuaSurface - /** The area selected. */ - readonly area: BoundingBox - /** The item used to select the area. */ - readonly item: string - /** The entities selected. */ - readonly entities: LuaEntity[] - /** The tiles selected. */ - readonly tiles: LuaTile[] - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_selected_area - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player sets a quickbar slot to anything (new value, or set to empty). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_set_quick_bar_slot View documentation} - */ -interface OnPlayerSetQuickBarSlotEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_set_quick_bar_slot - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player selects an area with a blueprint. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_setup_blueprint View documentation} - */ -interface OnPlayerSetupBlueprintEvent { - /** The player doing the selection. */ - readonly player_index: uint - /** The surface selected. */ - readonly surface: LuaSurface - /** The area selected. */ - readonly area: BoundingBox - /** The item used to select the area. */ - readonly item: string - /** If normal selection or alt selection was used. */ - readonly alt: boolean - /** The blueprint entity index to source entity mapping. Note: if any mod changes the blueprint this will be incorrect. */ - readonly mapping: LuaLazyLoadedValue> - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_setup_blueprint - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player toggles alt mode, also known as "show entity info". - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_toggled_alt_mode View documentation} - */ -interface OnPlayerToggledAltModeEvent { - readonly player_index: uint - /** - * The new alt mode value. This value is a shortcut for accessing - * {@link GameViewSettings.show_entity_info GameViewSettings::show_entity_info} on the player. - */ - readonly alt_mode: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_toggled_alt_mode - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player toggles the map editor on or off. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_toggled_map_editor View documentation} - */ -interface OnPlayerToggledMapEditorEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_toggled_map_editor - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a players trash inventory changed in some way. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_trash_inventory_changed View documentation} - */ -interface OnPlayerTrashInventoryChangedEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_trash_inventory_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player is un-banned. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_unbanned View documentation} - */ -interface OnPlayerUnbannedEvent { - /** The player un-banned. */ - readonly player_index?: uint - /** The player name un-banned. */ - readonly player_name: string - /** The player that did the un-banning if any. */ - readonly by_player?: uint - /** The reason the player was banned if any. */ - readonly reason?: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_unbanned - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player is unmuted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_unmuted View documentation} - */ -interface OnPlayerUnmutedEvent { - /** The player. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_unmuted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player uses a capsule that results in some game action. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_used_capsule View documentation} - */ -interface OnPlayerUsedCapsuleEvent { - /** The player. */ - readonly player_index: uint - /** The capsule item used. */ - readonly item: LuaItemPrototype - /** The position the capsule was used. */ - readonly position: Position - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_used_capsule - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player uses spidertron remote to send a spidertron to a given position - * - * {@link https://lua-api.factorio.com/next/Events.html#on_player_used_spider_remote View documentation} - */ -interface OnPlayerUsedSpiderRemoteEvent { - /** The player that used the remote. */ - readonly player_index: uint - /** Spider vehicle which was requested to move. */ - readonly vehicle: LuaEntity - /** Goal position to which spidertron was sent to. */ - readonly position: Position - /** If the use was successful. It may fail when spidertron has different driver or when player is on different surface. */ - readonly success: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_player_used_spider_remote - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after an entity dies. Can be filtered using {@link LuaPostEntityDiedEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_post_entity_died View documentation} - */ -interface OnPostEntityDiedEvent { - /** The ghost created by the entity dying if any. */ - readonly ghost?: LuaEntity - /** The force that did the killing if any. */ - readonly force?: LuaForce - /** Position where the entity died. */ - readonly position: Position - /** The entity prototype of the entity that died. */ - readonly prototype: LuaEntityPrototype - /** The damage type if any. */ - readonly damage_type?: LuaDamagePrototype - /** The corpses created by the entity dying if any. */ - readonly corpses: LuaEntity[] - /** The surface the entity was on. */ - readonly surface_index: uint - /** The unit number the entity had if any. */ - readonly unit_number?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_post_entity_died - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when players uses an item to build something. Called before {@link OnBuiltEntityEvent on_built_entity}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_build View documentation} - */ -interface OnPreBuildEvent { - /** The player who did the placing. */ - readonly player_index: uint - /** Where the item was placed. */ - readonly position: Position - /** Item was placed using shift building. */ - readonly shift_build: boolean - /** The direction the item was facing when placed. */ - readonly direction: defines.direction - /** If building this blueprint was flipped horizontally. */ - readonly flip_horizontal: boolean - /** If building this blueprint was flipped vertically. */ - readonly flip_vertical: boolean - /** Item was placed while moving. */ - readonly created_by_moving: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_build - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called before one or more chunks are deleted using {@link LuaSurface.delete_chunk LuaSurface::delete_chunk}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_chunk_deleted View documentation} - */ -interface OnPreChunkDeletedEvent { - readonly surface_index: uint - /** The chunks to be deleted. */ - readonly positions: ChunkPosition[] - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_chunk_deleted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called before entity copy-paste is done. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_entity_settings_pasted View documentation} - */ -interface OnPreEntitySettingsPastedEvent { - readonly player_index: uint - /** The source entity settings will be copied from. */ - readonly source: LuaEntity - /** The destination entity settings will be copied to. */ - readonly destination: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_entity_settings_pasted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called before a ghost entity is destroyed as a result of being marked for deconstruction. Can be filtered using - * {@link LuaPreGhostDeconstructedEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_ghost_deconstructed View documentation} - */ -interface OnPreGhostDeconstructedEvent { - /** The player that did the deconstruction if any. */ - readonly player_index?: uint - readonly ghost: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_ghost_deconstructed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called directly before a permission group is deleted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_permission_group_deleted View documentation} - */ -interface OnPrePermissionGroupDeletedEvent { - /** The player doing the deletion. */ - readonly player_index: uint - /** The group to be deleted. */ - readonly group: LuaPermissionGroup - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_permission_group_deleted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called directly before a permission string is imported. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_permission_string_imported View documentation} - */ -interface OnPrePermissionStringImportedEvent { - /** The player importing the string. */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_permission_string_imported - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a player queues something to be crafted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_player_crafted_item View documentation} - */ -interface OnPrePlayerCraftedItemEvent { - /** The player doing the crafting. */ - readonly player_index: uint - /** The recipe being queued. */ - readonly recipe: LuaRecipe - /** The items removed from the players inventory to do the crafting. */ - readonly items: LuaInventory - /** The number of times the recipe is being queued. */ - readonly queued_count: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_player_crafted_item - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called before a players dies. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_player_died View documentation} - */ -interface OnPrePlayerDiedEvent { - readonly player_index: uint - readonly cause?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_player_died - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called before a player leaves the game. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_player_left_game View documentation} - */ -interface OnPrePlayerLeftGameEvent { - readonly player_index: uint - readonly reason: defines.disconnect_reason - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_player_left_game - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the player finishes mining an entity, before the entity is removed from map. Can be filtered using - * {@link LuaPrePlayerMinedEntityEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_player_mined_item View documentation} - */ -interface OnPrePlayerMinedItemEvent { - /** The entity being mined */ - readonly entity: LuaEntity - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_player_mined_item - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called before a player is removed (deleted) from the game. Not to be confused with the player logging of this is - * different in that the player is deleted as if he never existed in the save file. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_player_removed View documentation} - */ -interface OnPrePlayerRemovedEvent { - /** The player index that will be removed */ - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_player_removed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called before a player toggles the map editor on or off. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_player_toggled_map_editor View documentation} - */ -interface OnPrePlayerToggledMapEditorEvent { - readonly player_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_player_toggled_map_editor - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called directly before a robot explodes cliffs. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_robot_exploded_cliff View documentation} - */ -interface OnPreRobotExplodedCliffEvent { - readonly robot: LuaEntity - readonly cliff: LuaEntity - /** The cliff explosive used. */ - readonly item: LuaItemPrototype - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_robot_exploded_cliff - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called just before a script inventory is resized. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_script_inventory_resized View documentation} - */ -interface OnPreScriptInventoryResizedEvent { - /** If done by console command; the player who ran the command. */ - readonly player_index?: uint - /** The mod that did the resizing. This will be `"core"` if done by console command or scenario script. */ - readonly mod: string - readonly inventory: LuaInventory - /** The old inventory size. */ - readonly old_size: uint - /** The new inventory size. */ - readonly new_size: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_script_inventory_resized - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called just before a surface is cleared (all entities removed and all chunks deleted). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_surface_cleared View documentation} - */ -interface OnPreSurfaceClearedEvent { - readonly surface_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_surface_cleared - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called just before a surface is deleted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_pre_surface_deleted View documentation} - */ -interface OnPreSurfaceDeletedEvent { - readonly surface_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_pre_surface_deleted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a research finishes. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_research_finished View documentation} - */ -interface OnResearchFinishedEvent { - /** The researched technology */ - readonly research: LuaTechnology - /** If the technology was researched by script. */ - readonly by_script: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_research_finished - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a research is reversed (unresearched). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_research_reversed View documentation} - */ -interface OnResearchReversedEvent { - /** The technology un-researched */ - readonly research: LuaTechnology - /** If the technology was un-researched by script. */ - readonly by_script: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_research_reversed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a technology research starts. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_research_started View documentation} - */ -interface OnResearchStartedEvent { - /** The technology being researched */ - readonly research: LuaTechnology - readonly last_research?: LuaTechnology - /** Identifier of the event */ - readonly name: typeof defines.events.on_research_started - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a resource entity reaches 0 or its minimum yield for infinite resources. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_resource_depleted View documentation} - */ -interface OnResourceDepletedEvent { - readonly entity: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_resource_depleted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a construction robot builds an entity. Can be filtered using {@link LuaRobotBuiltEntityEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_robot_built_entity View documentation} - */ -interface OnRobotBuiltEntityEvent { - /** The robot that did the building. */ - readonly robot: LuaEntity - /** The entity built. */ - readonly created_entity: LuaEntity - /** The item used to do the building. */ - readonly stack: LuaItemStack - /** The tags associated with this entity if any. */ - readonly tags?: Tags - /** Identifier of the event */ - readonly name: typeof defines.events.on_robot_built_entity - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a robot builds tiles. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_robot_built_tile View documentation} - */ -interface OnRobotBuiltTileEvent { - /** The robot. */ - readonly robot: LuaEntity - /** The position data. */ - readonly tiles: OldTileAndPosition[] - /** The tile prototype that was placed. */ - readonly tile: LuaTilePrototype - /** The item type used to build the tiles. */ - readonly item: LuaItemPrototype - /** The stack used to build the tiles (may be empty if all of the items where used to build the tiles). */ - readonly stack: LuaItemStack - /** The surface the tile(s) are build on. */ - readonly surface_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_robot_built_tile - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called directly after a robot explodes cliffs. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_robot_exploded_cliff View documentation} - */ -interface OnRobotExplodedCliffEvent { - readonly robot: LuaEntity - /** The cliff explosive used. */ - readonly item: LuaItemPrototype - /** Identifier of the event */ - readonly name: typeof defines.events.on_robot_exploded_cliff - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a robot mines an entity. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_robot_mined View documentation} - */ -interface OnRobotMinedEvent { - /** The robot that did the mining. */ - readonly robot: LuaEntity - /** The entity the robot just picked up. */ - readonly item_stack: SimpleItemStack - /** Identifier of the event */ - readonly name: typeof defines.events.on_robot_mined - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after the results of an entity being mined are collected just before the entity is destroyed. After this event - * any items in the buffer will be transferred into the robot as if they came from mining the entity. Can be filtered - * using {@link LuaRobotMinedEntityEventFilter}. - * - * **Note**: The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding - * as more items are transferred into it. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_robot_mined_entity View documentation} - */ -interface OnRobotMinedEntityEvent { - /** The robot doing the mining. */ - readonly robot: LuaEntity - /** The entity that has been mined. */ - readonly entity: LuaEntity - /** The temporary inventory that holds the result of mining the entity. */ - readonly buffer: LuaInventory - /** Identifier of the event */ - readonly name: typeof defines.events.on_robot_mined_entity - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a robot mines tiles. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_robot_mined_tile View documentation} - */ -interface OnRobotMinedTileEvent { - /** The robot. */ - readonly robot: LuaEntity - /** The position data. */ - readonly tiles: OldTileAndPosition[] - /** The surface the tile(s) were mined on. */ - readonly surface_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_robot_mined_tile - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called before a robot mines an entity. Can be filtered using {@link LuaPreRobotMinedEntityEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_robot_pre_mined View documentation} - */ -interface OnRobotPreMinedEvent { - /** The robot that's about to do the mining. */ - readonly robot: LuaEntity - /** The entity which is about to be mined. */ - readonly entity: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_robot_pre_mined - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a rocket silo is ordered to be launched. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_rocket_launch_ordered View documentation} - */ -interface OnRocketLaunchOrderedEvent { - readonly rocket: LuaEntity - readonly rocket_silo: LuaEntity - /** The player that is riding the rocket, if any. */ - readonly player_index?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_rocket_launch_ordered - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when the rocket is launched. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_rocket_launched View documentation} - */ -interface OnRocketLaunchedEvent { - readonly rocket: LuaEntity - readonly rocket_silo?: LuaEntity - /** The player that is riding the rocket, if any. */ - readonly player_index?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_rocket_launched - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a runtime mod setting is changed by a player. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_runtime_mod_setting_changed View documentation} - */ -interface OnRuntimeModSettingChangedEvent { - /** - * If the `setting_type` is `"global"` and it was changed through the mod settings GUI, this is the index of the - * player that changed the global setting. If the `setting_type` is `"runtime-per-user"` and it changed a current - * setting of the player, this is the index of the player whose setting was changed. In all other cases, this is `nil`. - */ - readonly player_index?: uint - /** The prototype name of the setting that was changed. */ - readonly setting: string - /** Either "runtime-per-user" or "runtime-global". */ - readonly setting_type: "runtime-per-user" | "runtime-global" - /** Identifier of the event */ - readonly name: typeof defines.events.on_runtime_mod_setting_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called just after a script inventory is resized. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_script_inventory_resized View documentation} - */ -interface OnScriptInventoryResizedEvent { - /** If done by console command; the player who ran the command. */ - readonly player_index?: uint - /** The mod that did the resizing. This will be `"core"` if done by console command or scenario script. */ - readonly mod: string - readonly inventory: LuaInventory - /** The old inventory size. */ - readonly old_size: uint - /** The new inventory size. */ - readonly new_size: uint - /** Any items which didn't fit into the new inventory size. */ - readonly overflow_inventory: LuaInventory - /** Identifier of the event */ - readonly name: typeof defines.events.on_script_inventory_resized - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a {@link LuaSurface.request_path LuaSurface::request_path} call completes. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_script_path_request_finished View documentation} - */ -interface OnScriptPathRequestFinishedEvent { - /** The actual path that the pathfinder has determined. `nil` if pathfinding failed. */ - readonly path?: PathfinderWaypoint[] - /** Handle to associate the callback with a particular call to {@link LuaSurface.request_path LuaSurface::request_path}. */ - readonly id: uint - /** Indicates that the pathfinder failed because it is too busy, and that you can retry later. */ - readonly try_again_later: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_script_path_request_finished - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a script trigger effect is triggered. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_script_trigger_effect View documentation} - */ -interface OnScriptTriggerEffectEvent { - /** The effect_id specified in the trigger effect. */ - readonly effect_id: string - /** The surface the effect happened on. */ - readonly surface_index: uint - readonly source_position?: Position - readonly source_entity?: LuaEntity - readonly target_position?: Position - readonly target_entity?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_script_trigger_effect - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity of type `radar` finishes scanning a sector. Can be filtered for the radar using - * {@link LuaSectorScannedEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_sector_scanned View documentation} - */ -interface OnSectorScannedEvent { - /** The radar that did the scanning. */ - readonly radar: LuaEntity - /** The chunk scanned. */ - readonly chunk_position: ChunkPosition - /** Area of the scanned chunk. */ - readonly area: BoundingBox - /** Identifier of the event */ - readonly name: typeof defines.events.on_sector_scanned - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after the selected entity changes for a given player. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_selected_entity_changed View documentation} - */ -interface OnSelectedEntityChangedEvent { - /** The player whose selected entity changed. */ - readonly player_index: uint - /** The last selected entity if it still exists and there was one. */ - readonly last_entity?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_selected_entity_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a spider finishes moving to its autopilot position. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_spider_command_completed View documentation} - */ -interface OnSpiderCommandCompletedEvent { - /** Spider vehicle which was requested to move. */ - readonly vehicle: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_spider_command_completed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a translation request generated through - * {@link LuaPlayer.request_translation LuaPlayer::request_translation} is translated. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_string_translated View documentation} - */ -interface OnStringTranslatedEvent { - /** The player whose locale was used for the translation. */ - readonly player_index: uint - /** The localised string being translated. */ - readonly localised_string: LocalisedString - /** The translated `localised_string`. */ - readonly result: string - /** Whether the requested localised string was valid and could be translated. */ - readonly translated: boolean - /** Identifier of the event */ - readonly name: typeof defines.events.on_string_translated - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called just after a surface is cleared (all entities removed and all chunks deleted). - * - * {@link https://lua-api.factorio.com/next/Events.html#on_surface_cleared View documentation} - */ -interface OnSurfaceClearedEvent { - readonly surface_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_surface_cleared - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a surface is created. - * - * **Note**: This is not called when the default surface is created as it will always exist. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_surface_created View documentation} - */ -interface OnSurfaceCreatedEvent { - readonly surface_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_surface_created - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a surface is deleted. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_surface_deleted View documentation} - */ -interface OnSurfaceDeletedEvent { - readonly surface_index: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_surface_deleted - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called after a surface is imported. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_surface_imported View documentation} - */ -interface OnSurfaceImportedEvent { - readonly surface_index: uint - /** The original surface name. */ - readonly original_name: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_surface_imported - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a surface is renamed. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_surface_renamed View documentation} - */ -interface OnSurfaceRenamedEvent { - readonly surface_index: uint - readonly old_name: string - readonly new_name: string - /** Identifier of the event */ - readonly name: typeof defines.events.on_surface_renamed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when {@link LuaForce.reset_technology_effects LuaForce::reset_technology_effects} is finished. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_technology_effects_reset View documentation} - */ -interface OnTechnologyEffectsResetEvent { - readonly force: LuaForce - /** Identifier of the event */ - readonly name: typeof defines.events.on_technology_effects_reset - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * It is fired once every tick. Since this event is fired every tick, its handler shouldn't include performance heavy code. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_tick View documentation} - */ -interface OnTickEvent { - /** Identifier of the event */ - readonly name: typeof defines.events.on_tick - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a train changes state (started to stopped and vice versa) - * - * {@link https://lua-api.factorio.com/next/Events.html#on_train_changed_state View documentation} - */ -interface OnTrainChangedStateEvent { - readonly train: LuaTrain - readonly old_state: defines.train_state - /** Identifier of the event */ - readonly name: typeof defines.events.on_train_changed_state - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a new train is created either through disconnecting/connecting an existing one or building a new one. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_train_created View documentation} - */ -interface OnTrainCreatedEvent { - readonly train: LuaTrain - /** The first old train id when splitting/merging trains. */ - readonly old_train_id_1?: uint - /** The second old train id when splitting/merging trains. */ - readonly old_train_id_2?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_train_created - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a trains schedule is changed either by the player or through script. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_train_schedule_changed View documentation} - */ -interface OnTrainScheduleChangedEvent { - readonly train: LuaTrain - /** The player who made the change if any. */ - readonly player_index?: uint - /** Identifier of the event */ - readonly name: typeof defines.events.on_train_schedule_changed - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity with a trigger prototype (such as capsules) create an entity AND that trigger prototype defined - * `trigger_created_entity="true"`. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_trigger_created_entity View documentation} - */ -interface OnTriggerCreatedEntityEvent { - readonly entity: LuaEntity - readonly source?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_trigger_created_entity - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when an entity with a trigger prototype (such as capsules) fire an artillery projectile AND that trigger - * prototype defined `trigger_fired_artillery="true"`. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_trigger_fired_artillery View documentation} - */ -interface OnTriggerFiredArtilleryEvent { - readonly entity: LuaEntity - readonly source?: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_trigger_fired_artillery - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a unit is added to a unit group. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_unit_added_to_group View documentation} - */ -interface OnUnitAddedToGroupEvent { - readonly unit: LuaEntity - readonly group: LuaUnitGroup - /** Identifier of the event */ - readonly name: typeof defines.events.on_unit_added_to_group - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a new unit group is created, before any members are added to it. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_unit_group_created View documentation} - */ -interface OnUnitGroupCreatedEvent { - readonly group: LuaUnitGroup - /** Identifier of the event */ - readonly name: typeof defines.events.on_unit_group_created - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a unit group finishes gathering and starts executing its command. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_unit_group_finished_gathering View documentation} - */ -interface OnUnitGroupFinishedGatheringEvent { - readonly group: LuaUnitGroup - /** Identifier of the event */ - readonly name: typeof defines.events.on_unit_group_finished_gathering - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a unit is removed from a unit group. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_unit_removed_from_group View documentation} - */ -interface OnUnitRemovedFromGroupEvent { - readonly unit: LuaEntity - readonly group: LuaUnitGroup - /** Identifier of the event */ - readonly name: typeof defines.events.on_unit_removed_from_group - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * Called when a worker (construction or logistic) robot expires through a lack of energy. - * - * {@link https://lua-api.factorio.com/next/Events.html#on_worker_robot_expired View documentation} - */ -interface OnWorkerRobotExpiredEvent { - readonly robot: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.on_worker_robot_expired - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * A static event mods can use to tell other mods they built something by script. This event is only raised if a mod - * does so with {@link LuaBootstrap.raise_event LuaBootstrap::raise_event} or - * {@link LuaBootstrap.raise_script_built LuaBootstrap::raise_script_built}, or when `raise_built` is passed to - * {@link LuaSurface.create_entity LuaSurface::create_entity}. Can be filtered using {@link LuaScriptRaisedBuiltEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#script_raised_built View documentation} - */ -interface ScriptRaisedBuiltEvent { - /** The entity that has been built. */ - readonly entity: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.script_raised_built - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * A static event mods can use to tell other mods they destroyed something by script. This event is only raised if a mod - * does so with {@link LuaBootstrap.raise_event LuaBootstrap::raise_event} or - * {@link LuaBootstrap.raise_script_destroy LuaBootstrap::raise_script_destroy}, or when `raise_destroy` is passed to - * {@link LuaEntity.destroy LuaEntity::destroy}. Can be filtered using {@link LuaScriptRaisedDestroyEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#script_raised_destroy View documentation} - */ -interface ScriptRaisedDestroyEvent { - /** The entity that was destroyed. */ - readonly entity: LuaEntity - /** Identifier of the event */ - readonly name: typeof defines.events.script_raised_destroy - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * A static event mods can use to tell other mods they revived something by script. This event is only raised if a mod - * does so with {@link LuaBootstrap.raise_event LuaBootstrap::raise_event} or - * {@link LuaBootstrap.raise_script_revive LuaBootstrap::raise_script_revive}, or when `raise_revive` is passed to - * {@link LuaEntity.revive LuaEntity::revive}. Can be filtered using {@link LuaScriptRaisedReviveEventFilter}. - * - * {@link https://lua-api.factorio.com/next/Events.html#script_raised_revive View documentation} - */ -interface ScriptRaisedReviveEvent { - /** The entity that was revived. */ - readonly entity: LuaEntity - /** The tags associated with this entity, if any. */ - readonly tags?: Tags - /** Identifier of the event */ - readonly name: typeof defines.events.script_raised_revive - /** Tick the event was generated. */ - readonly tick: uint -} - -/** - * A static event mods can use to tell other mods they changed tiles on a surface by script. This event is only raised - * if a mod does so with {@link LuaBootstrap.raise_event LuaBootstrap::raise_event} or - * {@link LuaBootstrap.raise_script_set_tiles LuaBootstrap::raise_script_set_tiles}, or when `raise_event` is passed to - * {@link LuaSurface.set_tiles LuaSurface::set_tiles}. - * - * {@link https://lua-api.factorio.com/next/Events.html#script_raised_set_tiles View documentation} - */ -interface ScriptRaisedSetTilesEvent { - /** The surface whose tiles were changed. */ - readonly surface_index: uint - /** The tiles that were changed. */ - readonly tiles: Tile[] - /** Identifier of the event */ - readonly name: typeof defines.events.script_raised_set_tiles - /** Tick the event was generated. */ - readonly tick: uint -} - -/** An event id. */ -type EventId = uint & { - readonly _eventData: T - readonly _filter: F -} - -/** - * An event id generated by {@link LuaBootstrap.generate_event_name LuaBootstrap::generate_event_name} and raisable via - * {@link LuaBootstrap.raise_event LuaBootstrap::raise_event}. - */ -type CustomEventId = EventId & { - _customEventIdBrand: any -} diff --git a/modules/mod2/typed-factorio/generated/global-objects.d.ts b/modules/mod2/typed-factorio/generated/global-objects.d.ts deleted file mode 100644 index f4c5a0f..0000000 --- a/modules/mod2/typed-factorio/generated/global-objects.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** @noSelfInFile */ - -/** - * This is the main object, through which most of the API is accessed. It is, however, not available inside handlers - * registered with {@link LuaBootstrap.on_load LuaBootstrap::on_load}. - * - * {@link https://lua-api.factorio.com/next/ View documentation} - */ -declare const game: LuaGameScript - -/** - * Provides an interface for registering event handlers. - * - * {@link https://lua-api.factorio.com/next/ View documentation} - */ -declare const script: LuaBootstrap - -/** - * Allows inter-mod communication by way of providing a repository of interfaces that is shared by all mods. - * - * {@link https://lua-api.factorio.com/next/ View documentation} - */ -declare const remote: LuaRemote - -/** - * Allows registering custom commands for the in-game console accessible via the grave key. - * - * {@link https://lua-api.factorio.com/next/ View documentation} - */ -declare const commands: LuaCommandProcessor - -/** - * Allows reading the current mod settings. - * - * {@link https://lua-api.factorio.com/next/ View documentation} - */ -declare const settings: LuaSettings - -/** - * Allows printing messages to the calling RCON instance if any. - * - * {@link https://lua-api.factorio.com/next/ View documentation} - */ -declare const rcon: LuaRCON - -/** - * Allows rendering of geometric shapes, text and sprites in the game world. - * - * {@link https://lua-api.factorio.com/next/ View documentation} - */ -declare const rendering: LuaRendering diff --git a/modules/mod2/typed-factorio/generated/index.d.ts b/modules/mod2/typed-factorio/generated/index.d.ts deleted file mode 100644 index 4a7b7d8..0000000 --- a/modules/mod2/typed-factorio/generated/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -/// -/// -/// -/// -/// -/// diff --git a/modules/mod2/typed-factorio/package.json b/modules/mod2/typed-factorio/package.json deleted file mode 100644 index 6a0eb5a..0000000 --- a/modules/mod2/typed-factorio/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "typed-factorio", - "version": "0.7.1", - "description": "Featureful typescript definitions for the the Factorio modding lua api.", - "keywords": [ - "factorio", - "types", - "typescript-to-lua", - "tstl" - ], - "repository": "https://github.com/GlassBricks/typed-factorio", - "license": "MIT", - "files": [ - "**/*.d.ts" - ], - "homepage": "https://github.com/GlassBricks/typed-factorio#readme", - "scripts": { - "generate": "cd ../generator && yarn run check && yarn run gen --in ../definitions/generatorSrc --out ../definitions/generated --warn-as-error", - "generate:dev": "cd ../generator && yarn run gen --in ../definitions/generatorSrc --out ../definitions/generated --no-format", - "clean": "rimraf ./generated", - "pretest": "yarn run generate", - "test": "jest", - "prepublishOnly": "yarn run test", - "download-latest-runtime-api": "ts-node ./scripts/downloadLatest.ts" - }, - "dependencies": { - "lua-types": "^2.10.1", - "typescript": "~4.3.5", - "typescript-to-lua": "^1.0.0" - }, - "devDependencies": { - "@types/jest": "^26.0.24", - "@types/node": "^16.4.13", - "jest": "^27.0.6", - "prettier": "^2.3.2", - "ts-jest": "^27.0.4", - "ts-node": "^10.1.0" - } -} diff --git a/modules/mod2/typed-factorio/runtime/index.d.ts b/modules/mod2/typed-factorio/runtime/index.d.ts deleted file mode 100644 index 43bdc07..0000000 --- a/modules/mod2/typed-factorio/runtime/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -/// - -/// -/// - -// lualib -/// -/// diff --git a/modules/mod2/typed-factorio/runtime/librariesAndFunctions.d.ts b/modules/mod2/typed-factorio/runtime/librariesAndFunctions.d.ts deleted file mode 100644 index 82a0f31..0000000 --- a/modules/mod2/typed-factorio/runtime/librariesAndFunctions.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -// from https://lua-api.factorio.com/latest/Libraries.html -// last updated for 1.1.35, 1.1.36, 1.1.37 - -/** @noSelfInFile */ - -/** @noSelf */ -interface SerpentOptions { - /** Indentation; triggers long multi-line output. */ - indent: string - /** Provide stringified value in a comment (up to maxlevel of depth). */ - comment: boolean | number - /** Sort keys. */ - sortkeys: boolean | ((this: void, keys: any[], table: any) => void) - /** Force sparse encoding (no nil filling based on #t). */ - sparse: boolean - /** Remove spaces. */ - compact: boolean - /** Raise fatal error on non-serializable values. */ - fatal: boolean - /** Disable bytecode serialization for easy comparison. */ - nocode: boolean - /** Disable checking numbers against undefined and huge values. */ - nohuge: boolean - /** Specify max level up to which to expand nested tables. */ - maxlevel: number - /** Specify max number of elements in a table. */ - maxnum: number - /** Specify max length for all table elements. */ - maxlength: number - /** - * Use __tostring metamethod when serializing tables (v0.29); set to false to disable and serialize the table as is, - * even when __tostring is present. - */ - metatostring: boolean - /** - * Specify format for numeric values as shortest possible round-trippable double (v0.30). Use "%.16g" for better - * readability and "%.17g" (the default value) to preserve floating point precision. - */ - numformat: string - /** Allows to specify a list of values to ignore (as keys). */ - valignore: string[] - /** Allows to specify the list of keys to be serialized. Any keys not in this list are not included in final output (as keys). */ - keyallow: string[] - /** Allows to specity the list of keys to ignore in serialization. */ - keyignore: string[] - /** Allows to specify a list of value types to ignore (as keys). */ - valtypeignore: string[] - /** Provide custom output for tables. */ - custom(opts: { - /** The name of the current element with '=' or an empty string in case of array index, */ - tag: string - /** An opening table bracket { and associated indentation and newline (if any), */ - head: string - /** Table elements concatenated into a string using commas and indentation/newlines (if any), */ - body: string - /** A closing table bracket } and associated indentation and newline (if any), and */ - tail: string - /** The current level. */ - level: number - }): string - /** Name; triggers full serialization with self-ref section. */ - name: string - - refcomment: boolean | number - tablecomment: boolean | number -} - -/** - * Factorio provides the {@link https://github.com/pkulchenko/serpent serpent library} as a global variable `serpent` for - * all mods to use. It allows for easy debugging of tables, because serpent makes it trivial to print them, for example - * by using `serpent.block()`. However, serpent cannot pretty-print LuaObjects such as LuaEntity. The serpent library - * was modified to improve determinism, e.g. comments are turned off by default to avoid returning table addresses. - * Furthermore, two options were added: `refcomment` (true/false/maxlevel) and `tablecomment` (true/false/maxlevel), - * which allow to separately control the self-reference and table value output of the `comment` option. - */ -declare namespace serpent { - /** Full serialization; sets name, compact and sparse options; */ - function dump(tbl: unknown, options?: Partial): string - - /** Single line pretty printing, no self-ref section; sets sortkeys and comment options; */ - function line(tbl: unknown, options?: Partial): string - - /** Multi-line indented pretty printing, no self-ref section; sets indent, sortkeys, and comment options. */ - function block(tbl: unknown, options?: Partial): string - - /** - * For loading serialized fragments, serpent also provides `load` function that adds safety checks and reports an - * error if there is any executable code in the fragment. - */ - function load(str: string, options?: { safe?: boolean }): LuaMultiReturn<[true, T] | [false, string]> -} - -/** - * This function allows to log {@link LocalisedString} to the Factorio - * {@link https://wiki.factorio.com/Log_file log file}. This, in combination with serpent, makes debugging in the data - * stage easier, because it allows to simply inspect entire prototype tables. For example, this allows to see all - * properties of the sulfur item prototype: `log(serpent.block(data.raw["item"]["sulfur"]))` - */ -declare function log(ls: LocalisedString): void - -/** - * This function allows printing {@link LocalisedString}s to stdout without polluting the logfile. This is primarily - * useful for communicating with external tools that launch Factorio as a child process. - */ -declare function localised_print(ls: LocalisedString): void - -/** - * Factorio provides the function `table_size()` as a simple way to find the size of tables with non-continuous keys, - * because the standard `#` does not work correctly for these. The function is a C++-side implementation of the - * following Lua code, thus it is faster than using this code in Lua: - * - * local function size(t) - * local count = 0 - * for k,v in pairs(t) do - * count = count + 1 - * end - * return count - * end - * - * Note that `table_size()` does not work correctly for {@link LuaCustomTable}s, their size has to be determined with - * {@link LuaCustomTable.length LuaCustomTable::operator #} instead. - */ -declare function table_size(tbl: table): number diff --git a/modules/mod2/typed-factorio/runtime/mod-gui.d.ts b/modules/mod2/typed-factorio/runtime/mod-gui.d.ts deleted file mode 100644 index 761a98f..0000000 --- a/modules/mod2/typed-factorio/runtime/mod-gui.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** @noSelfInFile */ - -/** @noResolution */ -declare module "mod-gui" { - const button_style: string - const frame_style: string - - function get_button_flow(player: LuaPlayer): FrameGuiElement - - function get_frame_flow(player: LuaPlayer): FlowGuiElement -} diff --git a/modules/mod2/typed-factorio/runtime/pairs.d.ts b/modules/mod2/typed-factorio/runtime/pairs.d.ts deleted file mode 100644 index 2ec352f..0000000 --- a/modules/mod2/typed-factorio/runtime/pairs.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** @noSelfInFile */ - -/** Iterating with `pairs` will only iterate the array part of a {@link LuaCustomTable}. */ -declare function pairs(table: LuaCustomTable): LuaIterable> - -declare function pairs(table: LuaCustomTable): LuaIterable> - -/** - * {@link LuaCustomTable} cannot be iterated with `ipairs`. Use `pairs` instead. - * - * @deprecated - */ -declare function ipairs(table: LuaCustomTable): never diff --git a/modules/mod2/typed-factorio/runtime/util.d.ts b/modules/mod2/typed-factorio/runtime/util.d.ts deleted file mode 100644 index 08ed5e0..0000000 --- a/modules/mod2/typed-factorio/runtime/util.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -// "util" is declared only as a module, even though it also modifies global variables -// This is both because of limitations in `declare module`, and that modules are much friendlier to tooling. - -/** @noSelfInFile */ - -/** @noResolution */ -declare module "util" { - namespace table { - function deepcopy(table: T): T - - function compare(tb1: T, tb2: T): boolean - } - - function copy(table: T): T - - function distance(position1: Position, position2: Position): number - - function positiontostr(position: Position): string - - function formattime(ticks: number): string - - /** Supports 'rrggbb', 'rgb', 'rrggbbaa', 'rgba', 'ww', 'w' */ - function color(hex: string): ColorTable - - function premul_color(color: Color): ColorTable - - function mix_color(c1: Color, c2: Color): ColorArray - - function multiply_color(c1: Color, n: number): ColorArray - - function moveposition( - position: Position, - direction: defines.direction.north | defines.direction.east | defines.direction.south | defines.direction.west, - distance: number - ): Position - function moveposition( - position: Position, - direction: defines.direction, //todo: cardinal only - distance: number - ): Position | undefined - - function oppositedirection(direction: defines.direction): defines.direction - - /** Creates a new array where each element in `stripes` is duplicated `count` times */ - function multiplystripes(count: number, stripes: T[]): T[] - - /** Gets tile position by pixel */ - function by_pixel(x: number, y: number): Position - - /** Gets tile position by pixel, hr */ - function by_pixel_hr(x: number, y: number): Position - - // omitted: foreach_sprite_definition - - function add_shift(a: PositionArray | undefined, b: PositionArray): PositionArray - function add_shift(a: PositionArray, b: PositionArray | undefined): PositionArray - function add_shift(a: PositionArray | undefined, b: PositionArray | undefined): PositionArray | undefined - - // omitted: add_shift_offset - - function mul_shift(shift: PositionArray, scale: number | undefined): PositionArray - function mul_shift(shift: PositionArray | undefined, scale: number | undefined): PositionArray | undefined - - function format_number(amount: number, append_suffix?: boolean): string - - function increment(t: number[], index: number, v?: number): void - - // omitted: conditional_return - - /** - * Recursively merges and/or deep-copies tables. Entries in later tables override entries in earlier ones, unless both - * entries are themselves tables, in which case they are recursively merged. Non-merged tables are deep-copied, so - * that the result is brand new. - */ - function merge(tables: T[]): T - - function insert_safe(entity: LuaEntity | undefined, item_dict: Record | undefined): void - - function remove_safe(entity: LuaEntity | undefined, item_dict: Record | undefined): void - - function split_whitespace(string: string): string[] - - // omitted: split, string_starts_with. already TS functions for that - - // omitted: online_players. use game.connected_players - - function clamp(x: number, lower: number, upper: number): number - - // omitted: get_walkable_tile - - // omitted: combine_icons - // omitted: technology_icons. Create an issue if you really want to see these - - function parse_energy(energy: string): number - - function product_amount( - product: { - probability: number - } & ( - | { - amount: number - } - | { - amount_min: number - amount_max: number - } - ) - ): number - - function empty_sprite(): object - - // omitted: draw_as_glow - // omitted: remove_tile_references - - function remove_from_list(list: T[], value: T): boolean - - function list_to_map(list: T[]): Record - function list_to_map(list: T[]): LuaTable - function list_to_map(list: T): LuaTable -} diff --git a/modules/mod2/typed-factorio/settings/types.d.ts b/modules/mod2/typed-factorio/settings/types.d.ts deleted file mode 100644 index d11dae2..0000000 --- a/modules/mod2/typed-factorio/settings/types.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -// Based off of https://wiki.factorio.com/Tutorial:Mod_settings - -export type SettingType = "bool-setting" | "int-setting" | "double-setting" | "string-setting" - -export interface BaseSettingDefinition { - type: SettingType - /** - * The name of the settings prototype should be unique to avoid mod conflicts since the mod settings are global across - * all mods. Because of that it is recommended to prefix mod settings with your mod name, - */ - name: string - localized_name?: LocalisedString - localized_description?: LocalisedString - - /** - * The order property can be used to change how the mod settings are ordered in the settings gui. Mod settings are sorted - * - * - First by mod - * - Then by the setting "order" string - * - Then finally by the setting name. - */ - order?: string - /** - * The hidden property can be used to hide mod settings from GUIs, so that they cannot be seen or changed by players. - * However, other mods can still access hidden settings. {@link https://forums.factorio.com/83316} - */ - hidden?: boolean - /** - * There are the overall kinds of settings: - * - * - **startup**: This kind of setting is available in the prototype stage, and can not be changed runtime. They have to - * be set to the same values for all players on a server. - * - **runtime-global**: This kind of setting is global to an entire save game and can be changed runtime. On servers, - * only admins can change these settings. - * - **runtime-per-user**: This kind of setting is only available runtime in the control.lua stage and each player has - * their own instance of this setting. When a player joins a server their local setting of "keep mod settings per - * save" determines if the local settings they have set are synced to the loaded save or if the save's settings are used. - * - * This "setting_type" also determines in which tab the setting is showed in the mod settings menu. - */ - - setting_type: "startup" | "runtime-global" | "runtime-per-user" -} -/** A true/false checkbox */ -export interface BoolSettingDefinition extends BaseSettingDefinition { - type: "bool-setting" - /** Defines the default value of the setting, in this case whether the checkbox is checked or not. */ - default_value: boolean - /** - * Only loaded if `hidden = true`. This forces the setting to be of this value. This can be useful for mod - * compatibility. {@link https://forums.factorio.com/viewtopic.php?p=531322#p531322} - */ - forced_value?: boolean -} -/** A signed 64 bit integer textfield (or selection dropdown) */ -export interface IntSettingDefinition extends BaseSettingDefinition { - type: "int-setting" - /** Defines the default value of the setting. */ - default_value: number - /** Defines the lowest possible number. */ - minimum_value?: number - /** Defines the highest possible number. */ - maximum_value?: number - /** - * Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a - * textfield. If only one allowed value is given, the settings is forced to be of that value. - */ - allowed_values?: number[] -} -/** A double precision floating point textfield (or selection dropdown) */ -export interface DoubleSettingDefinition extends BaseSettingDefinition { - type: "double-setting" - /** Defines the default value of the setting. */ - default_value: number - /** Defines the lowest possible number. */ - minimum_value?: number - /** Defines the highest possible number. */ - maximum_value?: number - /** - * Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a - * textfield. If only one allowed value is given, the settings is forced to be of that value. - */ - allowed_values?: number[] -} -/** A string textfield (or selection dropdown) */ -export interface StringSettingDefinition extends BaseSettingDefinition { - type: "string-setting" - /** Defines the default value of the setting. */ - default_value: string - /** Defines whether it's possible for the user to set the textfield to empty and apply the setting. */ - allow_blank?: boolean - /** Whether values that are input by the user should have whitespace removed from both ends of the string. */ - auto_trim?: boolean - /** - * Makes it possible to force the player to choose between the defined strings, creates a dropdown instead of a - * textfield. The strings in the dropdown can be localized (translated) and can have a tooltip, see below. If only one - * allowed value is given, the settings is forced to be of that value. - */ - allowed_values?: string[] -} -/** Setting definitions. See {@link https://wiki.factorio.com/Tutorial:Mod_settings} for more info. */ -export type SettingDefinition = - | BoolSettingDefinition - | IntSettingDefinition - | DoubleSettingDefinition - | StringSettingDefinition - -export interface Data { - readonly raw: { - [T in SettingDefinition["type"]]: Record> - } - /** - * The `data` table expects a specific format for each item in the table. Missing properties will either fall back to - * default values or give an error indicating what's missing. Extra properties that the game isn't looking for are - * simply ignored. - */ - extend(prototypes: SettingDefinition[]): void -} -/** A mapping of mod names to mod version for all enabled mods. */ -export type Mods = Record diff --git a/modules/protoc-gradle-plugin/build.gradle.kts b/modules/protoc-gradle-plugin/build.gradle.kts deleted file mode 100644 index 47892e9..0000000 --- a/modules/protoc-gradle-plugin/build.gradle.kts +++ /dev/null @@ -1,77 +0,0 @@ -plugins { - kotlin("jvm") version "1.5.31" - `kotlin-dsl` - `java-gradle-plugin` - `maven-publish` -} - -gradlePlugin { - plugins { - create("ProtobufAndGradle") { - id = "dev.adamko.pb-and-g" - implementationClass = "dev.adamko.gradle.pbandg.ProtocPluginKt" - description = - "Protobuf & Gradle. Wrapper for protoc to generate code from Proto Buffer files." - } - } -} - -group = "dev.adamko.gradle.pbandg" -version = "0.0.1-SNAPSHOT" - - -val protocConfiguration: Configuration by configurations.creating { - // A configuration meant for consumers that need the implementation of this component - isCanBeResolved = true - isCanBeConsumed = false -} - -val protobufVersion = "3.19.1" -val protocVersion = "3.9.2" - -dependencies { - implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - implementation(kotlin("stdlib")) - - implementation(platform("com.google.protobuf:protobuf-bom:$protobufVersion")) - - implementation("com.google.protobuf:protobuf-java:$protobufVersion") - implementation("com.google.protobuf:protobuf-javalite:$protobufVersion") - implementation("com.google.protobuf:protobuf-kotlin-lite:$protobufVersion") - implementation("com.google.protobuf:protobuf-kotlin:$protobufVersion") - implementation("com.google.protobuf:protoc:$protobufVersion") - - implementation(platform("io.grpc:grpc-bom:1.41.0")) - implementation("io.grpc:grpc-stub:1.41.0") - implementation("io.grpc:grpc-protobuf:1.41.0") - - implementation("io.grpc:grpc-kotlin-stub:1.2.0") - implementation("io.grpc:protoc-gen-grpc-kotlin:1.2.0") - - implementation("javax.annotation:javax.annotation-api:1.3.2") - - implementation( - group = "com.google.protobuf", - name = "protoc", - version = "3.9.2", -// configuration = "", - classifier = "windows-x86_64", - ext = "exe", - ) - - protocConfiguration( - group = "com.google.protobuf", - name = "protoc", - version = protocVersion, -// configuration = "", - classifier = "windows-x86_64", - ext = "exe", - ) - - -} - -repositories { - mavenCentral() -} - diff --git a/modules/protoc-gradle-plugin/src/main/kotlin/dev/adamko/gradle/pbandg/ProtocPlugin.kt b/modules/protoc-gradle-plugin/src/main/kotlin/dev/adamko/gradle/pbandg/ProtocPlugin.kt deleted file mode 100644 index 70080a8..0000000 --- a/modules/protoc-gradle-plugin/src/main/kotlin/dev/adamko/gradle/pbandg/ProtocPlugin.kt +++ /dev/null @@ -1,294 +0,0 @@ -package dev.adamko.gradle.pbandg - -import java.io.File -import java.util.function.Supplier -import org.gradle.api.DefaultTask -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.artifacts.Configuration -import org.gradle.api.artifacts.ExternalDependency -import org.gradle.api.artifacts.ExternalModuleDependency -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.file.RegularFileProperty -import org.gradle.api.plugins.ExtensionAware -import org.gradle.api.provider.Property -import org.gradle.api.provider.Provider -import org.gradle.api.tasks.Exec -import org.gradle.api.tasks.Internal -import org.gradle.api.tasks.OutputDirectory -import org.gradle.api.tasks.Sync -import org.gradle.api.tasks.TaskAction -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.domainObjectContainer -import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.defaultDependencies -import org.gradle.kotlin.dsl.dependencies -import org.gradle.kotlin.dsl.findByType -import org.gradle.kotlin.dsl.getByType -import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.getValue -import org.gradle.kotlin.dsl.withType -import org.gradle.kotlin.dsl.property -import org.gradle.kotlin.dsl.provideDelegate -import org.gradle.kotlin.dsl.register -import org.gradle.nativeplatform.platform.Architecture -import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform -import org.gradle.nativeplatform.platform.internal.DefaultOperatingSystem -import org.gradle.plugins.ide.idea.GenerateIdeaModule -import org.gradle.plugins.ide.idea.IdeaPlugin -import org.gradle.plugins.ide.idea.model.IdeaModel -import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs - - -open class ProtocPlugin : Plugin { - - override fun apply(project: Project) { - - configureIntelliJ(project) - - val protocConfig = - project.extensions.create("protocPluginConfig", ProtocPluginConfig::class, project) - - val protobufCompiler: Configuration = project.configurations.create("protobufCompiler") { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - isTransitive = false - - defaultDependencies { - add(protocConfig.dependency.get()) - } - } - - val protobufLib: Configuration = project.configurations.create("protobufLib") { - isVisible = true - isCanBeConsumed = false - isCanBeResolved = true - isTransitive = false - } - - project.dependencies { - protobufLib("com.google.protobuf:protobuf-javalite:3.19.1") -// implementation("com.google.protobuf:protobuf-javalite:3.19.1") -// implementation("com.google.protobuf:protobuf-kotlin-lite:3.19.1") - } - - /** Download protobuf libs */ - val protoLibsTask = project.tasks.register("protobufLibs") { - group = "protobuf" - description = "Download and extract protobuf libs" - includeEmptyDirs = false - dependsOn(protobufLib) - - val protoLibDir by project.objects.directoryProperty() - .convention(project.layout.buildDirectory.dir("protobuf/libs")) - into(protoLibDir) - - protobufLib - .map { project.zipTree(it) } - .forEach { - logger.lifecycle("protoc lib - $it") - from(it) { - include("**/*.proto") - } - } - } - - // TODO investigate builtBy and sourceDirectorySet? -// project.objects.fileCollection().builtBy() -// val pbSrcSet = project.objects.sourceDirectorySet("protobuf", "protobuf") - - - /** Convert `.proto` files to Kotlin */ - val pbCompileTask = project.tasks.register("protobufCompile") { - group = "protobuf" - dependsOn(protobufCompiler, protoLibsTask) - - standardOutput = System.out - - executable(protobufCompiler.singleFile) - workingDir(temporaryDirFactory) - - val outDir = project.layout.buildDirectory.dir("protobuf/generated-sources") - outputs.dir(outDir) - - val protoLibsDir: Provider = protoLibsTask.map { it.destinationDir } - - val javaOut = workingDir.resolve("java") - val kotlinOut = workingDir.resolve("kotlin") - val protoFile by project.objects.fileProperty() - .convention(project.layout.projectDirectory.file("src/main/proto/FactorioServerLogRecord.proto")) - - val protoFileParent = project.provider { protoFile.asFile.parentFile } - - val isLiteEnabled: Boolean by project.objects.property().convention(true) - - doFirst { - project.delete(workingDir) - - project.mkdir(outDir) - project.mkdir(javaOut) - project.mkdir(kotlinOut) - - val liteOpt: String = when (isLiteEnabled) { - true -> "lite:" - false -> "" - } - - args( - parseSpaceSeparatedArgs( - """ - --proto_path=${protoLibsDir.get()} - --proto_path=${protoFileParent.get()} - --java_out=$liteOpt$javaOut - --kotlin_out=$liteOpt$kotlinOut - $protoFile - """ - ) - ) - } - - doLast { - project.sync { - from(workingDir) - into(outDir) - } - project.delete(workingDir) - } - } - - project.tasks.assemble { dependsOn(pbCompileTask) } - - } - - /** - * IntelliJ requires source dirs are configured first. - * - * https://github.com/google/protobuf-gradle-plugin/blob/master/src/main/groovy/com/google/protobuf/gradle/Utils.groovy#L128 - */ - private fun configureIntelliJ(project: Project) { - - val genSrcDir = project.layout.buildDirectory.dir("protobuf/generated-sources") - val ktGenSrc = genSrcDir.map { it.dir("kotlin") } - val jGenSrc = genSrcDir.map { it.dir("java") } - - project.mkdir(ktGenSrc) - - project.extensions.findByType()?.apply { - project.logger.lifecycle("-------\nadding generated sources $ktGenSrc\n-------") - - project.sourceSets.named("main") { - this.java.srcDir(ktGenSrc) - this.java.srcDir(jGenSrc) - } - -// sourceSets.main.get().kotlin.srcDir(ktGenSrc) - -// sourceSets.main.configure { -// this.kotlin.srcDir(ktGenSrc) -// } - } - - project.plugins.withType { - project.extensions.configure { - this.module.generatedSourceDirs.add(ktGenSrc.get().asFile) - this.module.generatedSourceDirs.add(jGenSrc.get().asFile) - } - } - - project.tasks.withType { - doFirst { - project.mkdir(ktGenSrc) - } - } - } -} - -abstract class ProtocPluginConfig(private val project: Project) { - - val protocWorkingDir: DirectoryProperty = - project.objects.directoryProperty() - .convention(project.rootProject.layout.projectDirectory.dir(".gradle/protoc")) - - val protocVersion: Property = - project.objects.property(String::class).convention("3.19.1") - - val protocGroup: Property = - project.objects.property(String::class).convention("com.google.protobuf") - - val protocArtifactName: Property = - project.objects.property(String::class).convention("protoc") - - val protocArtifactExtension: Property = - project.objects.property(String::class).convention("exe") - - val operatingSystemProvider: Property> = - project.objects.property>() - .convention { DefaultNativePlatform.getCurrentOperatingSystem() } - - /** - * Should return one of - * - * * `linux` - * * `osx` - * * `windows` - */ - val operatingSystemName: Property = - project.objects - .property() - .convention(operatingSystemProvider.map { it.get().toFamilyName() }) - - private val architectureProvider: Provider = - project.provider { DefaultNativePlatform.getCurrentArchitecture() } - - /** - * Should return one of - * - * * `aarch_64` - * * `ppcle_64` - * * `x86_32` - * * `x86_64` - */ - val architectureName: Property = - project.objects - .property() - .convention(architectureProvider.map { it.name.replace("-", "_") }) - - private val classifierProvider: Provider = - project.provider { "${operatingSystemName.get()}-${architectureName.get()}" } - - /** - * Default: concatenate [osFamilyNameProvider] and [architectureProvider] - * - * Should return one of: - * - * * `linux-aarch_64` - * * `linux-ppcle_64` - * * `linux-x86_64` - * * `osx-x86_32` - * * `osx-x86_64` - * * `windows-x86_32` - */ - val classifier: Property = - project.objects - .property() - .convention(classifierProvider) - - - private val dependencyProvider: Provider = - project.provider { - project.dependencies.create( - group = protocGroup.get(), - name = protocArtifactName.get(), - version = protocVersion.get(), - classifier = classifierProvider.get(), - ext = protocArtifactExtension.get(), - ) - } - - val dependency: Property = - project.objects - .property() - .convention(dependencyProvider) - -} diff --git a/modules/server/build.gradle.kts b/modules/server/build.gradle.kts deleted file mode 100644 index f5bde61..0000000 --- a/modules/server/build.gradle.kts +++ /dev/null @@ -1,60 +0,0 @@ -import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig - -plugins { - id("dev.adamko.factoriowebmap.archetype.base") -// kotlin("jvm") - id("io.kvision") version "5.4.1" - kotlin("js") - kotlin("plugin.serialization") -} - -group = "${rootProject.group}.server" -version = rootProject.version - - -val webDir = file("src/main/web") - - -val kvisionVersion = "5.4.1" - -kotlin { - js { - browser { - runTask { - outputFileName = "main.bundle.js" - sourceMaps = false - devServer = KotlinWebpackConfig.DevServer( - open = false, - port = 3000, - proxy = mutableMapOf( - "/kv/*" to "http://localhost:8080", - "/kvws/*" to mapOf("target" to "ws://localhost:8080", "ws" to true) - ), - static = mutableListOf("$buildDir/processedResources/js/main") - ) - } - webpackTask { - outputFileName = "main.bundle.js" - } - testTask { - useKarma { - useChromeHeadless() - } - } - } - binaries.executable() - } - - sourceSets["main"].dependencies { - implementation("io.kvision:kvision:$kvisionVersion") - implementation("io.kvision:kvision-bootstrap:$kvisionVersion") - implementation("io.kvision:kvision-bootstrap-css:$kvisionVersion") - implementation("io.kvision:kvision-i18n:$kvisionVersion") - } - sourceSets["test"].dependencies { - implementation(kotlin("test-js")) - implementation("io.kvision:kvision-testutils:$kvisionVersion") - } - sourceSets["main"].resources.srcDir(webDir) - -} diff --git a/modules/server/src/main/kotlin/com/example/App.kt b/modules/server/src/main/kotlin/com/example/App.kt deleted file mode 100644 index a7c20c1..0000000 --- a/modules/server/src/main/kotlin/com/example/App.kt +++ /dev/null @@ -1,38 +0,0 @@ -package com.example - -import io.kvision.Application -import io.kvision.BootstrapCssModule -import io.kvision.BootstrapModule -import io.kvision.CoreModule -import io.kvision.html.div -import io.kvision.i18n.DefaultI18nManager -import io.kvision.i18n.I18n -import io.kvision.i18n.I18n.tr -import io.kvision.module -import io.kvision.panel.root -import io.kvision.require -import io.kvision.startApplication - -class App : Application() { - init { - require("./css/kvapp.css") - } - - override fun start() { - I18n.manager = - DefaultI18nManager( - mapOf( - "pl" to require("./i18n/messages-pl.json"), - "en" to require("./i18n/messages-en.json") - ) - ) - - root("kvapp") { - div(tr("This is a localized message.")) - } - } -} - -fun main() { - startApplication(::App, module.hot, BootstrapModule, BootstrapCssModule, CoreModule) -} diff --git a/modules/server/src/main/resources/css/kvapp.css b/modules/server/src/main/resources/css/kvapp.css deleted file mode 100644 index e69de29..0000000 diff --git a/modules/server/src/main/resources/i18n/messages-en.po b/modules/server/src/main/resources/i18n/messages-en.po deleted file mode 100644 index 520a528..0000000 --- a/modules/server/src/main/resources/i18n/messages-en.po +++ /dev/null @@ -1,23 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the KVision package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: KVision\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-18 01:34+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: English\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" - -#: ../src/main/kotlin/com/example/App.kt:20 -msgid "This is a localized message." -msgstr "" diff --git a/modules/server/src/main/resources/i18n/messages-pl.po b/modules/server/src/main/resources/i18n/messages-pl.po deleted file mode 100644 index 2431017..0000000 --- a/modules/server/src/main/resources/i18n/messages-pl.po +++ /dev/null @@ -1,23 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the KVision package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: KVision\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-18 01:34+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: Polish\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" - -#: ../src/main/kotlin/com/example/App.kt:20 -msgid "This is a localized message." -msgstr "To jest przetłumaczona wiadomość." diff --git a/modules/server/src/main/resources/i18n/messages.pot b/modules/server/src/main/resources/i18n/messages.pot deleted file mode 100644 index 68feb5b..0000000 --- a/modules/server/src/main/resources/i18n/messages.pot +++ /dev/null @@ -1,8 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Language: \n" - -#: src/main/kotlin/com/example/App.kt:31 -msgid "This is a localized message." -msgstr "" diff --git a/modules/server/src/main/web/index.html b/modules/server/src/main/web/index.html deleted file mode 100644 index b723f01..0000000 --- a/modules/server/src/main/web/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - KVision App - - - -

- - diff --git a/modules/server/src/test/kotlin/test/com/example/AppSpec.kt b/modules/server/src/test/kotlin/test/com/example/AppSpec.kt deleted file mode 100644 index 33d8534..0000000 --- a/modules/server/src/test/kotlin/test/com/example/AppSpec.kt +++ /dev/null @@ -1,15 +0,0 @@ -package test.com.example - -import io.kvision.test.SimpleSpec -import kotlin.test.Test -import kotlin.test.assertTrue - -class AppSpec : SimpleSpec { - - @Test - fun render() { - run { - assertTrue(true, "Dummy test") - } - } -} diff --git a/modules/server/webpack.config.d/bootstrap.js b/modules/server/webpack.config.d/bootstrap.js deleted file mode 100644 index c9ac06d..0000000 --- a/modules/server/webpack.config.d/bootstrap.js +++ /dev/null @@ -1,3 +0,0 @@ -config.module.rules.push({test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, type: 'asset'}); -config.module.rules.push({test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, type: 'asset'}); -config.module.rules.push({test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, type: 'asset/resource'}); diff --git a/modules/server/webpack.config.d/css.js b/modules/server/webpack.config.d/css.js deleted file mode 100644 index fd904af..0000000 --- a/modules/server/webpack.config.d/css.js +++ /dev/null @@ -1 +0,0 @@ -config.module.rules.push({ test: /\.css$/, use: ["style-loader", { loader: "css-loader", options: {sourceMap: false} } ] }); diff --git a/modules/server/webpack.config.d/file.js b/modules/server/webpack.config.d/file.js deleted file mode 100644 index aa64925..0000000 --- a/modules/server/webpack.config.d/file.js +++ /dev/null @@ -1,6 +0,0 @@ -config.module.rules.push( - { - test: /\.(jpe?g|png|gif|svg)$/i, - type: 'asset/resource' - } -); diff --git a/modules/server/webpack.config.d/handlebars.js b/modules/server/webpack.config.d/handlebars.js deleted file mode 100644 index 3847b17..0000000 --- a/modules/server/webpack.config.d/handlebars.js +++ /dev/null @@ -1,6 +0,0 @@ -config.module.rules.push( - { - test: /\.hbs$/i, - loader: 'handlebars-loader' - } -); \ No newline at end of file diff --git a/modules/server/webpack.config.d/jquery.js b/modules/server/webpack.config.d/jquery.js deleted file mode 100644 index e6c6b21..0000000 --- a/modules/server/webpack.config.d/jquery.js +++ /dev/null @@ -1,9 +0,0 @@ -;(function() { - const webpack = require('webpack') - - config.plugins.push(new webpack.ProvidePlugin({ - $: "jquery", - jQuery: "jquery", - "window.jQuery": "jquery" - })); -})(); diff --git a/modules/server/webpack.config.d/moment.js b/modules/server/webpack.config.d/moment.js deleted file mode 100644 index fb7c329..0000000 --- a/modules/server/webpack.config.d/moment.js +++ /dev/null @@ -1,15 +0,0 @@ -;(function() { - const webpack = require('webpack') - try { - const moment = require("moment"); - config.plugins.push(new webpack.IgnorePlugin({ - resourceRegExp: /^\.\/locale$/, - contextRegExp: /moment$/, - })); - config.plugins.push(new webpack.ProvidePlugin({ - moment: "moment", - "window.moment": "moment" - })); - } catch (e) { - } -})(); diff --git a/modules/server/webpack.config.d/webpack.js b/modules/server/webpack.config.d/webpack.js deleted file mode 100644 index 4ce4481..0000000 --- a/modules/server/webpack.config.d/webpack.js +++ /dev/null @@ -1,15 +0,0 @@ -config.resolve.modules.push("../../processedResources/js/main"); - -if (config.devServer) { - config.devServer.hot = true; - config.devtool = 'eval-cheap-source-map'; -} else { - config.devtool = undefined; -} - -// disable bundle size warning -config.performance = { - assetFilter: function (assetFilename) { - return !assetFilename.endsWith('.js'); - }, -}; diff --git a/src/jsMain/kotlin/main.kt b/src/jsMain/kotlin/main.kt deleted file mode 100644 index 60460bd..0000000 --- a/src/jsMain/kotlin/main.kt +++ /dev/null @@ -1,8 +0,0 @@ -fun main() { - println("Hello, Kotlin/JS!") -} - -//@JsModule("typed-factorio") -//@JsNonModule -////@JsModule -//external fun diff --git a/src/nativeMain/kotlin/Main.kt b/src/nativeMain/kotlin/Main.kt deleted file mode 100644 index 96a3690..0000000 --- a/src/nativeMain/kotlin/Main.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main() { - println("Hello, Kotlin/Native!") -} \ No newline at end of file diff --git a/src/nativeMain/kotlin/example/hello.kt b/src/nativeMain/kotlin/example/hello.kt deleted file mode 100644 index 73e1b99..0000000 --- a/src/nativeMain/kotlin/example/hello.kt +++ /dev/null @@ -1,27 +0,0 @@ -package example - -import org.luaj.vm2.LuaBoolean -import org.luaj.vm2.LuaValue - - -object Object { - val field = "A" -} - -class Clazz { - fun memberFunction(p: Int): ULong = 42UL -} - -fun forIntegers(b: Byte, s: Short, i: UInt, l: Long) {} -fun forFloats(f: Float, d: Double) {} - -fun strings(str: String): String { - return "That is '$str' from C" -} - -val globalString = "A global String" - -fun testingLuaBooleanElephant() { - val b: LuaBoolean = LuaValue.TRUE - println(b) -} diff --git a/xbuild.gradle.kts b/xbuild.gradle.kts deleted file mode 100644 index de53fb0..0000000 --- a/xbuild.gradle.kts +++ /dev/null @@ -1,124 +0,0 @@ -import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension - -plugins { - kotlin("multiplatform") version "1.5.31" -} - -group = "dev.adamko.factoriowebmap" -version = "1.0-SNAPSHOT" - -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["main"].apply { - 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 -}