factorio-types 0.0.50 → 1.1.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 CHANGED
@@ -1,9 +1,44 @@
1
1
  # factorio-types
2
2
 
3
- Typescript declarations for the factorio mod API. Note this library is not particularly "battle-hardened" by real use, but is here for anyone that may get value from it.
3
+ Typescript declarations for the factorio mod API.
4
4
 
5
- Install `factorio-types` from [npm](https://www.npmjs.com/package/factorio-types), but note the warning above about minimal testing.
5
+ ## Installation
6
6
 
7
- Intended to be used with [Typescript to Lua](https://github.com/TypeScriptToLua/TypeScriptToLua). This library uses some language extensions from the TSTL library, such as the `LuaMultiReturn` type to handle functions that return multiple values. Enable these extensions in your project's tsconfig as per [the docs](https://typescripttolua.github.io/docs/advanced/language-extensions/)
7
+ Install `factorio-types` from [npm](https://www.npmjs.com/package/factorio-types)
8
+
9
+ Intended to be used with [Typescript to Lua](https://github.com/TypeScriptToLua/TypeScriptToLua) (which is a peer dependency)
10
+
11
+ ## Configuration
12
+
13
+ This library includes [tsconfig.base.json](./tsconfig.base.json) in the root of the package with recommended configuration. This can be used as follows
14
+
15
+ `tsconfig.json`:
16
+
17
+ ```json
18
+ {
19
+ "extends": "factorio-types/tsconfig.base.json",
20
+ // other config like included files and output paths
21
+ }
22
+ ```
23
+
24
+ ## Examples
8
25
 
9
26
  A very minimal proof-of-concept showing basic toolchain setup can be found [Here](https://github.com/sguest/factorio-fire-armor-typescript)
27
+
28
+ A slightly more in-depth and realistic mode can be found [Here](https://github.com/sguest/basic-seablock)
29
+
30
+ ## Noise library
31
+
32
+ A note on using the `noise` library from within Factorio: Several mods (typically those that deal with terrain generation) will `require('noise')`. While this seems to work, this is not an officially documented part of the Factorio modding API and is not expressed in these types. If you want to use it, you'll want to add the following to your configuration
33
+
34
+ `tsconfig.json`:
35
+
36
+ ```json
37
+ {
38
+ "tstl": {
39
+ "noResolvePaths": ["noise"]
40
+ }
41
+ }
42
+ ```
43
+
44
+ You can then optionally write your own custom type definitions for these types, or leave them as `any`