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 CHANGED
@@ -1,19 +1,43 @@
1
+ # v0.17.0
2
+
3
+ - Updated to factorio version 1.1.52
4
+
5
+ # v0.16.0
6
+
7
+ - `LuaCustomTable` can be iterated on in a for-of loop directly (without using `pairs`). This requires TSTL v1.3.0 or later.
8
+ - TSTL dependency minimum version is now v1.3.0.
9
+
10
+ # v0.15.0
11
+
12
+ - Table or array concepts are now declared in table form wherever it is an "read" position.
13
+ - This works with setter overloading for applicable properties: `player.color.x; player.color = [1, 1, 1]` is now valid!
14
+ - This also applies to concepts/complex types which contain table_or_array properties.
15
+ - 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`.
16
+ - 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.
17
+ - `MapPosition` is now a table or array concept.
18
+ - Classes with subclasses are now declared with all properties, instead of an intersection of subclasses (reversion)
19
+ - Subclass specializations added for some missing classes
20
+
21
+ # v0.14.1
22
+
23
+ - LuaStyle: `extra_margin/padding_when_activated` is now for subclass scroll_pane
24
+
1
25
  # v0.14.0
2
26
 
3
27
  - LuaStyle size, margin/padding setters now have more specific array types. These array types are `SizeArray` and `StyleValuesArray` for size and margin/padding, respectively.
4
28
  - `@noSelf` annotation is now only present when necessary.
5
29
  - For classes with subclasses:
6
- - The original class name (e.g. `LuaItemStack`) still contains attributes of all subclasses (same as before).
7
- - There is now a `Base` type (e.g. `BaseItemStack`) which only includes attributes common to all subclasses.
8
- - 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).
9
- - The above two can be optionally used for stricter types.
30
+ - The original class name (e.g. `LuaItemStack`) still contains attributes of all subclasses (same as before).
31
+ - There is now a `Base` type (e.g. `BaseItemStack`) which only includes attributes common to all subclasses.
32
+ - 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).
33
+ - The above two can be optionally used for stricter types.
10
34
 
11
35
  # v0.13.2
12
36
 
13
37
  - Fix: resize_to_sprite property should not be on subclass sprite-button
14
38
  - Fix: ChooseElemButtonSpec filters should be named elem_filters
15
39
  - Switch back to `/latest` api docs link
16
- - New version of web api docs is now active
40
+ - New version of web api docs is now active
17
41
 
18
42
  # v0.13.0
19
43
 
@@ -49,7 +73,7 @@
49
73
  # v0.7.3
50
74
 
51
75
  - Update to factorio version 1.1.42
52
- - No api changes, but improvements to descriptions
76
+ - No api changes, but improvements to descriptions
53
77
 
54
78
  # v0.7.2
55
79
 
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