typed-factorio 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Changelog.md +4 -0
- package/generated/classes.d.ts +31 -19
- package/generated/concepts.d.ts +15 -1
- package/package.json +23 -21
package/Changelog.md
CHANGED
package/generated/classes.d.ts
CHANGED
@@ -1187,7 +1187,7 @@ interface LuaControl {
|
|
1187
1187
|
* players, cars, and spidertrons can be teleported cross-surface.
|
1188
1188
|
* @returns `true` when the entity was successfully teleported.
|
1189
1189
|
*/
|
1190
|
-
teleport(position:
|
1190
|
+
teleport(position: MapPosition, surface?: SurfaceIdentification): boolean
|
1191
1191
|
/**
|
1192
1192
|
* Select an entity, as if by hovering the mouse above it.
|
1193
1193
|
*
|
@@ -1195,7 +1195,7 @@ interface LuaControl {
|
|
1195
1195
|
*
|
1196
1196
|
* @param position - Position of the entity to select
|
1197
1197
|
*/
|
1198
|
-
update_selected_entity(position:
|
1198
|
+
update_selected_entity(position: MapPosition): void
|
1199
1199
|
/**
|
1200
1200
|
* Unselect any selected entity.
|
1201
1201
|
*
|
@@ -1378,7 +1378,7 @@ interface LuaControl {
|
|
1378
1378
|
*
|
1379
1379
|
* {@link https://lua-api.factorio.com/next/LuaControl.html#LuaControl.position View documentation}
|
1380
1380
|
*/
|
1381
|
-
readonly position:
|
1381
|
+
readonly position: MapPosition
|
1382
1382
|
/**
|
1383
1383
|
* The vehicle the player is currently sitting in; `nil` if none.
|
1384
1384
|
*
|
@@ -2996,7 +2996,7 @@ interface LuaEntity extends LuaControl {
|
|
2996
2996
|
*/
|
2997
2997
|
clone(params: {
|
2998
2998
|
/** The destination position */
|
2999
|
-
readonly position:
|
2999
|
+
readonly position: MapPosition
|
3000
3000
|
/** The destination surface */
|
3001
3001
|
readonly surface?: LuaSurface
|
3002
3002
|
readonly force?: ForceIdentification
|
@@ -3139,7 +3139,7 @@ interface LuaEntity extends LuaControl {
|
|
3139
3139
|
* @param target
|
3140
3140
|
* @param position
|
3141
3141
|
*/
|
3142
|
-
can_shoot(target: LuaEntity, position:
|
3142
|
+
can_shoot(target: LuaEntity, position: MapPosition): boolean
|
3143
3143
|
/**
|
3144
3144
|
* Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style. Starts animating
|
3145
3145
|
* the opacity of the speech bubble towards zero, and destroys the entity when it hits zero.
|
@@ -3279,7 +3279,7 @@ interface LuaEntity extends LuaControl {
|
|
3279
3279
|
*
|
3280
3280
|
* @param position - The position the spidertron should move to.
|
3281
3281
|
*/
|
3282
|
-
add_autopilot_destination(position:
|
3282
|
+
add_autopilot_destination(position: MapPosition): void
|
3283
3283
|
/**
|
3284
3284
|
* Connects current linked belt with another one.
|
3285
3285
|
*
|
@@ -4501,7 +4501,7 @@ interface LuaEntity extends LuaControl {
|
|
4501
4501
|
*
|
4502
4502
|
* {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.autopilot_destination View documentation}
|
4503
4503
|
*/
|
4504
|
-
autopilot_destination:
|
4504
|
+
autopilot_destination: MapPosition | undefined
|
4505
4505
|
/**
|
4506
4506
|
* The queued destination positions of spidertron's autopilot.
|
4507
4507
|
*
|
@@ -4509,7 +4509,7 @@ interface LuaEntity extends LuaControl {
|
|
4509
4509
|
*
|
4510
4510
|
* {@link https://lua-api.factorio.com/next/LuaEntity.html#LuaEntity.autopilot_destinations View documentation}
|
4511
4511
|
*/
|
4512
|
-
readonly autopilot_destinations:
|
4512
|
+
readonly autopilot_destinations: MapPosition[]
|
4513
4513
|
/**
|
4514
4514
|
* Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds
|
4515
4515
|
* a path to next target) and trains having this train stop as goal or waypoint. Writing nil will disable the limit
|
@@ -5829,7 +5829,7 @@ interface LuaEntityPrototype {
|
|
5829
5829
|
*/
|
5830
5830
|
readonly related_underground_belt: LuaEntityPrototype
|
5831
5831
|
/**
|
5832
|
-
* Gets the
|
5832
|
+
* Gets the built-in stack size bonus of this inserter prototype. `nil` if this is not an inserter.
|
5833
5833
|
*
|
5834
5834
|
* {@link https://lua-api.factorio.com/next/LuaEntityPrototype.html#LuaEntityPrototype.inserter_stack_size_bonus View documentation}
|
5835
5835
|
*/
|
@@ -7825,6 +7825,12 @@ interface LuaGameScript {
|
|
7825
7825
|
readonly can_continue: boolean
|
7826
7826
|
readonly victorious_force: ForceIdentification
|
7827
7827
|
}): void
|
7828
|
+
/**
|
7829
|
+
* Reset scenario state (game_finished, player_won, etc.).
|
7830
|
+
*
|
7831
|
+
* {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.reset_game_state View documentation}
|
7832
|
+
*/
|
7833
|
+
reset_game_state(): void
|
7828
7834
|
/**
|
7829
7835
|
* {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.get_entity_by_tag View documentation}
|
7830
7836
|
*
|
@@ -8834,11 +8840,17 @@ interface LuaGameScript {
|
|
8834
8840
|
*/
|
8835
8841
|
ticks_to_run: uint
|
8836
8842
|
/**
|
8837
|
-
*
|
8843
|
+
* True while the victory screen is shown.
|
8838
8844
|
*
|
8839
8845
|
* {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.finished View documentation}
|
8840
8846
|
*/
|
8841
8847
|
readonly finished: boolean
|
8848
|
+
/**
|
8849
|
+
* True after players finished the game and clicked "continue".
|
8850
|
+
*
|
8851
|
+
* {@link https://lua-api.factorio.com/next/LuaGameScript.html#LuaGameScript.finished_but_continuing View documentation}
|
8852
|
+
*/
|
8853
|
+
readonly finished_but_continuing: boolean
|
8842
8854
|
/**
|
8843
8855
|
* Speed to update the map at. 1.0 is normal speed -- 60 UPS.
|
8844
8856
|
*
|
@@ -13955,7 +13967,7 @@ interface LuaPlayer extends LuaControl {
|
|
13955
13967
|
* Position at which cursor was clicked. Used only to decide which side of arithmetic combinator, decider
|
13956
13968
|
* combinator or power switch is to be connected. Entity itself to be connected is based on the player's selected entity.
|
13957
13969
|
*/
|
13958
|
-
readonly position:
|
13970
|
+
readonly position: MapPosition
|
13959
13971
|
}): boolean
|
13960
13972
|
/**
|
13961
13973
|
* Disable recipe groups.
|
@@ -14161,7 +14173,7 @@ interface LuaPlayer extends LuaControl {
|
|
14161
14173
|
/** Name of the entity to check */
|
14162
14174
|
readonly name: string
|
14163
14175
|
/** Where the entity would be placed */
|
14164
|
-
readonly position:
|
14176
|
+
readonly position: MapPosition
|
14165
14177
|
/** Direction the entity would be placed */
|
14166
14178
|
readonly direction?: defines.direction
|
14167
14179
|
}): boolean
|
@@ -14172,7 +14184,7 @@ interface LuaPlayer extends LuaControl {
|
|
14172
14184
|
*/
|
14173
14185
|
can_build_from_cursor(params: {
|
14174
14186
|
/** Where the entity would be placed */
|
14175
|
-
readonly position:
|
14187
|
+
readonly position: MapPosition
|
14176
14188
|
/** Direction the entity would be placed */
|
14177
14189
|
readonly direction?: defines.direction
|
14178
14190
|
/** If alt build should be used instead of normal build. Defaults to normal. */
|
@@ -14193,7 +14205,7 @@ interface LuaPlayer extends LuaControl {
|
|
14193
14205
|
*/
|
14194
14206
|
build_from_cursor(params: {
|
14195
14207
|
/** Where the entity would be placed */
|
14196
|
-
readonly position:
|
14208
|
+
readonly position: MapPosition
|
14197
14209
|
/** Direction the entity would be placed */
|
14198
14210
|
readonly direction?: defines.direction
|
14199
14211
|
/** If alt build should be used instead of normal build. Defaults to normal. */
|
@@ -14279,7 +14291,7 @@ interface LuaPlayer extends LuaControl {
|
|
14279
14291
|
/** The flying text to show. */
|
14280
14292
|
readonly text: LocalisedString
|
14281
14293
|
/** The location on the map at which to show the flying text. */
|
14282
|
-
readonly position?:
|
14294
|
+
readonly position?: MapPosition
|
14283
14295
|
/** If `true`, the flying text is created at the player's cursor. Defaults to `false`. */
|
14284
14296
|
readonly create_at_cursor?: boolean
|
14285
14297
|
/** The color of the flying text. Defaults to white text. */
|
@@ -14350,7 +14362,7 @@ interface LuaPlayer extends LuaControl {
|
|
14350
14362
|
* @param position
|
14351
14363
|
* @param scale
|
14352
14364
|
*/
|
14353
|
-
open_map(position:
|
14365
|
+
open_map(position: MapPosition, scale?: double): void
|
14354
14366
|
/**
|
14355
14367
|
* Queues a request to zoom to world at the specified position. If the player is already zooming to world, the
|
14356
14368
|
* request will simply set the position (and scale). Render mode change requests are processed before rendering of
|
@@ -14361,7 +14373,7 @@ interface LuaPlayer extends LuaControl {
|
|
14361
14373
|
* @param position
|
14362
14374
|
* @param scale
|
14363
14375
|
*/
|
14364
|
-
zoom_to_world(position:
|
14376
|
+
zoom_to_world(position: MapPosition, scale?: double): void
|
14365
14377
|
/**
|
14366
14378
|
* Queues request to switch to the normal game view from the map or zoom to world view. Render mode change requests
|
14367
14379
|
* are processed before rendering of the next frame.
|
@@ -14499,7 +14511,7 @@ interface LuaPlayer extends LuaControl {
|
|
14499
14511
|
* @param position - The position to start selection from.
|
14500
14512
|
* @param selection_mode - The type of selection to start. Can be `select`, `alternative-select`, `reverse-select`.
|
14501
14513
|
*/
|
14502
|
-
start_selection(position:
|
14514
|
+
start_selection(position: MapPosition, selection_mode: string): void
|
14503
14515
|
/**
|
14504
14516
|
* Clears the players selection tool selection position.
|
14505
14517
|
*
|
@@ -18810,7 +18822,7 @@ interface LuaSurface {
|
|
18810
18822
|
*
|
18811
18823
|
* {@link https://lua-api.factorio.com/next/LuaSurface.html#LuaSurface.daytime View documentation}
|
18812
18824
|
*/
|
18813
|
-
daytime:
|
18825
|
+
daytime: double
|
18814
18826
|
/**
|
18815
18827
|
* Amount of darkness at the current time.
|
18816
18828
|
*
|
package/generated/concepts.d.ts
CHANGED
@@ -99,6 +99,17 @@ type PositionArray = readonly [x: int, y: int]
|
|
99
99
|
*/
|
100
100
|
type Position = PositionTable | PositionArray
|
101
101
|
|
102
|
+
/**
|
103
|
+
* Coordinates of an entity on a map. This uses the same format as {@link Position}, meaning it can be specified either
|
104
|
+
* with or without explicit keys.
|
105
|
+
*
|
106
|
+
* {@link https://lua-api.factorio.com/next/Concepts.html#MapPosition View documentation}
|
107
|
+
*/
|
108
|
+
interface MapPosition {
|
109
|
+
readonly x: double
|
110
|
+
readonly y: double
|
111
|
+
}
|
112
|
+
|
102
113
|
interface ChunkPositionTable {
|
103
114
|
readonly x: int
|
104
115
|
readonly y: int
|
@@ -705,7 +716,10 @@ interface SteeringMapSettings {
|
|
705
716
|
}
|
706
717
|
|
707
718
|
interface PathFinderMapSettings {
|
708
|
-
/**
|
719
|
+
/**
|
720
|
+
* The pathfinder performs a step of the backward search every `fwd2bwd_ratio`'th step. The minimum allowed value is
|
721
|
+
* `2`, which means symmetric search. The default value is `5`.
|
722
|
+
*/
|
709
723
|
readonly fwd2bwd_ratio: uint
|
710
724
|
/**
|
711
725
|
* When looking at which node to check next, their heuristic value is multiplied by this ratio. The higher it is,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "typed-factorio",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.13.0",
|
4
4
|
"description": "Featureful typescript definitions for the the Factorio modding lua api.",
|
5
5
|
"keywords": [
|
6
6
|
"factorio",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
],
|
16
16
|
"homepage": "https://github.com/GlassBricks/typed-factorio#readme",
|
17
17
|
"scripts": {
|
18
|
-
"gen": "ts-node generator/index.ts",
|
18
|
+
"gen": "ts-node -P generator/tsconfig.json generator/index.ts",
|
19
19
|
"generate": "yarn run gen --in ./generatorSrc --out ./generated --warn-as-error",
|
20
20
|
"generate:dev": "yarn run gen --in ./generatorSrc --out ./generated --no-format",
|
21
21
|
"clean": "rimraf generated",
|
@@ -26,31 +26,33 @@
|
|
26
26
|
"prepublishOnly": "yarn run check",
|
27
27
|
"download-latest-runtime-api": "ts-node ./scripts/downloadLatest.ts"
|
28
28
|
},
|
29
|
-
"
|
30
|
-
"lua-types": "^2.
|
29
|
+
"peerDependencies": {
|
30
|
+
"lua-types": "^2.11.0",
|
31
31
|
"typescript-to-lua": "^1.0.0"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
34
|
-
"@types/jest": "^
|
35
|
-
"@types/node": "^16.
|
36
|
-
"@types/prettier": "^2.
|
37
|
-
"@typescript-eslint/eslint-plugin": "^
|
38
|
-
"@typescript-eslint/parser": "^
|
39
|
-
"chalk": "^
|
34
|
+
"@types/jest": "^27.0.3",
|
35
|
+
"@types/node": "^16.11.12",
|
36
|
+
"@types/prettier": "^2.4.2",
|
37
|
+
"@typescript-eslint/eslint-plugin": "^5.6.0",
|
38
|
+
"@typescript-eslint/parser": "^5.6.0",
|
39
|
+
"chalk": "^3.0.0",
|
40
40
|
"commander": "^8.3.0",
|
41
|
-
"eslint": "^
|
41
|
+
"eslint": "^8.4.1",
|
42
42
|
"eslint-config-prettier": "^8.3.0",
|
43
43
|
"eslint-config-standard": "^16.0.3",
|
44
|
-
"eslint-import-resolver-typescript": "^2.
|
45
|
-
"eslint-plugin-import": "^2.
|
44
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
45
|
+
"eslint-plugin-import": "^2.25.3",
|
46
46
|
"eslint-plugin-node": "^11.1.0",
|
47
|
-
"eslint-plugin-prettier": "^
|
48
|
-
"eslint-plugin-promise": "^5.
|
49
|
-
"jest": "^27.
|
50
|
-
"
|
51
|
-
"prettier
|
52
|
-
"
|
53
|
-
"ts-
|
54
|
-
"
|
47
|
+
"eslint-plugin-prettier": "^4.0.0",
|
48
|
+
"eslint-plugin-promise": "^5.2.0",
|
49
|
+
"jest": "^27.4.3",
|
50
|
+
"lua-types": "^2.11.0",
|
51
|
+
"prettier": "^2.5.1",
|
52
|
+
"prettier-plugin-jsdoc": "^0.3.30",
|
53
|
+
"ts-jest": "^27.1.0",
|
54
|
+
"ts-node": "^10.4.0",
|
55
|
+
"typescript": "4.5.2",
|
56
|
+
"typescript-to-lua": "^1.2.0"
|
55
57
|
}
|
56
58
|
}
|