typed-factorio 1.16.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,32 +2,34 @@
2
2
 
3
3
  /** @noSelfInFile */
4
4
 
5
- /**
6
- * `log()` can print {@link LocalisedString LocalisedStrings} to the Factorio {@linkplain https://wiki.factorio.com/Log_file log file}. This, in combination with the serpent library, makes debugging in the data stage easier because it allows the inspection of entire prototype tables. For example, printing all properties of the sulfur item prototype can be done like so: `log(serpent.block(data.raw["item"]["sulfur"]))`
7
- * @see {@link https://lua-api.factorio.com/latest/Libraries.html#2.-new-functions Online documentation}
8
- */
9
- declare function log(string: LocalisedString): void
5
+ import type { LocalisedString, table, uint } from "factorio:runtime"
10
6
 
11
- /**
12
- * `localised_print()` allows printing {@link LocalisedString} to stdout without polluting the Factorio {@linkplain https://wiki.factorio.com/Log_file log file}. This is primarily useful when communicating with external tools that launch Factorio as a child process.
13
- * @see {@link https://lua-api.factorio.com/latest/Libraries.html#2.-new-functions Online documentation}
14
- */
15
- declare function localised_print(string: LocalisedString): void
16
-
17
- /**
18
- * Factorio provides the `table_size()` function as a simple way to determine the size of tables with non-continuous keys, as the standard `#` operator does not work correctly for these. The function is a C++ implementation of the following Lua code, which is faster than doing the same in Lua:
19
- *
20
- * ```
21
- * local function size(t)
22
- * local count = 0
23
- * for k,v in pairs(t) do
24
- * count = count + 1
25
- * end
26
- * return count
27
- * end
28
- * ```
29
- *
30
- * Note that `table_size()` does not work correctly for {@link LuaCustomTable}, their size has to be determined with {@link LuaCustomTable#length LuaCustomTable::length_operator} instead.
31
- * @see {@link https://lua-api.factorio.com/latest/Libraries.html#2.-new-functions Online documentation}
32
- */
33
- declare function table_size(table: table): uint
7
+ declare global {
8
+ /**
9
+ * `log()` can print {@link LocalisedString LocalisedStrings} to the Factorio {@linkplain https://wiki.factorio.com/Log_file log file}. This, in combination with the serpent library, makes debugging in the data stage easier because it allows the inspection of entire prototype tables. For example, printing all properties of the sulfur item prototype can be done like so: `log(serpent.block(data.raw["item"]["sulfur"]))`
10
+ * @see {@link https://lua-api.factorio.com/1.1.89/auxiliary/libraries.html#new-functions Online documentation}
11
+ */
12
+ function log(string: LocalisedString): void
13
+ /**
14
+ * `localised_print()` allows printing {@link LocalisedString} to stdout without polluting the Factorio {@linkplain https://wiki.factorio.com/Log_file log file}. This is primarily useful when communicating with external tools that launch Factorio as a child process.
15
+ * @see {@link https://lua-api.factorio.com/1.1.89/auxiliary/libraries.html#new-functions Online documentation}
16
+ */
17
+ function localised_print(string: LocalisedString): void
18
+ /**
19
+ * Factorio provides the `table_size()` function as a simple way to determine the size of tables with non-continuous keys, as the standard `#` operator does not work correctly for these. The function is a C++ implementation of the following Lua code, which is faster than doing the same in Lua:
20
+ *
21
+ * ```
22
+ * local function size(t)
23
+ * local count = 0
24
+ * for k,v in pairs(t) do
25
+ * count = count + 1
26
+ * end
27
+ * return count
28
+ * end
29
+ * ```
30
+ *
31
+ * Note that `table_size()` does not work correctly for {@link LuaCustomTable}, their size has to be determined with {@link LuaCustomTable#length LuaCustomTable::length_operator} instead.
32
+ * @see {@link https://lua-api.factorio.com/1.1.89/auxiliary/libraries.html#new-functions Online documentation}
33
+ */
34
+ function table_size(table: table): uint
35
+ }
@@ -2,44 +2,45 @@
2
2
 
3
3
  /** @noSelfInFile */
4
4
 
5
- /**
6
- * 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}.
7
- * @see {@link https://lua-api.factorio.com/latest/ Online documentation}
8
- */
9
- declare const game: LuaGameScript
10
-
11
- /**
12
- * Provides an interface for registering event handlers.
13
- * @see {@link https://lua-api.factorio.com/latest/ Online documentation}
14
- */
15
- declare const script: LuaBootstrap
16
-
17
- /**
18
- * Allows inter-mod communication by way of providing a repository of interfaces that is shared by all mods.
19
- * @see {@link https://lua-api.factorio.com/latest/ Online documentation}
20
- */
21
- declare const remote: LuaRemote
22
-
23
- /**
24
- * Allows registering custom commands for the in-game console accessible via the grave key.
25
- * @see {@link https://lua-api.factorio.com/latest/ Online documentation}
26
- */
27
- declare const commands: LuaCommandProcessor
28
-
29
- /**
30
- * Allows reading the current mod settings.
31
- * @see {@link https://lua-api.factorio.com/latest/ Online documentation}
32
- */
33
- declare const settings: LuaSettings
34
-
35
- /**
36
- * Allows printing messages to the calling RCON instance if any.
37
- * @see {@link https://lua-api.factorio.com/latest/ Online documentation}
38
- */
39
- declare const rcon: LuaRCON
40
-
41
- /**
42
- * Allows rendering of geometric shapes, text and sprites in the game world.
43
- * @see {@link https://lua-api.factorio.com/latest/ Online documentation}
44
- */
45
- declare const rendering: LuaRendering
5
+ import type {
6
+ LuaBootstrap,
7
+ LuaCommandProcessor,
8
+ LuaGameScript,
9
+ LuaRCON,
10
+ LuaRemote,
11
+ LuaRendering,
12
+ } from "factorio:runtime"
13
+
14
+ declare global {
15
+ /**
16
+ * The main scripting interface through which most of the API is accessed.
17
+ * @see {@link https://lua-api.factorio.com/1.1.89/index-runtime.html Online documentation}
18
+ */
19
+ const game: LuaGameScript
20
+ /**
21
+ * Provides an interface for registering game event handlers.
22
+ * @see {@link https://lua-api.factorio.com/1.1.89/index-runtime.html Online documentation}
23
+ */
24
+ const script: LuaBootstrap
25
+ /**
26
+ * Allows registration and use of functions to communicate between mods.
27
+ * @see {@link https://lua-api.factorio.com/1.1.89/index-runtime.html Online documentation}
28
+ */
29
+ const remote: LuaRemote
30
+ /**
31
+ * Allows registration of custom commands for the in-game console.
32
+ * @see {@link https://lua-api.factorio.com/1.1.89/index-runtime.html Online documentation}
33
+ */
34
+ const commands: LuaCommandProcessor
35
+ //The "settings" global is declared in common/settings-global.d.ts; its runtime type is handled below.
36
+ /**
37
+ * Allows printing messages to the calling RCON instance, if any.
38
+ * @see {@link https://lua-api.factorio.com/1.1.89/index-runtime.html Online documentation}
39
+ */
40
+ const rcon: LuaRCON
41
+ /**
42
+ * Allows rendering of geometric shapes, text and sprites in the game world.
43
+ * @see {@link https://lua-api.factorio.com/1.1.89/index-runtime.html Online documentation}
44
+ */
45
+ const rendering: LuaRendering
46
+ }
@@ -3,54 +3,55 @@
3
3
  /** @noSelfInFile */
4
4
 
5
5
  /**
6
- * See {@link LuaPlayer#index LuaPlayer.index}.
7
- *
8
- * If using strict-index-types, and you need to use a plain number for this type, you can use a cast, e.g. `1 as PlayerIndex`.
6
+ * @noResolution
9
7
  */
10
- type PlayerIndex = uint & IndexBrand<"_playerIndexBrand">
11
-
12
- /**
13
- * See {@link LuaSurface#index LuaSurface.index}.
14
- *
15
- * If using strict-index-types, and you need to use a plain number for this type, you can use a cast, e.g. `1 as SurfaceIndex`.
16
- */
17
- type SurfaceIndex = uint & IndexBrand<"_surfaceIndexBrand">
18
-
19
- /**
20
- * See {@link LuaForce#index LuaForce.index}.
21
- *
22
- * If using strict-index-types, and you need to use a plain number for this type, you can use a cast, e.g. `1 as ForceIndex`.
23
- */
24
- type ForceIndex = uint & IndexBrand<"_forceIndexBrand">
25
-
26
- /**
27
- * See {@link LuaEntity#unit_number LuaEntity.unit_number}.
28
- *
29
- * If using strict-index-types, and you need to use a plain number for this type, you can use a cast, e.g. `1 as UnitNumber`.
30
- */
31
- type UnitNumber = uint & IndexBrand<"_unitNumberBrand">
32
-
33
- /**
34
- * See {@link LuaGuiElement#index LuaGuiElement.index}.
35
- *
36
- * If using strict-index-types, and you need to use a plain number for this type, you can use a cast, e.g. `1 as GuiElementIndex`.
37
- */
38
- type GuiElementIndex = uint & IndexBrand<"_guiElementIndexBrand">
39
-
40
- /**
41
- * See {@link LuaBootstrap#register_on_entity_destroyed LuaBootstrap.register_on_entity_destroyed}.
42
- *
43
- * If using strict-index-types, and you need to use a plain number for this type, you can use a cast, e.g. `1 as RegistrationNumber`.
44
- */
45
- type RegistrationNumber = uint64 & IndexBrand<"_registrationNumberBrand">
46
-
47
- interface __OptInFeatures {}
48
-
49
- /**
50
- * Equals a branded type when __OptInFeatures contains strictIndexTypes, otherwise equals `unknown`.
51
- */
52
- type IndexBrand<B extends string> = "strictIndexTypes" extends keyof __OptInFeatures
53
- ? {
54
- [K in B]: any
55
- }
56
- : unknown
8
+ declare module "factorio:runtime" {
9
+ /**
10
+ * See {@link LuaPlayer#index LuaPlayer.index}.
11
+ *
12
+ * You can cast a raw number to this type, e.g. `1 as PlayerIndex`.
13
+ */
14
+ type PlayerIndex = uint & {
15
+ _playerIndexBrand: void
16
+ }
17
+ /**
18
+ * See {@link LuaSurface#index LuaSurface.index}.
19
+ *
20
+ * You can cast a raw number to this type, e.g. `1 as SurfaceIndex`.
21
+ */
22
+ type SurfaceIndex = uint & {
23
+ _surfaceIndexBrand: void
24
+ }
25
+ /**
26
+ * See {@link LuaForce#index LuaForce.index}.
27
+ *
28
+ * You can cast a raw number to this type, e.g. `1 as ForceIndex`.
29
+ */
30
+ type ForceIndex = uint & {
31
+ _forceIndexBrand: void
32
+ }
33
+ /**
34
+ * See {@link LuaEntity#unit_number LuaEntity.unit_number}.
35
+ *
36
+ * You can cast a raw number to this type, e.g. `1 as UnitNumber`.
37
+ */
38
+ type UnitNumber = uint & {
39
+ _unitNumberBrand: void
40
+ }
41
+ /**
42
+ * See {@link LuaGuiElement#index LuaGuiElement.index}.
43
+ *
44
+ * You can cast a raw number to this type, e.g. `1 as GuiElementIndex`.
45
+ */
46
+ type GuiElementIndex = uint & {
47
+ _guiElementIndexBrand: void
48
+ }
49
+ /**
50
+ * See {@link LuaBootstrap#register_on_entity_destroyed LuaBootstrap.register_on_entity_destroyed}.
51
+ *
52
+ * You can cast a raw number to this type, e.g. `1 as RegistrationNumber`.
53
+ */
54
+ type RegistrationNumber = uint64 & {
55
+ _registrationNumberBrand: void
56
+ }
57
+ }
@@ -1,19 +1,11 @@
1
- /// <reference types="lua-types/5.2" />
1
+ // This file declares globals for the factorio runtime stage.
2
2
 
3
- // generated
4
- /// <reference path="./generated/builtin-types.d.ts" />
3
+ /// <reference path="../index.d.ts" />
5
4
  /// <reference path="./generated/global-objects.d.ts" />
6
- /// <reference path="./generated/global-functions.d.ts" />
7
- /// <reference path="./generated/defines.d.ts" />
8
- /// <reference path="./generated/events.d.ts" />
9
- /// <reference path="./generated/classes.d.ts" />
10
- /// <reference path="./generated/concepts.d.ts" />
11
- /// <reference path="./generated/index-types.d.ts" />
5
+ /// <reference path="../common/settings-global.d.ts" />
12
6
 
13
- // other runtime
14
- /// <reference path="librariesAndFunctions.d.ts" />
15
- /// <reference path="pairs.d.ts" />
16
-
17
- // lualib
18
- /// <reference path="util.d.ts" />
19
- /// <reference path="mod-gui.d.ts" />
7
+ /** @noResolution */
8
+ declare module "factorio:common" {
9
+ import { LuaSettings } from "factorio:runtime"
10
+ export interface SettingsGlobal extends LuaSettings {}
11
+ }
@@ -1,10 +1,12 @@
1
1
  /** @noSelfInFile */
2
- ///<reference types="lua-types/5.2" />
2
+ import { LuaCustomTable } from "factorio:runtime"
3
3
 
4
- /** **Note**: you can also iterate on a LuaCustomTable directly without using `pairs`, e.g. `for(const [k, v] of table)`. */
5
- declare function pairs<T extends LuaCustomTable<any, any>>(
6
- table: T
7
- ): LuaIterable<LuaMultiReturn<T extends Iterable<infer E> ? E : never>>
4
+ declare global {
5
+ /** **Note**: you can also iterate on a LuaCustomTable directly without using `pairs`, e.g. `for(const [k, v] of table)`. */
6
+ function pairs<T extends LuaCustomTable<any, any>>(
7
+ table: T
8
+ ): LuaIterable<LuaMultiReturn<T extends Iterable<infer E> ? E : never>>
8
9
 
9
- /** @deprecated {@link LuaCustomTable} cannot be iterated with `ipairs`; Use {@link pairs} instead. */
10
- declare function ipairs(table: LuaCustomTable<any, any>): never
10
+ /** @deprecated {@link LuaCustomTable} cannot be iterated with `ipairs`; Use {@link pairs} instead. */
11
+ function ipairs(table: LuaCustomTable<any, any>): never
12
+ }
@@ -0,0 +1,10 @@
1
+ // This file declares globals for the factorio settings stage.
2
+
3
+ /// <reference path="../index.d.ts" />
4
+ /// <reference path="../common/data-global.d.ts" />
5
+
6
+ /** @noResolution */
7
+ declare module "factorio:common" {
8
+ import { PrototypeMap } from "factorio:settings"
9
+ export interface GlobalPrototypeMap extends PrototypeMap {}
10
+ }
@@ -1,120 +1,111 @@
1
1
  // Based off of https://wiki.factorio.com/Tutorial:Mod_settings
2
2
 
3
- export type SettingType = "bool-setting" | "int-setting" | "double-setting" | "string-setting"
3
+ /** @noResolution */
4
+ declare module "factorio:settings" {
5
+ import { LocalisedString } from "factorio:prototype"
6
+ export type SettingType = "bool-setting" | "int-setting" | "double-setting" | "string-setting"
4
7
 
5
- export interface BaseSettingDefinition {
6
- type: SettingType
7
- /**
8
- * The name of the settings prototype should be unique to avoid mod conflicts since the mod settings are global across
9
- * all mods. Because of that it is recommended to prefix mod settings with your mod name,
10
- */
11
- name: string
12
- localized_name?: LocalisedString
13
- localized_description?: LocalisedString
8
+ export interface BaseSettingDefinition {
9
+ readonly type: SettingType
10
+ /**
11
+ * The name of the settings prototype should be unique to avoid mod conflicts since the mod settings are global across
12
+ * all mods. Because of that it is recommended to prefix mod settings with your mod name,
13
+ */
14
+ name: string
15
+ localized_name?: LocalisedString
16
+ localized_description?: LocalisedString
14
17
 
15
- /**
16
- * The order property can be used to change how the mod settings are ordered in the settings gui. Mod settings are sorted
17
- *
18
- * - First by mod
19
- * - Then by the setting "order" string
20
- * - Then finally by the setting name.
21
- */
22
- order?: string
23
- /**
24
- * The hidden property can be used to hide mod settings from GUIs, so that they cannot be seen or changed by players.
25
- * However, other mods can still access hidden settings. {@link https://forums.factorio.com/83316}
26
- */
27
- hidden?: boolean
28
- /**
29
- * There are the overall kinds of settings:
30
- *
31
- * - **startup**: This kind of setting is available in the prototype stage, and can not be changed runtime. They have to
32
- * be set to the same values for all players on a server.
33
- * - **runtime-global**: This kind of setting is global to an entire save game and can be changed runtime. On servers,
34
- * only admins can change these settings.
35
- * - **runtime-per-user**: This kind of setting is only available runtime in the control.lua stage and each player has
36
- * their own instance of this setting. When a player joins a server their local setting of "keep mod settings per
37
- * save" determines if the local settings they have set are synced to the loaded save or if the save's settings are used.
38
- *
39
- * This "setting_type" also determines in which tab the setting is showed in the mod settings menu.
40
- */
18
+ /**
19
+ * The order property can be used to change how the mod settings are ordered in the settings gui. Mod settings are sorted
20
+ *
21
+ * - First by mod
22
+ * - Then by the setting "order" string
23
+ * - Then finally by the setting name.
24
+ */
25
+ order?: string
26
+ /**
27
+ * The hidden property can be used to hide mod settings from GUIs, so that they cannot be seen or changed by players.
28
+ * However, other mods can still access hidden settings. {@link https://forums.factorio.com/83316}
29
+ */
30
+ hidden?: boolean
31
+ /**
32
+ * There are the overall kinds of settings:
33
+ *
34
+ * - **startup**: This kind of setting is available in the prototype stage, and can not be changed runtime. They have to
35
+ * be set to the same values for all players on a server.
36
+ * - **runtime-global**: This kind of setting is global to an entire save game and can be changed runtime. On servers,
37
+ * only admins can change these settings.
38
+ * - **runtime-per-user**: This kind of setting is only available runtime in the control.lua stage and each player has
39
+ * their own instance of this setting. When a player joins a server their local setting of "keep mod settings per
40
+ * save" determines if the local settings they have set are synced to the loaded save or if the save's settings are used.
41
+ *
42
+ * This "setting_type" also determines in which tab the setting is showed in the mod settings menu.
43
+ */
41
44
 
42
- setting_type: "startup" | "runtime-global" | "runtime-per-user"
43
- }
44
- /** A true/false checkbox */
45
- export interface BoolSettingDefinition extends BaseSettingDefinition {
46
- type: "bool-setting"
47
- /** Defines the default value of the setting, in this case whether the checkbox is checked or not. */
48
- default_value: boolean
49
- /**
50
- * Only loaded if `hidden = true`. This forces the setting to be of this value. This can be useful for mod
51
- * compatibility. {@link https://forums.factorio.com/viewtopic.php?p=531322#p531322}
52
- */
53
- forced_value?: boolean
54
- }
55
- /** A signed 64 bit integer textfield (or selection dropdown) */
56
- export interface IntSettingDefinition extends BaseSettingDefinition {
57
- type: "int-setting"
58
- /** Defines the default value of the setting. */
59
- default_value: number
60
- /** Defines the lowest possible number. */
61
- minimum_value?: number
62
- /** Defines the highest possible number. */
63
- maximum_value?: number
64
- /**
65
- * Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a
66
- * textfield. If only one allowed value is given, the settings is forced to be of that value.
67
- */
68
- allowed_values?: number[]
69
- }
70
- /** A double precision floating point textfield (or selection dropdown) */
71
- export interface DoubleSettingDefinition extends BaseSettingDefinition {
72
- type: "double-setting"
73
- /** Defines the default value of the setting. */
74
- default_value: number
75
- /** Defines the lowest possible number. */
76
- minimum_value?: number
77
- /** Defines the highest possible number. */
78
- maximum_value?: number
79
- /**
80
- * Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a
81
- * textfield. If only one allowed value is given, the settings is forced to be of that value.
82
- */
83
- allowed_values?: number[]
84
- }
85
- /** A string textfield (or selection dropdown) */
86
- export interface StringSettingDefinition extends BaseSettingDefinition {
87
- type: "string-setting"
88
- /** Defines the default value of the setting. */
89
- default_value: string
90
- /** Defines whether it's possible for the user to set the textfield to empty and apply the setting. */
91
- allow_blank?: boolean
92
- /** Whether values that are input by the user should have whitespace removed from both ends of the string. */
93
- auto_trim?: boolean
94
- /**
95
- * Makes it possible to force the player to choose between the defined strings, creates a dropdown instead of a
96
- * textfield. The strings in the dropdown can be localized (translated) and can have a tooltip, see below. If only one
97
- * allowed value is given, the settings is forced to be of that value.
98
- */
99
- allowed_values?: string[]
100
- }
101
- /** Setting definitions. See {@link https://wiki.factorio.com/Tutorial:Mod_settings} for more info. */
102
- export type SettingDefinition =
103
- | BoolSettingDefinition
104
- | IntSettingDefinition
105
- | DoubleSettingDefinition
106
- | StringSettingDefinition
45
+ setting_type: "startup" | "runtime-global" | "runtime-per-user"
46
+ }
47
+ /** A true/false checkbox */
48
+ export interface BoolSettingDefinition extends BaseSettingDefinition {
49
+ readonly type: "bool-setting"
50
+ /** Defines the default value of the setting, in this case whether the checkbox is checked or not. */
51
+ default_value: boolean
52
+ /**
53
+ * Only loaded if `hidden = true`. This forces the setting to be of this value. This can be useful for mod
54
+ * compatibility. {@link https://forums.factorio.com/viewtopic.php?p=531322#p531322}
55
+ */
56
+ forced_value?: boolean
57
+ }
58
+ /** A signed 64 bit integer textfield (or selection dropdown) */
59
+ export interface IntSettingDefinition extends BaseSettingDefinition {
60
+ readonly type: "int-setting"
61
+ /** Defines the default value of the setting. */
62
+ default_value: number
63
+ /** Defines the lowest possible number. */
64
+ minimum_value?: number
65
+ /** Defines the highest possible number. */
66
+ maximum_value?: number
67
+ /**
68
+ * Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a
69
+ * textfield. If only one allowed value is given, the settings is forced to be of that value.
70
+ */
71
+ allowed_values?: number[]
72
+ }
73
+ /** A double precision floating point textfield (or selection dropdown) */
74
+ export interface DoubleSettingDefinition extends BaseSettingDefinition {
75
+ readonly type: "double-setting"
76
+ /** Defines the default value of the setting. */
77
+ default_value: number
78
+ /** Defines the lowest possible number. */
79
+ minimum_value?: number
80
+ /** Defines the highest possible number. */
81
+ maximum_value?: number
82
+ /**
83
+ * Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a
84
+ * textfield. If only one allowed value is given, the settings is forced to be of that value.
85
+ */
86
+ allowed_values?: number[]
87
+ }
88
+ /** A string textfield (or selection dropdown) */
89
+ export interface StringSettingDefinition extends BaseSettingDefinition {
90
+ readonly type: "string-setting"
91
+ /** Defines the default value of the setting. */
92
+ default_value: string
93
+ /** Defines whether it's possible for the user to set the textfield to empty and apply the setting. */
94
+ allow_blank?: boolean
95
+ /** Whether values that are input by the user should have whitespace removed from both ends of the string. */
96
+ auto_trim?: boolean
97
+ /**
98
+ * Makes it possible to force the player to choose between the defined strings, creates a dropdown instead of a
99
+ * textfield. The strings in the dropdown can be localized (translated) and can have a tooltip, see below. If only one
100
+ * allowed value is given, the settings is forced to be of that value.
101
+ */
102
+ allowed_values?: string[]
103
+ }
107
104
 
108
- export interface Data {
109
- readonly raw: {
110
- [T in SettingDefinition["type"]]: Record<string, Extract<SettingDefinition, { type: T }>>
105
+ export interface PrototypeMap {
106
+ "bool-setting": BoolSettingDefinition
107
+ "int-setting": IntSettingDefinition
108
+ "double-setting": DoubleSettingDefinition
109
+ "string-setting": StringSettingDefinition
111
110
  }
112
- /**
113
- * The `data` table expects a specific format for each item in the table. Missing properties will either fall back to
114
- * default values or give an error indicating what's missing. Extra properties that the game isn't looking for are
115
- * simply ignored.
116
- */
117
- extend(prototypes: SettingDefinition[]): void
118
111
  }
119
- /** A mapping of mod names to mod version for all enabled mods. */
120
- export type Mods = Record<string, string>
@@ -1,23 +0,0 @@
1
- // This references the same files as "typed-factorio/runtime".
2
- // For example, if you want to modify a file, copy the file you want to modify to your project and make the changes. Then, copy this template file into your project and remove the line corresponding to modified file.
3
- // If you think your modification will be useful to others, please consider making a change suggestion by creating an issue on GitHub.
4
-
5
- /// <reference types="lua-types/5.2" />
6
-
7
- // generated
8
- /// <reference types="typed-factorio/runtime/generated/builtin-types.d.ts" />
9
- /// <reference types="typed-factorio/runtime/generated/global-objects.d.ts" />
10
- /// <reference types="typed-factorio/runtime/generated/global-functions.d.ts" />
11
- /// <reference types="typed-factorio/runtime/generated/defines.d.ts" />
12
- /// <reference types="typed-factorio/runtime/generated/events.d.ts" />
13
- /// <reference types="typed-factorio/runtime/generated/classes.d.ts" />
14
- /// <reference types="typed-factorio/runtime/generated/concepts.d.ts" />
15
- /// <reference types="typed-factorio/runtime/generated/index-types.d.ts" />
16
-
17
- // other runtime
18
- /// <reference types="typed-factorio/runtime/librariesAndFunctions.d.ts" />
19
- /// <reference types="typed-factorio/runtime/pairs.d.ts" />
20
-
21
- // lualib
22
- /// <reference types="typed-factorio/runtime/util.d.ts" />
23
- /// <reference types="typed-factorio/runtime/mod-gui.d.ts" />
package/data/types.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export interface Data {
2
- readonly raw: Record<string, Record<string, any>>
3
-
4
- /**
5
- * The `data` table expects a specific format for each item in the table. Missing properties will either fall back to
6
- * default values or give an error indicating what's missing. Extra properties that the game isn't looking for are
7
- * simply ignored.
8
- */
9
- extend(prototypes: Record<string, any>[]): void
10
- }
11
-
12
- /** A mapping of mod names to mod version for all enabled mods. */
13
- export type Mods = Record<string, string>