@defold-typescript/library-types 0.23.0 → 0.25.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 (130) hide show
  1. package/NOTICE +2 -3
  2. package/api-doc/boom.json +3872 -0
  3. package/api-doc/bridge.json +10 -5
  4. package/api-doc/bzAnim.json +338 -0
  5. package/api-doc/checkpoint.json +127 -0
  6. package/api-doc/decore.json +1 -1
  7. package/api-doc/defcon.json +150 -0
  8. package/api-doc/{defmath.defmath.json → defmath.json} +6 -46
  9. package/api-doc/defsave.json +518 -0
  10. package/api-doc/deftest.json +745 -0
  11. package/api-doc/{dicebag.dicebag.json → dicebag.json} +19 -1
  12. package/api-doc/druid.json +90 -92
  13. package/api-doc/event.json +16 -16
  14. package/api-doc/gooey.json +2050 -0
  15. package/api-doc/in.accelerometer.json +75 -1
  16. package/api-doc/in.button.json +17 -10
  17. package/api-doc/in.cursor.json +26 -0
  18. package/api-doc/in.gesture.json +401 -6
  19. package/api-doc/in.keyboard.json +2 -0
  20. package/api-doc/in.mapper.json +12 -8
  21. package/api-doc/in.onscreen.json +61 -5
  22. package/api-doc/in.state.json +61 -13
  23. package/api-doc/in.textbox.json +23 -12
  24. package/api-doc/in.triggers.json +336 -0
  25. package/api-doc/lang.json +5 -5
  26. package/api-doc/log.json +1 -1
  27. package/api-doc/metrics.fps.json +61 -2
  28. package/api-doc/metrics.mem.json +61 -2
  29. package/api-doc/monarch.monarch.json +249 -7
  30. package/api-doc/monarch.transitions.easings.json +19 -26
  31. package/api-doc/monarch.transitions.gui.json +782 -79
  32. package/api-doc/nakama.engine.defold.json +31 -18
  33. package/api-doc/{nakama.nakama.json → nakama.json} +4752 -2554
  34. package/api-doc/nakama.session.json +315 -0
  35. package/api-doc/nakama.socket.json +3356 -0
  36. package/api-doc/nakama.util.log.json +32 -4
  37. package/api-doc/narrator.json +1 -1
  38. package/api-doc/openapi/nakama.nakama.json +7680 -0
  39. package/api-doc/orthographic.camera.json +96 -98
  40. package/api-doc/orthographic.json +602 -0
  41. package/api-doc/panthera.json +1183 -0
  42. package/api-doc/{persist.persist.json → persist.json} +26 -1
  43. package/api-doc/{platypus.platypus.json → platypus.json} +68 -14
  44. package/api-doc/{rendy.rendy.json → rendy.json} +46 -99
  45. package/api-doc/richtext.color.json +77 -0
  46. package/api-doc/richtext.richtext.json +375 -5
  47. package/api-doc/saver.saver.json +2 -1
  48. package/api-doc/saver.storage.json +2 -1
  49. package/api-doc/shutter.json +551 -0
  50. package/api-doc/{yagames.yagames.json → yagames.json} +784 -189
  51. package/api-doc/{zzfx.api.json → zzfx.json} +9 -9
  52. package/authored-targets.json +433 -0
  53. package/generated/{boom.boom.d.ts → boom.d.ts} +14 -0
  54. package/generated/bridge.d.ts +5 -5
  55. package/generated/{bzAnim.bzLibrary.d.ts → bzAnim.d.ts} +6 -0
  56. package/generated/checkpoint.d.ts +62 -0
  57. package/generated/decore.d.ts +1 -1
  58. package/generated/defcon.d.ts +43 -0
  59. package/generated/{defmath.defmath.d.ts → defmath.d.ts} +3 -2
  60. package/generated/defsave.d.ts +144 -0
  61. package/generated/{dicebag.dicebag.d.ts → dicebag.d.ts} +25 -0
  62. package/generated/druid.d.ts +81 -79
  63. package/generated/event.d.ts +15 -15
  64. package/generated/{gooey.gooey.d.ts → gooey.d.ts} +61 -6
  65. package/generated/in.onscreen.d.ts +5 -0
  66. package/generated/in.textbox.d.ts +4 -0
  67. package/generated/lang.d.ts +5 -5
  68. package/generated/log.d.ts +1 -1
  69. package/generated/metrics.fps.d.ts +19 -1
  70. package/generated/metrics.mem.d.ts +19 -1
  71. package/generated/monarch.monarch.d.ts +44 -1
  72. package/generated/monarch.transitions.easings.d.ts +0 -1
  73. package/generated/monarch.transitions.gui.d.ts +96 -12
  74. package/generated/nakama.d.ts +1158 -0
  75. package/generated/nakama.engine.defold.d.ts +3 -1
  76. package/generated/nakama.session.d.ts +95 -0
  77. package/generated/nakama.socket.d.ts +706 -0
  78. package/generated/nakama.util.log.d.ts +6 -0
  79. package/generated/narrator.d.ts +1 -1
  80. package/generated/openapi/nakama.nakama.d.ts +884 -0
  81. package/generated/orthographic.camera.d.ts +24 -38
  82. package/generated/orthographic.d.ts +155 -0
  83. package/generated/panthera.d.ts +170 -0
  84. package/generated/{persist.persist.d.ts → persist.d.ts} +3 -0
  85. package/generated/{platypus.platypus.d.ts → platypus.d.ts} +9 -0
  86. package/generated/proto.d.ts +4 -4
  87. package/generated/{rendy.rendy.d.ts → rendy.d.ts} +33 -80
  88. package/generated/richtext.color.d.ts +15 -0
  89. package/generated/saver.saver.d.ts +2 -0
  90. package/generated/saver.storage.d.ts +2 -0
  91. package/generated/shutter.d.ts +183 -0
  92. package/generated/{yagames.yagames.d.ts → yagames.d.ts} +151 -29
  93. package/generated/{zzfx.api.d.ts → zzfx.d.ts} +7 -0
  94. package/library-classification.json +0 -156
  95. package/library-targets.json +1 -218
  96. package/luals-targets.json +56 -3
  97. package/openapi-targets.json +17 -0
  98. package/package.json +7 -57
  99. package/scripts/__snapshots__/parse-luals.test.ts.snap +164 -10
  100. package/scripts/apply-luals-overrides.ts +39 -7
  101. package/scripts/authored-parity.ts +718 -0
  102. package/scripts/emit-library-dts.ts +94 -17
  103. package/scripts/extract-api-doc.ts +214 -42
  104. package/scripts/fidelity-floor.ts +178 -0
  105. package/scripts/import-upstream-docs.ts +125 -0
  106. package/scripts/lower-api-doc.ts +21 -3
  107. package/scripts/luals-fidelity.ts +16 -11
  108. package/scripts/map-luals-types.ts +52 -21
  109. package/scripts/parse-lua-surface.ts +187 -0
  110. package/scripts/parse-luals.ts +50 -4
  111. package/scripts/parse-markdown-api.ts +247 -0
  112. package/scripts/parse-openapi-api.ts +313 -0
  113. package/scripts/sync-authored-types.ts +249 -0
  114. package/scripts/sync-library-types.ts +99 -3
  115. package/scripts/sync-luals-types.ts +14 -1
  116. package/scripts/sync-markdown-types.ts +761 -0
  117. package/scripts/sync-openapi-types.ts +308 -0
  118. package/scripts/sync-script-api-types.ts +16 -17
  119. package/api-doc/boom.boom.json +0 -26
  120. package/api-doc/bzAnim.bzLibrary.json +0 -156
  121. package/api-doc/defcon.console.json +0 -109
  122. package/api-doc/defsave.defsave.json +0 -175
  123. package/api-doc/deftest.deftest.json +0 -71
  124. package/api-doc/gooey.gooey.json +0 -963
  125. package/api-doc/starly.starly.json +0 -488
  126. package/generated/defcon.console.d.ts +0 -24
  127. package/generated/defsave.defsave.d.ts +0 -31
  128. package/generated/nakama.nakama.d.ts +0 -594
  129. package/generated/starly.starly.d.ts +0 -148
  130. /package/generated/{deftest.deftest.d.ts → deftest.d.ts} +0 -0
@@ -39,25 +39,25 @@ declare module 'event.event' {
39
39
  * event_2 = event.create()
40
40
  * event_2:subscribe(event_1) -- Now event2 will trigger event1
41
41
  */
42
- subscribe(callback: unknown | event, callback_context?: unknown | undefined): boolean;
42
+ subscribe(callback: ((...args: any[]) => unknown) | event, callback_context?: unknown | undefined): boolean;
43
43
  /**
44
44
  * Subscribe a callback for a single trigger. After the first trigger the callback is automatically unsubscribed.
45
45
  * on_click_event:subscribe_once(function(self) print("one-time click!") end, self)
46
46
  */
47
- subscribe_once(callback: unknown | event, callback_context?: unknown | undefined): boolean;
47
+ subscribe_once(callback: ((...args: any[]) => unknown) | event, callback_context?: unknown | undefined): boolean;
48
48
  /**
49
49
  * Remove a previously subscribed callback from the event.
50
50
  * The callback_context should be the same as the one used when subscribing the callback.
51
51
  * If there is no callback_context provided, all callbacks with the same function will be unsubscribed.
52
52
  * on_click_event:unsubscribe(callback, self)
53
53
  */
54
- unsubscribe(callback: unknown | event, callback_context?: unknown | undefined): boolean;
54
+ unsubscribe(callback: ((...args: any[]) => unknown) | event, callback_context?: unknown | undefined): boolean;
55
55
  /**
56
56
  * Determine if a specific callback is currently subscribed to the event.
57
57
  * The callback_context should be the same as the one used when subscribing the callback.
58
58
  * local is_subscribed = on_click_event:is_subscribed(callback, self)
59
59
  */
60
- is_subscribed(callback: unknown | event, callback_context?: unknown | undefined): LuaMultiReturn<[boolean, number | undefined]>;
60
+ is_subscribed(callback: ((...args: any[]) => unknown) | event, callback_context?: unknown | undefined): LuaMultiReturn<[boolean, number | undefined]>;
61
61
  /**
62
62
  * Trigger the event, causing all subscribed callbacks to be executed.
63
63
  * Any parameters passed to trigger will be forwarded to the callbacks.
@@ -107,12 +107,12 @@ declare module 'event.event' {
107
107
  * Returns a new promise that will be resolved or rejected based on the handlers' return values.
108
108
  * load_data():next(function(data) return process(data) end):next(display):catch(show_error)
109
109
  */
110
- next(on_resolved?: unknown | promise | event | undefined, on_rejected?: unknown | promise | event | undefined, context?: unknown | undefined): promise;
110
+ next(on_resolved?: ((...args: any[]) => unknown) | promise | event | undefined, on_rejected?: ((...args: any[]) => unknown) | promise | event | undefined, context?: unknown | undefined): promise;
111
111
  /**
112
112
  * Attach a rejection handler to the promise. Equivalent to next(nil, on_rejected).
113
113
  * load_data():catch(function(err) print("Failed:", err) end)
114
114
  */
115
- "catch"(on_rejected: unknown | event, context?: unknown | undefined): promise;
115
+ "catch"(on_rejected: ((...args: any[]) => unknown) | event, context?: unknown | undefined): promise;
116
116
  /**
117
117
  * Attach a handler that is called regardless of whether the promise is resolved or rejected.
118
118
  * The handler is called with the resolved value or rejection reason.
@@ -120,7 +120,7 @@ declare module 'event.event' {
120
120
  * The handler return value is ignored.
121
121
  * load_data():finally(function() hide_loading_spinner() end)
122
122
  */
123
- "finally"(on_finally: unknown | event, context?: unknown | undefined): promise;
123
+ "finally"(on_finally: ((...args: any[]) => unknown) | event, context?: unknown | undefined): promise;
124
124
  /**
125
125
  * Check if the promise is in pending state.
126
126
  */
@@ -208,7 +208,7 @@ declare module 'event.event' {
208
208
  * my_queue:push(save_data)
209
209
  * my_queue:push(save_data, function() print("saved!") end)
210
210
  */
211
- push(data: unknown, on_handle?: unknown | event | undefined, context?: unknown | undefined): void;
211
+ push(data: unknown, on_handle?: ((...args: any[]) => unknown) | event | undefined, context?: unknown | undefined): void;
212
212
  /**
213
213
  * Subscribe a handler to this queue instance. When an event is pushed to this queue,
214
214
  * the handler will be called. If there are already events in the queue, they will be processed immediately.
@@ -219,35 +219,35 @@ declare module 'event.event' {
219
219
  * end
220
220
  * my_queue:subscribe(on_save, self)
221
221
  */
222
- subscribe(handler: unknown | event, context?: unknown | undefined): boolean;
222
+ subscribe(handler: ((...args: any[]) => unknown) | event, context?: unknown | undefined): boolean;
223
223
  /**
224
224
  * Subscribe a handler until it handles one event. The handler is invoked for each event in the queue until it returns non-nil (handles an event)
225
225
  * then it is automatically unsubscribed and will not be invoked again, even if more events remain in the queue.
226
226
  * my_queue:subscribe_once(function(self, data) return process(data) end, self)
227
227
  */
228
- subscribe_once(handler: unknown | event, context?: unknown | undefined): boolean;
228
+ subscribe_once(handler: ((...args: any[]) => unknown) | event, context?: unknown | undefined): boolean;
229
229
  /**
230
230
  * Unsubscribe a handler from this queue instance.
231
231
  * my_queue:unsubscribe(on_save, self)
232
232
  */
233
- unsubscribe(handler: unknown | event, context?: unknown | undefined): boolean;
233
+ unsubscribe(handler: ((...args: any[]) => unknown) | event, context?: unknown | undefined): boolean;
234
234
  /**
235
235
  * Check if a handler is subscribed to this queue instance.
236
236
  * local ok = my_queue:is_subscribed(on_save, self)
237
237
  */
238
- is_subscribed(handler: unknown | event, context?: unknown | undefined): LuaMultiReturn<[boolean, number | undefined]>;
238
+ is_subscribed(handler: ((...args: any[]) => unknown) | event, context?: unknown | undefined): LuaMultiReturn<[boolean, number | undefined]>;
239
239
  /**
240
240
  * Process all events in this queue immediately. Subscribers will not be called in this function.
241
241
  * Events can be handled and removed in event handler callback. If event is handled, it will be removed from the queue.
242
242
  * my_queue:process(function(self, data) return handle(data) end, self)
243
243
  */
244
- process(event_handler: unknown | event, context?: unknown | undefined): void;
244
+ process(event_handler: ((...args: any[]) => unknown) | event, context?: unknown | undefined): void;
245
245
  /**
246
246
  * Process exactly one queued event with a specific handler (subscribers will NOT be called).
247
247
  * If the handler returns non-nil the event will be removed from the queue.
248
248
  * local handled = my_queue:process_next(function(data) return handle(data) end)
249
249
  */
250
- process_next(event_handler?: unknown | event | undefined, context?: unknown | undefined): boolean;
250
+ process_next(event_handler?: ((...args: any[]) => unknown) | event | undefined, context?: unknown | undefined): boolean;
251
251
  /**
252
252
  * Get all pending events in this queue.
253
253
  * for _, event_data in ipairs(my_queue:get_events()) do
@@ -298,7 +298,7 @@ declare module 'event.event' {
298
298
  * local e = event.create()
299
299
  * local e = event.create(function(self) print("ok") end, self)
300
300
  */
301
- export function create(this: void, callback?: unknown | event | undefined, callback_context?: unknown | undefined): event;
301
+ export function create(this: void, callback?: ((...args: any[]) => unknown) | event | undefined, callback_context?: unknown | undefined): event;
302
302
  /**
303
303
  * Check if the table is an event instance.
304
304
  * if event.is_event(my_value) then
@@ -135,6 +135,38 @@ declare module 'gooey.gooey' {
135
135
  total_width: number;
136
136
  };
137
137
 
138
+ /** What `create_theme` hands back: the helpers it installs, over any component
139
+ * carrying a node. `is_enabled` and `set_enabled` return nothing when it does not. */
140
+ type Theme = {
141
+ is_enabled: (component: { node?: Opaque<"node"> }) => boolean | undefined;
142
+ set_enabled: (component: { node?: Opaque<"node"> }, enabled: boolean) => void;
143
+ acquire_input: () => void;
144
+ release_input: () => void;
145
+ group: (
146
+ group_id: Hash | string,
147
+ action_id: Hash,
148
+ action: table,
149
+ group_fn: () => void,
150
+ ) => table;
151
+ };
152
+
153
+ /**
154
+ * Check if a node is enabled. This is done by not only looking at the state of the
155
+ * node itself but also it's ancestors all the way up the hierarchy.
156
+ */
157
+ export function is_enabled(node: Opaque<"node">): boolean;
158
+
159
+ /** Convenience function to acquire input focus */
160
+ export function acquire_input(): void;
161
+
162
+ /** Convenience function to release input focus */
163
+ export function release_input(): void;
164
+
165
+ export function create_theme(): Theme;
166
+
167
+ /** Mask text by replacing every character with a mask character */
168
+ export function mask_text(text: string, mask: string): string;
169
+
138
170
  export function button(
139
171
  node_id: Hash | string,
140
172
  action_id: Hash,
@@ -151,6 +183,15 @@ declare module 'gooey.gooey' {
151
183
  refresh_fn?: (checkbox: CheckboxState) => void,
152
184
  ): CheckboxState;
153
185
 
186
+ /** Wraps the `gooey.radio` calls of one group; `fn` receives the group's id and the
187
+ * input it was called with, not a radio state (`README.md:265`). */
188
+ export function radiogroup(
189
+ group_id: Hash | string,
190
+ action_id: Hash,
191
+ action: table,
192
+ fn: (group_id: Hash | string, action_id: Hash, action: table) => void,
193
+ ): table;
194
+
154
195
  export function radio(
155
196
  node_id: Hash | string,
156
197
  group: string,
@@ -169,12 +210,10 @@ declare module 'gooey.gooey' {
169
210
  config: { horizontal?: boolean } | undefined,
170
211
  fn: (list: ListState) => void,
171
212
  refresh_fn?: (list: ListState) => void,
172
- is_horizontal?: boolean,
173
213
  ): ListState;
174
214
 
175
215
  export function dynamic_list(
176
216
  list_id: string,
177
- root_id: string,
178
217
  stencil_id: Hash | string,
179
218
  item_id: Hash | string,
180
219
  data: table,
@@ -183,12 +222,10 @@ declare module 'gooey.gooey' {
183
222
  config: { horizontal?: boolean; carousel?: boolean } | undefined,
184
223
  fn: (list: ListState) => void,
185
224
  refresh_fn?: (list: ListState) => void,
186
- is_horizontal?: boolean,
187
225
  ): ListState;
188
226
 
189
227
  export function horizontal_dynamic_list(
190
228
  list_id: string,
191
- root_id: string,
192
229
  stencil_id: Hash | string,
193
230
  item_id: Hash | string,
194
231
  data: table,
@@ -201,7 +238,6 @@ declare module 'gooey.gooey' {
201
238
 
202
239
  export function vertical_dynamic_list(
203
240
  list_id: string,
204
- root_id: string,
205
241
  stencil_id: Hash | string,
206
242
  item_id: Hash | string,
207
243
  data: table,
@@ -239,6 +275,17 @@ declare module 'gooey.gooey' {
239
275
  bounds_id: Hash | string,
240
276
  action_id: Hash,
241
277
  action: table,
278
+ config: table | undefined,
279
+ fn: (scrollbar: ScrollbarState) => void,
280
+ refresh_fn?: (scrollbar: ScrollbarState) => void,
281
+ ): ScrollbarState;
282
+
283
+ export function horizontal_scrollbar(
284
+ handle_id: Hash | string,
285
+ bounds_id: Hash | string,
286
+ action_id: Hash,
287
+ action: table,
288
+ config: table | undefined,
242
289
  fn: (scrollbar: ScrollbarState) => void,
243
290
  refresh_fn?: (scrollbar: ScrollbarState) => void,
244
291
  ): ScrollbarState;
@@ -257,5 +304,13 @@ declare module 'gooey.gooey' {
257
304
  refresh_fn?: (input: InputState) => void,
258
305
  ): InputState;
259
306
 
260
- export function group(group_id: string, fn: () => void): table;
307
+ export function group(
308
+ group_id: Hash | string,
309
+ action_id: Hash,
310
+ action: table,
311
+ group_fn: () => void,
312
+ ): table;
313
+
314
+ /** Move a group's focus to the component at `index`, refreshing it. */
315
+ export function set_focus(group: table, index: number): void;
261
316
  }
@@ -32,6 +32,11 @@ declare module 'in.onscreen' {
32
32
  on_input: (action_id: Hash, action: {}) => boolean;
33
33
  };
34
34
 
35
+ /**
36
+ * Create an instance of the onscreen controls.
37
+ * @param config Optional settings. `touch` is the action id bound to single touch.
38
+ * @returns The instance the register and input functions operate on.
39
+ */
35
40
  function create(config?: { touch: Hash }): OnscreenInstance;
36
41
 
37
42
  export function reset(instance?: OnscreenInstance): void;
@@ -18,6 +18,10 @@ declare module 'in.textbox' {
18
18
  ): Opaque<"node">;
19
19
  export function unregister(node_or_string?: Opaque<"node"> | string): void;
20
20
  export function effect(node: Opaque<"node">, scale: { x: number; y: number }): void;
21
+ /**
22
+ * Get a registered textbox's text, or set it first when `text` is given.
23
+ * Returns the text the box holds after the call.
24
+ */
21
25
  export function text(
22
26
  node_or_string: Opaque<"node"> | string,
23
27
  text?: string,
@@ -11,7 +11,7 @@ declare module 'lang.lang' {
11
11
  }
12
12
  interface lang {
13
13
  state: lang_state;
14
- on_lang_changed: unknown;
14
+ on_lang_changed: (...args: any[]) => unknown;
15
15
  }
16
16
  interface lang_state {
17
17
  lang: string;
@@ -19,7 +19,7 @@ declare module 'lang.lang' {
19
19
  interface lang_data {
20
20
  path?: string | LuaTable | undefined;
21
21
  id: string;
22
- loader?: unknown | undefined;
22
+ loader?: ((...args: any[]) => unknown) | undefined;
23
23
  }
24
24
  /**
25
25
  * Global callback after language is loaded and translations are ready.
@@ -33,15 +33,15 @@ declare module 'lang.lang' {
33
33
  /**
34
34
  * Load additional locale pack and refresh current language
35
35
  */
36
- export function load_langs(this: void, pack_id: string, langs: lang_data[], on_lang_changed?: unknown | undefined): void;
36
+ export function load_langs(this: void, pack_id: string, langs: lang_data[], on_lang_changed?: ((...args: any[]) => unknown) | undefined): void;
37
37
  /**
38
38
  * Set current language
39
39
  */
40
- export function set_lang(this: void, lang_id: string, on_lang_changed?: unknown | undefined): void;
40
+ export function set_lang(this: void, lang_id: string, on_lang_changed?: ((...args: any[]) => unknown) | undefined): void;
41
41
  /**
42
42
  * Set next language from lang list and return it's code
43
43
  */
44
- export function set_next_lang(this: void, on_lang_changed?: unknown | undefined): string;
44
+ export function set_next_lang(this: void, on_lang_changed?: ((...args: any[]) => unknown) | undefined): string;
45
45
  /**
46
46
  * Get next language from lang list and return it's code
47
47
  */
@@ -32,5 +32,5 @@ declare module 'log.log' {
32
32
  /**
33
33
  * Return the basename of the current file
34
34
  */
35
- export function get_default_logger_name(this: void, debuginfo: unknown): string;
35
+ export function get_default_logger_name(this: void, debuginfo: debug.FunctionInfo): string;
36
36
  }
@@ -12,5 +12,23 @@ declare module 'metrics.fps' {
12
12
  draw: () => void;
13
13
  }
14
14
 
15
- export function create(samples?: number, format?: string, position?: string, color?: string): Metrics;
15
+ /** Where `draw()` places the text, and the default `create()` uses when given no position. */
16
+ export const POSITION: Vector3;
17
+
18
+ /** The `string.format` pattern the FPS reading is rendered through. */
19
+ export const FORMAT: string;
20
+
21
+ /** The colour `draw()` renders the text in, and the default `create()` uses when given no colour. */
22
+ export const COLOR: Vector4;
23
+
24
+ export function create(samples?: number, format?: string, position?: Vector3, color?: Vector4): Metrics;
25
+
26
+ /** Call this once per frame. Once enough samples have been collected it is possible to call fps() to get the current FPS. */
27
+ export function update(): void;
28
+
29
+ /** Get the current FPS, based on collected samples. */
30
+ export function fps(): number;
31
+
32
+ /** Draw fps count text using `draw_debug_text`. */
33
+ export function draw(): void;
16
34
  }
@@ -12,5 +12,23 @@ declare module 'metrics.mem' {
12
12
  draw: () => void;
13
13
  }
14
14
 
15
- export function create(format?: string, position?: string, color?: string): Metrics;
15
+ /** Where `draw()` places the text, and the default `create()` uses when given no position. */
16
+ export const POSITION: Vector3;
17
+
18
+ /** The `string.format` pattern the memory reading is rendered through. */
19
+ export const FORMAT: string;
20
+
21
+ /** The colour `draw()` renders the text in, and the default `create()` uses when given no colour. */
22
+ export const COLOR: Vector4;
23
+
24
+ export function create(format?: string, position?: Vector3, color?: Vector4): Metrics;
25
+
26
+ /** Call this to get a new memory usage reading. */
27
+ export function update(): void;
28
+
29
+ /** Get the current memory usage, in kilobytes. */
30
+ export function mem(): number;
31
+
32
+ /** Draw memory usage text using `draw_debug_text`. */
33
+ export function draw(): void;
16
34
  }
@@ -40,6 +40,36 @@ declare module 'monarch.monarch' {
40
40
  type Callback = () => void;
41
41
 
42
42
  // transition messages
43
+ /**
44
+ * Post this back to Monarch from a transition listener once the transition
45
+ * has finished. Monarch will not proceed until it arrives.
46
+ */
47
+ export const TRANSITION_DONE: Hash;
48
+ /** Sent to a screen's transition url when the screen should transition in. */
49
+ export const TRANSITION_SHOW_IN: Hash;
50
+ /** Sent to a screen's transition url when the screen should transition out. */
51
+ export const TRANSITION_SHOW_OUT: Hash;
52
+ /**
53
+ * Sent to a screen's transition url when the screen above it was popped and
54
+ * this screen should transition back in.
55
+ */
56
+ export const TRANSITION_BACK_IN: Hash;
57
+ /**
58
+ * Sent to a screen's transition url when this screen is being popped and
59
+ * should transition back out.
60
+ */
61
+ export const TRANSITION_BACK_OUT: Hash;
62
+
63
+ // focus messages
64
+ /** Sent to a screen's focus url when the screen gains focus. */
65
+ export const FOCUS_GAINED: Hash;
66
+ /** Sent to a screen's focus url when the screen loses focus. */
67
+ export const FOCUS_LOST: Hash;
68
+
69
+ /**
70
+ * @deprecated Use the flat `TRANSITION_*` constants instead — Monarch marks
71
+ * this grouping deprecated in its own source.
72
+ */
43
73
  export const TRANSITION: {
44
74
  DONE: Hash;
45
75
  SHOW_IN: Hash;
@@ -48,13 +78,20 @@ declare module 'monarch.monarch' {
48
78
  BACK_OUT: Hash;
49
79
  };
50
80
 
51
- // focus messages
81
+ /**
82
+ * @deprecated Use the flat `FOCUS_*` constants instead — Monarch marks this
83
+ * grouping deprecated in its own source.
84
+ */
52
85
  export const FOCUS: {
53
86
  GAINED: Hash;
54
87
  LOST: Hash;
55
88
  };
56
89
 
57
90
  // listener messages
91
+ /**
92
+ * Sent to every url registered with `add_listener` when a screen begins
93
+ * transitioning in, carrying `screen` and `previous_screen` ids.
94
+ */
58
95
  export const SCREEN_TRANSITION_IN_STARTED: Hash;
59
96
  export const SCREEN_TRANSITION_IN_FINISHED: Hash;
60
97
  export const SCREEN_TRANSITION_OUT_STARTED: Hash;
@@ -126,6 +163,12 @@ declare module 'monarch.monarch' {
126
163
  settings: RegisterProxyOptions,
127
164
  ): void;
128
165
 
166
+ /**
167
+ * Alias of {@link register_proxy}, kept for the pre-factory API.
168
+ * Typed through the function it aliases so the two cannot drift apart.
169
+ */
170
+ export const register: typeof register_proxy;
171
+
129
172
  /**
130
173
  * Register a new screen contained in a collection factory.
131
174
  * This is done automatically by the screen_factory.script. It is expected that
@@ -61,5 +61,4 @@ declare module 'monarch.transitions.easings' {
61
61
  export function QUART(): Easing;
62
62
  export function QUINT(): Easing;
63
63
  export function SINE(): Easing;
64
- export function create(name: EasingIn | EasingOut): Easing;
65
64
  }
@@ -135,18 +135,102 @@ declare module 'monarch.transitions.gui' {
135
135
  complete_function?: (this: any, node: Opaque<"node">) => void,
136
136
  ) => void;
137
137
 
138
- export const slide_in_right: TransitionInFn;
139
- export const slide_in_left: TransitionInFn;
140
- export const slide_in_top: TransitionInFn;
141
- export const slide_in_bottom: TransitionInFn;
142
- export const slide_out_right: TransitionOutFn;
143
- export const slide_out_left: TransitionOutFn;
144
- export const slide_out_top: TransitionOutFn;
145
- export const slide_out_bottom: TransitionOutFn;
146
- export const scale_in: TransitionInFn;
147
- export const scale_out: TransitionOutFn;
148
- export const fade_in: TransitionInFn;
149
- export const fade_out: TransitionOutFn;
138
+ export function slide_in_right(
139
+ node: Opaque<"node">,
140
+ to: Vector3,
141
+ easing: GuiEasing,
142
+ duration: number,
143
+ delay?: number,
144
+ complete_function?: (this: any, node: Opaque<"node">) => void,
145
+ ): void;
146
+ export function slide_in_left(
147
+ node: Opaque<"node">,
148
+ to: Vector3,
149
+ easing: GuiEasing,
150
+ duration: number,
151
+ delay?: number,
152
+ complete_function?: (this: any, node: Opaque<"node">) => void,
153
+ ): void;
154
+ export function slide_in_top(
155
+ node: Opaque<"node">,
156
+ to: Vector3,
157
+ easing: GuiEasing,
158
+ duration: number,
159
+ delay?: number,
160
+ complete_function?: (this: any, node: Opaque<"node">) => void,
161
+ ): void;
162
+ export function slide_in_bottom(
163
+ node: Opaque<"node">,
164
+ to: Vector3,
165
+ easing: GuiEasing,
166
+ duration: number,
167
+ delay?: number,
168
+ complete_function?: (this: any, node: Opaque<"node">) => void,
169
+ ): void;
170
+ export function slide_out_right(
171
+ node: Opaque<"node">,
172
+ from: Vector3,
173
+ easing: GuiEasing,
174
+ duration: number,
175
+ delay?: number,
176
+ complete_function?: (this: any, node: Opaque<"node">) => void,
177
+ ): void;
178
+ export function slide_out_left(
179
+ node: Opaque<"node">,
180
+ from: Vector3,
181
+ easing: GuiEasing,
182
+ duration: number,
183
+ delay?: number,
184
+ complete_function?: (this: any, node: Opaque<"node">) => void,
185
+ ): void;
186
+ export function slide_out_top(
187
+ node: Opaque<"node">,
188
+ from: Vector3,
189
+ easing: GuiEasing,
190
+ duration: number,
191
+ delay?: number,
192
+ complete_function?: (this: any, node: Opaque<"node">) => void,
193
+ ): void;
194
+ export function slide_out_bottom(
195
+ node: Opaque<"node">,
196
+ from: Vector3,
197
+ easing: GuiEasing,
198
+ duration: number,
199
+ delay?: number,
200
+ complete_function?: (this: any, node: Opaque<"node">) => void,
201
+ ): void;
202
+ export function scale_in(
203
+ node: Opaque<"node">,
204
+ to: Vector3,
205
+ easing: GuiEasing,
206
+ duration: number,
207
+ delay?: number,
208
+ complete_function?: (this: any, node: Opaque<"node">) => void,
209
+ ): void;
210
+ export function scale_out(
211
+ node: Opaque<"node">,
212
+ from: Vector3,
213
+ easing: GuiEasing,
214
+ duration: number,
215
+ delay?: number,
216
+ complete_function?: (this: any, node: Opaque<"node">) => void,
217
+ ): void;
218
+ export function fade_in(
219
+ node: Opaque<"node">,
220
+ from: Vector3,
221
+ easing: GuiEasing,
222
+ duration: number,
223
+ delay?: number,
224
+ complete_function?: (this: any, node: Opaque<"node">) => void,
225
+ ): void;
226
+ export function fade_out(
227
+ node: Opaque<"node">,
228
+ from: Vector3,
229
+ easing: GuiEasing,
230
+ duration: number,
231
+ delay?: number,
232
+ complete_function?: (this: any, node: Opaque<"node">) => void,
233
+ ): void;
150
234
 
151
235
  export function in_right_out_left(
152
236
  node: Opaque<"node">,