typed-factorio 0.14.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Changelog.md +30 -6
- package/README.md +8 -3
- package/generated/classes.d.ts +14874 -9240
- package/generated/concepts.d.ts +119 -18
- package/generated/events.d.ts +27 -27
- package/generated/index.d.ts +1 -1
- package/generator/typescript-internal.d.ts +9 -0
- package/package.json +3 -3
- package/runtime/pairs.d.ts +8 -7
- package/runtime/util.d.ts +1 -5
package/generated/concepts.d.ts
CHANGED
@@ -101,16 +101,20 @@ type PositionArray = readonly [x: int, y: int]
|
|
101
101
|
*/
|
102
102
|
type Position = PositionTable | PositionArray
|
103
103
|
|
104
|
+
interface MapPositionTable {
|
105
|
+
readonly x: double
|
106
|
+
readonly y: double
|
107
|
+
}
|
108
|
+
|
109
|
+
type MapPositionArray = readonly [x: double, y: double]
|
110
|
+
|
104
111
|
/**
|
105
112
|
* Coordinates of an entity on a map. This uses the same format as {@link Position}, meaning it can be specified either
|
106
113
|
* with or without explicit keys.
|
107
114
|
*
|
108
115
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#MapPosition View documentation}
|
109
116
|
*/
|
110
|
-
|
111
|
-
readonly x: double
|
112
|
-
readonly y: double
|
113
|
-
}
|
117
|
+
type MapPosition = MapPositionTable | MapPositionArray
|
114
118
|
|
115
119
|
interface ChunkPositionTable {
|
116
120
|
readonly x: int
|
@@ -167,7 +171,7 @@ type GuiLocation = GuiLocationTable | GuiLocationArray
|
|
167
171
|
interface ChunkPositionAndArea {
|
168
172
|
readonly x: int
|
169
173
|
readonly y: int
|
170
|
-
readonly area:
|
174
|
+
readonly area: BoundingBoxRead
|
171
175
|
}
|
172
176
|
|
173
177
|
/**
|
@@ -201,7 +205,7 @@ interface TabAndContent {
|
|
201
205
|
|
202
206
|
interface OldTileAndPosition {
|
203
207
|
readonly old_tile: LuaTilePrototype
|
204
|
-
readonly position:
|
208
|
+
readonly position: TilePositionTable
|
205
209
|
}
|
206
210
|
|
207
211
|
/**
|
@@ -230,7 +234,7 @@ interface SmokeSource {
|
|
230
234
|
readonly east_position?: PositionTable
|
231
235
|
readonly south_position?: PositionTable
|
232
236
|
readonly west_position?: PositionTable
|
233
|
-
readonly deviation?:
|
237
|
+
readonly deviation?: PositionTable
|
234
238
|
readonly starting_frame_speed: uint16
|
235
239
|
readonly starting_frame_speed_deviation: double
|
236
240
|
readonly starting_frame: uint16
|
@@ -285,6 +289,13 @@ type BoundingBoxArray = readonly [left_top: Position, right_bottom: Position, or
|
|
285
289
|
*/
|
286
290
|
type BoundingBox = BoundingBoxTable | BoundingBoxArray
|
287
291
|
|
292
|
+
/** @addAfter BoundingBox */
|
293
|
+
interface BoundingBoxRead extends BoundingBoxTable {
|
294
|
+
readonly left_top: PositionTable
|
295
|
+
readonly right_bottom: PositionTable
|
296
|
+
readonly orientation?: RealOrientation
|
297
|
+
}
|
298
|
+
|
288
299
|
/**
|
289
300
|
* An area defined using the map editor.
|
290
301
|
*
|
@@ -297,6 +308,11 @@ interface ScriptArea {
|
|
297
308
|
readonly id: uint
|
298
309
|
}
|
299
310
|
|
311
|
+
interface ScriptAreaRead extends ScriptArea {
|
312
|
+
readonly area: BoundingBoxRead
|
313
|
+
readonly color: ColorTable
|
314
|
+
}
|
315
|
+
|
300
316
|
/**
|
301
317
|
* A position defined using the map editor.
|
302
318
|
*
|
@@ -309,6 +325,11 @@ interface ScriptPosition {
|
|
309
325
|
readonly id: uint
|
310
326
|
}
|
311
327
|
|
328
|
+
interface ScriptPositionRead extends ScriptPosition {
|
329
|
+
readonly position: PositionTable
|
330
|
+
readonly color: ColorTable
|
331
|
+
}
|
332
|
+
|
312
333
|
interface ColorTable {
|
313
334
|
readonly r?: float
|
314
335
|
readonly g?: float
|
@@ -368,7 +389,7 @@ interface Alert {
|
|
368
389
|
readonly tick: uint
|
369
390
|
readonly target?: LuaEntity
|
370
391
|
readonly prototype?: LuaEntityPrototype
|
371
|
-
readonly position?:
|
392
|
+
readonly position?: PositionTable
|
372
393
|
/** The SignalID used for a custom alert. Only present for custom alerts. */
|
373
394
|
readonly icon?: SignalID
|
374
395
|
/** The message for a custom alert. Only present for custom alerts. */
|
@@ -388,7 +409,7 @@ interface ScriptRenderVertexTarget {
|
|
388
409
|
|
389
410
|
interface PathfinderWaypoint {
|
390
411
|
/** The position of the waypoint on its surface. */
|
391
|
-
readonly position:
|
412
|
+
readonly position: PositionTable
|
392
413
|
/** `true` if the path from the previous waypoint to this one goes through an entity that must be destroyed. */
|
393
414
|
readonly needs_destroy_to_reach: boolean
|
394
415
|
}
|
@@ -414,7 +435,7 @@ interface Decorative {
|
|
414
435
|
}
|
415
436
|
|
416
437
|
interface DecorativeResult {
|
417
|
-
readonly position:
|
438
|
+
readonly position: TilePositionTable
|
418
439
|
readonly decorative: LuaDecorativePrototype
|
419
440
|
readonly amount: uint
|
420
441
|
}
|
@@ -873,18 +894,34 @@ interface DifficultySettings {
|
|
873
894
|
readonly research_queue_setting: "after-victory" | "always" | "never"
|
874
895
|
}
|
875
896
|
|
897
|
+
/**
|
898
|
+
* All regular {@link MapSettings} plus an additional table that contains the {@link DifficultySettings}.
|
899
|
+
*
|
900
|
+
* {@link https://lua-api.factorio.com/latest/Concepts.html#MapAndDifficultySettings View documentation}
|
901
|
+
*/
|
902
|
+
interface MapAndDifficultySettings {
|
903
|
+
readonly pollution: PollutionMapSettings
|
904
|
+
readonly enemy_evolution: EnemyEvolutionMapSettings
|
905
|
+
readonly enemy_expansion: EnemyExpansionMapSettings
|
906
|
+
readonly unit_group: UnitGroupMapSettings
|
907
|
+
readonly steering: SteeringMapSettings
|
908
|
+
readonly path_finder: PathFinderMapSettings
|
909
|
+
/**
|
910
|
+
* If a behavior fails this many times, the enemy (or enemy group) is destroyed. This solves biters getting stuck
|
911
|
+
* within their own base.
|
912
|
+
*/
|
913
|
+
readonly max_failed_behavior_count: uint
|
914
|
+
readonly difficulty_settings: DifficultySettings
|
915
|
+
}
|
916
|
+
|
876
917
|
/**
|
877
918
|
* The data that can be extracted from a map exchange string, as a plain table.
|
878
919
|
*
|
879
920
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#MapExchangeStringData View documentation}
|
880
921
|
*/
|
881
922
|
interface MapExchangeStringData {
|
882
|
-
|
883
|
-
|
884
|
-
* {@link DifficultySettings}.
|
885
|
-
*/
|
886
|
-
readonly map_settings: MapSettings
|
887
|
-
readonly map_gen_settings: MapGenSettings
|
923
|
+
readonly map_settings: MapAndDifficultySettings
|
924
|
+
readonly map_gen_settings: MapGenSettingsRead
|
888
925
|
}
|
889
926
|
|
890
927
|
interface BlueprintItemIcon {
|
@@ -982,6 +1019,11 @@ interface BlueprintEntity {
|
|
982
1019
|
readonly schedule?: TrainScheduleRecord[]
|
983
1020
|
}
|
984
1021
|
|
1022
|
+
interface BlueprintEntityRead extends BlueprintEntity {
|
1023
|
+
/** The position of the entity. */
|
1024
|
+
readonly position: PositionTable
|
1025
|
+
}
|
1026
|
+
|
985
1027
|
interface Tile {
|
986
1028
|
/** The position of the tile. */
|
987
1029
|
readonly position: Position
|
@@ -989,6 +1031,11 @@ interface Tile {
|
|
989
1031
|
readonly name: string
|
990
1032
|
}
|
991
1033
|
|
1034
|
+
interface TileRead extends Tile {
|
1035
|
+
/** The position of the tile. */
|
1036
|
+
readonly position: PositionTable
|
1037
|
+
}
|
1038
|
+
|
992
1039
|
interface Fluid {
|
993
1040
|
/** Fluid prototype name of the fluid. */
|
994
1041
|
readonly name: string
|
@@ -1584,6 +1631,11 @@ interface MapGenSettings {
|
|
1584
1631
|
readonly property_expression_names: Record<string, string>
|
1585
1632
|
}
|
1586
1633
|
|
1634
|
+
interface MapGenSettingsRead extends MapGenSettings {
|
1635
|
+
/** Positions of the starting areas. */
|
1636
|
+
readonly starting_points: PositionTable[]
|
1637
|
+
}
|
1638
|
+
|
1587
1639
|
interface SignalID {
|
1588
1640
|
/** `"item"`, `"fluid"`, or `"virtual"`. */
|
1589
1641
|
readonly type: "item" | "fluid" | "virtual"
|
@@ -1848,6 +1900,15 @@ interface GoToLocationCommand extends BaseCommand {
|
|
1848
1900
|
readonly radius?: double
|
1849
1901
|
}
|
1850
1902
|
|
1903
|
+
interface GoToLocationCommandRead extends BaseCommand, GoToLocationCommand {
|
1904
|
+
readonly type: defines.command.go_to_location
|
1905
|
+
/**
|
1906
|
+
* The position to path to. Either this or `destination_entity` need to be specified. If both are,
|
1907
|
+
* `destination_entity` is used.
|
1908
|
+
*/
|
1909
|
+
readonly destination?: PositionTable
|
1910
|
+
}
|
1911
|
+
|
1851
1912
|
interface CompoundCommand extends BaseCommand {
|
1852
1913
|
readonly type: defines.command.compound
|
1853
1914
|
/** How the commands should be chained together. */
|
@@ -1856,6 +1917,12 @@ interface CompoundCommand extends BaseCommand {
|
|
1856
1917
|
readonly commands: Command[]
|
1857
1918
|
}
|
1858
1919
|
|
1920
|
+
interface CompoundCommandRead extends BaseCommand, CompoundCommand {
|
1921
|
+
readonly type: defines.command.compound
|
1922
|
+
/** The sub-commands. */
|
1923
|
+
readonly commands: CommandRead[]
|
1924
|
+
}
|
1925
|
+
|
1859
1926
|
interface GroupCommand extends BaseCommand {
|
1860
1927
|
readonly type: defines.command.group
|
1861
1928
|
/** The group whose command to follow. */
|
@@ -1876,6 +1943,12 @@ interface AttackAreaCommand extends BaseCommand {
|
|
1876
1943
|
readonly distraction?: defines.distraction
|
1877
1944
|
}
|
1878
1945
|
|
1946
|
+
interface AttackAreaCommandRead extends BaseCommand, AttackAreaCommand {
|
1947
|
+
readonly type: defines.command.attack_area
|
1948
|
+
/** Center of the attack area. */
|
1949
|
+
readonly destination: PositionTable
|
1950
|
+
}
|
1951
|
+
|
1879
1952
|
interface WanderCommand extends BaseCommand {
|
1880
1953
|
readonly type: defines.command.wander
|
1881
1954
|
/** Defaults to `defines.distraction.by_enemy`. */
|
@@ -1922,6 +1995,23 @@ interface BuildBaseCommand extends BaseCommand {
|
|
1922
1995
|
readonly ignore_planner?: boolean
|
1923
1996
|
}
|
1924
1997
|
|
1998
|
+
interface BuildBaseCommandRead extends BaseCommand, BuildBaseCommand {
|
1999
|
+
readonly type: defines.command.build_base
|
2000
|
+
/** Where to build the base. */
|
2001
|
+
readonly destination: PositionTable
|
2002
|
+
}
|
2003
|
+
|
2004
|
+
type CommandRead =
|
2005
|
+
| AttackCommand
|
2006
|
+
| GoToLocationCommandRead
|
2007
|
+
| CompoundCommandRead
|
2008
|
+
| GroupCommand
|
2009
|
+
| AttackAreaCommandRead
|
2010
|
+
| WanderCommand
|
2011
|
+
| StopCommand
|
2012
|
+
| FleeCommand
|
2013
|
+
| BuildBaseCommandRead
|
2014
|
+
|
1925
2015
|
/**
|
1926
2016
|
* Commands can be given to enemies and unit groups.
|
1927
2017
|
*
|
@@ -2243,7 +2333,7 @@ interface BeamTarget {
|
|
2243
2333
|
/** The target entity. */
|
2244
2334
|
readonly entity?: LuaEntity
|
2245
2335
|
/** The target position. */
|
2246
|
-
readonly position?:
|
2336
|
+
readonly position?: PositionTable
|
2247
2337
|
}
|
2248
2338
|
|
2249
2339
|
interface RidingState {
|
@@ -2837,7 +2927,7 @@ interface SelectedPrototypeData {
|
|
2837
2927
|
interface ScriptRenderTarget {
|
2838
2928
|
readonly entity?: LuaEntity
|
2839
2929
|
readonly entity_offset?: Vector
|
2840
|
-
readonly position?:
|
2930
|
+
readonly position?: PositionTable
|
2841
2931
|
}
|
2842
2932
|
|
2843
2933
|
type MouseButtonFlag =
|
@@ -6549,6 +6639,17 @@ type StyleValuesArray =
|
|
6549
6639
|
|
6550
6640
|
type SizeArray = readonly [width: int, height: int]
|
6551
6641
|
|
6642
|
+
type RaiseableEvents =
|
6643
|
+
| typeof defines.events.on_console_chat
|
6644
|
+
| typeof defines.events.on_player_crafted_item
|
6645
|
+
| typeof defines.events.on_player_fast_transferred
|
6646
|
+
| typeof defines.events.on_biter_base_built
|
6647
|
+
| typeof defines.events.on_market_item_purchased
|
6648
|
+
| typeof defines.events.script_raised_built
|
6649
|
+
| typeof defines.events.script_raised_destroy
|
6650
|
+
| typeof defines.events.script_raised_revive
|
6651
|
+
| typeof defines.events.script_raised_set_tiles
|
6652
|
+
|
6552
6653
|
/**
|
6553
6654
|
* A map gen preset. Used in {@link https://wiki.factorio.com/Prototype/MapGenPresets Prototype/MapGenPresets}.
|
6554
6655
|
*
|
package/generated/events.d.ts
CHANGED
@@ -13,7 +13,7 @@ interface CustomInputEvent extends EventData {
|
|
13
13
|
/** The prototype name of the custom input that was activated. */
|
14
14
|
readonly input_name: string
|
15
15
|
/** The mouse cursor position when the custom input was activated. */
|
16
|
-
readonly cursor_position:
|
16
|
+
readonly cursor_position: PositionTable
|
17
17
|
/** Information about the prototype that is selected when the custom input is used. `nil` if none is selected. */
|
18
18
|
readonly selected_prototype?: SelectedPrototypeData
|
19
19
|
/** Identifier of the event */
|
@@ -46,9 +46,9 @@ interface OnAiCommandCompletedEvent extends EventData {
|
|
46
46
|
*/
|
47
47
|
interface OnAreaClonedEvent extends EventData {
|
48
48
|
readonly source_surface: LuaSurface
|
49
|
-
readonly source_area:
|
49
|
+
readonly source_area: BoundingBoxRead
|
50
50
|
readonly destination_surface: LuaSurface
|
51
|
-
readonly destination_area:
|
51
|
+
readonly destination_area: BoundingBoxRead
|
52
52
|
readonly destination_force?: LuaForce
|
53
53
|
readonly clone_tiles: boolean
|
54
54
|
readonly clone_entities: boolean
|
@@ -84,10 +84,10 @@ interface OnBiterBaseBuiltEvent extends EventData {
|
|
84
84
|
* {@link https://lua-api.factorio.com/latest/Events.html#on_brush_cloned View documentation}
|
85
85
|
*/
|
86
86
|
interface OnBrushClonedEvent extends EventData {
|
87
|
-
readonly source_offset:
|
88
|
-
readonly destination_offset:
|
87
|
+
readonly source_offset: TilePositionTable
|
88
|
+
readonly destination_offset: TilePositionTable
|
89
89
|
readonly source_surface: LuaSurface
|
90
|
-
readonly source_positions:
|
90
|
+
readonly source_positions: TilePositionTable[]
|
91
91
|
readonly destination_surface: LuaSurface
|
92
92
|
readonly destination_force?: LuaForce
|
93
93
|
readonly clone_tiles: boolean
|
@@ -236,9 +236,9 @@ interface OnChartTagRemovedEvent extends EventData {
|
|
236
236
|
*/
|
237
237
|
interface OnChunkChartedEvent extends EventData {
|
238
238
|
readonly surface_index: uint
|
239
|
-
readonly position:
|
239
|
+
readonly position: ChunkPositionTable
|
240
240
|
/** Area of the chunk. */
|
241
|
-
readonly area:
|
241
|
+
readonly area: BoundingBoxRead
|
242
242
|
readonly force: LuaForce
|
243
243
|
/** Identifier of the event */
|
244
244
|
readonly name: typeof defines.events.on_chunk_charted
|
@@ -254,7 +254,7 @@ interface OnChunkChartedEvent extends EventData {
|
|
254
254
|
interface OnChunkDeletedEvent extends EventData {
|
255
255
|
readonly surface_index: uint
|
256
256
|
/** The chunks deleted. */
|
257
|
-
readonly positions:
|
257
|
+
readonly positions: ChunkPositionTable[]
|
258
258
|
/** Identifier of the event */
|
259
259
|
readonly name: typeof defines.events.on_chunk_deleted
|
260
260
|
/** Tick the event was generated. */
|
@@ -268,9 +268,9 @@ interface OnChunkDeletedEvent extends EventData {
|
|
268
268
|
*/
|
269
269
|
interface OnChunkGeneratedEvent extends EventData {
|
270
270
|
/** Area of the chunk. */
|
271
|
-
readonly area:
|
271
|
+
readonly area: BoundingBoxRead
|
272
272
|
/** Position of the chunk. */
|
273
|
-
readonly position:
|
273
|
+
readonly position: ChunkPositionTable
|
274
274
|
/** The surface the chunk is on. */
|
275
275
|
readonly surface: LuaSurface
|
276
276
|
/** Identifier of the event */
|
@@ -748,7 +748,7 @@ interface OnGuiClosedEvent extends EventData {
|
|
748
748
|
/** The technology that was automatically selected when opening the research GUI */
|
749
749
|
readonly technology?: LuaTechnology
|
750
750
|
/** The tile position that was open */
|
751
|
-
readonly tile_position?:
|
751
|
+
readonly tile_position?: TilePositionTable
|
752
752
|
/** Identifier of the event */
|
753
753
|
readonly name: typeof defines.events.on_gui_closed
|
754
754
|
/** Tick the event was generated. */
|
@@ -1120,7 +1120,7 @@ interface OnPlayerAltSelectedAreaEvent extends EventData {
|
|
1120
1120
|
/** The surface selected. */
|
1121
1121
|
readonly surface: LuaSurface
|
1122
1122
|
/** The area selected. */
|
1123
|
-
readonly area:
|
1123
|
+
readonly area: BoundingBoxRead
|
1124
1124
|
/** The item used to select the area. */
|
1125
1125
|
readonly item: string
|
1126
1126
|
/** The entities selected. */
|
@@ -1307,7 +1307,7 @@ interface OnPlayerClickedGpsTagEvent extends EventData {
|
|
1307
1307
|
/** Index of the player */
|
1308
1308
|
readonly player_index: uint
|
1309
1309
|
/** Map position contained in gps tag */
|
1310
|
-
readonly position:
|
1310
|
+
readonly position: PositionTable
|
1311
1311
|
/** Surface name contained in gps tag, even when such surface does not exists */
|
1312
1312
|
readonly surface: string
|
1313
1313
|
/** Identifier of the event */
|
@@ -1402,7 +1402,7 @@ interface OnPlayerDeconstructedAreaEvent extends EventData {
|
|
1402
1402
|
/** The surface selected. */
|
1403
1403
|
readonly surface: LuaSurface
|
1404
1404
|
/** The area selected. */
|
1405
|
-
readonly area:
|
1405
|
+
readonly area: BoundingBoxRead
|
1406
1406
|
/** The item used to select the area. */
|
1407
1407
|
readonly item: string
|
1408
1408
|
/** If normal selection or alt selection was used. */
|
@@ -1824,7 +1824,7 @@ interface OnPlayerSelectedAreaEvent extends EventData {
|
|
1824
1824
|
/** The surface selected. */
|
1825
1825
|
readonly surface: LuaSurface
|
1826
1826
|
/** The area selected. */
|
1827
|
-
readonly area:
|
1827
|
+
readonly area: BoundingBoxRead
|
1828
1828
|
/** The item used to select the area. */
|
1829
1829
|
readonly item: string
|
1830
1830
|
/** The entities selected. */
|
@@ -1861,7 +1861,7 @@ interface OnPlayerSetupBlueprintEvent extends EventData {
|
|
1861
1861
|
/** The surface selected. */
|
1862
1862
|
readonly surface: LuaSurface
|
1863
1863
|
/** The area selected. */
|
1864
|
-
readonly area:
|
1864
|
+
readonly area: BoundingBoxRead
|
1865
1865
|
/** The item used to select the area. */
|
1866
1866
|
readonly item: string
|
1867
1867
|
/** If normal selection or alt selection was used. */
|
@@ -1963,7 +1963,7 @@ interface OnPlayerUsedCapsuleEvent extends EventData {
|
|
1963
1963
|
/** The capsule item used. */
|
1964
1964
|
readonly item: LuaItemPrototype
|
1965
1965
|
/** The position the capsule was used. */
|
1966
|
-
readonly position:
|
1966
|
+
readonly position: PositionTable
|
1967
1967
|
/** Identifier of the event */
|
1968
1968
|
readonly name: typeof defines.events.on_player_used_capsule
|
1969
1969
|
/** Tick the event was generated. */
|
@@ -1981,7 +1981,7 @@ interface OnPlayerUsedSpiderRemoteEvent extends EventData {
|
|
1981
1981
|
/** Spider vehicle which was requested to move. */
|
1982
1982
|
readonly vehicle: LuaEntity
|
1983
1983
|
/** Goal position to which spidertron was sent to. */
|
1984
|
-
readonly position:
|
1984
|
+
readonly position: PositionTable
|
1985
1985
|
/** If the use was successful. It may fail when spidertron has different driver or when player is on different surface. */
|
1986
1986
|
readonly success: boolean
|
1987
1987
|
/** Identifier of the event */
|
@@ -2001,7 +2001,7 @@ interface OnPostEntityDiedEvent extends EventData {
|
|
2001
2001
|
/** The force that did the killing if any. */
|
2002
2002
|
readonly force?: LuaForce
|
2003
2003
|
/** Position where the entity died. */
|
2004
|
-
readonly position:
|
2004
|
+
readonly position: PositionTable
|
2005
2005
|
/** The entity prototype of the entity that died. */
|
2006
2006
|
readonly prototype: LuaEntityPrototype
|
2007
2007
|
/** The damage type if any. */
|
@@ -2027,7 +2027,7 @@ interface OnPreBuildEvent extends EventData {
|
|
2027
2027
|
/** The player who did the placing. */
|
2028
2028
|
readonly player_index: uint
|
2029
2029
|
/** Where the item was placed. */
|
2030
|
-
readonly position:
|
2030
|
+
readonly position: PositionTable
|
2031
2031
|
/** Item was placed using shift building. */
|
2032
2032
|
readonly shift_build: boolean
|
2033
2033
|
/** The direction the item was facing when placed. */
|
@@ -2052,7 +2052,7 @@ interface OnPreBuildEvent extends EventData {
|
|
2052
2052
|
interface OnPreChunkDeletedEvent extends EventData {
|
2053
2053
|
readonly surface_index: uint
|
2054
2054
|
/** The chunks to be deleted. */
|
2055
|
-
readonly positions:
|
2055
|
+
readonly positions: ChunkPositionTable[]
|
2056
2056
|
/** Identifier of the event */
|
2057
2057
|
readonly name: typeof defines.events.on_pre_chunk_deleted
|
2058
2058
|
/** Tick the event was generated. */
|
@@ -2574,9 +2574,9 @@ interface OnScriptTriggerEffectEvent extends EventData {
|
|
2574
2574
|
readonly effect_id: string
|
2575
2575
|
/** The surface the effect happened on. */
|
2576
2576
|
readonly surface_index: uint
|
2577
|
-
readonly source_position?:
|
2577
|
+
readonly source_position?: PositionTable
|
2578
2578
|
readonly source_entity?: LuaEntity
|
2579
|
-
readonly target_position?:
|
2579
|
+
readonly target_position?: PositionTable
|
2580
2580
|
readonly target_entity?: LuaEntity
|
2581
2581
|
/** Identifier of the event */
|
2582
2582
|
readonly name: typeof defines.events.on_script_trigger_effect
|
@@ -2594,9 +2594,9 @@ interface OnSectorScannedEvent extends EventData {
|
|
2594
2594
|
/** The radar that did the scanning. */
|
2595
2595
|
readonly radar: LuaEntity
|
2596
2596
|
/** The chunk scanned. */
|
2597
|
-
readonly chunk_position:
|
2597
|
+
readonly chunk_position: ChunkPositionTable
|
2598
2598
|
/** Area of the scanned chunk. */
|
2599
|
-
readonly area:
|
2599
|
+
readonly area: BoundingBoxRead
|
2600
2600
|
/** Identifier of the event */
|
2601
2601
|
readonly name: typeof defines.events.on_sector_scanned
|
2602
2602
|
/** Tick the event was generated. */
|
@@ -2958,7 +2958,7 @@ interface ScriptRaisedSetTilesEvent extends EventData {
|
|
2958
2958
|
/** The surface whose tiles were changed. */
|
2959
2959
|
readonly surface_index: uint
|
2960
2960
|
/** The tiles that were changed. */
|
2961
|
-
readonly tiles:
|
2961
|
+
readonly tiles: TileRead[]
|
2962
2962
|
/** Identifier of the event */
|
2963
2963
|
readonly name: typeof defines.events.script_raised_set_tiles
|
2964
2964
|
/** Tick the event was generated. */
|
package/generated/index.d.ts
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
///<reference types="lua-types/5.2" />
|
4
4
|
///<reference path="builtin-types.d.ts" />
|
5
|
+
///<reference path="global-objects.d.ts" />
|
5
6
|
///<reference path="defines.d.ts" />
|
6
7
|
///<reference path="events.d.ts" />
|
7
8
|
///<reference path="classes.d.ts" />
|
8
9
|
///<reference path="concepts.d.ts" />
|
9
|
-
///<reference path="global-objects.d.ts" />
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "typed-factorio",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.17.0",
|
4
4
|
"description": "Featureful typescript definitions for the the Factorio modding lua api.",
|
5
5
|
"keywords": [
|
6
6
|
"factorio",
|
@@ -28,7 +28,7 @@
|
|
28
28
|
},
|
29
29
|
"peerDependencies": {
|
30
30
|
"lua-types": "^2.11.0",
|
31
|
-
"typescript-to-lua": "^1.
|
31
|
+
"typescript-to-lua": "^1.3.1"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
34
34
|
"@types/jest": "^27.0.3",
|
@@ -53,6 +53,6 @@
|
|
53
53
|
"ts-jest": "^27.1.0",
|
54
54
|
"ts-node": "^10.4.0",
|
55
55
|
"typescript": "4.5.2",
|
56
|
-
"typescript-to-lua": "^1.
|
56
|
+
"typescript-to-lua": "^1.3.1"
|
57
57
|
}
|
58
58
|
}
|
package/runtime/pairs.d.ts
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
/** @noSelfInFile */
|
2
2
|
|
3
|
-
/** Iterating with `pairs` will only iterate the array part of a {@link LuaCustomTable}. */
|
4
|
-
declare function pairs<V>(table: LuaCustomTable<number | string, V>): LuaIterable<LuaMultiReturn<[number, V]>>
|
5
|
-
|
6
|
-
declare function pairs<K extends keyof any, V>(table: LuaCustomTable<K, V>): LuaIterable<LuaMultiReturn<[K, V]>>
|
7
|
-
|
8
3
|
/**
|
9
|
-
*
|
4
|
+
* Iterating with `pairs` will only iterate the array part of a {@link LuaCustomTable}.
|
10
5
|
*
|
11
|
-
*
|
6
|
+
* **Note**: you can also iterate on a LuaCustomTable directly without using `pairs`, e.g. `for(const [k, v] of table)`.
|
12
7
|
*/
|
8
|
+
declare function pairs<V>(table: LuaCustomTable<number | string, V>): LuaIterable<LuaMultiReturn<[number, V]>>
|
9
|
+
|
10
|
+
/** **Note**: you can also iterate on a LuaCustomTable directly without using `pairs`, e.g. `for(const [k, v] of table)`. */
|
11
|
+
declare function pairs<K extends number | string, V>(table: LuaCustomTable<K, V>): LuaIterable<LuaMultiReturn<[K, V]>>
|
12
|
+
|
13
|
+
/** @deprecated {@link LuaCustomTable} cannot be iterated with `ipairs`; Use {@link pairs} instead. */
|
13
14
|
declare function ipairs(table: LuaCustomTable<any, any>): never
|
package/runtime/util.d.ts
CHANGED
@@ -33,11 +33,7 @@ declare module "util" {
|
|
33
33
|
direction: defines.direction.north | defines.direction.east | defines.direction.south | defines.direction.west,
|
34
34
|
distance: number
|
35
35
|
): Position
|
36
|
-
function moveposition(
|
37
|
-
position: Position,
|
38
|
-
direction: defines.direction, //todo: cardinal only
|
39
|
-
distance: number
|
40
|
-
): Position | undefined
|
36
|
+
function moveposition(position: Position, direction: defines.direction, distance: number): Position | undefined
|
41
37
|
|
42
38
|
function oppositedirection(direction: defines.direction): defines.direction
|
43
39
|
|