typed-factorio 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
package/Changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v1.3.1
2
+
3
+ - Use @linkplain instead of @link for web links. This works around issue #13
4
+
1
5
  # v1.3.0
2
6
 
3
7
  - Updated to factorio version 1.1.61
package/README.md CHANGED
@@ -71,54 +71,52 @@ The `global` table is just a lua table which can have any shape the mod desires,
71
71
 
72
72
  ## Type features
73
73
 
74
- Typed-factorio has 100% complete types for the runtime stage. Description-only concepts and some not documented types are filled in manually.
74
+ Here is a quick overview of type features:
75
75
 
76
- Here are some details on particular type features:
77
-
78
- ### Lua features
79
-
80
- The types include [TypescriptToLua language extensions](https://typescripttolua.github.io/docs/advanced/language-extensions/)
81
- and [lua-types](https://github.com/TypeScriptToLua/lua-types) (for v5.2) as dependencies.
82
-
83
- ### `nil`
76
+ ### Nullability
84
77
 
85
78
  The types consistently use `undefined` to represent `nil`.
86
- `null` is not used, because `undefined` in typescript is much more similar to `nil` in lua, and optional parameters/properties already use `undefined`.
87
79
 
88
- A class attribute is marked as possibly undefined only if the _read_ type is possibly `nil`. For properties where `nil` is not possible on _read_, but is possible on _write_, you can write `nil` by using `undefined!` or `myNullableValue!`, e.g. `controlBehavior.parameters = undefined!`.
80
+ A class attribute is marked as possibly undefined only if the _read_ type is possibly `nil`. For properties where `nil` is not possible on _read_, but possible on _write_, you can write `nil` by using `undefined!` or `myNullableValue!`, e.g. `controlBehavior.parameters = undefined!`.
89
81
 
90
- ### Variant parameter types
82
+ ### Parameter Variants
91
83
 
92
- Variant parameter types (types with "additional fields can be specified depending on type") are handled as a union of all variants (which is often a [discriminated union](https://basarat.gitbook.io/typescript/type-system/discriminated-unions#discriminated-union)). This gives proper type checking for each variant.
93
-
94
- The type for a specific variant is prefixed with the variant name, or with "Other" for variants without additional fields (e.g. `AmmoDamageTechnologyModifier`, `OtherTechnologyModifier`).
84
+ Parameters with variants (with "additional fields can be specified depending on type ...") are defined as a union of all variants. The type for a specific variant is prefixed with the variant name, or "Other" types variants without extra properties (e.g. `AmmoDamageTechnologyModifier`, `OtherTechnologyModifier`).
95
85
 
96
86
  ### Events
97
87
 
98
- `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.
99
-
100
- You can pass a type parameter to `script.generate_event_name<T>()`, and it will return an `EventId` that holds type info of the event data. Event functions on `script` can then use the type data when the `EventId` is passed.
88
+ Event IDs (`defines.events`) carry information about their event type and possible filters, which is used by the various methods on `script`.
89
+ You can pass a type parameter to `script.generate_event_name<T>()`, and it will return an `EventId` that holds type info of the event data.
101
90
 
102
- ### Array-like types
91
+ ### Array-like classes
103
92
 
104
93
  Classes that have an index operator, a length operator, and have an array-like structure, inherit from `(Readonly)Array`. These are `LuaInventory`, `LuaFluidBox`, `LuaTransportLine`. This allows you to use these classes like arrays, meaning having array methods, and `.length` translating to the lua length operator. However, this also means, like typescript arrays, they are **0-indexed, not 1-indexed**.
105
94
 
106
- ### Table or array types, and "Read" concepts
95
+ ### Table-or-array concepts, and "Read" variants
107
96
 
108
97
  For table-or-array types (e.g. Position), there also are types such as `PositionTable` and `PositionArray` that refer to the table or array form.
109
98
 
110
- Table-or-array types will appear in the Table form when known to be in a read position. This also applies to other concepts/complex types that have table-or-array attributes.
99
+ Table-or-array types will appear in Table form when known to be in a read position. This also applies to other concepts/types that have table-or-array attributes.
111
100
 
112
- 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`.
101
+ For some concepts, there is also a special form for when it 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`, `BoundingBoxRead`.
113
102
 
114
- ### Types with subclasses
103
+ ### Classes with subclasses
115
104
 
116
- 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:
105
+ Some classes have attributes that are documented to only work for particular subclasses. For these classes, e.g. `LuaEntity`, there are specific types that you can _optionally_ use:
117
106
 
118
107
  - a "Base" type, e.g. `BaseEntity`, which only contains members usable by all subclasses
119
- - individual subclass types, e.g. `CraftingMachineEntity`, which extends the base type with members specific to that subclass
108
+ - individual subclass types, e.g. `CraftingMachineEntity`, which extends the base type with members specific to that subclass.
120
109
 
121
- The simple class name, `LuaEntity` in this example, contains attributes for _all_ subclasses.
110
+ The simple class name, e.g. `LuaEntity`, contains attributes for _all_ subclasses.
111
+
112
+ For stricter types, use the `Base` type generally, and the specific subclass type when needed.
113
+ You can also create your own type-narrowing functions, like so:
114
+
115
+ ```ts
116
+ function isCraftingMachineEntity(entity: LuaEntity): entity is CraftingMachineEntity {
117
+ return entity.type === "crafting-machine"
118
+ }
119
+ ```
122
120
 
123
121
  ### LuaGuiElement
124
122
 
@@ -132,7 +130,6 @@ This is done both to provide more accurate types, and for possible integration w
132
130
 
133
131
  This is a recommended **opt-in** feature. To opt in, add `"typed-factorio/strict-index-types"` to `compilerOptions > types` in your tsconfig.json (in addition to `"typed-factorio/runtime"`).
134
132
 
135
- Some `uint` types which represent indices, e.g. player_index, entity_number, can be "branded" numbers with their own type, e.g. `PlayerIndex` and `EntityNumber`. These are assignable to `number`, but a plain `number` is not directly assignable to them. This helps ensure correctness.
136
- These are indices that do not index into an array-like structure, and otherwise should usually not have arithmetic done to them.
133
+ Some `uint` types which represent unique indices, e.g. player_index, entity_number, can be "branded" numbers with their own type, e.g. `PlayerIndex` and `EntityNumber`. If opted-in, these index-types will be still assignable to `number`, but a plain `number` is not directly assignable to them. This helps ensure correctness.
137
134
  You can use these types as keys in an index signature, e.g. `{ [index: PlayerIndex]: "foo" }`.
138
135
  You can cast "plain" numbers to these types, e.g. `1 as PlayerIndex`, do this with caution.
@@ -222,11 +222,11 @@ interface LuaAutoplaceControlPrototype {
222
222
  */
223
223
  interface LuaBootstrap {
224
224
  /**
225
- * Register a function to be run on mod initialization. This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to {@link LuaGameScript} and the {@link https://lua-api.factorio.com/latest/Global.html global} table and can change anything about them that it deems appropriate. No other events will be raised for the mod until it has finished this step.
225
+ * Register a function to be run on mod initialization. This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to {@link LuaGameScript} and the {@linkplain https://lua-api.factorio.com/latest/Global.html global} table and can change anything about them that it deems appropriate. No other events will be raised for the mod until it has finished this step.
226
226
  *
227
227
  * {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_init View documentation}
228
228
  * @param f The handler for this event. Passing `nil` will unregister it.
229
- * @remarks For more context, refer to the {@link https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
229
+ * @remarks For more context, refer to the {@linkplain https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
230
230
  * @example Initialize a `players` table in `global` for later use.
231
231
  *
232
232
  * ```
@@ -237,26 +237,26 @@ interface LuaBootstrap {
237
237
  */
238
238
  on_init(f: (() => void) | undefined): void
239
239
  /**
240
- * Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript} is not available. The {@link https://lua-api.factorio.com/latest/Global.html global} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
240
+ * Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript} is not available. The {@linkplain https://lua-api.factorio.com/latest/Global.html global} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
241
241
  *
242
242
  * The only legitimate uses of this event are the following:
243
- * - Re-setup {@link https://www.lua.org/pil/13.html metatables} as they are not persisted through the save/load cycle.
243
+ * - Re-setup {@linkplain https://www.lua.org/pil/13.html metatables} as they are not persisted through the save/load cycle.
244
244
  * - Re-setup conditional event handlers, meaning subscribing to an event only when some condition is met to save processing time.
245
- * - Create local references to data stored in the {@link https://lua-api.factorio.com/latest/Global.html global} table.
245
+ * - Create local references to data stored in the {@linkplain https://lua-api.factorio.com/latest/Global.html global} table.
246
246
  *
247
- * For all other purposes, {@link LuaBootstrap#on_init LuaBootstrap::on_init}, {@link LuaBootstrap#on_configuration_changed LuaBootstrap::on_configuration_changed} or {@link https://lua-api.factorio.com/latest/Migrations.html migrations} should be used instead.
247
+ * For all other purposes, {@link LuaBootstrap#on_init LuaBootstrap::on_init}, {@link LuaBootstrap#on_configuration_changed LuaBootstrap::on_configuration_changed} or {@linkplain https://lua-api.factorio.com/latest/Migrations.html migrations} should be used instead.
248
248
  *
249
249
  * {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_load View documentation}
250
250
  * @param f The handler for this event. Passing `nil` will unregister it.
251
- * @remarks For more context, refer to the {@link https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
251
+ * @remarks For more context, refer to the {@linkplain https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
252
252
  */
253
253
  on_load(f: (() => void) | undefined): void
254
254
  /**
255
- * Register a function to be run when mod configuration changes. This is called when the major game version or any mod version changed, when any mod was added or removed, when a startup setting has changed, or when any prototypes have been added or removed. It allows the mod to make any changes it deems appropriate to both the data structures in its {@link https://lua-api.factorio.com/latest/Global.html global} table or to the game state through {@link LuaGameScript}.
255
+ * Register a function to be run when mod configuration changes. This is called when the major game version or any mod version changed, when any mod was added or removed, when a startup setting has changed, or when any prototypes have been added or removed. It allows the mod to make any changes it deems appropriate to both the data structures in its {@linkplain https://lua-api.factorio.com/latest/Global.html global} table or to the game state through {@link LuaGameScript}.
256
256
  *
257
257
  * {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_configuration_changed View documentation}
258
258
  * @param f The handler for this event. Passing `nil` will unregister it.
259
- * @remarks For more context, refer to the {@link https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
259
+ * @remarks For more context, refer to the {@linkplain https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
260
260
  */
261
261
  on_configuration_changed(f: ((param1: ConfigurationChangedData) => void) | undefined): void
262
262
  /**
@@ -887,7 +887,7 @@ interface LuaCommandProcessor {
887
887
  */
888
888
  readonly commands: Record<string, LocalisedString>
889
889
  /**
890
- * Lists the built-in commands of the core game. The {@link https://wiki.factorio.com/Console wiki} has an overview of these.
890
+ * Lists the built-in commands of the core game. The {@linkplain https://wiki.factorio.com/Console wiki} has an overview of these.
891
891
  *
892
892
  * {@link https://lua-api.factorio.com/latest/LuaCommandProcessor.html#LuaCommandProcessor.game_commands View documentation}
893
893
  */
@@ -3810,13 +3810,13 @@ interface LuaEntity extends LuaControl {
3810
3810
  */
3811
3811
  readonly electric_emissions: double | undefined
3812
3812
  /**
3813
- * A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@link https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner}, as well as {@link https://wiki.factorio.com/Prototype/ItemRequestProxy ItemRequestProxy} and {@link https://wiki.factorio.com/Prototype/EntityGhost EntityGhost} entities, are assigned a unit number. This property is `nil` for entities without unit number.
3813
+ * A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@linkplain https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner}, as well as {@linkplain https://wiki.factorio.com/Prototype/ItemRequestProxy ItemRequestProxy} and {@linkplain https://wiki.factorio.com/Prototype/EntityGhost EntityGhost} entities, are assigned a unit number. This property is `nil` for entities without unit number.
3814
3814
  *
3815
3815
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number View documentation}
3816
3816
  */
3817
3817
  readonly unit_number: UnitNumber | undefined
3818
3818
  /**
3819
- * 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`.
3819
+ * The {@link LuaEntity#unit_number unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@linkplain 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`.
3820
3820
  *
3821
3821
  * _Can only be used if this is EntityGhost_
3822
3822
  *
@@ -5388,7 +5388,7 @@ interface BaseEntity extends LuaControl {
5388
5388
  */
5389
5389
  readonly electric_emissions: double | undefined
5390
5390
  /**
5391
- * A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@link https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner}, as well as {@link https://wiki.factorio.com/Prototype/ItemRequestProxy ItemRequestProxy} and {@link https://wiki.factorio.com/Prototype/EntityGhost EntityGhost} entities, are assigned a unit number. This property is `nil` for entities without unit number.
5391
+ * A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@linkplain https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner}, as well as {@linkplain https://wiki.factorio.com/Prototype/ItemRequestProxy ItemRequestProxy} and {@linkplain https://wiki.factorio.com/Prototype/EntityGhost EntityGhost} entities, are assigned a unit number. This property is `nil` for entities without unit number.
5392
5392
  *
5393
5393
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number View documentation}
5394
5394
  */
@@ -5806,7 +5806,7 @@ interface EntityGhostEntity extends BaseEntity {
5806
5806
  */
5807
5807
  ghost_has_flag(flag: keyof EntityPrototypeFlags): boolean
5808
5808
  /**
5809
- * 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`.
5809
+ * The {@link LuaEntity#unit_number unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@linkplain 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`.
5810
5810
  *
5811
5811
  * _Can only be used if this is EntityGhost_
5812
5812
  *
@@ -11832,7 +11832,7 @@ interface LuaGameScript {
11832
11832
  */
11833
11833
  regenerate_entity(entities: string | readonly string[]): void
11834
11834
  /**
11835
- * Take a screenshot of the game and save it to the `script-output` folder, located in the game's {@link https://wiki.factorio.com/User_data_directory user data directory}. The name of the image file can be specified via the `path` parameter.
11835
+ * Take a screenshot of the game and save it to the `script-output` folder, located in the game's {@linkplain https://wiki.factorio.com/User_data_directory user data directory}. The name of the image file can be specified via the `path` parameter.
11836
11836
  *
11837
11837
  * {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot View documentation}
11838
11838
  * @remarks If Factorio is running headless, this function will do nothing.
@@ -11910,7 +11910,7 @@ interface LuaGameScript {
11910
11910
  */
11911
11911
  set_wait_for_screenshots_to_finish(): void
11912
11912
  /**
11913
- * Take a screenshot of the technology screen and save it to the `script-output` folder, located in the game's {@link https://wiki.factorio.com/User_data_directory user data directory}. The name of the image file can be specified via the `path` parameter.
11913
+ * Take a screenshot of the technology screen and save it to the `script-output` folder, located in the game's {@linkplain https://wiki.factorio.com/User_data_directory user data directory}. The name of the image file can be specified via the `path` parameter.
11914
11914
  *
11915
11915
  * {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot View documentation}
11916
11916
  */
@@ -11955,7 +11955,7 @@ interface LuaGameScript {
11955
11955
  */
11956
11956
  json_to_table(json: string): AnyBasic | undefined
11957
11957
  /**
11958
- * Write a file to the `script-output` folder, located in the game's {@link https://wiki.factorio.com/User_data_directory user data directory}. The name and file extension of the file can be specified via the `filename` parameter.
11958
+ * Write a file to the `script-output` folder, located in the game's {@linkplain https://wiki.factorio.com/User_data_directory user data directory}. The name and file extension of the file can be specified via the `filename` parameter.
11959
11959
  *
11960
11960
  * {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.write_file View documentation}
11961
11961
  * @param filename The name of the file. Providing a directory path (ex. `"save/here/example.txt"`) will create the necessary folder structure in `script-output`.
@@ -11965,7 +11965,7 @@ interface LuaGameScript {
11965
11965
  */
11966
11966
  write_file(filename: string, data: LocalisedString, append?: boolean, for_player?: uint): void
11967
11967
  /**
11968
- * Remove a file or directory in the `script-output` folder, located in the game's {@link https://wiki.factorio.com/User_data_directory user data directory}. Can be used to remove files created by {@link LuaGameScript#write_file LuaGameScript::write_file}.
11968
+ * Remove a file or directory in the `script-output` folder, located in the game's {@linkplain https://wiki.factorio.com/User_data_directory user data directory}. Can be used to remove files created by {@link LuaGameScript#write_file LuaGameScript::write_file}.
11969
11969
  *
11970
11970
  * {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.remove_path View documentation}
11971
11971
  * @param path The path to the file or directory to remove, relative to `script-output`.
@@ -12273,7 +12273,7 @@ interface LuaGameScript {
12273
12273
  */
12274
12274
  create_profiler(stopped?: boolean): LuaProfiler
12275
12275
  /**
12276
- * Evaluate an expression, substituting variables as provided. For details on the formula, see the relevant page on the {@link https://wiki.factorio.com/Prototype/Technology#unit Factorio wiki}.
12276
+ * Evaluate an expression, substituting variables as provided. For details on the formula, see the relevant page on the {@linkplain https://wiki.factorio.com/Prototype/Technology#unit Factorio wiki}.
12277
12277
  *
12278
12278
  * {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.evaluate_expression View documentation}
12279
12279
  * @param expression The expression to evaluate.
@@ -12446,7 +12446,7 @@ interface LuaGameScript {
12446
12446
  */
12447
12447
  decode_string(string: string): string | undefined
12448
12448
  /**
12449
- * This property is only populated inside {@link LuaCommandProcessor custom command} handlers and when writing {@link https://wiki.factorio.com/Console#Scripting_and_cheat_commands Lua console commands}. Returns the player that is typing the command, `nil` in all other instances.
12449
+ * This property is only populated inside {@link LuaCommandProcessor custom command} handlers and when writing {@linkplain https://wiki.factorio.com/Console#Scripting_and_cheat_commands Lua console commands}. Returns the player that is typing the command, `nil` in all other instances.
12450
12450
  *
12451
12451
  * See {@link LuaGameScript#players LuaGameScript::players} for accessing all players.
12452
12452
  *
@@ -20184,7 +20184,7 @@ interface LuaRailSignalControlBehavior extends LuaControlBehavior {
20184
20184
  }
20185
20185
 
20186
20186
  /**
20187
- * A deterministic random generator independent from the core games random generator that can be seeded and re-seeded at will. This random generator can be saved and loaded and will maintain its state. Note this is entirely different from calling {@link https://lua-api.factorio.com/latest/Libraries.html#math.random math.random}() and you should be sure you actually want to use this over calling `math.random()`. If you aren't sure if you need to use this over calling `math.random()` then you probably don't need to use this.
20187
+ * A deterministic random generator independent from the core games random generator that can be seeded and re-seeded at will. This random generator can be saved and loaded and will maintain its state. Note this is entirely different from calling {@linkplain https://lua-api.factorio.com/latest/Libraries.html#math.random math.random}() and you should be sure you actually want to use this over calling `math.random()`. If you aren't sure if you need to use this over calling `math.random()` then you probably don't need to use this.
20188
20188
  *
20189
20189
  * {@link https://lua-api.factorio.com/latest/LuaRandomGenerator.html View documentation}
20190
20190
  * @noSelf
@@ -21112,7 +21112,7 @@ interface LuaRendering {
21112
21112
  */
21113
21113
  draw_animation(params: {
21114
21114
  /**
21115
- * Name of an {@link https://wiki.factorio.com/Prototype/Animation animation prototype}.
21115
+ * Name of an {@linkplain https://wiki.factorio.com/Prototype/Animation animation prototype}.
21116
21116
  */
21117
21117
  readonly animation: string
21118
21118
  /**
@@ -23676,7 +23676,7 @@ interface LuaSurface {
23676
23676
  readonly condition: ForceCondition
23677
23677
  }): LuaEntity[]
23678
23678
  /**
23679
- * Find the enemy military target ({@link https://wiki.factorio.com/Military_units_and_structures military entity}) closest to the given position.
23679
+ * Find the enemy military target ({@linkplain https://wiki.factorio.com/Military_units_and_structures military entity}) closest to the given position.
23680
23680
  *
23681
23681
  * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_nearest_enemy View documentation}
23682
23682
  * @returns The nearest enemy military target or `nil` if no enemy could be found within the given area.
@@ -655,7 +655,7 @@ interface EnemyEvolutionMapSettings {
655
655
  }
656
656
 
657
657
  /**
658
- * Candidate chunks are given scores to determine which one of them should be expanded into. This score takes into account various settings noted below. The iteration is over a square region centered around the chunk for which the calculation is done, and includes the central chunk as well. Distances are calculated as {@link https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance}.
658
+ * Candidate chunks are given scores to determine which one of them should be expanded into. This score takes into account various settings noted below. The iteration is over a square region centered around the chunk for which the calculation is done, and includes the central chunk as well. Distances are calculated as {@linkplain https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance}.
659
659
  *
660
660
  * The pseudocode algorithm to determine a chunk's score is as follows:
661
661
  *
@@ -1507,7 +1507,7 @@ interface AutoplaceSpecification {
1507
1507
  }
1508
1508
 
1509
1509
  /**
1510
- * A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. These can only be meaningfully written/modified during the data load phase. More detailed information is found on the {@link https://wiki.factorio.com/Types/NoiseExpression wiki}.
1510
+ * A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. These can only be meaningfully written/modified during the data load phase. More detailed information is found on the {@linkplain https://wiki.factorio.com/Types/NoiseExpression wiki}.
1511
1511
  *
1512
1512
  * {@link https://lua-api.factorio.com/latest/Concepts.html#NoiseExpression View documentation}
1513
1513
  */
@@ -2723,7 +2723,7 @@ type SpriteType =
2723
2723
  | "utility"
2724
2724
 
2725
2725
  /**
2726
- * It is specified by {@link string}. It can be either the name of a {@link https://wiki.factorio.com/Prototype/Sprite sprite prototype} defined in the data stage or a path in form "type/name".
2726
+ * It is specified by {@link string}. It can be either the name of a {@linkplain https://wiki.factorio.com/Prototype/Sprite sprite prototype} defined in the data stage or a path in form "type/name".
2727
2727
  *
2728
2728
  * The validity of a SpritePath can be verified at runtime using {@link LuaGameScript#is_valid_sprite_path LuaGameScript::is_valid_sprite_path}.
2729
2729
  *
@@ -2746,33 +2746,33 @@ type SpriteType =
2746
2746
  type SpritePath = string | `${SpriteType}/${string}`
2747
2747
 
2748
2748
  /**
2749
- * A sound defined by a {@link string}. It can be either the name of a {@link https://wiki.factorio.com/Prototype/Sound sound prototype} defined in the data stage or a path in the form `"type/name"`. The latter option can be sorted into three categories.
2749
+ * A sound defined by a {@link string}. It can be either the name of a {@linkplain https://wiki.factorio.com/Prototype/Sound sound prototype} defined in the data stage or a path in the form `"type/name"`. The latter option can be sorted into three categories.
2750
2750
  *
2751
2751
  * The validity of a SoundPath can be verified at runtime using {@link LuaGameScript#is_valid_sound_path LuaGameScript::is_valid_sound_path}.
2752
2752
  *
2753
2753
  * The utility and ambient types each contain general use sound prototypes defined by the game itself.
2754
- * - `"utility"` - Uses the {@link https://wiki.factorio.com/Prototype/UtilitySounds UtilitySounds} prototype. Example: `"utility/wire_connect_pole"`
2755
- * - `"ambient"` - Uses {@link https://wiki.factorio.com/Prototype/AmbientSound AmbientSound} prototypes. Example: `"ambient/resource-deficiency"`
2754
+ * - `"utility"` - Uses the {@linkplain https://wiki.factorio.com/Prototype/UtilitySounds UtilitySounds} prototype. Example: `"utility/wire_connect_pole"`
2755
+ * - `"ambient"` - Uses {@linkplain https://wiki.factorio.com/Prototype/AmbientSound AmbientSound} prototypes. Example: `"ambient/resource-deficiency"`
2756
2756
  *
2757
2757
  * The following types can be combined with any tile name as long as its prototype defines the
2758
2758
  *
2759
2759
  * corresponding sound.
2760
- * - `"tile-walking"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#walking_sound Tile::walking_sound}. Example: `"tile-walking/concrete"`
2761
- * - `"tile-mined"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#mined_sound Tile::mined_sound}
2762
- * - `"tile-build-small"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}. Example: `"tile-build-small/concrete"`
2763
- * - `"tile-build-medium"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}
2764
- * - `"tile-build-large"` - Uses {@link https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}
2760
+ * - `"tile-walking"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#walking_sound Tile::walking_sound}. Example: `"tile-walking/concrete"`
2761
+ * - `"tile-mined"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#mined_sound Tile::mined_sound}
2762
+ * - `"tile-build-small"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}. Example: `"tile-build-small/concrete"`
2763
+ * - `"tile-build-medium"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}
2764
+ * - `"tile-build-large"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}
2765
2765
  *
2766
2766
  * The following types can be combined with any entity name as long as its prototype defines the
2767
2767
  *
2768
2768
  * corresponding sound.
2769
- * - `"entity-build"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#build_sound Entity::build_sound}. Example: `"entity-build/wooden-chest"`
2770
- * - `"entity-mined"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#mined_sound Entity::mined_sound}
2771
- * - `"entity-mining"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#mining_sound Entity::mining_sound}
2772
- * - `"entity-vehicle_impact"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#vehicle_impact_sound Entity::vehicle_impact_sound}
2773
- * - `"entity-rotated"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#rotated_sound Entity::rotated_sound}
2774
- * - `"entity-open"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#open_sound Entity::open_sound}
2775
- * - `"entity-close"` - Uses {@link https://wiki.factorio.com/Prototype/Entity#close_sound Entity::close_sound}
2769
+ * - `"entity-build"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#build_sound Entity::build_sound}. Example: `"entity-build/wooden-chest"`
2770
+ * - `"entity-mined"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#mined_sound Entity::mined_sound}
2771
+ * - `"entity-mining"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#mining_sound Entity::mining_sound}
2772
+ * - `"entity-vehicle_impact"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#vehicle_impact_sound Entity::vehicle_impact_sound}
2773
+ * - `"entity-rotated"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#rotated_sound Entity::rotated_sound}
2774
+ * - `"entity-open"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#open_sound Entity::open_sound}
2775
+ * - `"entity-close"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#close_sound Entity::close_sound}
2776
2776
  *
2777
2777
  * {@link https://lua-api.factorio.com/latest/Concepts.html#SoundPath View documentation}
2778
2778
  */
@@ -3387,7 +3387,7 @@ type Alignment =
3387
3387
  | "bottom-right"
3388
3388
 
3389
3389
  /**
3390
- * Information about the event that has been raised. The table can also contain other fields depending on the type of event. See {@link https://lua-api.factorio.com/latest/events.html the list of Factorio events} for more information on these.
3390
+ * Information about the event that has been raised. The table can also contain other fields depending on the type of event. See {@linkplain https://lua-api.factorio.com/latest/events.html the list of Factorio events} for more information on these.
3391
3391
  *
3392
3392
  * {@link https://lua-api.factorio.com/latest/Concepts.html#EventData View documentation}
3393
3393
  */
@@ -643,7 +643,7 @@ declare namespace defines {
643
643
  cant_divide_segments,
644
644
  }
645
645
  /**
646
- * See the {@link https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
646
+ * See the {@linkplain https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
647
647
  *
648
648
  * {@link https://lua-api.factorio.com/latest/defines.html#defines.events View documentation}
649
649
  */
@@ -1396,7 +1396,7 @@ declare namespace defines {
1396
1396
  const on_player_reverse_selected_area: EventId<OnPlayerReverseSelectedAreaEvent>
1397
1397
  }
1398
1398
  /**
1399
- * See the {@link https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
1399
+ * See the {@linkplain https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
1400
1400
  *
1401
1401
  * {@link https://lua-api.factorio.com/latest/defines.html#defines.events View documentation}
1402
1402
  */
@@ -3,7 +3,7 @@
3
3
  /** @noSelfInFile */
4
4
 
5
5
  /**
6
- * Called when a {@link https://wiki.factorio.com/Prototype/CustomInput CustomInput} is activated.
6
+ * Called when a {@linkplain https://wiki.factorio.com/Prototype/CustomInput CustomInput} is activated.
7
7
  *
8
8
  * {@link https://lua-api.factorio.com/latest/events.html#CustomInputEvent View documentation}
9
9
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",