factorio-types 0.0.49 → 1.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 +44 -3
- package/dist/classes.d.ts +4786 -2
- package/dist/concepts.d.ts +1 -1
- package/dist/core.d.ts +4 -4
- package/dist/defines.d.ts +817 -817
- package/dist/events.d.ts +1 -1
- package/dist/global.d.ts +1 -1
- package/dist/prototypes.d.ts +3 -3
- package/dist/types.d.ts +6 -1
- package/index.d.ts +1 -0
- package/package.json +13 -6
- package/tsconfig.base.json +15 -0
package/README.md
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
# factorio-types
|
|
2
2
|
|
|
3
|
-
Typescript declarations for the factorio mod API.
|
|
3
|
+
Typescript declarations for the factorio mod API.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
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
|
+
## Noise library
|
|
29
|
+
|
|
30
|
+
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
|
|
31
|
+
|
|
32
|
+
`tsconfig.json`:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"tstl": {
|
|
37
|
+
"noResolvePaths": ["noise"]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then, include a definition file at the root of your project
|
|
43
|
+
|
|
44
|
+
`noise.d.ts`:
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
declare module 'noise' {
|
|
48
|
+
// declare any functions from the noise library that you are using
|
|
49
|
+
}
|
|
50
|
+
```
|