@defold-typescript/library-types 0.21.1 → 0.23.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.
Files changed (56) hide show
  1. package/api-doc/{bridge.bridge.json → bridge.json} +749 -844
  2. package/api-doc/decore.json +22 -22
  3. package/api-doc/druid.json +195 -1790
  4. package/api-doc/event.json +1074 -0
  5. package/api-doc/immutable.json +65 -0
  6. package/api-doc/lang.json +528 -0
  7. package/api-doc/{event.event.json → log.json} +96 -101
  8. package/api-doc/narrator.json +647 -0
  9. package/api-doc/proto.json +995 -0
  10. package/api-doc/saver.saver.json +713 -263
  11. package/api-doc/saver.storage.json +282 -52
  12. package/api-doc/squid.json +846 -0
  13. package/api-doc/tweener.json +277 -0
  14. package/generated/bridge.d.ts +468 -0
  15. package/generated/decore.d.ts +36 -36
  16. package/generated/druid.d.ts +137 -443
  17. package/generated/event.d.ts +318 -0
  18. package/generated/immutable.d.ts +13 -0
  19. package/generated/lang.d.ts +101 -0
  20. package/generated/log.d.ts +36 -0
  21. package/generated/narrator.d.ts +121 -0
  22. package/generated/proto.d.ts +146 -0
  23. package/generated/saver.saver.d.ts +287 -42
  24. package/generated/saver.storage.d.ts +77 -14
  25. package/generated/squid.d.ts +127 -0
  26. package/generated/tweener.d.ts +42 -0
  27. package/library-classification.json +0 -71
  28. package/library-targets.json +0 -66
  29. package/luals-targets.json +114 -0
  30. package/package.json +4 -33
  31. package/script-api-targets.json +15 -0
  32. package/scripts/__snapshots__/parse-luals.test.ts.snap +340 -75
  33. package/scripts/apply-luals-overrides.ts +63 -0
  34. package/scripts/emit-library-dts.ts +84 -3
  35. package/scripts/lower-api-doc.ts +48 -16
  36. package/scripts/luals-fidelity.ts +7 -0
  37. package/scripts/map-luals-types.ts +34 -1
  38. package/scripts/parse-luals.ts +423 -18
  39. package/scripts/sync-luals-types.ts +15 -1
  40. package/scripts/sync-script-api-types.ts +368 -0
  41. package/api-doc/immutable.immutable.json +0 -63
  42. package/api-doc/lang.lang.json +0 -411
  43. package/api-doc/log.log.json +0 -50
  44. package/api-doc/narrator.narrator.json +0 -150
  45. package/api-doc/proto.proto.json +0 -355
  46. package/api-doc/squid.squid.json +0 -660
  47. package/api-doc/tweener.tweener.json +0 -419
  48. package/generated/bridge.bridge.d.ts +0 -533
  49. package/generated/event.event.d.ts +0 -54
  50. package/generated/immutable.immutable.d.ts +0 -13
  51. package/generated/lang.lang.d.ts +0 -33
  52. package/generated/log.log.d.ts +0 -40
  53. package/generated/narrator.narrator.d.ts +0 -66
  54. package/generated/proto.proto.d.ts +0 -36
  55. package/generated/squid.squid.d.ts +0 -106
  56. package/generated/tweener.tweener.d.ts +0 -151
@@ -0,0 +1,146 @@
1
+ /** @noResolution */
2
+ declare module 'proto.proto' {
3
+ /**
4
+ * Download Defold annotations from here: https://github.com/astrochili/defold-annotations/releases/
5
+ * Logger interface
6
+ */
7
+ interface proto_logger {
8
+ trace: (logger: proto_logger, message: string, data: unknown | undefined) => void;
9
+ debug: (logger: proto_logger, message: string, data: unknown | undefined) => void;
10
+ info: (logger: proto_logger, message: string, data: unknown | undefined) => void;
11
+ warn: (logger: proto_logger, message: string, data: unknown | undefined) => void;
12
+ error: (logger: proto_logger, message: string, data: unknown | undefined) => void;
13
+ }
14
+ interface Lexer {
15
+ __call(): void;
16
+ test(): void;
17
+ expected(): void;
18
+ pos2loc(): void;
19
+ error(): void;
20
+ opterror(): void;
21
+ whitespace(): void;
22
+ comment(): void;
23
+ line_end(): void;
24
+ eof(): void;
25
+ keyword(): void;
26
+ ident(): void;
27
+ full_ident(): void;
28
+ integer(): void;
29
+ number(): void;
30
+ quote(): void;
31
+ structure(): void;
32
+ array(): void;
33
+ constant(): void;
34
+ option_name(): void;
35
+ type_name(): void;
36
+ __call(): void;
37
+ test(): void;
38
+ expected(): void;
39
+ pos2loc(): void;
40
+ error(): void;
41
+ opterror(): void;
42
+ whitespace(): void;
43
+ comment(): void;
44
+ line_end(): void;
45
+ eof(): void;
46
+ keyword(): void;
47
+ ident(): void;
48
+ full_ident(): void;
49
+ integer(): void;
50
+ number(): void;
51
+ quote(): void;
52
+ table(): void;
53
+ constant(): void;
54
+ option_name(): void;
55
+ type_name(): void;
56
+ }
57
+ interface Parser {
58
+ error(): void;
59
+ addpath(): void;
60
+ parsefile(): void;
61
+ parse(): void;
62
+ resolve(): void;
63
+ compile(): void;
64
+ compilefile(): void;
65
+ load(): void;
66
+ loadfile(): void;
67
+ error(): void;
68
+ addpath(): void;
69
+ parsefile(): void;
70
+ parse(): void;
71
+ resolve(): void;
72
+ compile(): void;
73
+ compilefile(): void;
74
+ load(): void;
75
+ loadfile(): void;
76
+ }
77
+ interface toplevel {
78
+ package(): void;
79
+ "import"(): void;
80
+ message(): void;
81
+ enum(): void;
82
+ option(): void;
83
+ extend(): void;
84
+ service(): void;
85
+ package(): void;
86
+ "import"(): void;
87
+ message(): void;
88
+ enum(): void;
89
+ option(): void;
90
+ extend(): void;
91
+ service(): void;
92
+ }
93
+ interface msg_body {
94
+ message(): void;
95
+ enum(): void;
96
+ extend(): void;
97
+ extensions(): void;
98
+ reserved(): void;
99
+ oneof(): void;
100
+ option(): void;
101
+ message(): void;
102
+ enum(): void;
103
+ extend(): void;
104
+ extensions(): void;
105
+ reserved(): void;
106
+ oneof(): void;
107
+ }
108
+ interface svr_body {
109
+ rpc(): void;
110
+ option(): void;
111
+ rpc(): void;
112
+ }
113
+ interface proto {
114
+ }
115
+ /**
116
+ * Loads proto files from the specified paths in the game.project
117
+ * Under the "proto.proto_paths" key in the game.project
118
+ */
119
+ export function init(this: void, proto_config_or_path: LuaTable | string): void;
120
+ /**
121
+ * Set the logger instance
122
+ */
123
+ export function set_logger(this: void, logger_instance?: proto_logger | undefined): void;
124
+ /**
125
+ * Create a new instance of the proto message
126
+ */
127
+ export function get(this: void, proto_type: string): LuaTable;
128
+ /**
129
+ * Encode data to bytes
130
+ */
131
+ export function encode(this: void, proto_type: string, data: LuaTable): string;
132
+ /**
133
+ * Decode bytes to lua table
134
+ */
135
+ export function decode(this: void, proto_type: string, bytes?: string | undefined): LuaTable;
136
+ /**
137
+ * Verify data to match the proto_type. Return data with all default values according to proto_type, remove extra fields
138
+ */
139
+ export function verify(this: void, proto_type: string, data: LuaTable): LuaTable;
140
+ /**
141
+ * Update data to match the proto_type.
142
+ * - All default values will be added to the data if they are not present
143
+ * - All extra fields will be removed from the data
144
+ */
145
+ export function update_with_default_messages(this: void, proto_type: string, data: LuaTable): void;
146
+ }
@@ -1,44 +1,289 @@
1
- /** @noSelfInFile **/
2
- /* eslint-disable @typescript-eslint/no-empty-object-type */
3
- /* eslint-disable @typescript-eslint/no-explicit-any */
4
-
5
- /**
6
- * @see {@link https://github.com/Insality/defold-saver|Github Source}
7
- * @see {@link https://github.com/Insality/defold-saver/blob/main/API_REFERENCE.md|API Reference}
8
- * @example `import * as saver from 'saver.saver'`
9
- * @noResolution
10
- */
1
+ /** @noResolution */
11
2
  declare module 'saver.saver' {
12
- interface LoggerInstance {
13
- trace(this: any, message: string, data?: {}): void;
14
- debug(this: any, message: string, data?: {}): void;
15
- info(this: any, message: string, data?: {}): void;
16
- warn(this: any, message: string, data?: {}): void;
17
- error(this: any, message: string, data?: {}): void;
18
- }
19
-
20
- export function init(): void;
21
- export function bind_save_part(keyId: string, tableReference: any): void;
22
- export function save_game_state(fileName?: string): boolean;
23
- export function load_game_state(fileName?: string): boolean;
24
- export function get_game_state(): unknown;
25
- export function set_game_state(state: any): boolean;
26
- export function save_file_by_path(data: any, filePath: string): boolean;
27
- export function load_file_by_path(path: string): unknown;
28
- export function save_file_by_name(data: any, fileName: string): boolean;
29
- export function load_file_by_name(fileName: string): unknown;
30
- export function set_autosave_timer(seconds: number): void;
31
- export function get_save_path(fileName?: string): string;
32
- export function get_save_version(): number;
33
- export function set_migrations(
34
- migrationList: ((
35
- this: void,
36
- gameState: any,
37
- logger: LoggerInstance,
38
- ) => any)[],
39
- ): void;
40
- export function apply_migrations(): void;
41
- export function set_logger(logger: LoggerInstance): void;
42
- export function set_logger(remove_logger: undefined): void;
43
- export function get_current_game_project_folder(): string | undefined;
3
+ /**
4
+ * Persist data between game sessions
5
+ */
6
+ interface saver_state {
7
+ storage: LuaTable<string, unknown>;
8
+ version: number;
9
+ last_game_version: string;
10
+ migration_version: number;
11
+ }
12
+ /**
13
+ * Whole game state. Add your fields here to inspect all fields
14
+ */
15
+ interface saver_game_state {
16
+ saver: saver_state;
17
+ storage: saver_storage_state;
18
+ }
19
+ /**
20
+ * Configuration table for `saver.init` to setup all things you can in game.project file
21
+ */
22
+ interface saver_config {
23
+ save_folder?: string | undefined;
24
+ save_name?: string | undefined;
25
+ saver_key?: string | undefined;
26
+ storage_key?: string | undefined;
27
+ autosave_timer?: number | undefined;
28
+ lua_require_as_string?: boolean | undefined;
29
+ }
30
+ /**
31
+ * Logger interface
32
+ */
33
+ interface saver_logger {
34
+ trace: (logger: saver_logger, message: string, data: unknown | undefined) => void;
35
+ debug: (logger: saver_logger, message: string, data: unknown | undefined) => void;
36
+ info: (logger: saver_logger, message: string, data: unknown | undefined) => void;
37
+ warn: (logger: saver_logger, message: string, data: unknown | undefined) => void;
38
+ error: (logger: saver_logger, message: string, data: unknown | undefined) => void;
39
+ }
40
+ interface saver {
41
+ }
42
+ /**
43
+ * Persist data between game sessions
44
+ */
45
+ interface saver_storage_state {
46
+ storage: LuaTable<string, saver_storage_value>;
47
+ }
48
+ /**
49
+ * One of the values in the storage
50
+ */
51
+ interface saver_storage_value {
52
+ s_value?: string | undefined;
53
+ i_value?: number | undefined;
54
+ b_value?: boolean | undefined;
55
+ }
56
+ interface saver_storage {
57
+ }
58
+ /**
59
+ * File format enum (mirrors saver_internal.FORMAT)
60
+ * Customize the logging mechanism used by Defold Saver.
61
+ * You can use Defold Log library or provide a custom logger.
62
+ * local log = require("log.log")
63
+ * local saver = require("saver.saver")
64
+ *
65
+ * saver.set_logger(log.get_logger("saver"))
66
+ */
67
+ export function set_logger(this: void, logger_instance?: saver_logger | LuaTable | undefined): void;
68
+ /**
69
+ * Initialize the Saver module. Should be called at the start of your game to set up the module.
70
+ * Call it after saver.set_migrations if you are using migrations.
71
+ * This function loads the game state from a file and starts the autosave timer.
72
+ * If the game state file does not exist, a new game state is created.
73
+ * saver.init()
74
+ */
75
+ export function init(this: void, config?: saver_config | undefined): void;
76
+ /**
77
+ * Save the current game state to a file. If no file name is provided, the default file name specified in the game.project file is used.
78
+ * -- Save the game with default name
79
+ * saver.save_game_state()
80
+ *
81
+ * -- Save the game with custom name
82
+ * saver.save_game_state("custom_save")
83
+ */
84
+ export function save_game_state(this: void, save_name?: string | undefined): boolean;
85
+ /**
86
+ * Load the game state from a file. If no file name is provided, the default file name specified in the game.project file is used.
87
+ * local is_loaded = saver.load_game_state() -- Load the game state with default name
88
+ * local is_loaded = saver.load_game_state("custom_save") -- Load the game state with custom name
89
+ */
90
+ export function load_game_state(this: void, save_name?: string | undefined): boolean;
91
+ /**
92
+ * Delete the game state file. Doesn't affect the current game state.
93
+ * If autosave is enabled, it will be rescheduled, so probably you want to immediately restart the game.
94
+ * -- Delete the game state with default name
95
+ * saver.delete_game_state()
96
+ *
97
+ * -- Delete the game state with custom name
98
+ * saver.delete_game_state("custom_save")
99
+ */
100
+ export function delete_game_state(this: void, save_name?: string | undefined): boolean;
101
+ /**
102
+ * Returns the current game state.
103
+ * local game_state = saver.get_game_state()
104
+ * pprint(game_state)
105
+ */
106
+ export function get_game_state(this: void): saver_game_state;
107
+ /**
108
+ * Sets the current game state to the specified state.
109
+ * local game_state = saver.get_game_state()
110
+ * game_state.game.level = 5
111
+ * saver.set_game_state(game_state)
112
+ */
113
+ export function set_game_state(this: void, data: LuaTable): boolean;
114
+ /**
115
+ * Binds a table reference as a part of the game state. When the game state is saved, all table references will be saved.
116
+ * This is a main function to use to save your game state. You can bind multiple tables to different parts of the game state.
117
+ * After binding, the table_reference will be updated with the saved data if it exists.
118
+ * local game_state = {
119
+ * level = 1,
120
+ * money = 100
121
+ * }
122
+ *
123
+ * saver.bind_save_state("game", game_state)
124
+ *
125
+ * -- If we have previously saved game state, the game_state will be changed to the saved data
126
+ * print(game_state.level) -- 5 (if it was saved before)
127
+ */
128
+ export function bind_save_state(this: void, table_key_id: string, table_reference: LuaTable): LuaTable;
129
+ /**
130
+ * Saves the specified data to a file at the specified path. The data format is chosen by file path extension.
131
+ * local data = {
132
+ * score = 100,
133
+ * level = 1
134
+ * }
135
+ *
136
+ * -- Get project path works on build from the Defold Editor only
137
+ * local project_path = saver.get_current_game_project_folder()
138
+ * -- Use path to the resources folder
139
+ * local file_path = saver.get_save_path(project_path .. "/resources/data.json")
140
+ * saver.save_file_by_path(data, file_path)
141
+ */
142
+ export function save_file_by_path(this: void, data: LuaTable, path: string, format?: string | undefined): boolean;
143
+ /**
144
+ * Saves the specified data to a file at the specified path. The data format is binary.
145
+ */
146
+ export function save_binary_by_path(this: void, data: string, path: string): boolean;
147
+ /**
148
+ * Loads the data from a file at the specified path.
149
+ * -- Get project path works on build from the Defold Editor only
150
+ * local project_path = saver.get_current_game_project_folder()
151
+ * -- Use path to the resources folder
152
+ * local file_path = saver.get_save_path(project_path .. "/resources/data.json")
153
+ * local data = saver.load_file_by_path(file_path)
154
+ * pprint(data)
155
+ * NOTE: For binary data like images, use `saver.load_binary_by_path` instead.
156
+ */
157
+ export function load_file_by_path(this: void, path: string, format?: string | undefined): LuaTable | undefined;
158
+ /**
159
+ * Loads the binary data from a file at the specified path.
160
+ */
161
+ export function load_binary_by_path(this: void, path: string): string | undefined;
162
+ /**
163
+ * Deletes the file at the specified path.
164
+ */
165
+ export function delete_file_by_path(this: void, path: string): boolean;
166
+ /**
167
+ * Checks if the file exists at the specified path.
168
+ * local is_project_file_exists = saver.is_file_exists_by_path(absolute_path_to_file)
169
+ */
170
+ export function is_file_exists_by_path(this: void, path: string): boolean;
171
+ /**
172
+ * Saves the specified data to a file with the specified name. The file is saved in the game save folder. Filename supports subfolders.
173
+ * local data = {
174
+ * score = 100,
175
+ * level = 1
176
+ * }
177
+ *
178
+ * -- Save the data to the game save folder
179
+ * saver.save_file_by_name(data, "data.json")
180
+ */
181
+ export function save_file_by_name(this: void, data: LuaTable, filename: string, format?: string | undefined): boolean;
182
+ /**
183
+ * Saves the specified data to a file with the specified name. The data format is binary.
184
+ */
185
+ export function save_binary_by_name(this: void, data: string, filename: string): boolean;
186
+ /**
187
+ * Loads the data from a file with the specified name. The file is loaded from the game save folder. Filename supports subfolders.
188
+ * local data = saver.load_file_by_name("data.json")
189
+ * pprint(data)
190
+ * NOTE: For binary data like images, use saver.load_binary_by_name instead.
191
+ */
192
+ export function load_file_by_name(this: void, filename: string, format?: string | undefined): LuaTable | undefined;
193
+ /**
194
+ * Loads the binary data from a file with the specified name. The file is loaded from the game save folder. Filename supports subfolders.
195
+ */
196
+ export function load_binary_by_name(this: void, filename: string): string | undefined;
197
+ /**
198
+ * Deletes the file with the specified name. The file is deleted from the game save folder. Filename supports subfolders.
199
+ * saver.delete_file_by_name("data.json")
200
+ */
201
+ export function delete_file_by_name(this: void, filename: string): boolean;
202
+ /**
203
+ * Checks if the file exists with the specified name. The file is checked in the game save folder. Filename supports subfolders.
204
+ */
205
+ export function is_file_exists_by_name(this: void, filename: string): boolean;
206
+ /**
207
+ * Returns the absolute path to the game save folder. If a file name is provided, the path to the file in the game save folder is returned. Filename supports subfolders.
208
+ * local folder_path = saver.get_save_path()
209
+ * print(folder_path) -- "/Users/user/Library/Application Support/Defold Saver/"
210
+ *
211
+ * local file_path = saver.get_save_path("data.json")
212
+ * print(file_path) -- "/Users/user/Library/Application Support/Defold Saver/data.json"
213
+ *
214
+ * local file_path_2 = saver.get_save_path("profiles/profile1.json")
215
+ * print(file_path_2) -- "/Users/user/Library/Application Support/Defold Saver/profiles/profile1.json"
216
+ */
217
+ export function get_save_path(this: void, filename?: string | undefined): string;
218
+ /**
219
+ * Returns the current save version of the game state. The save version is used to check if the game state is older than the current version. The save version increments when the game state is saved.
220
+ * local save_version = saver.get_save_version()
221
+ * print(save_version)
222
+ */
223
+ export function get_save_version(this: void): number;
224
+ /**
225
+ * Sets the autosave timer to the specified number of seconds. The autosave timer is used to automatically save the game state at regular intervals.
226
+ * Use 0 to disable autosave.
227
+ * saver.set_autosave_timer(5) -- Autosave every 5 seconds
228
+ * saver.set_autosave_timer(0) -- Disable autosave
229
+ */
230
+ export function set_autosave_timer(this: void, timer: number): void;
231
+ /**
232
+ * Returns the current autosave timer.
233
+ */
234
+ export function get_autosave_timer(this: void): number;
235
+ /**
236
+ * Returns the absolute path to the current game project folder. It is useful when you need to save or load files from the game project folder at development.
237
+ * Returns nil if the game project folder is not found. Used only at desktop platforms and if game started from the Defold Editor.
238
+ * local project_folder = saver.get_current_game_project_folder()
239
+ * print(project_folder) -- "/Users/user/projects/my_game"
240
+ */
241
+ export function get_current_game_project_folder(this: void): string | undefined;
242
+ /**
243
+ * Sets the list of migrations to apply after loading the game state manually with saver.apply_migrations() function.
244
+ * Migrations are used to update the game state in case of changes to the game state structure.
245
+ * Migrations are applied in order. Each migration should be a function that takes the game state as a parameter and returns the updated game state.
246
+ * local migrations = {
247
+ * -- Migration 1
248
+ * function(game_state, logger)
249
+ * -- Assume we have new level_data field in the game state and we need to move level and score to it
250
+ * game_state.game.level_data = {
251
+ * level = game_state.game.level,
252
+ * score = game_state.game.score
253
+ * }
254
+ * game_state.game.level = nil
255
+ * game_state.game.score = nil
256
+ * return game_state
257
+ * },
258
+ * -- Migration 2
259
+ * function(game_state, logger)
260
+ * -- Just an example, multiply the score by 1000. For example we changed our score system
261
+ * game_state.game.level_data.score = game_state.game.level_data.score * 1000
262
+ * return game_state
263
+ * }
264
+ * }
265
+ *
266
+ * saver.set_migrations(migrations)
267
+ * saver.init()
268
+ * saver.bind_save_state("game", game_state)
269
+ * saver.apply_migrations()
270
+ */
271
+ export function set_migrations(this: void, migrations_table: ((game_state: saver_game_state, logger: saver_logger) => undefined)[]): void;
272
+ /**
273
+ * Applies the migrations set by saver.set_migrations function. It should be called after loading the game state manually with saver.init() function.
274
+ * saver.apply_migrations()
275
+ */
276
+ export function apply_migrations(this: void): void;
277
+ /**
278
+ * Gets the value from the saver storage. If the value does not exist, it will return the default value.
279
+ */
280
+ export function get_value<T>(this: void, key_id: string, default_value?: T | undefined): T;
281
+ /**
282
+ * Sets the value in the saver storage.
283
+ */
284
+ export function set_value(this: void, key_id: string, value: unknown): void;
285
+ /**
286
+ * Checks if the value exists in the saver storage.
287
+ */
288
+ export function is_value_exists(this: void, key_id: string): boolean;
44
289
  }
@@ -1,16 +1,79 @@
1
- /** @noSelfInFile **/
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
-
4
- /**
5
- * @see {@link https://github.com/Insality/defold-saver|Github Source}
6
- * @see {@link https://github.com/Insality/defold-saver/blob/main/API_REFERENCE.md|API Reference}
7
- * @example `import * as storage from 'saver.storage'`
8
- * @noResolution
9
- */
1
+ /** @noResolution */
10
2
  declare module 'saver.storage' {
11
- export function set(id: string, value: boolean | number | string): boolean;
12
- export function get(id: string, defaultValue?: any): unknown;
13
- export function get_number(id: string, defaultValue?: number): number;
14
- export function get_string(id: string, defaultValue?: string): string;
15
- export function get_boolean(id: string, defaultValue?: boolean): boolean;
3
+ /**
4
+ * Persist data between game sessions
5
+ */
6
+ interface saver_state {
7
+ storage: LuaTable<string, unknown>;
8
+ version: number;
9
+ last_game_version: string;
10
+ migration_version: number;
11
+ }
12
+ /**
13
+ * Whole game state. Add your fields here to inspect all fields
14
+ */
15
+ interface saver_game_state {
16
+ saver: saver_state;
17
+ storage: saver_storage_state;
18
+ }
19
+ /**
20
+ * Configuration table for `saver.init` to setup all things you can in game.project file
21
+ */
22
+ interface saver_config {
23
+ save_folder?: string | undefined;
24
+ save_name?: string | undefined;
25
+ saver_key?: string | undefined;
26
+ storage_key?: string | undefined;
27
+ autosave_timer?: number | undefined;
28
+ lua_require_as_string?: boolean | undefined;
29
+ }
30
+ /**
31
+ * Logger interface
32
+ */
33
+ interface saver_logger {
34
+ trace: (logger: saver_logger, message: string, data: unknown | undefined) => void;
35
+ debug: (logger: saver_logger, message: string, data: unknown | undefined) => void;
36
+ info: (logger: saver_logger, message: string, data: unknown | undefined) => void;
37
+ warn: (logger: saver_logger, message: string, data: unknown | undefined) => void;
38
+ error: (logger: saver_logger, message: string, data: unknown | undefined) => void;
39
+ }
40
+ interface saver {
41
+ }
42
+ /**
43
+ * Persist data between game sessions
44
+ */
45
+ interface saver_storage_state {
46
+ storage: LuaTable<string, saver_storage_value>;
47
+ }
48
+ /**
49
+ * One of the values in the storage
50
+ */
51
+ interface saver_storage_value {
52
+ s_value?: string | undefined;
53
+ i_value?: number | undefined;
54
+ b_value?: boolean | undefined;
55
+ }
56
+ interface saver_storage {
57
+ }
58
+ export function reset_state(this: void): void;
59
+ /**
60
+ * Get the value from the storage.
61
+ */
62
+ export function get(this: void, name: string, default_value?: string | number | boolean | undefined): string | number | boolean | undefined;
63
+ /**
64
+ * Get the number from the storage.
65
+ */
66
+ export function get_number(this: void, name: string, default_value?: number | undefined): number;
67
+ /**
68
+ * Get the string from the storage.
69
+ */
70
+ export function get_string(this: void, name: string, default_value?: string | undefined): string;
71
+ /**
72
+ * Get the boolean from the storage.
73
+ */
74
+ export function get_boolean(this: void, name: string, default_value?: boolean | undefined): boolean;
75
+ /**
76
+ * Set the value to storage
77
+ */
78
+ export function set(this: void, id: string, value: string | number | boolean): boolean;
16
79
  }