typed-factorio 2.9.0 → 2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +33 -27
- package/index.d.ts +0 -1
- package/package.json +6 -4
- package/prototype/generated/prototypes.d.ts +1761 -1742
- package/prototype/generated/types.d.ts +1491 -1467
- package/runtime/generated/classes.d.ts +4645 -4108
- package/runtime/generated/concepts.d.ts +718 -801
- package/runtime/generated/defines.d.ts +501 -573
- package/runtime/generated/events.d.ts +304 -239
- package/runtime/generated/global-functions.d.ts +8 -8
- package/runtime/generated/global-objects.d.ts +6 -6
- package/settings/types.d.ts +11 -6
- package/runtime/generated/builtin-types.d.ts +0 -66
@@ -7,12 +7,12 @@ import type { LocalisedString, table, uint } from "factorio:runtime"
|
|
7
7
|
declare global {
|
8
8
|
/**
|
9
9
|
* `log()` can print {@link LocalisedString LocalisedStrings} to the Factorio {@linkplain https://wiki.factorio.com/Log_file log file}. This, in combination with the serpent library, makes debugging in the data stage easier because it allows the inspection of entire prototype tables. For example, printing all properties of the sulfur item prototype can be done like so: `log(serpent.block(data.raw["item"]["sulfur"]))`
|
10
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
10
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/auxiliary/libraries.html#new-functions Online documentation}
|
11
11
|
*/
|
12
12
|
function log(string: LocalisedString): void
|
13
13
|
/**
|
14
14
|
* `localised_print()` allows printing {@link LocalisedString} to stdout without polluting the Factorio {@linkplain https://wiki.factorio.com/Log_file log file}. This is primarily useful when communicating with external tools that launch Factorio as a child process.
|
15
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
15
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/auxiliary/libraries.html#new-functions Online documentation}
|
16
16
|
*/
|
17
17
|
function localised_print(string: LocalisedString): void
|
18
18
|
/**
|
@@ -20,16 +20,16 @@ declare global {
|
|
20
20
|
*
|
21
21
|
* ```
|
22
22
|
* local function size(t)
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
*
|
27
|
-
*
|
23
|
+
* local count = 0
|
24
|
+
* for k,v in pairs(t) do
|
25
|
+
* count = count + 1
|
26
|
+
* end
|
27
|
+
* return count
|
28
28
|
* end
|
29
29
|
* ```
|
30
30
|
*
|
31
31
|
* Note that `table_size()` does not work correctly for {@link LuaCustomTable}, their size has to be determined with {@link LuaCustomTable#length LuaCustomTable::length_operator} instead.
|
32
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
32
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/auxiliary/libraries.html#new-functions Online documentation}
|
33
33
|
*/
|
34
34
|
function table_size(table: table): uint
|
35
35
|
}
|
@@ -14,33 +14,33 @@ import type {
|
|
14
14
|
declare global {
|
15
15
|
/**
|
16
16
|
* The main scripting interface through which most of the API is accessed.
|
17
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
17
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/index-runtime.html Online documentation}
|
18
18
|
*/
|
19
19
|
const game: LuaGameScript
|
20
20
|
/**
|
21
21
|
* Provides an interface for registering game event handlers.
|
22
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
22
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/index-runtime.html Online documentation}
|
23
23
|
*/
|
24
24
|
const script: LuaBootstrap
|
25
25
|
/**
|
26
26
|
* Allows registration and use of functions to communicate between mods.
|
27
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
27
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/index-runtime.html Online documentation}
|
28
28
|
*/
|
29
29
|
const remote: LuaRemote
|
30
30
|
/**
|
31
31
|
* Allows registration of custom commands for the in-game console.
|
32
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
32
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/index-runtime.html Online documentation}
|
33
33
|
*/
|
34
34
|
const commands: LuaCommandProcessor
|
35
35
|
//The "settings" global is declared in common/settings-global.d.ts; its runtime type is handled below.
|
36
36
|
/**
|
37
37
|
* Allows printing messages to the calling RCON instance, if any.
|
38
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
38
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/index-runtime.html Online documentation}
|
39
39
|
*/
|
40
40
|
const rcon: LuaRCON
|
41
41
|
/**
|
42
42
|
* Allows rendering of geometric shapes, text and sprites in the game world.
|
43
|
-
* @see {@link https://lua-api.factorio.com/1.1.
|
43
|
+
* @see {@link https://lua-api.factorio.com/1.1.108/index-runtime.html Online documentation}
|
44
44
|
*/
|
45
45
|
const rendering: LuaRendering
|
46
46
|
}
|
package/settings/types.d.ts
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
/** @noResolution */
|
4
4
|
declare module "factorio:settings" {
|
5
|
-
import { LocalisedString } from "factorio:prototype"
|
6
|
-
export type SettingType = "bool-setting" | "int-setting" | "double-setting" | "string-setting"
|
5
|
+
import { Color, LocalisedString } from "factorio:prototype"
|
6
|
+
export type SettingType = "bool-setting" | "int-setting" | "double-setting" | "string-setting" | "color-setting"
|
7
7
|
|
8
8
|
export interface BaseSettingDefinition {
|
9
9
|
readonly type: SettingType
|
@@ -12,9 +12,8 @@ declare module "factorio:settings" {
|
|
12
12
|
* all mods. Because of that it is recommended to prefix mod settings with your mod name,
|
13
13
|
*/
|
14
14
|
name: string
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
localised_name?: LocalisedString
|
16
|
+
localised_description?: LocalisedString
|
18
17
|
/**
|
19
18
|
* The order property can be used to change how the mod settings are ordered in the settings gui. Mod settings are sorted
|
20
19
|
*
|
@@ -41,7 +40,6 @@ declare module "factorio:settings" {
|
|
41
40
|
*
|
42
41
|
* This "setting_type" also determines in which tab the setting is showed in the mod settings menu.
|
43
42
|
*/
|
44
|
-
|
45
43
|
setting_type: "startup" | "runtime-global" | "runtime-per-user"
|
46
44
|
}
|
47
45
|
/** A true/false checkbox */
|
@@ -101,12 +99,19 @@ declare module "factorio:settings" {
|
|
101
99
|
*/
|
102
100
|
allowed_values?: string[]
|
103
101
|
}
|
102
|
+
/** a color picker (sliders), with whole number textfields. Includes alpha. */
|
103
|
+
export interface ColorSettingDefinition extends BaseSettingDefinition {
|
104
|
+
readonly type: "color-setting"
|
105
|
+
/** Defines the default value of the setting. */
|
106
|
+
default_value: Color
|
107
|
+
}
|
104
108
|
|
105
109
|
export interface PrototypeMap {
|
106
110
|
"bool-setting": BoolSettingDefinition
|
107
111
|
"int-setting": IntSettingDefinition
|
108
112
|
"double-setting": DoubleSettingDefinition
|
109
113
|
"string-setting": StringSettingDefinition
|
114
|
+
"color-setting": ColorSettingDefinition
|
110
115
|
}
|
111
116
|
|
112
117
|
export type SettingsPrototypeMap = PrototypeMap
|
@@ -1,66 +0,0 @@
|
|
1
|
-
// This is an auto-generated file. Do not edit directly!
|
2
|
-
|
3
|
-
/** @noSelfInFile */
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @noResolution
|
7
|
-
*/
|
8
|
-
declare module "factorio:runtime" {
|
9
|
-
/**
|
10
|
-
* A floating-point number. This is a single-precision floating point number. Whilst Lua only uses double-precision numbers, when a function takes a float, the game engine will immediately convert the double-precision number to single-precision.
|
11
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#float Online documentation}
|
12
|
-
*/
|
13
|
-
export type float = number
|
14
|
-
/**
|
15
|
-
* A double-precision floating-point number. This is the same data type as all Lua numbers use.
|
16
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#double Online documentation}
|
17
|
-
*/
|
18
|
-
export type double = number
|
19
|
-
/**
|
20
|
-
* 32-bit signed integer. Possible values are -2 147 483 648 to 2 147 483 647.
|
21
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#int Online documentation}
|
22
|
-
*/
|
23
|
-
export type int = number
|
24
|
-
/**
|
25
|
-
* 8-bit signed integer. Possible values are -128 to 127.
|
26
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#int8 Online documentation}
|
27
|
-
*/
|
28
|
-
export type int8 = number
|
29
|
-
/**
|
30
|
-
* 32-bit unsigned integer. Possible values are 0 to 4 294 967 295.
|
31
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#uint Online documentation}
|
32
|
-
*/
|
33
|
-
export type uint = number
|
34
|
-
/**
|
35
|
-
* 8-bit unsigned integer. Possible values are 0 to 255.
|
36
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#uint8 Online documentation}
|
37
|
-
*/
|
38
|
-
export type uint8 = number
|
39
|
-
/**
|
40
|
-
* 16-bit unsigned integer. Possible values are 0 to 65 535.
|
41
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#uint16 Online documentation}
|
42
|
-
*/
|
43
|
-
export type uint16 = number
|
44
|
-
/**
|
45
|
-
* 64-bit unsigned integer. Possible values are 0 to 18 446 744 073 709 551 615.
|
46
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#uint64 Online documentation}
|
47
|
-
*/
|
48
|
-
export type uint64 = number
|
49
|
-
/**
|
50
|
-
* Nil is the type of the value `nil`, whose main property is to be different from any other value. It usually represents the absence of a useful value.
|
51
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#nil Online documentation}
|
52
|
-
*/
|
53
|
-
export type nil = undefined
|
54
|
-
/**
|
55
|
-
* Tables are enclosed in curly brackets, like this `{}`.
|
56
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#table Online documentation}
|
57
|
-
*/
|
58
|
-
export type table = object
|
59
|
-
/**
|
60
|
-
* Any LuaObject listed on the {@linkplain https://lua-api.factorio.com/1.1.105/classes.html Classes} page.
|
61
|
-
* @see {@link https://lua-api.factorio.com/1.1.105/builtin-types.html#LuaObject Online documentation}
|
62
|
-
*/
|
63
|
-
export interface LuaObject {
|
64
|
-
readonly object_name: string
|
65
|
-
}
|
66
|
-
}
|