@defold-typescript/types 0.25.0 → 0.27.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 (80) hide show
  1. package/api-availability.json +333 -306
  2. package/api-signatures.json +1312 -0
  3. package/api-targets.json +351 -2
  4. package/examples/translations.json +1984 -0
  5. package/fixtures/messages_doc.json +880 -0
  6. package/generated/collectionproxy.d.ts +22 -0
  7. package/generated/editor-vm/http.d.ts +2 -2
  8. package/generated/editor-vm/image.d.ts +48 -0
  9. package/generated/editor.d.ts +27 -8
  10. package/generated/gui.d.ts +35 -6
  11. package/generated/kinds/editor-script.d.ts +1 -0
  12. package/generated/material.d.ts +4 -0
  13. package/generated/versions/defold-1.12.4/liveupdate.d.ts +22 -22
  14. package/generated/versions/defold-1.12.4/physics.d.ts +78 -75
  15. package/generated/versions/defold-1.12.4/render.d.ts +75 -55
  16. package/generated/versions/defold-1.12.4/resource.d.ts +187 -175
  17. package/generated/versions/defold-1.13.0/b2d.d.ts +33 -0
  18. package/generated/versions/defold-1.13.0/b2d_body.d.ts +676 -0
  19. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +106 -0
  20. package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +155 -0
  21. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +823 -0
  22. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +215 -0
  23. package/generated/versions/defold-1.13.0/b2d_world.d.ts +314 -0
  24. package/generated/versions/defold-1.13.0/buffer.d.ts +176 -0
  25. package/generated/versions/defold-1.13.0/camera.d.ts +302 -0
  26. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +146 -0
  27. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +71 -0
  28. package/generated/versions/defold-1.13.0/compute.d.ts +306 -0
  29. package/generated/versions/defold-1.13.0/crash.d.ts +143 -0
  30. package/generated/versions/defold-1.13.0/editor-vm/http.d.ts +56 -0
  31. package/generated/versions/defold-1.13.0/editor-vm/json.d.ts +10 -0
  32. package/generated/versions/defold-1.13.0/editor-vm/localization.d.ts +42 -0
  33. package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +80 -0
  34. package/generated/versions/defold-1.13.0/editor-vm/zip.d.ts +10 -0
  35. package/generated/versions/defold-1.13.0/editor-vm/zlib.d.ts +24 -0
  36. package/generated/versions/defold-1.13.0/editor.d.ts +1092 -0
  37. package/generated/versions/defold-1.13.0/factory.d.ts +123 -0
  38. package/generated/versions/defold-1.13.0/font.d.ts +81 -0
  39. package/generated/versions/defold-1.13.0/go.d.ts +1054 -0
  40. package/generated/versions/defold-1.13.0/graphics.d.ts +321 -0
  41. package/generated/versions/defold-1.13.0/gui.d.ts +2370 -0
  42. package/generated/versions/defold-1.13.0/html5.d.ts +53 -0
  43. package/generated/versions/defold-1.13.0/http.d.ts +84 -0
  44. package/generated/versions/defold-1.13.0/iac.d.ts +18 -0
  45. package/generated/versions/defold-1.13.0/iap.d.ts +60 -0
  46. package/generated/versions/defold-1.13.0/image.d.ts +139 -0
  47. package/generated/versions/defold-1.13.0/index.d.ts +48 -0
  48. package/generated/versions/defold-1.13.0/json.d.ts +76 -0
  49. package/generated/versions/defold-1.13.0/kinds/editor-script.d.ts +13 -0
  50. package/generated/versions/defold-1.13.0/label.d.ts +94 -0
  51. package/generated/versions/defold-1.13.0/liveupdate.d.ts +140 -0
  52. package/generated/versions/defold-1.13.0/material.d.ts +444 -0
  53. package/generated/versions/defold-1.13.0/model.d.ts +246 -0
  54. package/generated/versions/defold-1.13.0/msg.d.ts +10 -0
  55. package/generated/versions/defold-1.13.0/particlefx.d.ts +166 -0
  56. package/generated/versions/defold-1.13.0/physics.d.ts +548 -0
  57. package/generated/versions/defold-1.13.0/profiler.d.ts +233 -0
  58. package/generated/versions/defold-1.13.0/push.d.ts +66 -0
  59. package/generated/versions/defold-1.13.0/render.d.ts +1185 -0
  60. package/generated/versions/defold-1.13.0/resource.d.ts +1530 -0
  61. package/generated/versions/defold-1.13.0/socket.d.ts +795 -0
  62. package/generated/versions/defold-1.13.0/sound.d.ts +291 -0
  63. package/generated/versions/defold-1.13.0/sprite.d.ts +157 -0
  64. package/generated/versions/defold-1.13.0/sys.d.ts +695 -0
  65. package/generated/versions/defold-1.13.0/tilemap.d.ts +195 -0
  66. package/generated/versions/defold-1.13.0/timer.d.ts +114 -0
  67. package/generated/versions/defold-1.13.0/types.d.ts +61 -0
  68. package/generated/versions/defold-1.13.0/vmath.d.ts +806 -0
  69. package/generated/versions/defold-1.13.0/webview.d.ts +68 -0
  70. package/generated/versions/defold-1.13.0/window.d.ts +198 -0
  71. package/generated/versions/defold-1.13.0/zlib.d.ts +40 -0
  72. package/index.d.ts +4 -81
  73. package/package.json +11 -3
  74. package/scripts/import-defold-release.ts +28 -1
  75. package/scripts/sync-api-docs.ts +4 -3
  76. package/src/api-availability.ts +0 -0
  77. package/src/emit-dts.ts +6 -0
  78. package/src/example-store.ts +5 -0
  79. package/src/index.ts +3 -0
  80. package/scripts/lua-types-signature-index.ts +0 -151
@@ -0,0 +1,106 @@
1
+ /** @noSelfInFile */
2
+ import type { Opaque } from "../../../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Functions for Box2D v3 chains. A chain owns multiple connected segment
7
+ * shapes, so it is represented by a separate `b2Chain` handle.
8
+ */
9
+ namespace b2d.chain {
10
+ type b2Chain = Opaque<"b2Chain">;
11
+ /**
12
+ * Destroying a chain removes all segment shapes owned by the chain. Destroying
13
+ * any segment shape through `b2d.body.destroy_shape` also destroys its parent chain.
14
+ *
15
+ * @param chain - chain
16
+ */
17
+ function destroy(chain: Opaque<"b2Chain">): void;
18
+ /**
19
+ * Returns `nil` if the shape is not a chain segment.
20
+ *
21
+ * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
22
+ * @returns parent chain, or `nil` if the shape is not a chain segment
23
+ */
24
+ function from_shape(shape_id: Opaque<"b2Shape">): Opaque<"b2Chain"> | undefined;
25
+ /**
26
+ * Get chain friction.
27
+ *
28
+ * @param chain - chain
29
+ * @returns chain friction
30
+ */
31
+ function get_friction(chain: Opaque<"b2Chain">): number;
32
+ /**
33
+ * Returns a chain geometry table with `loop`, `segment_count`, and `vertices`.
34
+ * Open chains also include `prev_vertex` and `next_vertex` ghost vertices.
35
+ *
36
+ * @param chain - chain
37
+ * @returns chain geometry table
38
+ */
39
+ function get_geometry(chain: Opaque<"b2Chain">): Record<string | number, unknown>;
40
+ /**
41
+ * Get chain material id.
42
+ *
43
+ * @param chain - chain
44
+ * @returns chain material id
45
+ */
46
+ function get_material(chain: Opaque<"b2Chain">): number;
47
+ /**
48
+ * Get chain restitution.
49
+ *
50
+ * @param chain - chain
51
+ * @returns chain restitution
52
+ */
53
+ function get_restitution(chain: Opaque<"b2Chain">): number;
54
+ /**
55
+ * Get the number of segment shapes in a chain.
56
+ *
57
+ * @param chain - chain
58
+ * @returns segment count
59
+ */
60
+ function get_segment_count(chain: Opaque<"b2Chain">): number;
61
+ /**
62
+ * Get the segment shapes owned by a chain.
63
+ *
64
+ * @param chain - chain
65
+ * @returns array of shape info tables for the chain segments. Each entry includes `shape_id`.
66
+ */
67
+ function get_segments(chain: Opaque<"b2Chain">): { shape_id: number }[];
68
+ /**
69
+ * Get the world owning a chain.
70
+ *
71
+ * @param chain - chain
72
+ * @returns owning world
73
+ */
74
+ function get_world(chain: Opaque<"b2Chain">): Opaque<"b2World">;
75
+ /**
76
+ * Validate a chain handle.
77
+ *
78
+ * @param chain - chain
79
+ * @returns true if the chain handle still refers to a live Box2D chain
80
+ */
81
+ function is_valid(chain: Opaque<"b2Chain">): boolean;
82
+ /**
83
+ * Set chain friction.
84
+ *
85
+ * @param chain - chain
86
+ * @param friction - chain friction
87
+ */
88
+ function set_friction(chain: Opaque<"b2Chain">, friction: number): void;
89
+ /**
90
+ * Set chain material id.
91
+ *
92
+ * @param chain - chain
93
+ * @param material - chain material id
94
+ */
95
+ function set_material(chain: Opaque<"b2Chain">, material: number): void;
96
+ /**
97
+ * Set chain restitution.
98
+ *
99
+ * @param chain - chain
100
+ * @param restitution - chain restitution
101
+ */
102
+ function set_restitution(chain: Opaque<"b2Chain">, restitution: number): void;
103
+ }
104
+ }
105
+
106
+ export {};
@@ -0,0 +1,155 @@
1
+ /** @noSelfInFile */
2
+ import type { Opaque, Vector3 } from "../../../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Functions for interacting with fixtures attached to Box2D bodies.
7
+ * Fixtures are addressed functionally by `(body, fixture_index)` rather than persistent Lua handles.
8
+ */
9
+ namespace b2d.fixture {
10
+ /**
11
+ * Get fixture AABB for a child shape.
12
+ *
13
+ * @param body - body
14
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
15
+ * @param child_index - 1-based child shape index
16
+ * @returns table with `lower` and `upper`
17
+ */
18
+ function get_aabb(body: Opaque<"b2Body">, fixture_index: number, child_index: number): { lower: Vector3; upper: Vector3 };
19
+ /**
20
+ * Get fixture density.
21
+ *
22
+ * @param body - body
23
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
24
+ * @returns density in kg/m^2
25
+ */
26
+ function get_density(body: Opaque<"b2Body">, fixture_index: number): number;
27
+ /**
28
+ * Get fixture filter data for a child shape.
29
+ *
30
+ * @param body - body
31
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
32
+ * @param child_index - 1-based child shape index
33
+ * @returns table with `category_bits`, `mask_bits`, and `group_index`
34
+ */
35
+ function get_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number): { category_bits: number; mask_bits: number; group_index: number };
36
+ /**
37
+ * Get fixture friction.
38
+ *
39
+ * @param body - body
40
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
41
+ */
42
+ function get_friction(body: Opaque<"b2Body">, fixture_index: number): number;
43
+ /**
44
+ * Get fixture restitution.
45
+ *
46
+ * @param body - body
47
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
48
+ */
49
+ function get_restitution(body: Opaque<"b2Body">, fixture_index: number): number;
50
+ /**
51
+ * Get the fixture shape as a functional shape table.
52
+ *
53
+ * @param body - body
54
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
55
+ * @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`,
56
+ * suitable for reuse in `b2d.body.create_fixture`.
57
+ * Circle shapes use `radius` and `center`, edge shapes use `v1`, `v2`, optional `v0`, `v3`,
58
+ * polygon shapes use `vertices`, and chain shapes use `vertices`, `loop`, optional `prev_vertex`, and `next_vertex`.
59
+ * Any angle values are in radians.
60
+ */
61
+ function get_shape(body: Opaque<"b2Body">, fixture_index: number): { type: number; radius?: number; center?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; vertices?: Vector3[]; hx?: number; hy?: number; angle?: number; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 };
62
+ /**
63
+ * Get the fixture type.
64
+ *
65
+ * @param body - body
66
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
67
+ */
68
+ function get_type(body: Opaque<"b2Body">, fixture_index: number): number;
69
+ /**
70
+ * Check if a fixture is a sensor.
71
+ *
72
+ * @param body - body
73
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
74
+ */
75
+ function is_sensor(body: Opaque<"b2Body">, fixture_index: number): boolean;
76
+ /**
77
+ * Refilter a fixture.
78
+ *
79
+ * @param body - body
80
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
81
+ * @param touch_proxies - if true, touch broad-phase proxies
82
+ */
83
+ function refilter(body: Opaque<"b2Body">, fixture_index: number, touch_proxies: boolean): void;
84
+ /**
85
+ * Set fixture density.
86
+ *
87
+ * @param body - body
88
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
89
+ * @param density - density in kg/m^2
90
+ * @param update_mass - if true, reset body mass data after the change
91
+ */
92
+ function set_density(body: Opaque<"b2Body">, fixture_index: number, density: number, update_mass: boolean): void;
93
+ /**
94
+ * Set fixture filter data for a child shape.
95
+ *
96
+ * @param body - body
97
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
98
+ * @param child_index - 1-based child shape index
99
+ * @param filter - table with `category_bits`, `mask_bits`, and `group_index`
100
+ */
101
+ function set_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number, filter: { category_bits?: number; mask_bits?: number; group_index?: number }): void;
102
+ /**
103
+ * Set fixture friction.
104
+ *
105
+ * @param body - body
106
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
107
+ */
108
+ function set_friction(body: Opaque<"b2Body">, fixture_index: number, friction: number): void;
109
+ /**
110
+ * Set fixture restitution.
111
+ *
112
+ * @param body - body
113
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
114
+ */
115
+ function set_restitution(body: Opaque<"b2Body">, fixture_index: number, restitution: number): void;
116
+ /**
117
+ * Set sensor mode for a fixture.
118
+ *
119
+ * @param body - body
120
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
121
+ */
122
+ function set_sensor(body: Opaque<"b2Body">, fixture_index: number, enabled: boolean): void;
123
+ /**
124
+ * This updates the existing Box2D v2 shape using the same table format as
125
+ * `b2d.body.create_fixture` and `b2d.fixture.get_shape`.
126
+ * The shape type must match the current fixture shape type. Polygon updates must
127
+ * keep the same vertex count. Chain shape geometry cannot be updated in-place.
128
+ * The body mass is not updated unless `update_mass` is true.
129
+ *
130
+ * @param body - body
131
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
132
+ * @param shape - shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
133
+ * @param update_mass - if true, reset body mass data after the change
134
+ * @example
135
+ * ```ts
136
+ * const body = b2d.get_body("#collisionobject");
137
+ * const circle = b2d.fixture.get_shape(body, 1);
138
+ * circle.center = vmath.vector3(24, 0, 0);
139
+ * b2d.fixture.set_shape(body, 1, circle, true);
140
+ * b2d.fixture.set_shape(body, 2, { type: b2d.shape.SHAPE_TYPE_EDGE, v1: vmath.vector3(-32, 0, 0), v2: vmath.vector3(32, 0, 0) });
141
+ * ```
142
+ */
143
+ function set_shape(body: Opaque<"b2Body">, fixture_index: number, shape: { type?: number; radius?: number; center?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; vertices?: Vector3[]; hx?: number; hy?: number; angle?: number; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, update_mass: boolean): void;
144
+ /**
145
+ * Test a point against a fixture.
146
+ *
147
+ * @param body - body
148
+ * @param fixture_index - 1-based fixture index from `b2d.body.get_fixtures`
149
+ * @param point - point in world coordinates
150
+ */
151
+ function test_point(body: Opaque<"b2Body">, fixture_index: number, point: Vector3): boolean;
152
+ }
153
+ }
154
+
155
+ export {};