factorio-types 0.0.43 → 0.0.44
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/LICENSE +21 -21
- package/README.md +9 -9
- package/dist/classes.d.ts +13 -7
- package/dist/concepts.d.ts +19 -4
- package/dist/core.d.ts +28 -28
- package/dist/defines.d.ts +15 -1
- package/dist/events.d.ts +1 -1
- package/dist/global.d.ts +1 -1
- package/dist/prototypes.d.ts +37 -27
- package/dist/serpent.d.ts +33 -33
- package/dist/types.d.ts +191 -97
- package/index.d.ts +14 -14
- package/package.json +28 -27
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2019 sguest
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 sguest
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# factorio-types
|
|
2
|
-
|
|
3
|
-
Typescript declarations for the factorio mod API. Note this library is not particularly "battle-hardened" by real use, but is here for anyone that may get value from it.
|
|
4
|
-
|
|
5
|
-
Install `factorio-types` from [npm](https://www.npmjs.com/package/factorio-types), but note the warning above about minimal testing.
|
|
6
|
-
|
|
7
|
-
Intended to be used with [Typescript to Lua](https://github.com/TypeScriptToLua/TypeScriptToLua). This library uses some language extensions from the TSTL library, such as the `LuaMultiReturn` type to handle functions that return multiple values. Enable these extensions in your project's tsconfig as per [the docs](https://typescripttolua.github.io/docs/advanced/language-extensions/)
|
|
8
|
-
|
|
9
|
-
A very minimal proof-of-concept showing basic toolchain setup can be found [Here](https://github.com/sguest/factorio-fire-armor-typescript)
|
|
1
|
+
# factorio-types
|
|
2
|
+
|
|
3
|
+
Typescript declarations for the factorio mod API. Note this library is not particularly "battle-hardened" by real use, but is here for anyone that may get value from it.
|
|
4
|
+
|
|
5
|
+
Install `factorio-types` from [npm](https://www.npmjs.com/package/factorio-types), but note the warning above about minimal testing.
|
|
6
|
+
|
|
7
|
+
Intended to be used with [Typescript to Lua](https://github.com/TypeScriptToLua/TypeScriptToLua). This library uses some language extensions from the TSTL library, such as the `LuaMultiReturn` type to handle functions that return multiple values. Enable these extensions in your project's tsconfig as per [the docs](https://typescripttolua.github.io/docs/advanced/language-extensions/)
|
|
8
|
+
|
|
9
|
+
A very minimal proof-of-concept showing basic toolchain setup can be found [Here](https://github.com/sguest/factorio-fire-armor-typescript)
|
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 1.1.
|
|
5
|
+
// Factorio version 1.1.96
|
|
6
6
|
// API version 4
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -14212,7 +14212,7 @@ interface LuaRendering {
|
|
|
14212
14212
|
/**
|
|
14213
14213
|
* Create a circle.
|
|
14214
14214
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
14215
|
-
* @param table.filled - If the circle should be filled.
|
|
14215
|
+
* @param table.filled - If the circle should be filled. Defaults to false.
|
|
14216
14216
|
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
14217
14217
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
14218
14218
|
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
@@ -14220,7 +14220,7 @@ interface LuaRendering {
|
|
|
14220
14220
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
14221
14221
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
14222
14222
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
14223
|
-
* @param table.width - Width of the outline, used only if filled = false. Value is in pixels (32 per tile).
|
|
14223
|
+
* @param table.width - Width of the outline, used only if filled = false. Value is in pixels (32 per tile). Defaults to 1.
|
|
14224
14224
|
* @returns Id of the render object
|
|
14225
14225
|
*/
|
|
14226
14226
|
draw_circle(this: void,
|
|
@@ -14228,7 +14228,7 @@ interface LuaRendering {
|
|
|
14228
14228
|
color: Color,
|
|
14229
14229
|
radius: number,
|
|
14230
14230
|
width?: number,
|
|
14231
|
-
filled
|
|
14231
|
+
filled?: boolean,
|
|
14232
14232
|
target: MapPosition | LuaEntity,
|
|
14233
14233
|
target_offset?: Vector,
|
|
14234
14234
|
surface: SurfaceIdentification,
|
|
@@ -14365,7 +14365,7 @@ interface LuaRendering {
|
|
|
14365
14365
|
/**
|
|
14366
14366
|
* Create a rectangle.
|
|
14367
14367
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
14368
|
-
* @param table.filled - If the rectangle should be filled.
|
|
14368
|
+
* @param table.filled - If the rectangle should be filled. Defaults to false.
|
|
14369
14369
|
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
14370
14370
|
* @param table.left_top_offset - Only used if `left_top` is a LuaEntity.
|
|
14371
14371
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
@@ -14373,14 +14373,20 @@ interface LuaRendering {
|
|
|
14373
14373
|
* @param table.right_bottom_offset - Only used if `right_bottom` is a LuaEntity.
|
|
14374
14374
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
14375
14375
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
14376
|
-
* @param table.width - Width of the outline, used only if filled = false. Value is in pixels (32 per tile).
|
|
14376
|
+
* @param table.width - Width of the outline, used only if filled = false. Value is in pixels (32 per tile). Defaults to 1.
|
|
14377
|
+
* @example
|
|
14378
|
+
* Draw a white and 1 pixel wide square outline with the corners {0, 0} and {2, 2}.
|
|
14379
|
+
* ```
|
|
14380
|
+
* rendering.draw_rectangle{surface = game.player.surface, left_top = {0, 0}, right_bottom = {2, 2}, color = {1, 1, 1}}
|
|
14381
|
+
* ```
|
|
14382
|
+
*
|
|
14377
14383
|
* @returns Id of the render object
|
|
14378
14384
|
*/
|
|
14379
14385
|
draw_rectangle(this: void,
|
|
14380
14386
|
table: {
|
|
14381
14387
|
color: Color,
|
|
14382
14388
|
width?: number,
|
|
14383
|
-
filled
|
|
14389
|
+
filled?: boolean,
|
|
14384
14390
|
left_top: MapPosition | LuaEntity,
|
|
14385
14391
|
left_top_offset?: Vector,
|
|
14386
14392
|
right_bottom: MapPosition | LuaEntity,
|
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 1.1.
|
|
5
|
+
// Factorio version 1.1.96
|
|
6
6
|
// API version 4
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -2314,14 +2314,29 @@ interface PrintSettings {
|
|
|
2314
2314
|
color?: Color,
|
|
2315
2315
|
|
|
2316
2316
|
/**
|
|
2317
|
-
* If
|
|
2317
|
+
* If set to false, message will not be part of game state and will dissapear from output console after save-load. Defaults to `true`.
|
|
2318
2318
|
*/
|
|
2319
|
-
|
|
2319
|
+
game_state?: boolean,
|
|
2320
|
+
|
|
2321
|
+
/**
|
|
2322
|
+
* Condition when to skip adding message. Defaults to `defines.print_skip.if_redundant`.
|
|
2323
|
+
*/
|
|
2324
|
+
skip?: defines.print_skip,
|
|
2320
2325
|
|
|
2321
2326
|
/**
|
|
2322
2327
|
* If a sound should be emitted for this message. Defaults to `defines.print_sound.use_player_settings`.
|
|
2323
2328
|
*/
|
|
2324
|
-
sound?: defines.print_sound
|
|
2329
|
+
sound?: defines.print_sound,
|
|
2330
|
+
|
|
2331
|
+
/**
|
|
2332
|
+
* The sound to play. If not given, {@link UtilitySounds::console_message | prototype:UtilitySounds::console_message} will be used instead.
|
|
2333
|
+
*/
|
|
2334
|
+
sound_path?: SoundPath,
|
|
2335
|
+
|
|
2336
|
+
/**
|
|
2337
|
+
* The volume of the sound to play. Must be between 0 and 1 inclusive. Defaults to 1.
|
|
2338
|
+
*/
|
|
2339
|
+
volume_modifier?: number
|
|
2325
2340
|
}
|
|
2326
2341
|
|
|
2327
2342
|
/**
|
package/dist/core.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
// Misc type definitions for Factorio API
|
|
2
|
-
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
|
-
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
|
-
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
|
|
6
|
-
declare const table: {
|
|
7
|
-
deepcopy<T>(this: void, value: T): T,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
declare const data: {
|
|
11
|
-
raw: prototype.dataCollection,
|
|
12
|
-
extend(values: any[]): void,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
declare const global: { [key: string]: any };
|
|
16
|
-
|
|
17
|
-
declare function log(str: runtime.LocalisedString): void;
|
|
18
|
-
|
|
19
|
-
declare function table_size(tbl: object): number;
|
|
20
|
-
|
|
21
|
-
declare const serpent: Serpent;
|
|
22
|
-
|
|
23
|
-
// The documentation in some places just says "Table", with extra info only available in the specific prototype doc
|
|
24
|
-
// can eventually fix these on a per-case basis
|
|
25
|
-
type Table = any;
|
|
26
|
-
|
|
27
|
-
// The docs and json definition make reference to these types but have no information as to what they are
|
|
28
|
-
type BlueprintCircuitConnection = any;
|
|
1
|
+
// Misc type definitions for Factorio API
|
|
2
|
+
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
|
+
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
|
+
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
+
|
|
6
|
+
declare const table: {
|
|
7
|
+
deepcopy<T>(this: void, value: T): T,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare const data: {
|
|
11
|
+
raw: prototype.dataCollection,
|
|
12
|
+
extend(values: any[]): void,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
declare const global: { [key: string]: any };
|
|
16
|
+
|
|
17
|
+
declare function log(str: runtime.LocalisedString): void;
|
|
18
|
+
|
|
19
|
+
declare function table_size(tbl: object): number;
|
|
20
|
+
|
|
21
|
+
declare const serpent: Serpent;
|
|
22
|
+
|
|
23
|
+
// The documentation in some places just says "Table", with extra info only available in the specific prototype doc
|
|
24
|
+
// can eventually fix these on a per-case basis
|
|
25
|
+
type Table = any;
|
|
26
|
+
|
|
27
|
+
// The docs and json definition make reference to these types but have no information as to what they are
|
|
28
|
+
type BlueprintCircuitConnection = any;
|
|
29
29
|
type BlueprintControlBehavior = any;
|
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 1.1.
|
|
5
|
+
// Factorio version 1.1.96
|
|
6
6
|
// API version 4
|
|
7
7
|
|
|
8
8
|
declare namespace defines {
|
|
@@ -1014,6 +1014,20 @@ declare namespace defines {
|
|
|
1014
1014
|
none,
|
|
1015
1015
|
right,
|
|
1016
1016
|
}
|
|
1017
|
+
enum print_skip {
|
|
1018
|
+
/**
|
|
1019
|
+
* Print will be skipped if same text was recently printed (within last 60 ticks). Used by most game messages.
|
|
1020
|
+
*/
|
|
1021
|
+
if_redundant,
|
|
1022
|
+
/**
|
|
1023
|
+
* Print will be skipped if same text is still visible (printed within last 1152 ticks). Used by some notifications.
|
|
1024
|
+
*/
|
|
1025
|
+
if_visible,
|
|
1026
|
+
/**
|
|
1027
|
+
* Print will not be skipped.
|
|
1028
|
+
*/
|
|
1029
|
+
never,
|
|
1030
|
+
}
|
|
1017
1031
|
enum print_sound {
|
|
1018
1032
|
always,
|
|
1019
1033
|
never,
|
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 1.1.
|
|
5
|
+
// Factorio version 1.1.96
|
|
6
6
|
// API version 4
|
|
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 1.1.
|
|
5
|
+
// Factorio version 1.1.96
|
|
6
6
|
// API version 4
|
|
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 1.1.
|
|
5
|
+
// Factorio version 1.1.96
|
|
6
6
|
// API version 4
|
|
7
7
|
|
|
8
8
|
declare namespace prototype {
|
|
@@ -525,7 +525,7 @@ Only one of `draw_as_shadow`, `draw_as_glow` and `draw_as_light` can be true. Th
|
|
|
525
525
|
|
|
526
526
|
The path to the sprite file to use.
|
|
527
527
|
*/
|
|
528
|
-
filename
|
|
528
|
+
filename?: FileName,
|
|
529
529
|
|
|
530
530
|
/**
|
|
531
531
|
* Only loaded if `layers` is not defined.
|
|
@@ -568,11 +568,11 @@ If this property exists and high resolution sprites are turned on, this is used
|
|
|
568
568
|
/**
|
|
569
569
|
* If this property is present, all Animation definitions have to be placed as entries in the array, and they will all be loaded from there. `layers` may not be an empty table. Each definition in the array may also have the `layers` property.
|
|
570
570
|
|
|
571
|
-
`animation_speed` and `max_advance`
|
|
571
|
+
`animation_speed` and `max_advance` of the first layer are used for all layers. All layers will run at the same speed.
|
|
572
572
|
|
|
573
573
|
If this property is present, all other properties besides `name` and `type` are ignored.
|
|
574
574
|
*/
|
|
575
|
-
layers
|
|
575
|
+
layers?: Animation[],
|
|
576
576
|
|
|
577
577
|
/**
|
|
578
578
|
* Only loaded if `layers` is not defined.
|
|
@@ -591,7 +591,9 @@ Minimal mode is entered when mod loading fails. You are in it when you see the g
|
|
|
591
591
|
/**
|
|
592
592
|
* Only loaded if `layers` is not defined.
|
|
593
593
|
|
|
594
|
-
If `layers` are used, `max_advance`
|
|
594
|
+
If `layers` are used, `max_advance` of the first layer is used for all layers.
|
|
595
|
+
|
|
596
|
+
Maximum amount of frames the animation can move forward in one update.
|
|
595
597
|
*/
|
|
596
598
|
max_advance?: number,
|
|
597
599
|
|
|
@@ -735,7 +737,7 @@ interface ArmorPrototype extends ToolPrototype{
|
|
|
735
737
|
/**
|
|
736
738
|
* What amount of damage the armor takes on what type of damage is incoming.
|
|
737
739
|
*/
|
|
738
|
-
resistances?:
|
|
740
|
+
resistances?: Resistance[]
|
|
739
741
|
}
|
|
740
742
|
|
|
741
743
|
/**
|
|
@@ -1819,7 +1821,7 @@ interface ConstructionRobotPrototype extends RobotWithLogisticInterfacePrototype
|
|
|
1819
1821
|
}
|
|
1820
1822
|
|
|
1821
1823
|
/**
|
|
1822
|
-
* A generic container, such as a chest.
|
|
1824
|
+
* A generic container, such as a chest. Cannot be rotated.
|
|
1823
1825
|
*/
|
|
1824
1826
|
interface ContainerPrototype extends EntityWithOwnerPrototype{
|
|
1825
1827
|
|
|
@@ -2170,12 +2172,18 @@ interface CustomInputPrototype extends PrototypeBase{
|
|
|
2170
2172
|
consuming?: ConsumingType,
|
|
2171
2173
|
|
|
2172
2174
|
/**
|
|
2173
|
-
* The alternative controller (game pad) keybinding for this control. See `
|
|
2175
|
+
* The alternative controller (game pad) keybinding for this control. See `controller_key_sequence` for the format.
|
|
2174
2176
|
*/
|
|
2175
2177
|
controller_alternative_key_sequence?: string,
|
|
2176
2178
|
|
|
2177
2179
|
/**
|
|
2178
|
-
* The controller (game pad) keybinding for this control.
|
|
2180
|
+
* The controller (game pad) keybinding for this control. Use "" (empty string) for unassigned.
|
|
2181
|
+
|
|
2182
|
+
" + " is used to separate modifier buttons from normal buttons: <code>"controller-righttrigger + controller-a"</code>.
|
|
2183
|
+
|
|
2184
|
+
For modifier buttons, the following names are used: "controller-righttrigger", "controller-lefttrigger".
|
|
2185
|
+
|
|
2186
|
+
A key binding can contain an unlimited amount of modifier buttons (listed above) but only one normal button (listed below).
|
|
2179
2187
|
*/
|
|
2180
2188
|
controller_key_sequence?: string,
|
|
2181
2189
|
|
|
@@ -2214,7 +2222,7 @@ A key binding can contain an unlimited amount of modifier keys (listed above) bu
|
|
|
2214
2222
|
/**
|
|
2215
2223
|
* When a custom-input is linked to a game control it won't show up in the control-settings GUI and will fire when the linked control is pressed.
|
|
2216
2224
|
*/
|
|
2217
|
-
linked_game_control?:
|
|
2225
|
+
linked_game_control?: LinkedGameControl,
|
|
2218
2226
|
|
|
2219
2227
|
/**
|
|
2220
2228
|
* Unique textual identification of the prototype. May not contain a dot, nor exceed a length of 200 characters.
|
|
@@ -2772,7 +2780,7 @@ Note, that for buildings, it is customary to leave 0.1 wide border between the e
|
|
|
2772
2780
|
created_smoke?: CreateTrivialSmokeEffectItem,
|
|
2773
2781
|
|
|
2774
2782
|
/**
|
|
2775
|
-
* Specification of space needed to see the whole entity. This is used to calculate the correct zoom and positioning in the entity info gui.
|
|
2783
|
+
* Specification of space needed to see the whole entity in GUIs. This is used to calculate the correct zoom and positioning in the entity info gui, for example in the entity tooltip.
|
|
2776
2784
|
*/
|
|
2777
2785
|
drawing_box?: BoundingBox,
|
|
2778
2786
|
|
|
@@ -2925,7 +2933,7 @@ When the tile width is odd, the center will be in the center of the tile, when i
|
|
|
2925
2933
|
vehicle_impact_sound?: Sound,
|
|
2926
2934
|
|
|
2927
2935
|
/**
|
|
2928
|
-
* May also be defined inside `graphics_set` instead of directly in the entity prototype. This is useful for entities that use
|
|
2936
|
+
* May also be defined inside `graphics_set` instead of directly in the entity prototype. This is useful for entities that use a `graphics_set` property to define their graphics, because then all graphics can be defined in one place.
|
|
2929
2937
|
|
|
2930
2938
|
{@link Currently only renders | https://forums.factorio.com/100703} for {@link EntityWithHealthPrototype | prototype:EntityWithHealthPrototype}.
|
|
2931
2939
|
*/
|
|
@@ -2970,7 +2978,7 @@ When the tile width is odd, the center will be in the center of the tile, when i
|
|
|
2970
2978
|
*/
|
|
2971
2979
|
interface EntityWithHealthPrototype extends EntityPrototype{
|
|
2972
2980
|
alert_when_damaged?: boolean,
|
|
2973
|
-
attack_reaction?: AttackReactionItem[],
|
|
2981
|
+
attack_reaction?: AttackReactionItem | AttackReactionItem[],
|
|
2974
2982
|
|
|
2975
2983
|
/**
|
|
2976
2984
|
* Specifies the names of the {@link CorpsePrototype | prototype:CorpsePrototype} to be used when this entity dies.
|
|
@@ -3017,7 +3025,7 @@ interface EntityWithHealthPrototype extends EntityPrototype{
|
|
|
3017
3025
|
/**
|
|
3018
3026
|
* See {@link damage | https://wiki.factorio.com/Damage}.
|
|
3019
3027
|
*/
|
|
3020
|
-
resistances?:
|
|
3028
|
+
resistances?: Resistance[]
|
|
3021
3029
|
}
|
|
3022
3030
|
|
|
3023
3031
|
/**
|
|
@@ -3338,7 +3346,7 @@ interface FluidPrototype extends PrototypeBase{
|
|
|
3338
3346
|
/**
|
|
3339
3347
|
* Whether the fluid should be included in the barrel recipes automatically generated by the base mod.
|
|
3340
3348
|
|
|
3341
|
-
This property is not read by the game engine itself, but the base mod's data-updates.lua
|
|
3349
|
+
This property is not read by the game engine itself, but the base mod's data-updates.lua file. This means it is discarded by the game engine after loading finishes.
|
|
3342
3350
|
*/
|
|
3343
3351
|
auto_barrel?: boolean,
|
|
3344
3352
|
|
|
@@ -4962,7 +4970,7 @@ interface MapSettings {
|
|
|
4962
4970
|
/**
|
|
4963
4971
|
* Offers can be added to a market and they are shown when opening the entity. Offers allow to spend items to get research bonuses or items.
|
|
4964
4972
|
*/
|
|
4965
|
-
interface MarketPrototype {
|
|
4973
|
+
interface MarketPrototype extends EntityWithOwnerPrototype{
|
|
4966
4974
|
|
|
4967
4975
|
/**
|
|
4968
4976
|
* Whether all forces are allowed to open this market.
|
|
@@ -6845,7 +6853,7 @@ interface RocketSiloPrototype extends AssemblingMachinePrototype{
|
|
|
6845
6853
|
base_light?: LightDefinition,
|
|
6846
6854
|
|
|
6847
6855
|
/**
|
|
6848
|
-
* Drawn instead of `base_day_sprite` during the night
|
|
6856
|
+
* Drawn instead of `base_day_sprite` during the night, that is when {@link LuaSurface::darkness | runtime:LuaSurface::darkness} is larger than 0.3.
|
|
6849
6857
|
*/
|
|
6850
6858
|
base_night_sprite?: Sprite,
|
|
6851
6859
|
|
|
@@ -6899,7 +6907,7 @@ interface RocketSiloPrototype extends AssemblingMachinePrototype{
|
|
|
6899
6907
|
/**
|
|
6900
6908
|
* May be 0.
|
|
6901
6909
|
|
|
6902
|
-
Additional energy used during the night
|
|
6910
|
+
Additional energy used during the night, that is when {@link LuaSurface::darkness | runtime:LuaSurface::darkness} is larger than 0.3.
|
|
6903
6911
|
*/
|
|
6904
6912
|
lamp_energy_usage: Energy,
|
|
6905
6913
|
|
|
@@ -7275,7 +7283,7 @@ Note: The scale that can be defined in the sprite may not behave as expected bec
|
|
|
7275
7283
|
}
|
|
7276
7284
|
|
|
7277
7285
|
/**
|
|
7278
|
-
* An extremely basic entity with no special functionality. Used for minable rocks.
|
|
7286
|
+
* An extremely basic entity with no special functionality. Used for minable rocks. Cannot be rotated.
|
|
7279
7287
|
*/
|
|
7280
7288
|
interface SimpleEntityPrototype extends EntityWithHealthPrototype{
|
|
7281
7289
|
animations?: AnimationVariations,
|
|
@@ -7286,9 +7294,9 @@ interface SimpleEntityPrototype extends EntityWithHealthPrototype{
|
|
|
7286
7294
|
count_as_rock_for_filtered_deconstruction?: boolean,
|
|
7287
7295
|
|
|
7288
7296
|
/**
|
|
7289
|
-
* Takes priority over `animations`.
|
|
7297
|
+
* Takes priority over `animations`. Only the `north` sprite is used because this entity cannot be rotated.
|
|
7290
7298
|
*/
|
|
7291
|
-
picture?:
|
|
7299
|
+
picture?: Sprite4Way,
|
|
7292
7300
|
|
|
7293
7301
|
/**
|
|
7294
7302
|
* Takes priority over `picture` and `animations`.
|
|
@@ -7309,7 +7317,7 @@ interface SimpleEntityPrototype extends EntityWithHealthPrototype{
|
|
|
7309
7317
|
}
|
|
7310
7318
|
|
|
7311
7319
|
/**
|
|
7312
|
-
* By default, this entity will be a priority target for units/turrets, who will choose to attack it even if it does not block their path.
|
|
7320
|
+
* By default, this entity will be a priority target for units/turrets, who will choose to attack it even if it does not block their path. Setting {@link EntityWithOwnerPrototype::is_military_target | prototype:EntityWithOwnerPrototype::is_military_target} to `false` will turn this off, which then makes this type equivalent to {@link SimpleEntityWithOwnerPrototype | prototype:SimpleEntityWithOwnerPrototype}.
|
|
7313
7321
|
*/
|
|
7314
7322
|
interface SimpleEntityWithForcePrototype extends SimpleEntityWithOwnerPrototype{
|
|
7315
7323
|
|
|
@@ -7321,6 +7329,8 @@ interface SimpleEntityWithForcePrototype extends SimpleEntityWithOwnerPrototype{
|
|
|
7321
7329
|
|
|
7322
7330
|
/**
|
|
7323
7331
|
* Has a force, but unlike {@link SimpleEntityWithForcePrototype | prototype:SimpleEntityWithForcePrototype} it is only attacked if the biters get stuck on it (or if {@link EntityWithOwnerPrototype::is_military_target | prototype:EntityWithOwnerPrototype::is_military_target} set to true to make the two entity types equivalent).
|
|
7332
|
+
*
|
|
7333
|
+
* Can be rotated in 4 directions. `picture` can be used to specify different graphics per direction.
|
|
7324
7334
|
*/
|
|
7325
7335
|
interface SimpleEntityWithOwnerPrototype extends EntityWithOwnerPrototype{
|
|
7326
7336
|
animations?: AnimationVariations,
|
|
@@ -7333,7 +7343,7 @@ interface SimpleEntityWithOwnerPrototype extends EntityWithOwnerPrototype{
|
|
|
7333
7343
|
/**
|
|
7334
7344
|
* Takes priority over `animations`.
|
|
7335
7345
|
*/
|
|
7336
|
-
picture?:
|
|
7346
|
+
picture?: Sprite4Way,
|
|
7337
7347
|
|
|
7338
7348
|
/**
|
|
7339
7349
|
* Takes priority over `picture` and `animations`.
|
|
@@ -7484,9 +7494,9 @@ interface SoundPrototype {
|
|
|
7484
7494
|
/**
|
|
7485
7495
|
* Supported sound file formats are `.ogg (Vorbis)` and `.wav`.
|
|
7486
7496
|
|
|
7487
|
-
Only loaded if `variations` is not defined.
|
|
7497
|
+
Only loaded, and mandatory if `variations` is not defined.
|
|
7488
7498
|
*/
|
|
7489
|
-
filename
|
|
7499
|
+
filename?: FileName,
|
|
7490
7500
|
game_controller_vibration_data?: GameControllerVibrationData,
|
|
7491
7501
|
|
|
7492
7502
|
/**
|
|
@@ -7738,11 +7748,11 @@ Only one of `draw_as_shadow`, `draw_as_glow` and `draw_as_light` can be true. Th
|
|
|
7738
7748
|
draw_as_shadow?: boolean,
|
|
7739
7749
|
|
|
7740
7750
|
/**
|
|
7741
|
-
* Only loaded if `layers` is not defined.
|
|
7751
|
+
* Only loaded, and mandatory if `layers` is not defined.
|
|
7742
7752
|
|
|
7743
7753
|
The path to the sprite file to use.
|
|
7744
7754
|
*/
|
|
7745
|
-
filename
|
|
7755
|
+
filename?: FileName,
|
|
7746
7756
|
|
|
7747
7757
|
/**
|
|
7748
7758
|
* Only loaded if `layers` is not defined.
|
package/dist/serpent.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
// Type definitions for Serpent interface - for use with Factorio API
|
|
2
|
-
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
|
-
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
|
-
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
|
|
6
|
-
interface Serpent {
|
|
7
|
-
dump(this: void, a: object, options: SerpentOptions): string
|
|
8
|
-
line(this: void, a: object, options: SerpentOptions): string
|
|
9
|
-
block(this: void, a: object, options: SerpentOptions): string
|
|
10
|
-
load(this: void, str: string, options?: {safe?: boolean}): string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface SerpentOptions {
|
|
14
|
-
indent?: string
|
|
15
|
-
comment?: boolean | number
|
|
16
|
-
sortkeys?: boolean | ((this: void, keys: any[], table: object) => void)
|
|
17
|
-
sparse?: boolean
|
|
18
|
-
compact?: boolean
|
|
19
|
-
fatal?: boolean
|
|
20
|
-
nocode?: boolean
|
|
21
|
-
nohuge?: boolean
|
|
22
|
-
maxlevel?: number
|
|
23
|
-
maxnum?: number
|
|
24
|
-
maxlength?: number
|
|
25
|
-
metatostring?: boolean
|
|
26
|
-
numformat?: string
|
|
27
|
-
valignore?: string[]
|
|
28
|
-
keyallow?: string[]
|
|
29
|
-
keyignore?: string[]
|
|
30
|
-
valtypeignore?: string[]
|
|
31
|
-
custom?: (tag: string, head: string, body: string, tail: string, level?: number) => void
|
|
32
|
-
name?: string
|
|
33
|
-
}
|
|
1
|
+
// Type definitions for Serpent interface - for use with Factorio API
|
|
2
|
+
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
|
+
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
|
+
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
+
|
|
6
|
+
interface Serpent {
|
|
7
|
+
dump(this: void, a: object, options: SerpentOptions): string
|
|
8
|
+
line(this: void, a: object, options: SerpentOptions): string
|
|
9
|
+
block(this: void, a: object, options: SerpentOptions): string
|
|
10
|
+
load(this: void, str: string, options?: {safe?: boolean}): string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface SerpentOptions {
|
|
14
|
+
indent?: string
|
|
15
|
+
comment?: boolean | number
|
|
16
|
+
sortkeys?: boolean | ((this: void, keys: any[], table: object) => void)
|
|
17
|
+
sparse?: boolean
|
|
18
|
+
compact?: boolean
|
|
19
|
+
fatal?: boolean
|
|
20
|
+
nocode?: boolean
|
|
21
|
+
nohuge?: boolean
|
|
22
|
+
maxlevel?: number
|
|
23
|
+
maxnum?: number
|
|
24
|
+
maxlength?: number
|
|
25
|
+
metatostring?: boolean
|
|
26
|
+
numformat?: string
|
|
27
|
+
valignore?: string[]
|
|
28
|
+
keyallow?: string[]
|
|
29
|
+
keyignore?: string[]
|
|
30
|
+
valtypeignore?: string[]
|
|
31
|
+
custom?: (tag: string, head: string, body: string, tail: string, level?: number) => void
|
|
32
|
+
name?: string
|
|
33
|
+
}
|