typed-factorio 1.17.0 → 2.0.1

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.
@@ -1,91 +0,0 @@
1
- // from https://lua-api.factorio.com/latest/Libraries.html
2
- // last updated for 1.1.35, 1.1.36, 1.1.37
3
-
4
- /** @noSelfInFile */
5
-
6
- /** @noSelf */
7
- interface SerpentOptions {
8
- /** Indentation; triggers long multi-line output. */
9
- indent: string
10
- /** Provide stringified value in a comment (up to maxlevel of depth). */
11
- comment: boolean | number
12
- /** Sort keys. */
13
- sortkeys: boolean | ((this: void, keys: any[], table: any) => void)
14
- /** Force sparse encoding (no nil filling based on #t). */
15
- sparse: boolean
16
- /** Remove spaces. */
17
- compact: boolean
18
- /** Raise fatal error on non-serializable values. */
19
- fatal: boolean
20
- /** Disable bytecode serialization for easy comparison. */
21
- nocode: boolean
22
- /** Disable checking numbers against undefined and huge values. */
23
- nohuge: boolean
24
- /** Specify max level up to which to expand nested tables. */
25
- maxlevel: number
26
- /** Specify max number of elements in a table. */
27
- maxnum: number
28
- /** Specify max length for all table elements. */
29
- maxlength: number
30
- /**
31
- * Use __tostring metamethod when serializing tables (v0.29); set to false to disable and serialize the table as is,
32
- * even when __tostring is present.
33
- */
34
- metatostring: boolean
35
- /**
36
- * Specify format for numeric values as shortest possible round-trippable double (v0.30). Use "%.16g" for better
37
- * readability and "%.17g" (the default value) to preserve floating point precision.
38
- */
39
- numformat: string
40
- /** Allows to specify a list of values to ignore (as keys). */
41
- valignore: string[]
42
- /** Allows to specify the list of keys to be serialized. Any keys not in this list are not included in final output (as keys). */
43
- keyallow: string[]
44
- /** Allows to specity the list of keys to ignore in serialization. */
45
- keyignore: string[]
46
- /** Allows to specify a list of value types to ignore (as keys). */
47
- valtypeignore: string[]
48
- /** Provide custom output for tables. */
49
- custom(opts: {
50
- /** The name of the current element with '=' or an empty string in case of array index, */
51
- tag: string
52
- /** An opening table bracket { and associated indentation and newline (if any), */
53
- head: string
54
- /** Table elements concatenated into a string using commas and indentation/newlines (if any), */
55
- body: string
56
- /** A closing table bracket } and associated indentation and newline (if any), and */
57
- tail: string
58
- /** The current level. */
59
- level: number
60
- }): string
61
- /** Name; triggers full serialization with self-ref section. */
62
- name: string
63
-
64
- refcomment: boolean | number
65
- tablecomment: boolean | number
66
- }
67
-
68
- /**
69
- * Factorio provides the {@link https://github.com/pkulchenko/serpent serpent library} as a global variable `serpent` for
70
- * all mods to use. It allows for easy debugging of tables, because serpent makes it trivial to print them, for example
71
- * by using `serpent.block()`. However, serpent cannot pretty-print LuaObjects such as LuaEntity. The serpent library
72
- * was modified to improve determinism, e.g. comments are turned off by default to avoid returning table addresses.
73
- * Furthermore, two options were added: `refcomment` (true/false/maxlevel) and `tablecomment` (true/false/maxlevel),
74
- * which allow to separately control the self-reference and table value output of the `comment` option.
75
- */
76
- declare namespace serpent {
77
- /** Full serialization; sets name, compact and sparse options; */
78
- function dump(tbl: unknown, options?: Partial<SerpentOptions>): string
79
-
80
- /** Single line pretty printing, no self-ref section; sets sortkeys and comment options; */
81
- function line(tbl: unknown, options?: Partial<SerpentOptions>): string
82
-
83
- /** Multi-line indented pretty printing, no self-ref section; sets indent, sortkeys, and comment options. */
84
- function block(tbl: unknown, options?: Partial<SerpentOptions>): string
85
-
86
- /**
87
- * For loading serialized fragments, serpent also provides `load` function that adds safety checks and reports an
88
- * error if there is any executable code in the fragment.
89
- */
90
- function load<T>(str: string, options?: { safe?: boolean }): LuaMultiReturn<[true, T] | [false, string]>
91
- }
@@ -1,3 +0,0 @@
1
- interface __OptInFeatures {
2
- strictIndexTypes: true
3
- }