typed-factorio 1.10.2 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "1.10.2",
3
+ "version": "1.12.0",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",
@@ -14882,6 +14882,11 @@ interface LuaInventory extends ReadonlyArray<LuaItemStack> {
14882
14882
  * @see {@link https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.is_empty Online documentation}
14883
14883
  */
14884
14884
  is_empty(): boolean
14885
+ /**
14886
+ * Is every stack in this inventory full? Ignores stacks blocked by the current bar.
14887
+ * @see {@link https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.is_full Online documentation}
14888
+ */
14889
+ is_full(): boolean
14885
14890
  /**
14886
14891
  * Get counts of all items in this inventory.
14887
14892
  * @returns The counts, indexed by item names.
@@ -14959,9 +14964,10 @@ interface LuaInventory extends ReadonlyArray<LuaItemStack> {
14959
14964
  /**
14960
14965
  * Counts the number of empty stacks.
14961
14966
  * @param include_filtered If true, filtered slots will be included. Defaults to false.
14967
+ * @param include_bar If true, slots blocked by the current bar will be included. Defaults to true.
14962
14968
  * @see {@link https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.count_empty_stacks Online documentation}
14963
14969
  */
14964
- count_empty_stacks(include_filtered?: boolean): uint
14970
+ count_empty_stacks(include_filtered?: boolean, include_bar?: boolean): uint
14965
14971
  /**
14966
14972
  * Gets the number of the given item that can be inserted into this inventory.
14967
14973
  * @param item The item to check.
@@ -19072,11 +19078,21 @@ interface LuaPlayer extends LuaControl {
19072
19078
  *
19073
19079
  * **Raised events:**
19074
19080
  * - {@link OnStringTranslatedEvent on_string_translated}? _future_tick_ Raised if the request was successfully sent.
19075
- * @returns Whether the request was sent or not.
19081
+ * @returns The unique id for the requested translation.
19076
19082
  * @remarks Does nothing if this player is not connected. (see {@link LuaPlayer#connected LuaPlayer::connected}).
19077
19083
  * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.request_translation Online documentation}
19078
19084
  */
19079
- request_translation(localised_string: LocalisedString): boolean
19085
+ request_translation(localised_string: LocalisedString): uint | nil
19086
+ /**
19087
+ * Requests a translation for the given localised strings. If the request is successful the {@link OnStringTranslatedEvent on_string_translated} event will be fired at a later time with the results.
19088
+ *
19089
+ * **Raised events:**
19090
+ * - {@link OnStringTranslatedEvent on_string_translated}? _future_tick_ Raised if the request was successfully sent.
19091
+ * @returns The unique id for the requested translation.
19092
+ * @remarks Does nothing if this player is not connected. (see {@link LuaPlayer#connected LuaPlayer::connected}).
19093
+ * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.request_translations Online documentation}
19094
+ */
19095
+ request_translations(localised_strings: readonly LocalisedString[]): uint[] | nil
19080
19096
  /**
19081
19097
  * Gets the filter for this map editor infinity filters at the given index or `nil` if the filter index doesn't exist or is empty.
19082
19098
  * @param index The index to get.
@@ -19286,6 +19302,11 @@ interface LuaPlayer extends LuaControl {
19286
19302
  * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.hand_location Online documentation}
19287
19303
  */
19288
19304
  hand_location?: ItemStackLocation
19305
+ /**
19306
+ * Returns true if the current item stack in cursor will be destroyed after clearing the cursor. Manually putting it into inventory still preserves the item. If the cursor stack is not one of the supported types (blueprint, blueprint-book, deconstruction-planner, upgrade-planner), write operation will be silently ignored.
19307
+ * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.cursor_stack_temporary Online documentation}
19308
+ */
19309
+ cursor_stack_temporary: boolean
19289
19310
  /**
19290
19311
  * The player's zoom-level.
19291
19312
  * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.zoom Online documentation}
@@ -3814,6 +3814,10 @@ interface OnStringTranslatedEvent extends EventData {
3814
3814
  * The translated `localised_string`.
3815
3815
  */
3816
3816
  readonly result: string
3817
+ /**
3818
+ * The unique id for this translation request.
3819
+ */
3820
+ readonly id: uint
3817
3821
  /**
3818
3822
  * Whether the requested localised string was valid and could be translated.
3819
3823
  */