@defold-typescript/library-types 0.18.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.
- package/NOTICE +52 -0
- package/README.md +78 -0
- package/api-doc/boom.boom.json +26 -0
- package/api-doc/bridge.bridge.json +1653 -0
- package/api-doc/bzAnim.bzLibrary.json +156 -0
- package/api-doc/defcon.console.json +109 -0
- package/api-doc/defmath.defmath.json +1381 -0
- package/api-doc/defsave.defsave.json +175 -0
- package/api-doc/deftest.deftest.json +71 -0
- package/api-doc/dicebag.dicebag.json +323 -0
- package/api-doc/event.event.json +238 -0
- package/api-doc/gooey.gooey.json +963 -0
- package/api-doc/immutable.immutable.json +63 -0
- package/api-doc/in.accelerometer.json +281 -0
- package/api-doc/in.button.json +148 -0
- package/api-doc/in.cursor.json +203 -0
- package/api-doc/in.gesture.json +206 -0
- package/api-doc/in.keyboard.json +45 -0
- package/api-doc/in.mapper.json +141 -0
- package/api-doc/in.onscreen.json +265 -0
- package/api-doc/in.state.json +195 -0
- package/api-doc/in.textbox.json +213 -0
- package/api-doc/in.triggers.json +1260 -0
- package/api-doc/lang.lang.json +411 -0
- package/api-doc/log.log.json +50 -0
- package/api-doc/metrics.fps.json +88 -0
- package/api-doc/metrics.mem.json +80 -0
- package/api-doc/monarch.monarch.json +1065 -0
- package/api-doc/monarch.transitions.easings.json +206 -0
- package/api-doc/monarch.transitions.gui.json +445 -0
- package/api-doc/nakama.engine.defold.json +165 -0
- package/api-doc/nakama.nakama.json +6574 -0
- package/api-doc/nakama.util.log.json +25 -0
- package/api-doc/narrator.narrator.json +150 -0
- package/api-doc/orthographic.camera.json +1019 -0
- package/api-doc/persist.persist.json +142 -0
- package/api-doc/platypus.platypus.json +631 -0
- package/api-doc/proto.proto.json +355 -0
- package/api-doc/rendy.rendy.json +408 -0
- package/api-doc/richtext.color.json +219 -0
- package/api-doc/richtext.richtext.json +382 -0
- package/api-doc/richtext.tags.json +67 -0
- package/api-doc/saver.saver.json +553 -0
- package/api-doc/saver.storage.json +174 -0
- package/api-doc/squid.squid.json +660 -0
- package/api-doc/starly.starly.json +488 -0
- package/api-doc/tweener.tweener.json +419 -0
- package/api-doc/yagames.yagames.json +1465 -0
- package/api-doc/zzfx.api.json +85 -0
- package/generated/boom.boom.d.ts +1585 -0
- package/generated/bridge.bridge.d.ts +533 -0
- package/generated/bzAnim.bzLibrary.d.ts +93 -0
- package/generated/defcon.console.d.ts +24 -0
- package/generated/defmath.defmath.d.ts +194 -0
- package/generated/defsave.defsave.d.ts +31 -0
- package/generated/deftest.deftest.d.ts +47 -0
- package/generated/dicebag.dicebag.d.ts +90 -0
- package/generated/event.event.d.ts +54 -0
- package/generated/gooey.gooey.d.ts +261 -0
- package/generated/immutable.immutable.d.ts +13 -0
- package/generated/in.accelerometer.d.ts +37 -0
- package/generated/in.button.d.ts +20 -0
- package/generated/in.cursor.d.ts +33 -0
- package/generated/in.gesture.d.ts +64 -0
- package/generated/in.keyboard.d.ts +18 -0
- package/generated/in.mapper.d.ts +23 -0
- package/generated/in.onscreen.d.ts +58 -0
- package/generated/in.state.d.ts +34 -0
- package/generated/in.textbox.d.ts +26 -0
- package/generated/in.triggers.d.ts +180 -0
- package/generated/lang.lang.d.ts +33 -0
- package/generated/log.log.d.ts +40 -0
- package/generated/metrics.fps.d.ts +16 -0
- package/generated/metrics.mem.d.ts +16 -0
- package/generated/monarch.monarch.d.ts +412 -0
- package/generated/monarch.transitions.easings.d.ts +65 -0
- package/generated/monarch.transitions.gui.d.ts +197 -0
- package/generated/nakama.engine.defold.d.ts +24 -0
- package/generated/nakama.nakama.d.ts +594 -0
- package/generated/nakama.util.log.d.ts +10 -0
- package/generated/narrator.narrator.d.ts +66 -0
- package/generated/orthographic.camera.d.ts +308 -0
- package/generated/persist.persist.d.ts +34 -0
- package/generated/platypus.platypus.d.ts +76 -0
- package/generated/proto.proto.d.ts +36 -0
- package/generated/rendy.rendy.d.ts +184 -0
- package/generated/richtext.color.d.ts +33 -0
- package/generated/richtext.richtext.d.ts +126 -0
- package/generated/richtext.tags.d.ts +12 -0
- package/generated/saver.saver.d.ts +44 -0
- package/generated/saver.storage.d.ts +16 -0
- package/generated/squid.squid.d.ts +106 -0
- package/generated/starly.starly.d.ts +148 -0
- package/generated/tweener.tweener.d.ts +151 -0
- package/generated/yagames.yagames.d.ts +279 -0
- package/generated/zzfx.api.d.ts +20 -0
- package/library-classification.json +726 -0
- package/library-targets.json +291 -0
- package/package.json +180 -0
- package/scripts/extract-api-doc.ts +418 -0
- package/scripts/sync-library-types.ts +542 -0
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Monarch is a screen manager for the Defold game engine.
|
|
5
|
+
* @see {@link https://github.com/britzl/monarch|Github Source}
|
|
6
|
+
* @see {@link https://github.com/britzl/monarch/blob/master/README_API.md|Documentation}
|
|
7
|
+
* @example `import * as monarch from 'monarch.monarch'`
|
|
8
|
+
* @noResolution
|
|
9
|
+
*/
|
|
10
|
+
declare module 'monarch.monarch' {
|
|
11
|
+
type ScreenId = Hash | string;
|
|
12
|
+
type ShowOptions = {
|
|
13
|
+
clear?: boolean;
|
|
14
|
+
reload?: boolean;
|
|
15
|
+
sequential?: boolean;
|
|
16
|
+
no_stack?: boolean;
|
|
17
|
+
pop?: number;
|
|
18
|
+
};
|
|
19
|
+
type ReplaceOptions = {
|
|
20
|
+
clear?: boolean;
|
|
21
|
+
reload?: boolean;
|
|
22
|
+
no_stack?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type RegisterProxyOptions = {
|
|
25
|
+
popup?: boolean;
|
|
26
|
+
popup_on_popup?: boolean;
|
|
27
|
+
timestep_below_popup?: number;
|
|
28
|
+
screen_keeps_input_focus_when_below_popup?: boolean;
|
|
29
|
+
others_keep_input_focus_when_below_screen?: boolean;
|
|
30
|
+
auto_preload?: boolean;
|
|
31
|
+
};
|
|
32
|
+
type BackOptions = {
|
|
33
|
+
sequential?: boolean;
|
|
34
|
+
};
|
|
35
|
+
type PreloadOptions = {
|
|
36
|
+
auto_preload?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type Data = {};
|
|
39
|
+
type Message = {};
|
|
40
|
+
type Callback = () => void;
|
|
41
|
+
|
|
42
|
+
// transition messages
|
|
43
|
+
export const TRANSITION: {
|
|
44
|
+
DONE: Hash;
|
|
45
|
+
SHOW_IN: Hash;
|
|
46
|
+
SHOW_OUT: Hash;
|
|
47
|
+
BACK_IN: Hash;
|
|
48
|
+
BACK_OUT: Hash;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// focus messages
|
|
52
|
+
export const FOCUS: {
|
|
53
|
+
GAINED: Hash;
|
|
54
|
+
LOST: Hash;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// listener messages
|
|
58
|
+
export const SCREEN_TRANSITION_IN_STARTED: Hash;
|
|
59
|
+
export const SCREEN_TRANSITION_IN_FINISHED: Hash;
|
|
60
|
+
export const SCREEN_TRANSITION_OUT_STARTED: Hash;
|
|
61
|
+
export const SCREEN_TRANSITION_OUT_FINISHED: Hash;
|
|
62
|
+
export const SCREEN_TRANSITION_FAILED: Hash;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Enable verbose logging of the internals of Monarch.
|
|
66
|
+
*/
|
|
67
|
+
export function debug(): void;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Check if a screen exists in the current screen stack
|
|
71
|
+
* @param {string|hash} screen_id
|
|
72
|
+
* @returns true of the screen is in the stack
|
|
73
|
+
*/
|
|
74
|
+
export function in_stack(screen_id: ScreenId): boolean;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Check if a Monarch screen is at the top of the view stack.
|
|
78
|
+
* @param {string|hash} screen_id
|
|
79
|
+
* @returns true if the screen is at the top of the stack
|
|
80
|
+
*/
|
|
81
|
+
export function is_top(screen_id: ScreenId): boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Check if a Monarch screen is visible.
|
|
85
|
+
* @param {string|hash} screen_id
|
|
86
|
+
* @returns true if the screen is visible
|
|
87
|
+
*/
|
|
88
|
+
export function is_visible(screen_id: ScreenId): boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Check if a screen is loaded
|
|
92
|
+
* @param {string|hash} screen_id
|
|
93
|
+
* @returns true if the screen is loaded
|
|
94
|
+
*/
|
|
95
|
+
export function is_loaded(screen_id: ScreenId): boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Check if a screen is a popup
|
|
99
|
+
* @param {string|hash} screen_id
|
|
100
|
+
* @returns true if the screen is a popup
|
|
101
|
+
*/
|
|
102
|
+
export function is_popup(screen_id: ScreenId): boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Register a new screen contained in a collection proxy.
|
|
106
|
+
* This is done automatically by the screen_proxy.script. It is expected that
|
|
107
|
+
* the caller of this function is a script component attached to the same game
|
|
108
|
+
* object as the proxy. This is required since monarch will acquire and
|
|
109
|
+
* release input focus of the game object where the proxy is attached.
|
|
110
|
+
* @param {string|hash} screen_id - Unique id of the screen
|
|
111
|
+
* @param {url} proxy - URL to the collection proxy containing the screen
|
|
112
|
+
* @param {object} settings - Settings table for screen. Accepted values:
|
|
113
|
+
* * popup - true if the screen is a popup
|
|
114
|
+
* * popup_on_popup - true if this popup can be shown on top of
|
|
115
|
+
* another popup or false if an underlying popup should be closed
|
|
116
|
+
* * timestep_below_popup - Timestep to set on proxy when below a popup
|
|
117
|
+
* * screen_keeps_input_focus_when_below_popup - If this screen should
|
|
118
|
+
* keep input focus when below a popup
|
|
119
|
+
* * others_keep_input_focus_when_below_screen - If screens below this
|
|
120
|
+
* screen should keep input focus
|
|
121
|
+
* * auto_preload - true if the screen should be automatically preloaded
|
|
122
|
+
*/
|
|
123
|
+
export function register_proxy(
|
|
124
|
+
screen_id: ScreenId,
|
|
125
|
+
proxy: Url,
|
|
126
|
+
settings: RegisterProxyOptions,
|
|
127
|
+
): void;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Register a new screen contained in a collection factory.
|
|
131
|
+
* This is done automatically by the screen_factory.script. It is expected that
|
|
132
|
+
* the caller of this function is a script component attached to the same game
|
|
133
|
+
* object as the factory. This is required since monarch will acquire and
|
|
134
|
+
* release input focus of the game object where the factory is attached.
|
|
135
|
+
* @param {string|hash} screen_id - Unique id of the screen
|
|
136
|
+
* @param {url} factory - URL to the collection factory containing the screen
|
|
137
|
+
* @param {object} settings - Settings table for screen. Accepted values:
|
|
138
|
+
* * popup - true if the screen is a popup
|
|
139
|
+
* * popup_on_popup - true if this popup can be shown on top of
|
|
140
|
+
* another popup or false if an underlying popup should be closed
|
|
141
|
+
* * screen_keeps_input_focus_when_below_popup - If this screen should
|
|
142
|
+
* keep input focus when below a popup
|
|
143
|
+
* * others_keep_input_focus_when_below_screen - If screens below this
|
|
144
|
+
* screen should keep input focus
|
|
145
|
+
* * auto_preload - true if the screen should be automatically preloaded
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
export function register_factory(
|
|
149
|
+
screen_id: ScreenId,
|
|
150
|
+
factory: Url,
|
|
151
|
+
settings: RegisterProxyOptions,
|
|
152
|
+
): void;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Unregister a screen
|
|
156
|
+
* This is done automatically by the screen.script
|
|
157
|
+
* @param {string|hash} screen_id - Id of the screen to unregister
|
|
158
|
+
*/
|
|
159
|
+
export function unregister(screen_id: ScreenId): void;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Get data associated with a screen
|
|
163
|
+
* @param {string|hash} screen_id - Id of the screen to get data for
|
|
164
|
+
* @returns {object} Data associated with the screen
|
|
165
|
+
*/
|
|
166
|
+
export function data(screen_id: ScreenId): Data;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Check if a Monarch screen exists.
|
|
170
|
+
* @param {string|hash} screen_id - Id of the screen to check if is registered
|
|
171
|
+
* @returns {boolean} True or False if the screen id is registered or not
|
|
172
|
+
*/
|
|
173
|
+
export function screen_exists(screen_id: ScreenId): boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Check if Monarch is busy showing and/or hiding a screen.
|
|
177
|
+
* @returns {boolean} true if busy
|
|
178
|
+
*/
|
|
179
|
+
export function is_busy(): boolean;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Show a Monarch screen.
|
|
183
|
+
* @param {string|hash} screen_id - Id of the screen to check if is registered
|
|
184
|
+
* @param {object} options Table with options when showing the screen (can be nil). Valid values:
|
|
185
|
+
* - clear - Set to true if the stack should be cleared down to an existing instance of the screen
|
|
186
|
+
* - reload - Set to true if screen should be reloaded if it already exists in the stack and is loaded.
|
|
187
|
+
This would be the case if doing a show() from a popup on the screen just below the popup.
|
|
188
|
+
* - sequential - Set to true to wait for the previous screen to show itself out before starting the
|
|
189
|
+
show in transition even when transitioning to a different scene ID.
|
|
190
|
+
* - no_stack - Set to true to load the screen without adding it to the screen stack.
|
|
191
|
+
* - pop - The number of screens to pop from the stack before adding the new one.
|
|
192
|
+
* @param {any} data - Optional data to set on the screen. Can be retrieved by the `data()` function
|
|
193
|
+
* @param {function} callback - Optional callback to invoke when screen is shown
|
|
194
|
+
*/
|
|
195
|
+
export function show(
|
|
196
|
+
screen_id: ScreenId,
|
|
197
|
+
options?: ShowOptions,
|
|
198
|
+
data?: Data,
|
|
199
|
+
callback?: Callback,
|
|
200
|
+
): void;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Replace the top of the stack with a new screen.
|
|
204
|
+
* @param {string|hash} screen_id - Id of the screen to show.
|
|
205
|
+
* @param {object} options - Table with options when showing the screen (can be nil). Valid values:
|
|
206
|
+
* - clear {boolean} - Set to true if the stack should be cleared down to an existing instance of the screen.
|
|
207
|
+
* - reload {boolean} - Set to true if the screen should be reloaded if it already exists in the stack and is loaded.
|
|
208
|
+
* This would be the case if doing a show() from a popup on the screen just below the popup.
|
|
209
|
+
* - no_stack {boolean} - Set to true to load the screen without adding it to the screen stack.
|
|
210
|
+
* @param {any} data - Optional data to set on the screen. Can be retrieved by the data() function.
|
|
211
|
+
* @param {function} callback - Optional callback to invoke when the screen is shown.
|
|
212
|
+
*/
|
|
213
|
+
export function replace(
|
|
214
|
+
screen_id: ScreenId,
|
|
215
|
+
options?: ReplaceOptions,
|
|
216
|
+
data?: Data,
|
|
217
|
+
callback?: Callback,
|
|
218
|
+
): void;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Hide a screen. The screen must either be at the top of the stack or
|
|
222
|
+
* visible but not added to the stack (through the no_stack option).
|
|
223
|
+
* @param {string|hash} screen_id - Id of the screen to hide.
|
|
224
|
+
* @param {function} callback - Optional callback to invoke when the screen is hidden.
|
|
225
|
+
* @returns {boolean} True if successfully hiding, false if busy or for some other reason unable to hide the screen.
|
|
226
|
+
*/
|
|
227
|
+
export function hide(screen_id: ScreenId, callback?: Callback): boolean;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Clear the stack completely. Any visible screens will be hidden by navigating back out
|
|
231
|
+
* from them.
|
|
232
|
+
* @param {function} callback - Optional callback to invoke when the stack has been cleared.
|
|
233
|
+
*/
|
|
234
|
+
export function clear(callback?: Callback): void;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Go back to the previous screen in the stack.
|
|
238
|
+
*
|
|
239
|
+
* @param {object} options - Table with options when backing out from the screen (can be nil).
|
|
240
|
+
* Valid values:
|
|
241
|
+
* - sequential {boolean} - Set to true to wait for the current screen to hide itself out before starting the
|
|
242
|
+
* back in transition even when transitioning to a different scene ID.
|
|
243
|
+
* @param {any} data - Optional data to set for the previous screen.
|
|
244
|
+
* @param {function} callback - Optional callback to invoke when the previous screen is visible again.
|
|
245
|
+
*/
|
|
246
|
+
export function back(
|
|
247
|
+
options?: BackOptions,
|
|
248
|
+
data?: Data,
|
|
249
|
+
callback?: Callback,
|
|
250
|
+
): void;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Check if a screen is preloading via monarch.preload() or automatically
|
|
254
|
+
* via the Preload screen option.
|
|
255
|
+
* @param {string|hash} screen_id - Screen id.
|
|
256
|
+
* @returns {boolean} True if preloading, false otherwise.
|
|
257
|
+
*/
|
|
258
|
+
export function is_preloading(screen_id: ScreenId): boolean;
|
|
259
|
+
|
|
260
|
+
export function is_preloaded(screen_id: ScreenId): boolean;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Invoke a callback when a specific screen has been preloaded.
|
|
264
|
+
* This is mainly useful on app start when wanting to show a screen that
|
|
265
|
+
* has the `Preload` flag set (since it will immediately start to load which
|
|
266
|
+
* would prevent a call to `monarch.show` from having any effect).
|
|
267
|
+
* @param {string|hash} screen_id - Id of the screen to monitor for preload completion.
|
|
268
|
+
* @param {function} callback - Callback to invoke when the screen has been preloaded.
|
|
269
|
+
*/
|
|
270
|
+
export function when_preloaded(
|
|
271
|
+
screen_id: ScreenId,
|
|
272
|
+
callback: (screen_id?: ScreenId) => void,
|
|
273
|
+
): void;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Preload a screen. This will load but not enable and show a screen.
|
|
277
|
+
* Useful for "heavier" screens that you wish to show without any delay.
|
|
278
|
+
*
|
|
279
|
+
* @param {string|hash} screen_id - Id of the screen to preload.
|
|
280
|
+
* @param {object} options - Options for preloading the screen.
|
|
281
|
+
* @param {function} callback - Optional callback to invoke when the screen is loaded.
|
|
282
|
+
*/
|
|
283
|
+
export function preload(
|
|
284
|
+
screen_id: ScreenId,
|
|
285
|
+
options?: PreloadOptions,
|
|
286
|
+
callback?: Callback,
|
|
287
|
+
): void;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Check if a screen has missing resources, always returns false for factory
|
|
291
|
+
* @param {string|hash} screen_id - Id of the screen to preload
|
|
292
|
+
*/
|
|
293
|
+
export function has_missing_resources(screen_id: ScreenId): boolean;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Unload a preloaded monarch screen.
|
|
297
|
+
* @param {string|hash} screen_id - Id of the screen to unload.
|
|
298
|
+
* @param {function} callback - Optional callback to invoke when the screen is unloaded.
|
|
299
|
+
*/
|
|
300
|
+
export function unload(screen_id: ScreenId, callback?: Callback): void;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Post a message to a screen using msg.post.
|
|
304
|
+
*
|
|
305
|
+
* @param {string|hash} screen_id - Id of the screen to send the message to.
|
|
306
|
+
* @param {string|hash} message_id - Id of the message to send.
|
|
307
|
+
* @param {object} [message] - Optional message data to send.
|
|
308
|
+
* @returns {boolean} result - True if the message is sent successfully.
|
|
309
|
+
* @returns {string|undefined} error - Error message if unable to send the message.
|
|
310
|
+
*/
|
|
311
|
+
export function post(
|
|
312
|
+
screen_id: ScreenId,
|
|
313
|
+
message_id: Hash | string,
|
|
314
|
+
message?: Message,
|
|
315
|
+
): LuaMultiReturn<[boolean, string | undefined]>;
|
|
316
|
+
|
|
317
|
+
export function on_message(
|
|
318
|
+
message_id: Hash | string,
|
|
319
|
+
message: Message,
|
|
320
|
+
sender: Url,
|
|
321
|
+
): void;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Get a list of IDs for the current screen stack.
|
|
325
|
+
* (Primarily used for unit testing, but could have uses outside testing.)
|
|
326
|
+
* @returns {Array} Table with screen IDs. The first entry is at the bottom of the
|
|
327
|
+
* stack, and the last value is at the top (and currently visible).
|
|
328
|
+
*/
|
|
329
|
+
export function get_stack(): ScreenId[];
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Get the screen on top of the stack.
|
|
333
|
+
*
|
|
334
|
+
* @param {number} [offset] - Optional offset from the top of the stack (e.g., -1 for the previous screen).
|
|
335
|
+
* @returns {string|hash} - Id of the requested screen.
|
|
336
|
+
*/
|
|
337
|
+
export function top(offset?: number): ScreenId;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Get the screen at the bottom of the stack.
|
|
341
|
+
* @param {number} [offset] - Optional offset from the bottom of the stack.
|
|
342
|
+
* @returns {string|hash} - Id of the requested screen.
|
|
343
|
+
*/
|
|
344
|
+
export function bottom(offset?: number): ScreenId;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Set the timestep to apply for a screen when below a popup.
|
|
348
|
+
* @param {string|hash} screen_id - Id of the screen to change the timestep setting for.
|
|
349
|
+
* @param {number} timestep - Timestep to apply.
|
|
350
|
+
*/
|
|
351
|
+
export function set_timestep_below_popup(
|
|
352
|
+
screen_id: ScreenId,
|
|
353
|
+
timestep: number,
|
|
354
|
+
): void;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Set a function to call when a transition should be started.
|
|
358
|
+
* The function will receive (`message_id`, `message`, `sender`).
|
|
359
|
+
* IMPORTANT! You must call `monarch.on_message()` from the same script as
|
|
360
|
+
* this function was called.
|
|
361
|
+
*
|
|
362
|
+
* @param {string|hash} screen_id - Screen id to associate the transition with.
|
|
363
|
+
* @param {function} fn - Transition handler function.
|
|
364
|
+
*/
|
|
365
|
+
export function on_transition(
|
|
366
|
+
screen_id: ScreenId,
|
|
367
|
+
fn: (message_id: string, message: Message, sender: Url) => void,
|
|
368
|
+
): void;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Set a function to call when a screen gains or loses focus.
|
|
372
|
+
* The function will receive (`message_id`, `message`, `sender`).
|
|
373
|
+
* IMPORTANT! You must call `monarch.on_message()` from the same script as
|
|
374
|
+
* this function was called.
|
|
375
|
+
* @param {string|hash} screen_id - Screen id to associate the focus listener function with.
|
|
376
|
+
* @param {function} fn - Focus listener function.
|
|
377
|
+
*/
|
|
378
|
+
export function on_focus_changed(
|
|
379
|
+
screen_id: ScreenId,
|
|
380
|
+
fn: (message_id: string, message: Message, sender: Url) => void,
|
|
381
|
+
): void;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Set either a function to be called when `msg.post()` is called on a specific screen
|
|
385
|
+
* or a URL where the message is sent.
|
|
386
|
+
* IMPORTANT! If you provide a function, you must also make sure to call
|
|
387
|
+
* `monarch.on_message(message_id, message, sender)` from the same script as
|
|
388
|
+
* this function was called.
|
|
389
|
+
* @param {string|hash} screen_id - Screen id to associate the message listener function with.
|
|
390
|
+
* @param {function|string} fn_or_url - The function to call or URL to send the message to.
|
|
391
|
+
*/
|
|
392
|
+
export function on_post(
|
|
393
|
+
screen_id: ScreenId,
|
|
394
|
+
fn_or_url: Callback | Url | string,
|
|
395
|
+
): void;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Add a listener to be notified when screens are shown or hidden.
|
|
399
|
+
* @param {url|undefined} url - The url to notify, undefined for the current url.
|
|
400
|
+
*/
|
|
401
|
+
export function add_listener(url?: Url): void;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Remove a previously added listener.
|
|
405
|
+
* @param {url|undefined} url - The url to remove, nil for current url.
|
|
406
|
+
*/
|
|
407
|
+
export function remove_listener(url?: Url): void;
|
|
408
|
+
|
|
409
|
+
export function dump_stack(): string;
|
|
410
|
+
|
|
411
|
+
export function queue_size(): number;
|
|
412
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://github.com/britzl/monarch|Github Source}
|
|
3
|
+
* @see {@link https://github.com/britzl/monarch/blob/master/README_API.md|Documentation}
|
|
4
|
+
* @example `import * as transitions_easings from 'monarch.transitions.easings'`
|
|
5
|
+
* @noResolution
|
|
6
|
+
*/
|
|
7
|
+
declare module 'monarch.transitions.easings' {
|
|
8
|
+
type EasingIn =
|
|
9
|
+
| 'BACK'
|
|
10
|
+
| 'BOUNCE'
|
|
11
|
+
| 'CIRC'
|
|
12
|
+
| 'CUBIC'
|
|
13
|
+
| 'ELASTIC'
|
|
14
|
+
| 'EXPO'
|
|
15
|
+
| 'OUTBACK'
|
|
16
|
+
| 'OUTBOUNCE'
|
|
17
|
+
| 'OUTCIRC'
|
|
18
|
+
| 'OUTCUBIC'
|
|
19
|
+
| 'OUTELASTIC'
|
|
20
|
+
| 'OUTEXPO'
|
|
21
|
+
| 'OUTQUAD'
|
|
22
|
+
| 'OUTQUART'
|
|
23
|
+
| 'OUTQUINT'
|
|
24
|
+
| 'OUTSINE'
|
|
25
|
+
| 'QUAD'
|
|
26
|
+
| 'QUART'
|
|
27
|
+
| 'QUINT'
|
|
28
|
+
| 'SINE';
|
|
29
|
+
type EasingOut =
|
|
30
|
+
| 'BACK'
|
|
31
|
+
| 'BOUNCE'
|
|
32
|
+
| 'CIRC'
|
|
33
|
+
| 'CUBIC'
|
|
34
|
+
| 'ELASTIC'
|
|
35
|
+
| 'EXPO'
|
|
36
|
+
| 'INBACK'
|
|
37
|
+
| 'INBOUNCE'
|
|
38
|
+
| 'INCIRC'
|
|
39
|
+
| 'INCUBIC'
|
|
40
|
+
| 'INELASTIC'
|
|
41
|
+
| 'INEXPO'
|
|
42
|
+
| 'INQUAD'
|
|
43
|
+
| 'INQUART'
|
|
44
|
+
| 'INQUINT'
|
|
45
|
+
| 'INSINE'
|
|
46
|
+
| 'QUAD'
|
|
47
|
+
| 'QUART'
|
|
48
|
+
| 'QUINT'
|
|
49
|
+
| 'SINE';
|
|
50
|
+
type Easing = {
|
|
51
|
+
IN: (typeof gui)[`EASING_OUT${EasingOut}`];
|
|
52
|
+
OUT: (typeof gui)[`EASING_IN${EasingIn}`];
|
|
53
|
+
};
|
|
54
|
+
export function BACK(): Easing;
|
|
55
|
+
export function BOUNCE(): Easing;
|
|
56
|
+
export function CIRC(): Easing;
|
|
57
|
+
export function CUBIC(): Easing;
|
|
58
|
+
export function ELASTIC(): Easing;
|
|
59
|
+
export function EXPO(): Easing;
|
|
60
|
+
export function QUAD(): Easing;
|
|
61
|
+
export function QUART(): Easing;
|
|
62
|
+
export function QUINT(): Easing;
|
|
63
|
+
export function SINE(): Easing;
|
|
64
|
+
export function create(name: EasingIn | EasingOut): Easing;
|
|
65
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Monarch comes with a system for setting up transitions easily
|
|
5
|
+
* in a `gui_script` using the `monarch.transitions.gui` module.
|
|
6
|
+
* @see {@link https://github.com/britzl/monarch|Github Source}
|
|
7
|
+
* @see {@link https://github.com/britzl/monarch/blob/master/README_API.md|Documentation}
|
|
8
|
+
* @example `import * as transitions_gui from 'monarch.transitions.gui'`
|
|
9
|
+
* @noResolution
|
|
10
|
+
*/
|
|
11
|
+
declare module 'monarch.transitions.gui' {
|
|
12
|
+
type GuiEasing =
|
|
13
|
+
| typeof gui.EASING_INBACK
|
|
14
|
+
| typeof gui.EASING_INBOUNCE
|
|
15
|
+
| typeof gui.EASING_INCIRC
|
|
16
|
+
| typeof gui.EASING_INCUBIC
|
|
17
|
+
| typeof gui.EASING_INELASTIC
|
|
18
|
+
| typeof gui.EASING_INEXPO
|
|
19
|
+
| typeof gui.EASING_INOUTBACK
|
|
20
|
+
| typeof gui.EASING_INOUTBOUNCE
|
|
21
|
+
| typeof gui.EASING_INOUTCIRC
|
|
22
|
+
| typeof gui.EASING_INOUTCUBIC
|
|
23
|
+
| typeof gui.EASING_INOUTELASTIC
|
|
24
|
+
| typeof gui.EASING_INOUTEXPO
|
|
25
|
+
| typeof gui.EASING_INOUTQUAD
|
|
26
|
+
| typeof gui.EASING_INOUTQUART
|
|
27
|
+
| typeof gui.EASING_INOUTQUINT
|
|
28
|
+
| typeof gui.EASING_INOUTSINE
|
|
29
|
+
| typeof gui.EASING_INQUAD
|
|
30
|
+
| typeof gui.EASING_INQUART
|
|
31
|
+
| typeof gui.EASING_INQUINT
|
|
32
|
+
| typeof gui.EASING_INSINE
|
|
33
|
+
| typeof gui.EASING_LINEAR
|
|
34
|
+
| typeof gui.EASING_OUTBACK
|
|
35
|
+
| typeof gui.EASING_OUTBOUNCE
|
|
36
|
+
| typeof gui.EASING_OUTCIRC
|
|
37
|
+
| typeof gui.EASING_OUTCUBIC
|
|
38
|
+
| typeof gui.EASING_OUTELASTIC
|
|
39
|
+
| typeof gui.EASING_OUTEXPO
|
|
40
|
+
| typeof gui.EASING_OUTINBACK
|
|
41
|
+
| typeof gui.EASING_OUTINBOUNCE
|
|
42
|
+
| typeof gui.EASING_OUTINCIRC
|
|
43
|
+
| typeof gui.EASING_OUTINCUBIC
|
|
44
|
+
| typeof gui.EASING_OUTINELASTIC
|
|
45
|
+
| typeof gui.EASING_OUTINEXPO
|
|
46
|
+
| typeof gui.EASING_OUTINQUAD
|
|
47
|
+
| typeof gui.EASING_OUTINQUART
|
|
48
|
+
| typeof gui.EASING_OUTINQUINT
|
|
49
|
+
| typeof gui.EASING_OUTINSINE
|
|
50
|
+
| typeof gui.EASING_OUTQUAD
|
|
51
|
+
| typeof gui.EASING_OUTQUART
|
|
52
|
+
| typeof gui.EASING_OUTQUINT
|
|
53
|
+
| typeof gui.EASING_OUTSINE;
|
|
54
|
+
|
|
55
|
+
type Easing = {
|
|
56
|
+
IN: GuiEasing;
|
|
57
|
+
OUT: GuiEasing;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type Transition = {
|
|
61
|
+
handle: (message_id: Hash | string, message: unknown, sender: Url) => void;
|
|
62
|
+
show_in: (
|
|
63
|
+
fn: TransitionInFn | TransitionOutFn,
|
|
64
|
+
easing: GuiEasing,
|
|
65
|
+
duration: number,
|
|
66
|
+
delay: number,
|
|
67
|
+
) => void;
|
|
68
|
+
show_out: (
|
|
69
|
+
fn: TransitionInFn | TransitionOutFn,
|
|
70
|
+
easing: GuiEasing,
|
|
71
|
+
duration: number,
|
|
72
|
+
delay: number,
|
|
73
|
+
) => void;
|
|
74
|
+
back_in: (
|
|
75
|
+
fn: TransitionInFn | TransitionOutFn,
|
|
76
|
+
easing: GuiEasing,
|
|
77
|
+
duration: number,
|
|
78
|
+
delay: number,
|
|
79
|
+
) => void;
|
|
80
|
+
back_out: (
|
|
81
|
+
fn: TransitionInFn | TransitionOutFn,
|
|
82
|
+
easing: GuiEasing,
|
|
83
|
+
duration: number,
|
|
84
|
+
delay: number,
|
|
85
|
+
) => void;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
type TransitionNodeless = {
|
|
89
|
+
handle: (message_id: Hash | string, message: unknown, sender: Url) => void;
|
|
90
|
+
show_in: (
|
|
91
|
+
node: Opaque<"node">,
|
|
92
|
+
fn: TransitionInFn | TransitionOutFn,
|
|
93
|
+
easing: GuiEasing,
|
|
94
|
+
duration: number,
|
|
95
|
+
delay: number,
|
|
96
|
+
) => void;
|
|
97
|
+
show_out: (
|
|
98
|
+
node: Opaque<"node">,
|
|
99
|
+
fn: TransitionInFn | TransitionOutFn,
|
|
100
|
+
easing: GuiEasing,
|
|
101
|
+
duration: number,
|
|
102
|
+
delay: number,
|
|
103
|
+
) => void;
|
|
104
|
+
back_in: (
|
|
105
|
+
node: Opaque<"node">,
|
|
106
|
+
fn: TransitionInFn | TransitionOutFn,
|
|
107
|
+
easing: GuiEasing,
|
|
108
|
+
duration: number,
|
|
109
|
+
delay: number,
|
|
110
|
+
) => void;
|
|
111
|
+
back_out: (
|
|
112
|
+
node: Opaque<"node">,
|
|
113
|
+
fn: TransitionInFn | TransitionOutFn,
|
|
114
|
+
easing: GuiEasing,
|
|
115
|
+
duration: number,
|
|
116
|
+
delay: number,
|
|
117
|
+
) => void;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export type TransitionInFn = (
|
|
121
|
+
node: Opaque<"node">,
|
|
122
|
+
to: Vector3,
|
|
123
|
+
easing: GuiEasing,
|
|
124
|
+
duration: number,
|
|
125
|
+
delay?: number,
|
|
126
|
+
complete_function?: (this: any, node: Opaque<"node">) => void,
|
|
127
|
+
) => void;
|
|
128
|
+
|
|
129
|
+
export type TransitionOutFn = (
|
|
130
|
+
node: Opaque<"node">,
|
|
131
|
+
from: Vector3,
|
|
132
|
+
easing: GuiEasing,
|
|
133
|
+
duration: number,
|
|
134
|
+
delay?: number,
|
|
135
|
+
complete_function?: (this: any, node: Opaque<"node">) => void,
|
|
136
|
+
) => void;
|
|
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;
|
|
150
|
+
|
|
151
|
+
export function in_right_out_left(
|
|
152
|
+
node: Opaque<"node">,
|
|
153
|
+
duration: number,
|
|
154
|
+
delay?: number,
|
|
155
|
+
easing?: Easing,
|
|
156
|
+
): void;
|
|
157
|
+
export function in_left_out_right(
|
|
158
|
+
node: Opaque<"node">,
|
|
159
|
+
duration: number,
|
|
160
|
+
delay?: number,
|
|
161
|
+
easing?: Easing,
|
|
162
|
+
): void;
|
|
163
|
+
export function in_left_out_left(
|
|
164
|
+
node: Opaque<"node">,
|
|
165
|
+
duration: number,
|
|
166
|
+
delay?: number,
|
|
167
|
+
easing?: Easing,
|
|
168
|
+
): void;
|
|
169
|
+
export function in_right_out_right(
|
|
170
|
+
node: Opaque<"node">,
|
|
171
|
+
duration: number,
|
|
172
|
+
delay?: number,
|
|
173
|
+
easing?: Easing,
|
|
174
|
+
): void;
|
|
175
|
+
export function fade_in_out(
|
|
176
|
+
node: Opaque<"node">,
|
|
177
|
+
duration: number,
|
|
178
|
+
delay?: number,
|
|
179
|
+
easing?: Easing,
|
|
180
|
+
): void;
|
|
181
|
+
|
|
182
|
+
/** Notify the transition system that the window size has changed */
|
|
183
|
+
export function window_resized(width: number, height: number): void;
|
|
184
|
+
|
|
185
|
+
/** Calls `complete_function` */
|
|
186
|
+
export function instant(
|
|
187
|
+
node: Opaque<"node">,
|
|
188
|
+
to: Vector3,
|
|
189
|
+
easing: GuiEasing,
|
|
190
|
+
duration: number,
|
|
191
|
+
delay?: number,
|
|
192
|
+
complete_function?: (this: any, node: Opaque<"node">) => void,
|
|
193
|
+
): void;
|
|
194
|
+
|
|
195
|
+
export function create(node: Opaque<"node">): Transition;
|
|
196
|
+
export function create(): TransitionNodeless;
|
|
197
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @noSelfInFile **/
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @see {@link https://github.com/heroiclabs/nakama-defold|Github Source}
|
|
5
|
+
* @noResolution
|
|
6
|
+
*/
|
|
7
|
+
declare module 'nakama.engine.defold' {
|
|
8
|
+
export function uuid(): string;
|
|
9
|
+
|
|
10
|
+
export function http(
|
|
11
|
+
config: unknown,
|
|
12
|
+
url_path: string,
|
|
13
|
+
query_params: string,
|
|
14
|
+
method: string,
|
|
15
|
+
post_data: string,
|
|
16
|
+
callback: (response: unknown) => void
|
|
17
|
+
): void;
|
|
18
|
+
|
|
19
|
+
export function socket_create(config: unknown, on_message: (socket: symbol, message: unknown) => void): void;
|
|
20
|
+
|
|
21
|
+
export function socket_connect(socket: symbol, callback: (success: boolean, error: string) => void): void;
|
|
22
|
+
|
|
23
|
+
export function socket_send(socket: symbol, message: string, callback: () => void): void;
|
|
24
|
+
}
|