typed-factorio 0.14.1 → 0.17.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,27 @@
1
+ # v0.17.1
2
+
3
+ - Fixed documentation links for events
4
+
5
+ # v0.17.0
6
+
7
+ - Updated to factorio version 1.1.52
8
+
9
+ # v0.16.0
10
+
11
+ - `LuaCustomTable` can be iterated on in a for-of loop directly (without using `pairs`). This requires TSTL v1.3.0 or later.
12
+ - TSTL dependency minimum version is now v1.3.0.
13
+
14
+ # v0.15.0
15
+
16
+ - Table or array concepts are now declared in table form wherever it is an "read" position.
17
+ - This works with setter overloading for applicable properties: `player.color.x; player.color = [1, 1, 1]` is now valid!
18
+ - This also applies to concepts/complex types which contain table_or_array properties.
19
+ - 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`.
20
+ - 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-only arrays to these methods.
21
+ - `MapPosition` is now a table or array concept.
22
+ - Classes with subclasses are now declared with all properties, instead of an intersection of subclasses (reversion)
23
+ - Subclass specializations added for some missing classes
24
+
1
25
  # v0.14.1
2
26
 
3
27
  - LuaStyle: `extra_margin/padding_when_activated` is now for subclass scroll_pane
@@ -7,17 +31,17 @@
7
31
  - LuaStyle size, margin/padding setters now have more specific array types. These array types are `SizeArray` and `StyleValuesArray` for size and margin/padding, respectively.
8
32
  - `@noSelf` annotation is now only present when necessary.
9
33
  - For classes with subclasses:
10
- - The original class name (e.g. `LuaItemStack`) still contains attributes of all subclasses (same as before).
11
- - There is now a `Base` type (e.g. `BaseItemStack`) which only includes attributes common to all subclasses.
12
- - 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).
13
- - The above two can be optionally used for stricter types.
34
+ - The original class name (e.g. `LuaItemStack`) still contains attributes of all subclasses (same as before).
35
+ - There is now a `Base` type (e.g. `BaseItemStack`) which only includes attributes common to all subclasses.
36
+ - 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).
37
+ - The above two can be optionally used for stricter types.
14
38
 
15
39
  # v0.13.2
16
40
 
17
41
  - Fix: resize_to_sprite property should not be on subclass sprite-button
18
42
  - Fix: ChooseElemButtonSpec filters should be named elem_filters
19
43
  - Switch back to `/latest` api docs link
20
- - New version of web api docs is now active
44
+ - New version of web api docs is now active
21
45
 
22
46
  # v0.13.0
23
47
 
@@ -53,7 +77,7 @@
53
77
  # v0.7.3
54
78
 
55
79
  - Update to factorio version 1.1.42
56
- - No api changes, but improvements to descriptions
80
+ - No api changes, but improvements to descriptions
57
81
 
58
82
  # v0.7.2
59
83
 
package/README.md CHANGED
@@ -73,7 +73,7 @@ The `global` table is just a lua table which can have any shape the mod desires,
73
73
 
74
74
  Typed-factorio has 100% complete types for the runtime stage. Description-only concepts and some not documented types are filled in manually.
75
75
 
76
- Here are some details on particular type features in the definitions:
76
+ Here are some details on particular type features:
77
77
 
78
78
  ### Lua features
79
79
 
@@ -96,6 +96,7 @@ The type for a specific variant is prefixed with the variant name, or with "Othe
96
96
  ### Types with subclasses
97
97
 
98
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
+
99
100
  - a "Base" type, e.g. `BaseEntity`, which only contains members usable by all subclasses
100
101
  - individual subclass types, e.g. `CraftingMachineEntity`, which extends the base type with members specific to that subclass
101
102
 
@@ -111,9 +112,13 @@ You can pass a type parameter to `script.generate_event_name<T>()`, and it will
111
112
 
112
113
  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**.
113
114
 
114
- ### Table or array types
115
+ ### Table or array types, and "Read" concepts
116
+
117
+ 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.
118
+
119
+ 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.
115
120
 
116
- 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 specifically.
121
+ 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`.
117
122
 
118
123
  ### LuaGuiElement
119
124