@defold-typescript/library-types 0.22.0 → 0.24.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 (145) hide show
  1. package/api-doc/boom.json +3870 -0
  2. package/api-doc/{bridge.bridge.json → bridge.json} +754 -844
  3. package/api-doc/bzAnim.json +338 -0
  4. package/api-doc/decore.json +23 -23
  5. package/api-doc/defcon.json +150 -0
  6. package/api-doc/{defmath.defmath.json → defmath.json} +6 -46
  7. package/api-doc/defsave.json +518 -0
  8. package/api-doc/deftest.json +741 -0
  9. package/api-doc/{dicebag.dicebag.json → dicebag.json} +19 -1
  10. package/api-doc/druid.json +249 -1846
  11. package/api-doc/event.json +1074 -0
  12. package/api-doc/gooey.json +2050 -0
  13. package/api-doc/immutable.json +65 -0
  14. package/api-doc/in.accelerometer.json +75 -1
  15. package/api-doc/in.button.json +17 -10
  16. package/api-doc/in.cursor.json +26 -0
  17. package/api-doc/in.gesture.json +401 -6
  18. package/api-doc/in.keyboard.json +2 -0
  19. package/api-doc/in.mapper.json +12 -8
  20. package/api-doc/in.onscreen.json +61 -5
  21. package/api-doc/in.state.json +61 -13
  22. package/api-doc/in.textbox.json +23 -12
  23. package/api-doc/in.triggers.json +336 -0
  24. package/api-doc/lang.json +528 -0
  25. package/api-doc/{event.event.json → log.json} +96 -101
  26. package/api-doc/metrics.fps.json +61 -2
  27. package/api-doc/metrics.mem.json +61 -2
  28. package/api-doc/monarch.monarch.json +249 -7
  29. package/api-doc/monarch.transitions.easings.json +19 -26
  30. package/api-doc/monarch.transitions.gui.json +782 -79
  31. package/api-doc/nakama.engine.defold.json +31 -18
  32. package/api-doc/{nakama.nakama.json → nakama.json} +4752 -2554
  33. package/api-doc/nakama.util.log.json +32 -4
  34. package/api-doc/narrator.json +647 -0
  35. package/api-doc/openapi/nakama.nakama.json +7680 -0
  36. package/api-doc/orthographic.camera.json +96 -98
  37. package/api-doc/orthographic.json +602 -0
  38. package/api-doc/panthera.json +1183 -0
  39. package/api-doc/{persist.persist.json → persist.json} +26 -1
  40. package/api-doc/{platypus.platypus.json → platypus.json} +68 -14
  41. package/api-doc/proto.json +995 -0
  42. package/api-doc/{rendy.rendy.json → rendy.json} +46 -99
  43. package/api-doc/richtext.color.json +77 -0
  44. package/api-doc/richtext.richtext.json +375 -5
  45. package/api-doc/saver.saver.json +714 -263
  46. package/api-doc/saver.storage.json +283 -52
  47. package/api-doc/squid.json +846 -0
  48. package/api-doc/{starly.starly.json → starly.json} +1 -1
  49. package/api-doc/tweener.json +277 -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 +403 -0
  53. package/generated/{boom.boom.d.ts → boom.d.ts} +14 -0
  54. package/generated/bridge.d.ts +468 -0
  55. package/generated/{bzAnim.bzLibrary.d.ts → bzAnim.d.ts} +6 -0
  56. package/generated/decore.d.ts +37 -37
  57. package/generated/defcon.d.ts +43 -0
  58. package/generated/{defmath.defmath.d.ts → defmath.d.ts} +3 -2
  59. package/generated/defsave.d.ts +144 -0
  60. package/generated/{dicebag.dicebag.d.ts → dicebag.d.ts} +25 -0
  61. package/generated/druid.d.ts +198 -502
  62. package/generated/event.d.ts +318 -0
  63. package/generated/{gooey.gooey.d.ts → gooey.d.ts} +61 -6
  64. package/generated/immutable.d.ts +13 -0
  65. package/generated/in.onscreen.d.ts +5 -0
  66. package/generated/in.textbox.d.ts +4 -0
  67. package/generated/lang.d.ts +101 -0
  68. package/generated/log.d.ts +36 -0
  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.util.log.d.ts +6 -0
  77. package/generated/narrator.d.ts +121 -0
  78. package/generated/openapi/nakama.nakama.d.ts +884 -0
  79. package/generated/orthographic.camera.d.ts +24 -38
  80. package/generated/orthographic.d.ts +155 -0
  81. package/generated/panthera.d.ts +170 -0
  82. package/generated/{persist.persist.d.ts → persist.d.ts} +3 -0
  83. package/generated/{platypus.platypus.d.ts → platypus.d.ts} +9 -0
  84. package/generated/proto.d.ts +146 -0
  85. package/generated/{rendy.rendy.d.ts → rendy.d.ts} +33 -80
  86. package/generated/richtext.color.d.ts +15 -0
  87. package/generated/saver.saver.d.ts +289 -42
  88. package/generated/saver.storage.d.ts +79 -14
  89. package/generated/squid.d.ts +127 -0
  90. package/generated/tweener.d.ts +42 -0
  91. package/generated/{yagames.yagames.d.ts → yagames.d.ts} +151 -29
  92. package/generated/{zzfx.api.d.ts → zzfx.d.ts} +7 -0
  93. package/library-classification.json +0 -227
  94. package/library-targets.json +1 -284
  95. package/luals-targets.json +168 -1
  96. package/openapi-targets.json +17 -0
  97. package/package.json +9 -88
  98. package/script-api-targets.json +15 -0
  99. package/scripts/__snapshots__/parse-luals.test.ts.snap +504 -85
  100. package/scripts/apply-luals-overrides.ts +95 -0
  101. package/scripts/authored-parity.ts +718 -0
  102. package/scripts/emit-library-dts.ts +177 -19
  103. package/scripts/extract-api-doc.ts +189 -38
  104. package/scripts/fidelity-floor.ts +178 -0
  105. package/scripts/import-upstream-docs.ts +125 -0
  106. package/scripts/lower-api-doc.ts +69 -19
  107. package/scripts/luals-fidelity.ts +22 -10
  108. package/scripts/map-luals-types.ts +86 -22
  109. package/scripts/parse-lua-surface.ts +187 -0
  110. package/scripts/parse-luals.ts +473 -22
  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 +29 -2
  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 +367 -0
  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/immutable.immutable.json +0 -63
  126. package/api-doc/lang.lang.json +0 -411
  127. package/api-doc/log.log.json +0 -50
  128. package/api-doc/narrator.narrator.json +0 -150
  129. package/api-doc/proto.proto.json +0 -355
  130. package/api-doc/squid.squid.json +0 -660
  131. package/api-doc/tweener.tweener.json +0 -419
  132. package/generated/bridge.bridge.d.ts +0 -533
  133. package/generated/defcon.console.d.ts +0 -24
  134. package/generated/defsave.defsave.d.ts +0 -31
  135. package/generated/event.event.d.ts +0 -54
  136. package/generated/immutable.immutable.d.ts +0 -13
  137. package/generated/lang.lang.d.ts +0 -33
  138. package/generated/log.log.d.ts +0 -40
  139. package/generated/nakama.nakama.d.ts +0 -594
  140. package/generated/narrator.narrator.d.ts +0 -66
  141. package/generated/proto.proto.d.ts +0 -36
  142. package/generated/squid.squid.d.ts +0 -106
  143. package/generated/tweener.tweener.d.ts +0 -151
  144. /package/generated/{deftest.deftest.d.ts → deftest.d.ts} +0 -0
  145. /package/generated/{starly.starly.d.ts → starly.d.ts} +0 -0
@@ -6,14 +6,14 @@
6
6
  */
7
7
  declare module 'orthographic.camera' {
8
8
  /**
9
- * Follow a game object.
9
+ * Follow one or more game objects. When following multiple objects the camera will follow the center point between the objects.
10
10
  * @param camera_id undefined for the first camera
11
- * @param target Game object to follow
11
+ * @param targets Game object(s) to follow
12
12
  * @param options Options
13
13
  */
14
14
  export function follow(
15
15
  camera_id: Hash | Url | undefined,
16
- target: Hash | Url,
16
+ targets: Hash | Url | (Hash | Url)[],
17
17
  options?: {
18
18
  /**
19
19
  * Lerp from current position to target position with lerp as t.
@@ -54,6 +54,24 @@ declare module 'orthographic.camera' {
54
54
  zoom: number,
55
55
  ): void;
56
56
 
57
+ /**
58
+ * Get if the camera is configured to use automatic zoom level.
59
+ * @param camera_id undefined for the first camera
60
+ */
61
+ export function get_automatic_zoom(
62
+ camera_id: Hash | Url | undefined,
63
+ ): boolean;
64
+
65
+ /**
66
+ * Set if the camera should use automatic zoom level.
67
+ * @param camera_id undefined for the first camera
68
+ * @param enabled True if automatic zoom should be enabled
69
+ */
70
+ export function set_automatic_zoom(
71
+ camera_id: Hash | Url | undefined,
72
+ enabled: boolean,
73
+ ): void;
74
+
57
75
  /**
58
76
  * Shake the camera.
59
77
  * @param camera_id undefined for the first camera
@@ -133,12 +151,6 @@ declare module 'orthographic.camera' {
133
151
  camera_id: Hash | Url | undefined,
134
152
  ): Matrix4;
135
153
 
136
- /**
137
- * Get the current projection id of the camera.
138
- * @param camera_id undefined for the first camera
139
- */
140
- export function get_projection_id(camera_id: Hash | Url | undefined): Hash;
141
-
142
154
  /**
143
155
  * Apply a recoil effect to the camera. The recoil will decay using linear interpolation.
144
156
  * @param camera_id
@@ -214,18 +226,13 @@ declare module 'orthographic.camera' {
214
226
  ): Vector4;
215
227
 
216
228
  /**
217
- * Translate world coordinates to screen coordinates, based on the view and projection of the camera, optionally taking into account an adjust mode. This is useful when manually culling game objects and you need to determine if a world coordinate will be visible or not. It can also be used to position gui nodes on top of game objects.
229
+ * Translate world coordinates to screen coordinates, based on the view and projection of the camera. This is useful when manually culling game objects and you need to determine if a world coordinate will be visible or not. It can also be used to position gui nodes on top of game objects.
218
230
  * @param camera_id undefined for the first camera
219
231
  * @param world World coordinates to convert
220
- * @param adjust_mode One of gui.ADJUST_FIT, gui.ADJUST_ZOOM and gui.ADJUST_STRETCH, or undefined to not take into account the adjust mode.
221
232
  */
222
233
  export function world_to_screen(
223
234
  camera_id: Hash | Url | undefined,
224
235
  world: Vector3,
225
- adjust_mode?:
226
- | typeof gui.ADJUST_FIT
227
- | typeof gui.ADJUST_STRETCH
228
- | typeof gui.ADJUST_ZOOM,
229
236
  ): Vector3;
230
237
 
231
238
  /**
@@ -252,26 +259,6 @@ declare module 'orthographic.camera' {
252
259
  world: Vector3,
253
260
  ): Vector3;
254
261
 
255
- /**
256
- * Add a custom projector that can be used by cameras in your project (see configuration above).
257
- * @param projector_id Id of the projector. Used as a value in the projection field of the camera script.
258
- * @param projector_fn The function to call when a projection matrix is needed for the camera. The function will receive the id, near_z and far_z values of the camera.
259
- */
260
- export function add_projector(
261
- projector_id: Hash,
262
- projector_fn: (id: Hash, near_z: number, far_z: number) => void,
263
- ): void;
264
-
265
- /**
266
- * Set a specific projector for a camera. This must be either one of the predefined projectors (see above) or a custom projector added using `camera.add_projector()`.
267
- * @param camera_id undefined for the first camera
268
- * @param projector_id Id of the projector.
269
- */
270
- export function use_projector(
271
- camera_id: Hash | Url | undefined,
272
- projector_id: Hash,
273
- ): void;
274
-
275
262
  /**
276
263
  * Set window scaling factor (basically retina or no retina screen). There is no built-in way to detect if Defold is running on a retina or non retina screen. This information combined with the High DPI setting in game.project can be used to ensure that the zoom behaves the same way regardless of screen type and High DPI setting. You can use an extension such as DefOS to get the window scaling factor.
277
264
  * @param scaling_factor Current window scaling factor
@@ -288,8 +275,6 @@ declare module 'orthographic.camera' {
288
275
  export const SHAKE_VERTICAL: Hash;
289
276
  export const SHAKE_HORIZONTAL: Hash;
290
277
 
291
- export const ORTHOGRAPHIC_RENDER_SCRIPT_USED: boolean;
292
-
293
278
  export const MSG_DISABLE: Hash;
294
279
  export const MSG_UNFOLLOW: Hash;
295
280
  export const MSG_FOLLOW: Hash;
@@ -302,7 +287,8 @@ declare module 'orthographic.camera' {
302
287
  export const MSG_BOUNDS: Hash;
303
288
  export const MSG_UPDATE_CAMERA: Hash;
304
289
  export const MSG_ZOOM_TO: Hash;
305
- export const MSG_USE_PROJECTION: Hash;
290
+ /** Posted to a camera to turn automatic zoom on or off. */
291
+ export const MSG_SET_AUTOMATIC_ZOOM: Hash;
306
292
  export const MSG_VIEWPORT: Hash;
307
293
  export const MSG_ENABLE: Hash;
308
294
  }
@@ -0,0 +1,155 @@
1
+ /** @noSelfInFile */
2
+ /** @noResolution */
3
+ declare module 'orthographic.camera' {
4
+ /**
5
+ * (synthesized)
6
+ * Defold `orthographic` API namespace.
7
+ */
8
+ export namespace orthographic {
9
+ /**
10
+ * Limits the camera position to within the specified rectangle.
11
+ *
12
+ * @param camera_id - nil for the first camera
13
+ * @param left - Left edge of the camera bounds
14
+ * @param top - Top edge of camera bounds
15
+ * @param right - Right edge of camera bounds
16
+ * @param bottom - Bottom edge of camera bounds
17
+ */
18
+ function bounds(camera_id: Hash | Url | undefined, left: number, top: number, right: number, bottom: number): void;
19
+ /**
20
+ * If following a game object this will add a deadzone around the camera position where the camera position will not update. If the target moves to the edge of the deadzone the camera will start to follow until the target returns within the bounds of the deadzone.
21
+ *
22
+ * @param camera_id - nil for the first camera
23
+ * @param left - Number of pixels to the left of the camera
24
+ * @param top - Number of pixels above the camera
25
+ * @param right - Number of pixels to the right of the camera
26
+ * @param bottom - Number of pixels below the camera
27
+ */
28
+ function deadzone(camera_id: Hash | Url | undefined, left: number, top: number, right: number, bottom: number): void;
29
+ /**
30
+ * Follow one or more game objects. When following multiple objects the camera will follow the center point between the objects.
31
+ *
32
+ * @param camera_id - nil for the first camera
33
+ * @param targets - Game object(s) to follow
34
+ * @param options - Options (see below)
35
+ */
36
+ function follow(camera_id: Hash | Url | undefined, targets: Hash | Url | Record<string | number, unknown>, options?: Record<string | number, unknown>): void;
37
+ /**
38
+ * Change the camera follow offset.
39
+ *
40
+ * @param camera_id - nil for the first camera
41
+ * @param offset - Camera offset from target position.
42
+ */
43
+ function follow_offset(camera_id: Hash | Url | undefined, offset: Vector3): void;
44
+ /**
45
+ * Get if the camera is configured to use automatic zoom level.
46
+ *
47
+ * @returns True if automatic zoom is enabled
48
+ */
49
+ function get_automatic_zoom(): boolean;
50
+ /**
51
+ * Get the display size, as specified in game.project.
52
+ */
53
+ function get_display_size(): LuaMultiReturn<[number, number]>;
54
+ /**
55
+ * Get the current offset of the camera (caused by shake or recoil)
56
+ *
57
+ * @param camera_id - nil for the first camera
58
+ * @returns The current offset of the camera
59
+ */
60
+ function get_offset(camera_id?: Hash | Url): Vector3;
61
+ /**
62
+ * Get the current projection of the camera.
63
+ *
64
+ * @param camera_id - nil for the first camera
65
+ * @returns The current projection
66
+ */
67
+ function get_projection(camera_id?: Hash | Url): Matrix4;
68
+ /**
69
+ * Get the current view of the camera.
70
+ *
71
+ * @param camera_id - nil for the first camera
72
+ * @returns The current view
73
+ */
74
+ function get_view(camera_id?: Hash | Url): Matrix4;
75
+ /**
76
+ * Get the current viewport of the camera.
77
+ *
78
+ * @param camera_id - nil for the first camera
79
+ */
80
+ function get_viewport(camera_id?: Hash | Url): LuaMultiReturn<[number, number, number, number]>;
81
+ /**
82
+ * Get the current window size. The default values will be the ones specified in game.project.
83
+ */
84
+ function get_window_size(): LuaMultiReturn<[number, number]>;
85
+ /**
86
+ * Get the current zoom level of the camera.
87
+ *
88
+ * @param camera_id - nil for the first camera
89
+ * @returns The current zoom of the camera
90
+ */
91
+ function get_zoom(camera_id?: Hash | Url): number;
92
+ /**
93
+ * Apply a recoil effect to the camera. The recoil will decay using linear interpolation.
94
+ *
95
+ * @param offset - Offset to apply to the camera. Defaults to 0.05
96
+ * @param duration - Duration of the recoil, in seconds. Defaults to 0.5
97
+ */
98
+ function recoil(camera_id: Hash | Url, offset: Vector3, duration?: number): void;
99
+ /**
100
+ * Translate screen coordinates to world coordinates, based on the view and projection of the camera.
101
+ *
102
+ * @param camera_id - nil for the first camera
103
+ * @param screen - Screen coordinates to convert
104
+ * @returns World coordinates
105
+ */
106
+ function screen_to_world(camera_id: Hash | Url | undefined, screen: Vector3): Vector3;
107
+ /**
108
+ * Translate screen boundaries (corners) to world coordinates, based on the view and projection of the camera.
109
+ *
110
+ * @param camera_id - nil for the first camera
111
+ * @returns Screen bounds (x = left, y = top, z = right, w = bottom)
112
+ */
113
+ function screen_to_world_bounds(camera_id?: Hash | Url): Vector4;
114
+ /**
115
+ * Set if the camera should use automatic zoom level.
116
+ *
117
+ * @param enabled - True if automatic zoom should be enabled
118
+ */
119
+ function set_automatic_zoom(enabled: boolean): void;
120
+ /**
121
+ * Change the zoom level of the camera.
122
+ *
123
+ * @param camera_id - nil for the first camera
124
+ * @param zoom - The new zoom level of the camera
125
+ */
126
+ function set_zoom(camera_id: Hash | Url | undefined, zoom: number): void;
127
+ /**
128
+ * Shake the camera.
129
+ *
130
+ * @param intensity - Intensity of the shake, in percent of screen. Defaults to 0.05
131
+ * @param duration - Duration of the shake, in seconds. Defaults to 0.5
132
+ * @param direction - Direction of the shake. Possible values: `both`, `horizontal`, `vertical`. Defaults to `both`.
133
+ * @param cb - Function to call when the shake has finished. Optional.
134
+ */
135
+ function shake(camera_id: Hash | Url, intensity?: number, duration?: number, direction?: Hash, cb?: (...args: unknown[]) => unknown): void;
136
+ /**
137
+ * Stop shaking the camera.
138
+ */
139
+ function stop_shaking(camera_id: Hash | Url): void;
140
+ /**
141
+ * Stop following a game object.
142
+ *
143
+ * @param camera_id - nil for the first camera
144
+ */
145
+ function unfollow(camera_id?: Hash | Url): void;
146
+ /**
147
+ * Translate world coordinates to screen coordinates, based on the view and projection of the camera. This is useful when manually culling game objects and you need to determine if a world coordinate will be visible or not. It can also be used to position gui nodes on top of game objects.
148
+ *
149
+ * @param camera_id - nil for the first camera
150
+ * @param world - World coordinates to convert
151
+ * @returns Screen coordinates
152
+ */
153
+ function world_to_screen(camera_id: Hash | Url | undefined, world: Vector3): Vector3;
154
+ }
155
+ }
@@ -0,0 +1,170 @@
1
+ /** @noResolution */
2
+ declare module 'panthera.panthera' {
3
+ interface panthera_animation {
4
+ adapter: panthera_adapter;
5
+ speed: number;
6
+ current_time: number;
7
+ nodes: LuaTable;
8
+ childs?: panthera_animation[] | undefined;
9
+ get_node: (node_id: string) => Opaque<"node">;
10
+ animation_id?: string | undefined;
11
+ previous_animation_id?: string | undefined;
12
+ animation_path: string;
13
+ animation_keys_index: number;
14
+ events?: LuaTable | undefined;
15
+ timer_id?: number | undefined;
16
+ }
17
+ interface panthera_options {
18
+ is_loop?: boolean | undefined;
19
+ is_skip_init?: boolean | undefined;
20
+ is_detached?: boolean | undefined;
21
+ speed?: number | undefined;
22
+ easing?: string | Opaque<"constant"> | undefined;
23
+ callback?: ((animation_id: string) => undefined) | undefined;
24
+ callback_event?: ((event_id: string, node: Opaque<"node"> | undefined, string_value: string, number_value: number) => undefined) | undefined;
25
+ }
26
+ interface panthera_options_tweener {
27
+ speed?: number | undefined;
28
+ is_loop?: boolean | undefined;
29
+ easing?: string | Opaque<"constant"> | undefined;
30
+ callback?: ((animation_id: string) => undefined) | undefined;
31
+ callback_event?: ((event_id: string, node: Opaque<"node"> | undefined, string_value: string, number_value: number) => undefined) | undefined;
32
+ is_reverse?: boolean | undefined;
33
+ from?: number | undefined;
34
+ to?: number | undefined;
35
+ }
36
+ interface panthera {
37
+ SPEED: number;
38
+ }
39
+ interface panthera_adapter {
40
+ get_node: (node_id: string) => Opaque<"node">;
41
+ get_easing: (easing_id: string) => Hash;
42
+ tween_animation_key: (node: Opaque<"node">, property_id: string, easing: Hash | number[], duration: number, end_value: number) => undefined;
43
+ trigger_animation_key: (node: Opaque<"node">, property_id: string, value: unknown) => undefined;
44
+ event_animation_key: (node: Opaque<"node">, key: panthera_animation_data_animation_key) => undefined;
45
+ set_node_property: (node: Opaque<"node">, property_id: string, value: number | string) => boolean;
46
+ stop_tween: (node: Opaque<"node">, property_id: string) => undefined;
47
+ is_node_valid: (node: Opaque<"node">) => boolean;
48
+ }
49
+ interface panthera_logger {
50
+ trace: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
51
+ debug: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
52
+ info: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
53
+ warn: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
54
+ error: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
55
+ }
56
+ interface panthera_animation_data_node {
57
+ }
58
+ interface panthera_animation_data_metadata {
59
+ gui_path: string;
60
+ fps: number;
61
+ settings: LuaTable;
62
+ gizmo_steps: LuaTable;
63
+ template_animation_paths: LuaTable<string, string>;
64
+ }
65
+ interface panthera_animation_data_animation {
66
+ duration: number;
67
+ animation_id: string;
68
+ initial_state: string;
69
+ animation_keys: panthera_animation_data_animation_key[];
70
+ }
71
+ interface panthera_animation_data {
72
+ name: string;
73
+ nodes: panthera_animation_data_node[];
74
+ animations: panthera_animation_data_animation[];
75
+ metadata: panthera_animation_data_metadata;
76
+ group_animation_keys: LuaTable<string, LuaTable<string, LuaTable<string, panthera_animation_data_animation_key[]>>>;
77
+ animations_dict: LuaTable<string, panthera_animation_data_animation>;
78
+ }
79
+ interface panthera_animation_project_file {
80
+ data: panthera_animation_data;
81
+ format: string;
82
+ version: string;
83
+ type: string;
84
+ }
85
+ interface panthera_animation_data_animation_key {
86
+ key_type: number;
87
+ node_id: string;
88
+ property_id: string;
89
+ start_time: number;
90
+ duration: number;
91
+ start_value: number;
92
+ end_value: number;
93
+ easing: string;
94
+ easing_custom?: number[] | Vector | undefined;
95
+ start_data: string;
96
+ data: string;
97
+ event_id: string;
98
+ is_editor_only: boolean;
99
+ }
100
+ /**
101
+ * Customize the logging mechanism used by Panthera Runtime. You can use Defold Log library or provide a custom logger.
102
+ */
103
+ export function set_logger(this: void, logger_instance?: panthera_logger | LuaTable | undefined): void;
104
+ /**
105
+ * Load and create a game object animation state from a Lua table or JSON file.
106
+ */
107
+ export function create_go(this: void, animation_or_path: string | LuaTable, collection_name?: string | undefined, objects?: LuaTable<string | Hash, string | Hash> | undefined): panthera_animation;
108
+ /**
109
+ * Load and create a GUI animation state from a Lua table or JSON file.
110
+ */
111
+ export function create_gui(this: void, animation_or_path: string | LuaTable, template?: string | undefined, nodes?: LuaTable<string | Hash, Opaque<"node">> | undefined): panthera_animation;
112
+ /**
113
+ * Load an animation from a Lua table or JSON file and create an animation state using a specified adapter.
114
+ */
115
+ export function create(this: void, animation_or_path: string | LuaTable, adapter: panthera_adapter, get_node: (node_id: string) => Opaque<"node">): panthera_animation;
116
+ /**
117
+ * Clone an existing animation state object, enabling multiple instances of the same animation to play simultaneously or independently.
118
+ */
119
+ export function clone_state(this: void, animation_state: panthera_animation): panthera_animation;
120
+ /**
121
+ * Play an animation with specified ID and options.
122
+ */
123
+ export function play(this: void, animation_state: panthera_animation, animation_id: string, options?: panthera_options | undefined): void;
124
+ /**
125
+ * Play animation with easing support using tweener. Allows for non-linear animation playback with custom easing functions.
126
+ */
127
+ export function play_tweener(this: void, animation_state: panthera_animation, animation_id: string, options?: panthera_options_tweener | undefined): void;
128
+ /**
129
+ * Play animation as a child of the current animation state, allowing multiple animations to run independently and simultaneously.
130
+ *
131
+ * This creates a detached animation that runs in parallel with the main animation state without affecting it.
132
+ * The child animation will be automatically cleaned up when it completes.
133
+ */
134
+ export function play_detached(this: void, animation_state: panthera_animation, animation_id: string, options?: panthera_options | undefined): void;
135
+ /**
136
+ * Set the current time of an animation. This function stops any currently playing animation.
137
+ */
138
+ export function set_time(this: void, animation_state: panthera_animation, animation_id: string, time: number, event_callback?: ((event_id: string, node: Opaque<"node"> | undefined, string_value: string, number_value: number) => void) | undefined): boolean;
139
+ /**
140
+ * Retrieve the current playback time in seconds of an animation. If the animation is not playing, the function returns 0.
141
+ */
142
+ export function get_time(this: void, animation_state: panthera_animation): number;
143
+ /**
144
+ * Stop a currently playing animation. The animation will be stopped at current time.
145
+ */
146
+ export function stop(this: void, animation_state: panthera_animation): boolean;
147
+ /**
148
+ * Retrieve the total duration of a specific animation.
149
+ */
150
+ export function get_duration(this: void, animation_state: panthera_animation, animation_id: string): number;
151
+ /**
152
+ * Check if an animation is currently playing.
153
+ */
154
+ export function is_playing(this: void, animation_state: panthera_animation): boolean;
155
+ /**
156
+ * Get the ID of the last animation that was started.
157
+ */
158
+ export function get_latest_animation_id(this: void, animation_state: panthera_animation): string | undefined;
159
+ /**
160
+ * Return a list of animation IDs from the created animation state.
161
+ */
162
+ export function get_animations(this: void, animation_state: panthera_animation): string[];
163
+ /**
164
+ * Reload animations from JSON files, useful for development and debugging.
165
+ *
166
+ * The animations loaded from Lua tables will not be reloaded.
167
+ * Animation will be reloaded only at desktop.
168
+ */
169
+ export function reload_animation(this: void, animation_path?: string | undefined): void;
170
+ }
@@ -31,4 +31,7 @@ declare module 'persist.persist' {
31
31
  * Returns an `object`, or `undefined` if the file does not exist.
32
32
  */
33
33
  export function load(file_name: string): {} | undefined;
34
+
35
+ /** Checks if a file exists. */
36
+ export function exists(file_name: string): boolean;
34
37
  }
@@ -67,6 +67,15 @@ declare module 'platypus.platypus' {
67
67
  export const DOUBLE_JUMP: Hash;
68
68
  export const WALL_SLIDE: Hash;
69
69
 
70
+ /** Value for `collisions.separation` selecting raycast separation. */
71
+ export const SEPARATION_RAYS: Hash;
72
+ /**
73
+ * Value for `collisions.separation` selecting shape separation. Platypus warns
74
+ * at runtime that this mode is no longer supported and only raycast separation
75
+ * is; the constant still exists.
76
+ */
77
+ export const SEPARATION_SHAPES: Hash;
78
+
70
79
  type Direction = number;
71
80
  export const DIR_UP: Direction;
72
81
  export const DIR_LEFT: Direction;
@@ -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
+ }