factorio-types 1.2.38 → 1.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes.d.ts +24 -3
- package/dist/concepts.d.ts +1 -1
- package/dist/datacollection.d.ts +1 -1
- package/dist/defines.d.ts +1 -1
- package/dist/events.d.ts +1 -1
- package/dist/global.d.ts +1 -1
- package/dist/prototypes.d.ts +2 -2
- package/dist/types.d.ts +5 -5
- package/package.json +2 -2
package/dist/classes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.55
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -11707,19 +11707,30 @@ interface LuaHeatEnergySourcePrototype {
|
|
|
11707
11707
|
readonly valid: boolean;
|
|
11708
11708
|
}
|
|
11709
11709
|
/**
|
|
11710
|
-
* Provides various helper and utility functions. It is accessible through the global object named `helpers
|
|
11710
|
+
* Provides various helper and utility functions. It is accessible through the global object named `helpers` in all stages (settings, prototype and runtime).
|
|
11711
11711
|
*/
|
|
11712
11712
|
interface LuaHelpers {
|
|
11713
11713
|
/**
|
|
11714
11714
|
* Goes over all items, entities, tiles, recipes, technologies among other things and logs if the locale is incorrect.
|
|
11715
11715
|
*
|
|
11716
11716
|
* Also prints true/false if called from the console.
|
|
11717
|
+
*
|
|
11718
|
+
* Not available in settings and prototype stages.
|
|
11717
11719
|
*/
|
|
11718
11720
|
check_prototype_translations(this: void): void;
|
|
11721
|
+
/**
|
|
11722
|
+
* Compares 2 version strings.
|
|
11723
|
+
* @param first First version string to compare.
|
|
11724
|
+
* @param second Second version string to compare.
|
|
11725
|
+
* @returns -1 if first is smaller than second, 0 if first equal second, 1 if first is greater than second.
|
|
11726
|
+
*/
|
|
11727
|
+
compare_versions(this: void, first: string, second: string): int;
|
|
11719
11728
|
/**
|
|
11720
11729
|
* Creates a {@link LuaProfiler | runtime:LuaProfiler}, which is used for measuring script performance.
|
|
11721
11730
|
*
|
|
11722
11731
|
* LuaProfiler cannot be serialized.
|
|
11732
|
+
*
|
|
11733
|
+
* Not available in settings and prototype stages.
|
|
11723
11734
|
* @param stopped Create the timer stopped
|
|
11724
11735
|
*/
|
|
11725
11736
|
create_profiler(this: void, stopped?: boolean): LuaProfiler;
|
|
@@ -11752,11 +11763,15 @@ interface LuaHelpers {
|
|
|
11752
11763
|
evaluate_expression(this: void, expression: MathExpression, variables?: Record<string, double>): double;
|
|
11753
11764
|
/**
|
|
11754
11765
|
* Checks if the given SoundPath is valid.
|
|
11766
|
+
*
|
|
11767
|
+
* Not available in settings and prototype stages.
|
|
11755
11768
|
* @param sound_path Path to the sound.
|
|
11756
11769
|
*/
|
|
11757
11770
|
is_valid_sound_path(this: void, sound_path: SoundPath): boolean;
|
|
11758
11771
|
/**
|
|
11759
11772
|
* Checks if the given SpritePath is valid and contains a loaded sprite. The existence of the image is not checked for paths of type `file`.
|
|
11773
|
+
*
|
|
11774
|
+
* Not available in settings and prototype stages.
|
|
11760
11775
|
* @param sprite_path Path to the image.
|
|
11761
11776
|
*/
|
|
11762
11777
|
is_valid_sprite_path(this: void, sprite_path: SpritePath): boolean;
|
|
@@ -11768,6 +11783,8 @@ interface LuaHelpers {
|
|
|
11768
11783
|
json_to_table(this: void, json: string): AnyBasic | null;
|
|
11769
11784
|
/**
|
|
11770
11785
|
* Convert a map exchange string to map gen settings and map settings.
|
|
11786
|
+
*
|
|
11787
|
+
* Not available in settings and prototype stages.
|
|
11771
11788
|
*/
|
|
11772
11789
|
parse_map_exchange_string(this: void, map_exchange_string: string): MapExchangeStringData;
|
|
11773
11790
|
/**
|
|
@@ -11784,9 +11801,13 @@ interface LuaHelpers {
|
|
|
11784
11801
|
* @param filename The name of the file. Providing a directory path (ex. `"save/here/example.txt"`) will create the necessary folder structure in `script-output`.
|
|
11785
11802
|
* @param data The content to write to the file.
|
|
11786
11803
|
* @param append If `true`, `data` will be appended to the end of the file. Defaults to `false`, which will overwrite any pre-existing file with the new `data`.
|
|
11787
|
-
* @param for_player If given, the file will only be written for this `player_index`. Providing `0` will only write to the server's output if present.
|
|
11804
|
+
* @param for_player If given, the file will only be written for this `player_index`. Providing `0` will only write to the server's output if present. `for_player` cannot be used in settings and prototype stages.
|
|
11788
11805
|
*/
|
|
11789
11806
|
write_file(this: void, filename: string, data: LocalisedString, append?: boolean, for_player?: uint): void;
|
|
11807
|
+
/**
|
|
11808
|
+
* Current version of game
|
|
11809
|
+
*/
|
|
11810
|
+
readonly game_version: string;
|
|
11790
11811
|
/**
|
|
11791
11812
|
* 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.
|
|
11792
11813
|
*/
|
package/dist/concepts.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.55
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
package/dist/datacollection.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/prototype-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.55
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace prototype {
|
package/dist/defines.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.55
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace defines {
|
package/dist/events.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.55
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
package/dist/global.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.55
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/prototypes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/prototype-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.55
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace prototype {
|
|
@@ -5146,7 +5146,7 @@ interface LandMinePrototype extends EntityWithOwnerPrototype {
|
|
|
5146
5146
|
trigger_collision_mask?: CollisionMaskConnector;
|
|
5147
5147
|
trigger_force?: ForceCondition;
|
|
5148
5148
|
/**
|
|
5149
|
-
* Time between checks to detonate due to nearby enemies. A larger time will be more performant.
|
|
5149
|
+
* Time between checks to detonate due to nearby enemies, in ticks. A larger time will be more performant.
|
|
5150
5150
|
*/
|
|
5151
5151
|
trigger_interval?: uint32;
|
|
5152
5152
|
trigger_radius: double;
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/prototype-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.55
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace prototype {
|
|
@@ -4462,7 +4462,7 @@ interface FastReplaceTipTrigger extends CountBasedTipTrigger {
|
|
|
4462
4462
|
type: 'fast-replace';
|
|
4463
4463
|
}
|
|
4464
4464
|
/**
|
|
4465
|
-
* A dictionary of feature flags and their status. It can be used to adjust prototypes based on whether the feature flags are enabled.
|
|
4465
|
+
* A dictionary of feature flags and their status. It can be used to adjust prototypes based on whether the feature flags are enabled. It is accessible through the global object named `feature_flags`.
|
|
4466
4466
|
* @example ```
|
|
4467
4467
|
-- sets coal to spoil only when the spoiling feature flag is enabled
|
|
4468
4468
|
if feature_flags["spoiling"] then
|
|
@@ -6657,10 +6657,10 @@ if mods["pizza"] then
|
|
|
6657
6657
|
end
|
|
6658
6658
|
```
|
|
6659
6659
|
* @example ```
|
|
6660
|
-
-- when the only active mod is the space-age mod with version
|
|
6660
|
+
-- when the only active mod is the space-age mod with version 2.0.7
|
|
6661
6661
|
-- then this logs
|
|
6662
6662
|
for name, version in pairs(mods) do
|
|
6663
|
-
log(name .. " version " .. version) -- => space-age version
|
|
6663
|
+
log(name .. " version " .. version) -- => space-age version 2.0.7
|
|
6664
6664
|
end
|
|
6665
6665
|
```
|
|
6666
6666
|
*/
|
|
@@ -8886,7 +8886,7 @@ interface SetTileTriggerEffectItem extends TriggerEffectItem {
|
|
|
8886
8886
|
type: 'set-tile';
|
|
8887
8887
|
}
|
|
8888
8888
|
/**
|
|
8889
|
-
* A struct that provides access to the user-set values of startup {@link mod settings | https://wiki.factorio.com/Tutorial:Mod_settings}.
|
|
8889
|
+
* A struct that provides access to the user-set values of startup {@link mod settings | https://wiki.factorio.com/Tutorial:Mod_settings}. It is accessible through the global object named `settings`.
|
|
8890
8890
|
* @example ```
|
|
8891
8891
|
-- Accessing the value of a mod setting
|
|
8892
8892
|
local val = settings.startup["my-mod-setting-name"].value
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "factorio-types",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.39",
|
|
4
4
|
"description": "Typescript declarations for the Factorio mod API",
|
|
5
5
|
"main": "index.d.ts",
|
|
6
6
|
"repository": "https://github.com/sguest/factorio-types.git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"src/**/*.d.ts",
|
|
24
24
|
"dist/**/*.d.ts"
|
|
25
25
|
],
|
|
26
|
-
"factorioVersion": "2.0.
|
|
26
|
+
"factorioVersion": "2.0.55",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"lua-types": "^2.13.1"
|
|
29
29
|
},
|