typed-factorio 2.14.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/package.json +1 -2
- package/prototype/generated/prototypes.d.ts +6818 -4113
- package/prototype/generated/types.d.ts +10656 -6113
- package/runtime/generated/classes.d.ts +11574 -10762
- package/runtime/generated/concepts.d.ts +7516 -5096
- package/runtime/generated/defines.d.ts +832 -250
- package/runtime/generated/events.d.ts +712 -287
- package/runtime/generated/global-functions.d.ts +3 -3
- package/runtime/generated/global-objects.d.ts +23 -11
package/README.md
CHANGED
@@ -107,14 +107,15 @@ const foo = util.copy(bar)
|
|
107
107
|
|
108
108
|
If you wish to see types for more lualib modules, feel free to open an issue or pull request.
|
109
109
|
|
110
|
-
### The `
|
110
|
+
### The `storage` table
|
111
111
|
|
112
|
-
The `
|
112
|
+
The `storage` table (in the runtime stage) can have any shape, so it is not defined here. Instead, you can define it yourself:
|
113
113
|
|
114
|
-
- Add `declare const
|
115
|
-
- Add `declare
|
114
|
+
- Add `declare const storage: <Your type>` in a `.d.ts` file. Make sure this file is included by your tsconfig!
|
115
|
+
- Add `declare global { const storage: <Your type> }` in a `.ts` file included in your project.
|
116
|
+
- Add `declare const storage: {...}` to each file where needed. This way, you can define only properties that each file specifically uses.
|
116
117
|
|
117
|
-
## Using multiple stages in the same project
|
118
|
+
## Using multiple loading stages in the same project
|
118
119
|
|
119
120
|
Every Factorio loading stage declares different global variables.
|
120
121
|
To add types for multiple Factorio stages, you have a few options:
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "typed-factorio",
|
3
|
-
"version": "
|
3
|
+
"version": "3.0.0",
|
4
4
|
"description": "Featureful typescript definitions for the Factorio modding api.",
|
5
5
|
"keywords": [
|
6
6
|
"factorio",
|
@@ -46,7 +46,6 @@
|
|
46
46
|
"@types/node": "^20.11.29",
|
47
47
|
"@typescript-eslint/eslint-plugin": "^7.3.0",
|
48
48
|
"@typescript-eslint/parser": "^7.3.0",
|
49
|
-
"chalk": "^5.3.0",
|
50
49
|
"download": "^8.0.0",
|
51
50
|
"eslint": "^8.57.0",
|
52
51
|
"eslint-config-prettier": "^9.1.0",
|