typed-factorio 0.19.1 → 0.20.0-beta.1
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/Changelog.md +14 -8
- package/README.md +26 -15
- package/custom-index-template.d.ts +24 -0
- package/generated/classes.d.ts +58 -58
- package/generated/concepts.d.ts +3 -3
- package/generated/events.d.ts +137 -139
- package/generated/index-types-strict.d.ts +52 -0
- package/generated/index-types.d.ts +38 -0
- package/package.json +2 -5
- package/runtime/index.d.ts +9 -1
- package/runtime/pairs.d.ts +1 -0
- package/runtime/strict-index-types.d.ts +18 -0
- package/generated/index.d.ts +0 -9
package/Changelog.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# v0.20.0
|
2
|
+
|
3
|
+
- Updated to factorio version 1.1.56
|
4
|
+
- Added custom-index-template.d.ts. You can use this if you would like to make a "custom" modification of the type definitions.
|
5
|
+
- **This is an opt-in**: Some numeric types which represent indices/number,e.g. player_index, entity_number, are now branded numbers with their own type, e.g. `PlayerIndex` and `EntityNumber`. See the README for more info.
|
6
|
+
|
1
7
|
# v0.19.0
|
2
8
|
|
3
9
|
- Updated to factorio version 1.1.53
|
@@ -33,8 +39,8 @@
|
|
33
39
|
# v0.15.0
|
34
40
|
|
35
41
|
- Table or array concepts are now declared in table form wherever it is an "read" position.
|
36
|
-
|
37
|
-
|
42
|
+
- This works with setter overloading for applicable properties: `player.color.x; player.color = [1, 1, 1]` is now valid!
|
43
|
+
- This also applies to concepts/complex types which contain table_or_array properties.
|
38
44
|
- Some concepts now also have a special form where it is known to be in a "read" position, where all table_or_array concepts are declared in table form. These concepts are suffixed with "Read", e.g. `ScriptAreaRead`.
|
39
45
|
- Arrays which are known to be in a "write" only form (e.g. method parameters) now are marked readonly. This means you can now pass readonly arrays to these methods.
|
40
46
|
- `MapPosition` is now a table or array concept.
|
@@ -50,17 +56,17 @@
|
|
50
56
|
- LuaStyle size, margin/padding setters now have more specific array types. These array types are `SizeArray` and `StyleValuesArray` for size and margin/padding, respectively.
|
51
57
|
- `@noSelf` annotation is now only present when necessary.
|
52
58
|
- For classes with subclasses:
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
59
|
+
- The original class name (e.g. `LuaItemStack`) still contains attributes of all subclasses (same as before).
|
60
|
+
- There is now a `Base` type (e.g. `BaseItemStack`) which only includes attributes common to all subclasses.
|
61
|
+
- There is a separate type definition for each subclass, e.g. `BlueprintItem`. Note that one instance may still belong to multiple subclasses (the subclasses are not mutually exclusive).
|
62
|
+
- The above two can be optionally used for stricter types.
|
57
63
|
|
58
64
|
# v0.13.2
|
59
65
|
|
60
66
|
- Fix: resize_to_sprite property should not be on subclass sprite-button
|
61
67
|
- Fix: ChooseElemButtonSpec filters should be named elem_filters
|
62
68
|
- Switch back to `/latest` api docs link
|
63
|
-
|
69
|
+
- New version of web api docs is now active
|
64
70
|
|
65
71
|
# v0.13.0
|
66
72
|
|
@@ -96,7 +102,7 @@
|
|
96
102
|
# v0.7.3
|
97
103
|
|
98
104
|
- Update to factorio version 1.1.42
|
99
|
-
|
105
|
+
- No api changes, but improvements to descriptions
|
100
106
|
|
101
107
|
# v0.7.2
|
102
108
|
|
package/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Complete and featureful typescript definitions for the Factorio modding lua api. This is intended to be used with [TypescriptToLua](https://typescripttolua.github.io/).
|
4
4
|
|
5
|
-
This project aims to provide type definitions for the Factorio lua API that are as complete as possible. This means no `any`s or `unknown`s, correct nullability, and smart
|
5
|
+
This project aims to provide type definitions for the Factorio lua API that are as complete as possible. This means no `any`s or `unknown`s, correct nullability, and lots of smart type features. The generator integrates both the Factorio JSON api docs and manually defined additions and overrides.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -30,7 +30,10 @@ yarn add typed-factorio
|
|
30
30
|
|
31
31
|
This will add the types for the runtime stage to your entire project.
|
32
32
|
|
33
|
-
|
33
|
+
Notes:
|
34
|
+
> When types are updated, or released for a new factorio version, you will need update your package version to get the types.
|
35
|
+
>
|
36
|
+
> There is an opt-in feature for stricter index types, see [Strict index types](#Strict index types) for more details.
|
34
37
|
|
35
38
|
### Settings and data stage
|
36
39
|
|
@@ -42,7 +45,7 @@ Example:
|
|
42
45
|
|
43
46
|
```ts
|
44
47
|
import { Data, Mods } from "typed-factorio/data/types"
|
45
|
-
// or
|
48
|
+
// or
|
46
49
|
import { Data, Mods } from "typed-factorio/settings/types"
|
47
50
|
|
48
51
|
declare const data: Data
|
@@ -93,15 +96,6 @@ Variant parameter types (types with "additional fields can be specified dependin
|
|
93
96
|
|
94
97
|
The type for a specific variant is prefixed with the variant name, or with "Other" for variants without additional fields (e.g. `AmmoDamageTechnologyModifier`, `OtherTechnologyModifier`).
|
95
98
|
|
96
|
-
### Types with subclasses
|
97
|
-
|
98
|
-
Some classes have attributes that are documented to only work on particular subclasses. For these classes, e.g. `LuaEntity`, there are also these other types that you can _optionally_ use:
|
99
|
-
|
100
|
-
- a "Base" type, e.g. `BaseEntity`, which only contains members usable by all subclasses
|
101
|
-
- individual subclass types, e.g. `CraftingMachineEntity`, which extends the base type with members specific to that subclass
|
102
|
-
|
103
|
-
The simple class name, `LuaEntity` in this example, still contains attributes for _all_ subclasses.
|
104
|
-
|
105
99
|
### Events
|
106
100
|
|
107
101
|
`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.
|
@@ -120,14 +114,31 @@ Table-or-array types will appear in the Table form when known to be in a read po
|
|
120
114
|
|
121
115
|
For some concepts, there is also a special form for when the concept is used in a "read" position, where all table-or-array types are in Table form. These types are suffixed with `Read`, e.g. `ScriptPositionRead`.
|
122
116
|
|
117
|
+
|
118
|
+
### Types with subclasses
|
119
|
+
|
120
|
+
Some classes have attributes that are documented to only work on particular subclasses. For these classes, e.g. `LuaEntity`, there are specific types that you can _optionally_ use:
|
121
|
+
|
122
|
+
- a "Base" type, e.g. `BaseEntity`, which only contains members usable by all subclasses
|
123
|
+
- individual subclass types, e.g. `CraftingMachineEntity`, which extends the base type with members specific to that subclass
|
124
|
+
|
125
|
+
The simple class name, `LuaEntity` in this example, contains attributes for _all_ subclasses.
|
126
|
+
|
123
127
|
### LuaGuiElement
|
124
128
|
|
125
129
|
`LuaGuiElement` is broken up into a [discriminated union](https://basarat.gitbook.io/typescript/type-system/discriminated-unions), with a separate type for each gui element type. Individual gui element types can be referred to by `<Type>GuiElement`, e.g. `ButtonGuiElement`.
|
126
130
|
|
127
|
-
Similarly, the table passed to `LuaGuiElement.add`, referred to as `GuiSpec`, is also broken up into a discriminated union
|
131
|
+
Similarly, the table passed to `LuaGuiElement.add`, referred to as `GuiSpec`, is also broken up into a discriminated union. The type for a specific GuiSpec is `<Type>GuiSpec`, e.g. `ListBoxGuiSpec`. `LuaGuiElement.add` will return the appropriate gui element type corresponding to the gui spec type received.
|
128
132
|
|
129
133
|
This is done both to provide more accurate types, and for possible integration with [JSX](https://typescripttolua.github.io/docs/jsx/).
|
130
134
|
|
131
|
-
###
|
135
|
+
### Strict index types
|
136
|
+
|
137
|
+
This feature is recommended, but currently is a **opt-in**. To opt in, use `typed-factorio/runtime/strict-index-types` instead of `typed-factorio/runtime` in your `tsconfig.json`.
|
138
|
+
|
139
|
+
Some `uint` types which represent indices, e.g. player_index, entity_number, are now "branded" numbers with their own type, e.g. `PlayerIndex` and `EntityNumber`. These are assignable to `number`, but `number` is not assignable to them.
|
140
|
+
These are indices that do not index into an array-like structure, and otherwise should usually not have arithmetic done to them. So, using a separate type helps ensure correctness.
|
141
|
+
You can still use these types as keys in an index signature, e.g. `{ [index: PlayerIndex]: "foo" }`.
|
142
|
+
You can cast "plain" numbers to these types, e.g. `2 as PlayerIndex`, only do this with some care.
|
132
143
|
|
133
|
-
|
144
|
+
- `player_index` and `surface_index` still allow the numeric constant 1 as a valid index, representing the first player or the default surface, respectively. This is allowed as this is a common enough use case.
|
@@ -0,0 +1,24 @@
|
|
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
|
+
// Replace "index-types.d.ts" with "index-types-strict.d.ts" below if you want strict index types.
|
6
|
+
|
7
|
+
/// <reference types="lua-types/5.2" />
|
8
|
+
|
9
|
+
// generated
|
10
|
+
/// <reference types="typed-factorio/generated/builtin-types.d.ts" />
|
11
|
+
/// <reference types="typed-factorio/generated/global-objects.d.ts" />
|
12
|
+
/// <reference types="typed-factorio/generated/defines.d.ts" />
|
13
|
+
/// <reference types="typed-factorio/generated/events.d.ts" />
|
14
|
+
/// <reference types="typed-factorio/generated/classes.d.ts" />
|
15
|
+
/// <reference types="typed-factorio/generated/concepts.d.ts" />
|
16
|
+
/// <reference types="typed-factorio/generated/index-types.d.ts" />
|
17
|
+
|
18
|
+
// other runtime
|
19
|
+
/// <reference types="typed-factorio/runtime/librariesAndFunctions.d.ts" />
|
20
|
+
/// <reference types="typed-factorio/runtime/pairs.d.ts" />
|
21
|
+
|
22
|
+
// lualib
|
23
|
+
/// <reference types="typed-factorio/runtime/util.d.ts" />
|
24
|
+
/// <reference types="typed-factorio/runtime/mod-gui.d.ts" />
|
package/generated/classes.d.ts
CHANGED
@@ -300,7 +300,7 @@ interface LuaBootstrap {
|
|
300
300
|
* @returns The registration number. It is used to identify the entity in the {@link OnEntityDestroyedEvent on_entity_destroyed} event.
|
301
301
|
* @remarks 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.
|
302
302
|
*/
|
303
|
-
register_on_entity_destroyed(entity: LuaEntity):
|
303
|
+
register_on_entity_destroyed(entity: LuaEntity): RegistrationNumber
|
304
304
|
/**
|
305
305
|
* Generate a new, unique event ID that can be used to raise custom events with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event}.
|
306
306
|
*
|
@@ -392,7 +392,7 @@ interface LuaBootstrap {
|
|
392
392
|
/**
|
393
393
|
* The player doing the chatting.
|
394
394
|
*/
|
395
|
-
readonly player_index:
|
395
|
+
readonly player_index: PlayerIndex
|
396
396
|
/**
|
397
397
|
* The chat message to send.
|
398
398
|
*/
|
@@ -413,7 +413,7 @@ interface LuaBootstrap {
|
|
413
413
|
/**
|
414
414
|
* The player doing the crafting.
|
415
415
|
*/
|
416
|
-
readonly player_index:
|
416
|
+
readonly player_index: PlayerIndex
|
417
417
|
/**
|
418
418
|
* The recipe used to craft this item.
|
419
419
|
*/
|
@@ -430,7 +430,7 @@ interface LuaBootstrap {
|
|
430
430
|
/**
|
431
431
|
* The player transferred from or to.
|
432
432
|
*/
|
433
|
-
readonly player_index:
|
433
|
+
readonly player_index: PlayerIndex
|
434
434
|
/**
|
435
435
|
* The entity transferred from or to.
|
436
436
|
*/
|
@@ -464,7 +464,7 @@ interface LuaBootstrap {
|
|
464
464
|
/**
|
465
465
|
* The player who did the purchasing.
|
466
466
|
*/
|
467
|
-
readonly player_index:
|
467
|
+
readonly player_index: PlayerIndex
|
468
468
|
/**
|
469
469
|
* The market entity.
|
470
470
|
*/
|
@@ -532,7 +532,7 @@ interface LuaBootstrap {
|
|
532
532
|
/**
|
533
533
|
* The surface whose tiles have been changed.
|
534
534
|
*/
|
535
|
-
readonly surface_index:
|
535
|
+
readonly surface_index: SurfaceIndex
|
536
536
|
/**
|
537
537
|
* The tiles that have been changed.
|
538
538
|
*/
|
@@ -1171,7 +1171,7 @@ interface LuaControl {
|
|
1171
1171
|
*
|
1172
1172
|
* {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.is_flashlight_enabled View documentation}
|
1173
1173
|
*/
|
1174
|
-
is_flashlight_enabled():
|
1174
|
+
is_flashlight_enabled(): boolean
|
1175
1175
|
/**
|
1176
1176
|
* Gets the count of the given recipe that can be crafted.
|
1177
1177
|
*
|
@@ -1938,7 +1938,7 @@ interface LuaCustomInputPrototype {
|
|
1938
1938
|
help(): string
|
1939
1939
|
}
|
1940
1940
|
|
1941
|
-
type
|
1941
|
+
type CustomTableIndexer<K extends string | number, V>
|
1942
1942
|
/**
|
1943
1943
|
* Access an element of this custom table.
|
1944
1944
|
*
|
@@ -1999,7 +1999,7 @@ interface LuaCustomTableMembers {
|
|
1999
1999
|
* ```
|
2000
2000
|
*/
|
2001
2001
|
type LuaCustomTable<K extends string | number, V> = LuaCustomTableMembers &
|
2002
|
-
|
2002
|
+
CustomTableIndexer<K, V> &
|
2003
2003
|
LuaPairsIterable<[number] extends [K] ? number : K, V>
|
2004
2004
|
|
2005
2005
|
/**
|
@@ -2467,13 +2467,13 @@ interface LuaEntity extends LuaControl {
|
|
2467
2467
|
*/
|
2468
2468
|
clear_request_slot(slot: uint): void
|
2469
2469
|
/**
|
2470
|
-
* Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether
|
2470
|
+
* Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether a crafting process has been started in this machine.
|
2471
2471
|
*
|
2472
2472
|
* _Can only be used if this is CraftingMachine_
|
2473
2473
|
*
|
2474
2474
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_crafting View documentation}
|
2475
2475
|
*/
|
2476
|
-
is_crafting():
|
2476
|
+
is_crafting(): boolean
|
2477
2477
|
/**
|
2478
2478
|
* _Can only be used if this is Gate_
|
2479
2479
|
*
|
@@ -3793,7 +3793,7 @@ interface LuaEntity extends LuaControl {
|
|
3793
3793
|
*
|
3794
3794
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number View documentation}
|
3795
3795
|
*/
|
3796
|
-
readonly unit_number:
|
3796
|
+
readonly unit_number: UnitNumber | undefined
|
3797
3797
|
/**
|
3798
3798
|
* The {@link LuaEntity#unit_number unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@link https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner} that was destroyed to create this ghost. If it was created by other means, or if the inner entity doesn not support unit numbers, this property is `nil`.
|
3799
3799
|
*
|
@@ -3801,7 +3801,7 @@ interface LuaEntity extends LuaControl {
|
|
3801
3801
|
*
|
3802
3802
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_unit_number View documentation}
|
3803
3803
|
*/
|
3804
|
-
readonly ghost_unit_number:
|
3804
|
+
readonly ghost_unit_number: UnitNumber | undefined
|
3805
3805
|
/**
|
3806
3806
|
* 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]
|
3807
3807
|
*
|
@@ -5355,7 +5355,7 @@ interface BaseEntity extends LuaControl {
|
|
5355
5355
|
*
|
5356
5356
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number View documentation}
|
5357
5357
|
*/
|
5358
|
-
readonly unit_number:
|
5358
|
+
readonly unit_number: UnitNumber | undefined
|
5359
5359
|
/**
|
5360
5360
|
* 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]
|
5361
5361
|
*
|
@@ -5772,7 +5772,7 @@ interface EntityGhostEntity extends BaseEntity {
|
|
5772
5772
|
*
|
5773
5773
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_unit_number View documentation}
|
5774
5774
|
*/
|
5775
|
-
readonly ghost_unit_number:
|
5775
|
+
readonly ghost_unit_number: UnitNumber | undefined
|
5776
5776
|
}
|
5777
5777
|
|
5778
5778
|
/**
|
@@ -5831,13 +5831,13 @@ interface MarketEntity extends BaseEntity {
|
|
5831
5831
|
*/
|
5832
5832
|
interface CraftingMachineEntity extends BaseEntity {
|
5833
5833
|
/**
|
5834
|
-
* Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether
|
5834
|
+
* Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether a crafting process has been started in this machine.
|
5835
5835
|
*
|
5836
5836
|
* _Can only be used if this is CraftingMachine_
|
5837
5837
|
*
|
5838
5838
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_crafting View documentation}
|
5839
5839
|
*/
|
5840
|
-
is_crafting():
|
5840
|
+
is_crafting(): boolean
|
5841
5841
|
/**
|
5842
5842
|
* Current recipe being assembled by this machine or `nil` if no recipe is set.
|
5843
5843
|
*
|
@@ -11954,7 +11954,7 @@ interface LuaGameScript {
|
|
11954
11954
|
* @param player The player index or name.
|
11955
11955
|
* @remarks This is a shortcut for game.players[...]
|
11956
11956
|
*/
|
11957
|
-
get_player(
|
11957
|
+
get_player(index: PlayerIndex | string): LuaPlayer | undefined
|
11958
11958
|
/**
|
11959
11959
|
* Gets the given surface or returns `nil` if no surface is found.
|
11960
11960
|
*
|
@@ -11962,7 +11962,7 @@ interface LuaGameScript {
|
|
11962
11962
|
* @param surface The surface index or name.
|
11963
11963
|
* @remarks This is a shortcut for game.surfaces[...]
|
11964
11964
|
*/
|
11965
|
-
get_surface(
|
11965
|
+
get_surface(index: SurfaceIndex | string): LuaSurface | undefined
|
11966
11966
|
/**
|
11967
11967
|
* Creates a {@link LuaProfiler}, which is used for measuring script performance.
|
11968
11968
|
*
|
@@ -12155,7 +12155,7 @@ interface LuaGameScript {
|
|
12155
12155
|
*
|
12156
12156
|
* {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players View documentation}
|
12157
12157
|
*/
|
12158
|
-
readonly players: LuaCustomTable<
|
12158
|
+
readonly players: LuaCustomTable<PlayerIndex | string, LuaPlayer>
|
12159
12159
|
/**
|
12160
12160
|
* 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.
|
12161
12161
|
*
|
@@ -12422,7 +12422,7 @@ interface LuaGameScript {
|
|
12422
12422
|
*
|
12423
12423
|
* {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.surfaces View documentation}
|
12424
12424
|
*/
|
12425
|
-
readonly surfaces: LuaCustomTable<
|
12425
|
+
readonly surfaces: LuaCustomTable<SurfaceIndex | string, LuaSurface>
|
12426
12426
|
/**
|
12427
12427
|
* The active mods versions. The keys are mod names, the values are the versions.
|
12428
12428
|
*
|
@@ -12966,7 +12966,7 @@ interface CameraGuiSpec extends BaseGuiSpec {
|
|
12966
12966
|
/**
|
12967
12967
|
* The surface that the camera will render. Defaults to the player's current surface.
|
12968
12968
|
*/
|
12969
|
-
readonly surface_index?:
|
12969
|
+
readonly surface_index?: SurfaceIndex
|
12970
12970
|
/**
|
12971
12971
|
* The initial camera zoom. Defaults to `0.75`.
|
12972
12972
|
*/
|
@@ -13136,7 +13136,7 @@ interface MinimapGuiSpec extends BaseGuiSpec {
|
|
13136
13136
|
/**
|
13137
13137
|
* The surface the camera will render. Defaults to the player's current surface.
|
13138
13138
|
*/
|
13139
|
-
readonly surface_index?:
|
13139
|
+
readonly surface_index?: SurfaceIndex
|
13140
13140
|
/**
|
13141
13141
|
* The player index the map should use. Defaults to the current player.
|
13142
13142
|
*/
|
@@ -13218,7 +13218,7 @@ type GuiSpec =
|
|
13218
13218
|
| TabbedPaneGuiSpec
|
13219
13219
|
| LabelGuiSpec
|
13220
13220
|
|
13221
|
-
interface
|
13221
|
+
interface GuiElementIndexer {
|
13222
13222
|
/**
|
13223
13223
|
* The indexing operator. Gets children by name.
|
13224
13224
|
*
|
@@ -13312,7 +13312,7 @@ interface BaseGuiElement {
|
|
13312
13312
|
*
|
13313
13313
|
* {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.index View documentation}
|
13314
13314
|
*/
|
13315
|
-
readonly index:
|
13315
|
+
readonly index: GuiElementIndex
|
13316
13316
|
/**
|
13317
13317
|
* The GUI this element is a child of.
|
13318
13318
|
*
|
@@ -13367,7 +13367,7 @@ interface BaseGuiElement {
|
|
13367
13367
|
*
|
13368
13368
|
* {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.player_index View documentation}
|
13369
13369
|
*/
|
13370
|
-
readonly player_index:
|
13370
|
+
readonly player_index: PlayerIndex
|
13371
13371
|
tooltip: LocalisedString
|
13372
13372
|
/**
|
13373
13373
|
* The type of this GUI element.
|
@@ -13497,7 +13497,7 @@ interface ChooseElemButtonGuiElementMembers extends BaseGuiElement {
|
|
13497
13497
|
locked: boolean
|
13498
13498
|
}
|
13499
13499
|
|
13500
|
-
type ChooseElemButtonGuiElement = ChooseElemButtonGuiElementMembers &
|
13500
|
+
type ChooseElemButtonGuiElement = ChooseElemButtonGuiElementMembers & GuiElementIndexer
|
13501
13501
|
|
13502
13502
|
/**
|
13503
13503
|
* @noSelf
|
@@ -13559,7 +13559,7 @@ interface DropDownGuiElementMembers extends BaseGuiElement {
|
|
13559
13559
|
selected_index: uint
|
13560
13560
|
}
|
13561
13561
|
|
13562
|
-
type DropDownGuiElement = DropDownGuiElementMembers &
|
13562
|
+
type DropDownGuiElement = DropDownGuiElementMembers & GuiElementIndexer
|
13563
13563
|
|
13564
13564
|
interface EmptyWidgetGuiElementMembers extends BaseGuiElement {
|
13565
13565
|
/**
|
@@ -13587,7 +13587,7 @@ interface EmptyWidgetGuiElementMembers extends BaseGuiElement {
|
|
13587
13587
|
drag_target: LuaGuiElement | undefined
|
13588
13588
|
}
|
13589
13589
|
|
13590
|
-
type EmptyWidgetGuiElement = EmptyWidgetGuiElementMembers &
|
13590
|
+
type EmptyWidgetGuiElement = EmptyWidgetGuiElementMembers & GuiElementIndexer
|
13591
13591
|
|
13592
13592
|
interface EntityPreviewGuiElementMembers extends BaseGuiElement {
|
13593
13593
|
/**
|
@@ -13604,7 +13604,7 @@ interface EntityPreviewGuiElementMembers extends BaseGuiElement {
|
|
13604
13604
|
entity: LuaEntity | undefined
|
13605
13605
|
}
|
13606
13606
|
|
13607
|
-
type EntityPreviewGuiElement = EntityPreviewGuiElementMembers &
|
13607
|
+
type EntityPreviewGuiElement = EntityPreviewGuiElementMembers & GuiElementIndexer
|
13608
13608
|
|
13609
13609
|
/**
|
13610
13610
|
* @noSelf
|
@@ -13676,7 +13676,7 @@ interface ListBoxGuiElementMembers extends BaseGuiElement {
|
|
13676
13676
|
selected_index: uint
|
13677
13677
|
}
|
13678
13678
|
|
13679
|
-
type ListBoxGuiElement = ListBoxGuiElementMembers &
|
13679
|
+
type ListBoxGuiElement = ListBoxGuiElementMembers & GuiElementIndexer
|
13680
13680
|
|
13681
13681
|
/**
|
13682
13682
|
* @noSelf
|
@@ -13748,7 +13748,7 @@ interface ScrollPaneGuiElementMembers extends BaseGuiElement {
|
|
13748
13748
|
vertical_scroll_policy: "auto" | "never" | "always" | "auto-and-reserve-space" | "dont-show-but-allow-scrolling"
|
13749
13749
|
}
|
13750
13750
|
|
13751
|
-
type ScrollPaneGuiElement = ScrollPaneGuiElementMembers &
|
13751
|
+
type ScrollPaneGuiElement = ScrollPaneGuiElementMembers & GuiElementIndexer
|
13752
13752
|
|
13753
13753
|
interface SpriteButtonGuiElementMembers extends BaseGuiElement {
|
13754
13754
|
/**
|
@@ -13798,7 +13798,7 @@ interface SpriteButtonGuiElementMembers extends BaseGuiElement {
|
|
13798
13798
|
set mouse_button_filter(value: MouseButtonFlags)
|
13799
13799
|
}
|
13800
13800
|
|
13801
|
-
type SpriteButtonGuiElement = SpriteButtonGuiElementMembers &
|
13801
|
+
type SpriteButtonGuiElement = SpriteButtonGuiElementMembers & GuiElementIndexer
|
13802
13802
|
|
13803
13803
|
/**
|
13804
13804
|
* @noSelf
|
@@ -13846,7 +13846,7 @@ interface TabbedPaneGuiElementMembers extends BaseGuiElement {
|
|
13846
13846
|
readonly tabs: TabAndContent[]
|
13847
13847
|
}
|
13848
13848
|
|
13849
|
-
type TabbedPaneGuiElement = TabbedPaneGuiElementMembers &
|
13849
|
+
type TabbedPaneGuiElement = TabbedPaneGuiElementMembers & GuiElementIndexer
|
13850
13850
|
|
13851
13851
|
/**
|
13852
13852
|
* @noSelf
|
@@ -13960,7 +13960,7 @@ interface TextBoxGuiElementMembers extends BaseGuiElement {
|
|
13960
13960
|
clear_and_focus_on_right_click: boolean
|
13961
13961
|
}
|
13962
13962
|
|
13963
|
-
type TextBoxGuiElement = TextBoxGuiElementMembers &
|
13963
|
+
type TextBoxGuiElement = TextBoxGuiElementMembers & GuiElementIndexer
|
13964
13964
|
|
13965
13965
|
interface ButtonGuiElementMembers extends BaseGuiElement {
|
13966
13966
|
/**
|
@@ -13978,7 +13978,7 @@ interface ButtonGuiElementMembers extends BaseGuiElement {
|
|
13978
13978
|
set mouse_button_filter(value: MouseButtonFlags)
|
13979
13979
|
}
|
13980
13980
|
|
13981
|
-
type ButtonGuiElement = ButtonGuiElementMembers &
|
13981
|
+
type ButtonGuiElement = ButtonGuiElementMembers & GuiElementIndexer
|
13982
13982
|
|
13983
13983
|
interface CameraGuiElementMembers extends BaseGuiElement {
|
13984
13984
|
/**
|
@@ -13999,7 +13999,7 @@ interface CameraGuiElementMembers extends BaseGuiElement {
|
|
13999
13999
|
*
|
14000
14000
|
* {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.surface_index View documentation}
|
14001
14001
|
*/
|
14002
|
-
surface_index:
|
14002
|
+
surface_index: SurfaceIndex
|
14003
14003
|
/**
|
14004
14004
|
* The zoom this camera or minimap is using.
|
14005
14005
|
*
|
@@ -14014,7 +14014,7 @@ interface CameraGuiElementMembers extends BaseGuiElement {
|
|
14014
14014
|
entity: LuaEntity | undefined
|
14015
14015
|
}
|
14016
14016
|
|
14017
|
-
type CameraGuiElement = CameraGuiElementMembers &
|
14017
|
+
type CameraGuiElement = CameraGuiElementMembers & GuiElementIndexer
|
14018
14018
|
|
14019
14019
|
interface CheckboxGuiElementMembers extends BaseGuiElement {
|
14020
14020
|
/**
|
@@ -14033,7 +14033,7 @@ interface CheckboxGuiElementMembers extends BaseGuiElement {
|
|
14033
14033
|
state: boolean
|
14034
14034
|
}
|
14035
14035
|
|
14036
|
-
type CheckboxGuiElement = CheckboxGuiElementMembers &
|
14036
|
+
type CheckboxGuiElement = CheckboxGuiElementMembers & GuiElementIndexer
|
14037
14037
|
|
14038
14038
|
interface FlowGuiElementMembers extends BaseGuiElement {
|
14039
14039
|
/**
|
@@ -14069,7 +14069,7 @@ interface FlowGuiElementMembers extends BaseGuiElement {
|
|
14069
14069
|
drag_target: LuaGuiElement | undefined
|
14070
14070
|
}
|
14071
14071
|
|
14072
|
-
type FlowGuiElement = FlowGuiElementMembers &
|
14072
|
+
type FlowGuiElement = FlowGuiElementMembers & GuiElementIndexer
|
14073
14073
|
|
14074
14074
|
/**
|
14075
14075
|
* @noSelf
|
@@ -14127,7 +14127,7 @@ interface FrameGuiElementMembers extends BaseGuiElement {
|
|
14127
14127
|
drag_target: LuaGuiElement | undefined
|
14128
14128
|
}
|
14129
14129
|
|
14130
|
-
type FrameGuiElement = FrameGuiElementMembers &
|
14130
|
+
type FrameGuiElement = FrameGuiElementMembers & GuiElementIndexer
|
14131
14131
|
|
14132
14132
|
interface LabelGuiElementMembers extends BaseGuiElement {
|
14133
14133
|
/**
|
@@ -14155,7 +14155,7 @@ interface LabelGuiElementMembers extends BaseGuiElement {
|
|
14155
14155
|
drag_target: LuaGuiElement | undefined
|
14156
14156
|
}
|
14157
14157
|
|
14158
|
-
type LabelGuiElement = LabelGuiElementMembers &
|
14158
|
+
type LabelGuiElement = LabelGuiElementMembers & GuiElementIndexer
|
14159
14159
|
|
14160
14160
|
interface LineGuiElementMembers extends BaseGuiElement {
|
14161
14161
|
/**
|
@@ -14174,7 +14174,7 @@ interface LineGuiElementMembers extends BaseGuiElement {
|
|
14174
14174
|
readonly direction: "horizontal" | "vertical"
|
14175
14175
|
}
|
14176
14176
|
|
14177
|
-
type LineGuiElement = LineGuiElementMembers &
|
14177
|
+
type LineGuiElement = LineGuiElementMembers & GuiElementIndexer
|
14178
14178
|
|
14179
14179
|
interface MinimapGuiElementMembers extends BaseGuiElement {
|
14180
14180
|
/**
|
@@ -14195,7 +14195,7 @@ interface MinimapGuiElementMembers extends BaseGuiElement {
|
|
14195
14195
|
*
|
14196
14196
|
* {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.surface_index View documentation}
|
14197
14197
|
*/
|
14198
|
-
surface_index:
|
14198
|
+
surface_index: SurfaceIndex
|
14199
14199
|
/**
|
14200
14200
|
* The zoom this camera or minimap is using.
|
14201
14201
|
*
|
@@ -14224,7 +14224,7 @@ interface MinimapGuiElementMembers extends BaseGuiElement {
|
|
14224
14224
|
entity: LuaEntity | undefined
|
14225
14225
|
}
|
14226
14226
|
|
14227
|
-
type MinimapGuiElement = MinimapGuiElementMembers &
|
14227
|
+
type MinimapGuiElement = MinimapGuiElementMembers & GuiElementIndexer
|
14228
14228
|
|
14229
14229
|
interface ProgressBarGuiElementMembers extends BaseGuiElement {
|
14230
14230
|
/**
|
@@ -14243,7 +14243,7 @@ interface ProgressBarGuiElementMembers extends BaseGuiElement {
|
|
14243
14243
|
value: double
|
14244
14244
|
}
|
14245
14245
|
|
14246
|
-
type ProgressBarGuiElement = ProgressBarGuiElementMembers &
|
14246
|
+
type ProgressBarGuiElement = ProgressBarGuiElementMembers & GuiElementIndexer
|
14247
14247
|
|
14248
14248
|
interface RadioButtonGuiElementMembers extends BaseGuiElement {
|
14249
14249
|
/**
|
@@ -14262,7 +14262,7 @@ interface RadioButtonGuiElementMembers extends BaseGuiElement {
|
|
14262
14262
|
state: boolean
|
14263
14263
|
}
|
14264
14264
|
|
14265
|
-
type RadioButtonGuiElement = RadioButtonGuiElementMembers &
|
14265
|
+
type RadioButtonGuiElement = RadioButtonGuiElementMembers & GuiElementIndexer
|
14266
14266
|
|
14267
14267
|
/**
|
14268
14268
|
* @noSelf
|
@@ -14340,7 +14340,7 @@ interface SliderGuiElementMembers extends BaseGuiElement {
|
|
14340
14340
|
slider_value: double
|
14341
14341
|
}
|
14342
14342
|
|
14343
|
-
type SliderGuiElement = SliderGuiElementMembers &
|
14343
|
+
type SliderGuiElement = SliderGuiElementMembers & GuiElementIndexer
|
14344
14344
|
|
14345
14345
|
interface SpriteGuiElementMembers extends BaseGuiElement {
|
14346
14346
|
/**
|
@@ -14363,7 +14363,7 @@ interface SpriteGuiElementMembers extends BaseGuiElement {
|
|
14363
14363
|
resize_to_sprite: boolean
|
14364
14364
|
}
|
14365
14365
|
|
14366
|
-
type SpriteGuiElement = SpriteGuiElementMembers &
|
14366
|
+
type SpriteGuiElement = SpriteGuiElementMembers & GuiElementIndexer
|
14367
14367
|
|
14368
14368
|
interface SwitchGuiElementMembers extends BaseGuiElement {
|
14369
14369
|
/**
|
@@ -14424,7 +14424,7 @@ interface SwitchGuiElementMembers extends BaseGuiElement {
|
|
14424
14424
|
right_label_tooltip: LocalisedString
|
14425
14425
|
}
|
14426
14426
|
|
14427
|
-
type SwitchGuiElement = SwitchGuiElementMembers &
|
14427
|
+
type SwitchGuiElement = SwitchGuiElementMembers & GuiElementIndexer
|
14428
14428
|
|
14429
14429
|
interface TabGuiElementMembers extends BaseGuiElement {
|
14430
14430
|
/**
|
@@ -14443,7 +14443,7 @@ interface TabGuiElementMembers extends BaseGuiElement {
|
|
14443
14443
|
badge_text: LocalisedString
|
14444
14444
|
}
|
14445
14445
|
|
14446
|
-
type TabGuiElement = TabGuiElementMembers &
|
14446
|
+
type TabGuiElement = TabGuiElementMembers & GuiElementIndexer
|
14447
14447
|
|
14448
14448
|
interface TableGuiElementMembers extends BaseGuiElement {
|
14449
14449
|
/**
|
@@ -14511,7 +14511,7 @@ interface TableGuiElementMembers extends BaseGuiElement {
|
|
14511
14511
|
drag_target: LuaGuiElement | undefined
|
14512
14512
|
}
|
14513
14513
|
|
14514
|
-
type TableGuiElement = TableGuiElementMembers &
|
14514
|
+
type TableGuiElement = TableGuiElementMembers & GuiElementIndexer
|
14515
14515
|
|
14516
14516
|
/**
|
14517
14517
|
* @noSelf
|
@@ -14609,7 +14609,7 @@ interface TextFieldGuiElementMembers extends BaseGuiElement {
|
|
14609
14609
|
clear_and_focus_on_right_click: boolean
|
14610
14610
|
}
|
14611
14611
|
|
14612
|
-
type TextFieldGuiElement = TextFieldGuiElementMembers &
|
14612
|
+
type TextFieldGuiElement = TextFieldGuiElementMembers & GuiElementIndexer
|
14613
14613
|
|
14614
14614
|
type GuiElementMembers =
|
14615
14615
|
| ChooseElemButtonGuiElementMembers
|
@@ -14691,7 +14691,7 @@ type GuiElementMembers =
|
|
14691
14691
|
* tabbed_pane.add_tab(tab2, label2)
|
14692
14692
|
* ```
|
14693
14693
|
*/
|
14694
|
-
type LuaGuiElement = GuiElementMembers &
|
14694
|
+
type LuaGuiElement = GuiElementMembers & GuiElementIndexer
|
14695
14695
|
|
14696
14696
|
/**
|
14697
14697
|
* Prototype of a heat energy source.
|
@@ -19309,7 +19309,7 @@ interface LuaPlayer extends LuaControl {
|
|
19309
19309
|
*
|
19310
19310
|
* {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.index View documentation}
|
19311
19311
|
*/
|
19312
|
-
readonly index:
|
19312
|
+
readonly index: PlayerIndex
|
19313
19313
|
readonly gui: LuaGui
|
19314
19314
|
/**
|
19315
19315
|
* `true` if the player opened itself. I.e. if they opened the character or god-controller GUI.
|
@@ -22804,7 +22804,7 @@ interface ProgrammableSpeakerSurfaceCreateEntity extends BaseSurfaceCreateEntity
|
|
22804
22804
|
|
22805
22805
|
interface CharacterCorpseSurfaceCreateEntity extends BaseSurfaceCreateEntity {
|
22806
22806
|
readonly inventory_size?: uint
|
22807
|
-
readonly player_index?:
|
22807
|
+
readonly player_index?: PlayerIndex
|
22808
22808
|
}
|
22809
22809
|
|
22810
22810
|
interface HighlightBoxSurfaceCreateEntity extends BaseSurfaceCreateEntity {
|
@@ -23855,7 +23855,7 @@ interface LuaSurface {
|
|
23855
23855
|
*/
|
23856
23856
|
clear(ignore_characters?: boolean): void
|
23857
23857
|
/**
|
23858
|
-
* 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
|
23858
|
+
* 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, such as vehicles. If you want to command actual units (such as biters or spitters) to move, use {@link LuaEntity#set_command LuaEntity::set_command} instead.
|
23859
23859
|
*
|
23860
23860
|
* The resulting path is ultimately returned asynchronously via {@link OnScriptPathRequestFinishedEvent on_script_path_request_finished}.
|
23861
23861
|
*
|
@@ -24071,7 +24071,7 @@ interface LuaSurface {
|
|
24071
24071
|
*
|
24072
24072
|
* {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.index View documentation}
|
24073
24073
|
*/
|
24074
|
-
readonly index:
|
24074
|
+
readonly index: SurfaceIndex
|
24075
24075
|
/**
|
24076
24076
|
* 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.
|
24077
24077
|
*
|