@defold-typescript/types 0.49.0 → 0.50.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.
- package/api-availability.json +696 -624
- package/api-signatures.json +6799 -160
- package/api-targets.json +393 -2
- package/examples/translations.json +12 -0
- package/generated/b2d.d.ts +15 -0
- package/generated/bullet3d.d.ts +16 -0
- package/generated/font.d.ts +7 -3
- package/generated/graphics.d.ts +7 -0
- package/generated/gui.d.ts +5 -4
- package/generated/label.d.ts +3 -3
- package/generated/render.d.ts +16 -1
- package/generated/versions/defold-1.13.2/b2d.d.ts +709 -0
- package/generated/versions/defold-1.13.2/b2d_body.d.ts +593 -0
- package/generated/versions/defold-1.13.2/b2d_chain.d.ts +105 -0
- package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +175 -0
- package/generated/versions/defold-1.13.2/b2d_joint.d.ts +1301 -0
- package/generated/versions/defold-1.13.2/b2d_shape.d.ts +423 -0
- package/generated/versions/defold-1.13.2/b2d_world.d.ts +308 -0
- package/generated/versions/defold-1.13.2/buffer.d.ts +192 -0
- package/generated/versions/defold-1.13.2/bullet3d.d.ts +91 -0
- package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +433 -0
- package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +818 -0
- package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +429 -0
- package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +123 -0
- package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +492 -0
- package/generated/versions/defold-1.13.2/camera.d.ts +300 -0
- package/generated/versions/defold-1.13.2/collectionfactory.d.ts +148 -0
- package/generated/versions/defold-1.13.2/collectionproxy.d.ts +109 -0
- package/generated/versions/defold-1.13.2/compute.d.ts +107 -0
- package/generated/versions/defold-1.13.2/crash.d.ts +157 -0
- package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +139 -0
- package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +48 -0
- package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +21 -0
- package/generated/versions/defold-1.13.2/editor-vm/localization.d.ts +42 -0
- package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +126 -0
- package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +38 -0
- package/generated/versions/defold-1.13.2/editor-vm/zlib.d.ts +24 -0
- package/generated/versions/defold-1.13.2/editor.d.ts +2177 -0
- package/generated/versions/defold-1.13.2/factory.d.ts +121 -0
- package/generated/versions/defold-1.13.2/font.d.ts +123 -0
- package/generated/versions/defold-1.13.2/go.d.ts +1166 -0
- package/generated/versions/defold-1.13.2/graphics.d.ts +613 -0
- package/generated/versions/defold-1.13.2/gui.d.ts +2212 -0
- package/generated/versions/defold-1.13.2/html5.d.ts +55 -0
- package/generated/versions/defold-1.13.2/http.d.ts +83 -0
- package/generated/versions/defold-1.13.2/image.d.ts +181 -0
- package/generated/versions/defold-1.13.2/index.d.ts +63 -0
- package/generated/versions/defold-1.13.2/json.d.ts +94 -0
- package/generated/versions/defold-1.13.2/kinds/editor-script.d.ts +14 -0
- package/generated/versions/defold-1.13.2/label.d.ts +164 -0
- package/generated/versions/defold-1.13.2/liveupdate.d.ts +143 -0
- package/generated/versions/defold-1.13.2/material.d.ts +490 -0
- package/generated/versions/defold-1.13.2/model.d.ts +287 -0
- package/generated/versions/defold-1.13.2/msg.d.ts +10 -0
- package/generated/versions/defold-1.13.2/particlefx.d.ts +155 -0
- package/generated/versions/defold-1.13.2/physics.d.ts +789 -0
- package/generated/versions/defold-1.13.2/profiler.d.ts +228 -0
- package/generated/versions/defold-1.13.2/render.d.ts +1153 -0
- package/generated/versions/defold-1.13.2/resource.d.ts +1628 -0
- package/generated/versions/defold-1.13.2/socket.d.ts +797 -0
- package/generated/versions/defold-1.13.2/sound.d.ts +323 -0
- package/generated/versions/defold-1.13.2/sprite.d.ts +179 -0
- package/generated/versions/defold-1.13.2/sys.d.ts +754 -0
- package/generated/versions/defold-1.13.2/tilemap.d.ts +206 -0
- package/generated/versions/defold-1.13.2/timer.d.ts +136 -0
- package/generated/versions/defold-1.13.2/types.d.ts +61 -0
- package/generated/versions/defold-1.13.2/vmath.d.ts +775 -0
- package/generated/versions/defold-1.13.2/window.d.ts +196 -0
- package/generated/versions/defold-1.13.2/zlib.d.ts +41 -0
- package/identity-vocabulary.json +1 -0
- package/package.json +2 -2
- package/scripts/import-defold-release.ts +3 -31
- package/scripts/materialize-version.ts +13 -7
- package/scripts/regen.ts +63 -29
- package/scripts/sync-api-docs.ts +31 -2
- package/src/emit-dts.ts +25 -3
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import type { Hash, Quaternion, Url, Vector3 } from "../../../src/core-types";
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
/**
|
|
6
|
+
* Functions for controlling factory components which are used to
|
|
7
|
+
* dynamically spawn game objects into the runtime.
|
|
8
|
+
*/
|
|
9
|
+
namespace factory {
|
|
10
|
+
type Status = typeof factory.STATUS_UNLOADED | typeof factory.STATUS_LOADING | typeof factory.STATUS_LOADED;
|
|
11
|
+
type STATUS = typeof factory.STATUS_LOADED | typeof factory.STATUS_LOADING | typeof factory.STATUS_UNLOADED;
|
|
12
|
+
/**
|
|
13
|
+
* The factory resources are loaded.
|
|
14
|
+
*/
|
|
15
|
+
const STATUS_LOADED: number & { readonly __brand: "factory.STATUS_LOADED" };
|
|
16
|
+
/**
|
|
17
|
+
* The factory resources are loading.
|
|
18
|
+
*/
|
|
19
|
+
const STATUS_LOADING: number & { readonly __brand: "factory.STATUS_LOADING" };
|
|
20
|
+
/**
|
|
21
|
+
* The factory resources are unloaded.
|
|
22
|
+
*/
|
|
23
|
+
const STATUS_UNLOADED: number & { readonly __brand: "factory.STATUS_UNLOADED" };
|
|
24
|
+
/**
|
|
25
|
+
* The URL identifies which factory should create the game object.
|
|
26
|
+
* If the game object is created inside of the frame (e.g. from an update callback), the game object will be created instantly, but none of its component will be updated in the same frame.
|
|
27
|
+
* Properties defined in scripts in the created game object can be overridden through the properties-parameter below.
|
|
28
|
+
* See go.property for more information on script properties.
|
|
29
|
+
* Calling factory.create on a factory that is marked as dynamic without having loaded resources
|
|
30
|
+
* using factory.load will synchronously load and create resources which may affect application performance.
|
|
31
|
+
*
|
|
32
|
+
* @param url - the factory that should create a game object.
|
|
33
|
+
* @param position - the position of the new game object, the position of the game object calling `factory.create()` is used by default, or if the value is `nil`.
|
|
34
|
+
* @param rotation - the rotation of the new game object, the rotation of the game object calling `factory.create()` is used by default, or if the value is `nil`.
|
|
35
|
+
* @param properties - the properties defined in a script attached to the new game object.
|
|
36
|
+
* @param scale - the scale of the new game object (must be greater than 0), the scale of the game object containing the factory is used by default, or if the value is `nil`
|
|
37
|
+
* @returns the global id of the spawned game object
|
|
38
|
+
* @example
|
|
39
|
+
* How to create a new game object:
|
|
40
|
+
* ```ts
|
|
41
|
+
* export default defineScript({
|
|
42
|
+
* init(self) {
|
|
43
|
+
* // create a new game object and provide property values
|
|
44
|
+
* const created = factory.create("#factory", undefined, undefined, { my_value: 1 });
|
|
45
|
+
* // communicate with the object
|
|
46
|
+
* msg.post(created, "hello");
|
|
47
|
+
* },
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
* @example
|
|
51
|
+
* And then let the new game object have a script attached:
|
|
52
|
+
* ```ts
|
|
53
|
+
* go.property("my_value", 0);
|
|
54
|
+
*
|
|
55
|
+
* export default defineScript({
|
|
56
|
+
* init(self) {
|
|
57
|
+
* // do something with self.my_value which is now one
|
|
58
|
+
* },
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
function create(url: string | Hash | Url, position?: Vector3, rotation?: Quaternion, properties?: LuaMap<string | Hash, unknown> | Record<string, unknown>, scale?: number | Vector3): Hash;
|
|
63
|
+
/**
|
|
64
|
+
* This returns status of the factory.
|
|
65
|
+
* Calling this function when the factory is not marked as dynamic loading always returns
|
|
66
|
+
* factory.STATUS_LOADED.
|
|
67
|
+
*
|
|
68
|
+
* @param url - the factory component to get status from
|
|
69
|
+
* @returns status of the factory component
|
|
70
|
+
*/
|
|
71
|
+
function get_status(url: string | Hash | Url): factory.STATUS;
|
|
72
|
+
/**
|
|
73
|
+
* Resources are referenced by the factory component until the existing (parent) collection is destroyed or factory.unload is called.
|
|
74
|
+
* Calling this function when the factory is not marked as dynamic loading does nothing.
|
|
75
|
+
*
|
|
76
|
+
* @param url - the factory component to load
|
|
77
|
+
* @param complete_function - function to call when resources are loaded.
|
|
78
|
+
*
|
|
79
|
+
* `self`
|
|
80
|
+
* script_instance The current script instance.
|
|
81
|
+
* `url`
|
|
82
|
+
* url url of the factory component
|
|
83
|
+
* `result`
|
|
84
|
+
* boolean True if resources were loaded successfully
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* // How to load resources of a factory prototype.
|
|
88
|
+
* factory.load("#factory", (self, url, result) => {});
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
function load(url: string | Hash | Url, complete_function: (self: unknown, url: Url, result: boolean) => void): void;
|
|
92
|
+
/**
|
|
93
|
+
* Changes the prototype for the factory.
|
|
94
|
+
*
|
|
95
|
+
* @param url - the factory component
|
|
96
|
+
* @param prototype - the path to the new prototype, or `nil`
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* // How to unload the previous prototype's resources, and then spawn a new game object:
|
|
100
|
+
* factory.unload("#factory"); // unload the previous resources
|
|
101
|
+
* factory.set_prototype("#factory", "/main/levels/enemyA.goc");
|
|
102
|
+
* const id = factory.create("#factory", go.get_world_position(), vmath.quat());
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
function set_prototype(url: string | Hash | Url, prototype: string | undefined): void;
|
|
106
|
+
/**
|
|
107
|
+
* This decreases the reference count for each resource loaded with factory.load. If reference is zero, the resource is destroyed.
|
|
108
|
+
* Calling this function when the factory is not marked as dynamic loading does nothing.
|
|
109
|
+
*
|
|
110
|
+
* @param url - the factory component to unload
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* // How to unload resources of a factory prototype loaded with factory.load:
|
|
114
|
+
* factory.unload("#factory");
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
function unload(url: string | Hash | Url): void;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import type { Hash } from "../../../src/core-types";
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
/**
|
|
6
|
+
* Functions, messages and properties used to manipulate font resources.
|
|
7
|
+
*/
|
|
8
|
+
namespace font {
|
|
9
|
+
/**
|
|
10
|
+
* Associated font file information
|
|
11
|
+
*/
|
|
12
|
+
interface file_info {
|
|
13
|
+
/**
|
|
14
|
+
* path to the `.ttf` or `.otf` font file
|
|
15
|
+
*/
|
|
16
|
+
path: string;
|
|
17
|
+
/**
|
|
18
|
+
* hashed font-file path
|
|
19
|
+
*/
|
|
20
|
+
path_hash: Hash;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Font resource information
|
|
24
|
+
*/
|
|
25
|
+
interface info {
|
|
26
|
+
/**
|
|
27
|
+
* path hash of the `.fontc` resource
|
|
28
|
+
*/
|
|
29
|
+
path: Hash;
|
|
30
|
+
/**
|
|
31
|
+
* associated font files
|
|
32
|
+
*/
|
|
33
|
+
fonts: font.file_info[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* associates a TTF or OTF resource to a .fontc file.
|
|
37
|
+
*
|
|
38
|
+
* @param fontc - The path to the .fontc resource
|
|
39
|
+
* @param font - The path to the .ttf or .otf resource
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const font_hash = hash("/assets/fonts/roboto.fontc");
|
|
43
|
+
* const ttf_hash = hash("/assets/fonts/Roboto/Roboto-Bold.ttf");
|
|
44
|
+
* font.add_font(font_hash, ttf_hash);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
function add_font(fontc: string | Hash, font: string | Hash): void;
|
|
48
|
+
/**
|
|
49
|
+
* Gets information about a font, such as the associated font files
|
|
50
|
+
*
|
|
51
|
+
* @param fontc - The path to the .fontc resource
|
|
52
|
+
* @returns font resource information
|
|
53
|
+
*/
|
|
54
|
+
function get_info(fontc: string | Hash): font.info;
|
|
55
|
+
/**
|
|
56
|
+
* prepopulates the font glyph cache with rasterised glyphs
|
|
57
|
+
*
|
|
58
|
+
* @param fontc - The path to the .fontc resource
|
|
59
|
+
* @param text - The text to layout
|
|
60
|
+
* @param callback - (optional) A callback function that is called after the request is finished
|
|
61
|
+
*
|
|
62
|
+
* `self`
|
|
63
|
+
* script_instance The current script instance.
|
|
64
|
+
* `request_id`
|
|
65
|
+
* integer The request id
|
|
66
|
+
* `result`
|
|
67
|
+
* boolean True if request was succesful
|
|
68
|
+
* `errstring`
|
|
69
|
+
* string `nil` if the request was successful
|
|
70
|
+
* @returns Returns the asynchronous request id
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const font_hash = hash("/assets/fonts/roboto.fontc");
|
|
74
|
+
* font.prewarm_text(font_hash, "Some text", (self, request_id, result, errstring) => {
|
|
75
|
+
* // cache is warm, show the text!
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
function prewarm_text(fontc: string | Hash, text: string, callback?: (self: unknown, request_id: number, result: boolean, errstring?: string) => void): number;
|
|
80
|
+
/**
|
|
81
|
+
* associates a TTF or OTF resource to a .fontc file
|
|
82
|
+
*
|
|
83
|
+
* @param fontc - The path to the .fontc resource
|
|
84
|
+
* @param font - The path to the .ttf or .otf resource
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* const font_hash = hash("/assets/fonts/roboto.fontc");
|
|
88
|
+
* const ttf_hash = hash("/assets/fonts/Roboto/Roboto-Bold.ttf");
|
|
89
|
+
* font.remove_font(font_hash, ttf_hash);
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
function remove_font(fontc: string | Hash, font: string | Hash): void;
|
|
93
|
+
/**
|
|
94
|
+
* Named object styles are resolved by text layouts without reshaping text.
|
|
95
|
+
* A `link` tag uses `link` by default. Callers may select another named style,
|
|
96
|
+
* such as `link:hover` or `link:active`, in response to input.
|
|
97
|
+
* Font collections initially define these named styles. Each default contains
|
|
98
|
+
* a normalized RGBA face-color multiplier and no effects. The default `link`
|
|
99
|
+
* style also uses a solid underline, which remains when hover or active colors
|
|
100
|
+
* are applied:
|
|
101
|
+
*
|
|
102
|
+
* - `link`: `(0.10, 0.45, 0.90, 1.0)`, solid underline
|
|
103
|
+
* - `link:hover`: `(0.30, 0.65, 1.00, 1.0)`
|
|
104
|
+
* - `link:active`: `(0.05, 0.30, 0.70, 1.0)`
|
|
105
|
+
*
|
|
106
|
+
* The definition is an opening-only sequence of rich-text tags. Tags are
|
|
107
|
+
* implicitly closed in reverse order. Calling this function replaces the
|
|
108
|
+
* named render properties and effects. Resource-defined decorations, such as
|
|
109
|
+
* the default `link` underline, remain unchanged.
|
|
110
|
+
*
|
|
111
|
+
* @param fontc - The path to the `.fontc` resource.
|
|
112
|
+
* @param name - Style name, for example `link:hover`.
|
|
113
|
+
* @param style - Opening-only render-style markup.
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* font.set_style("/fonts/ui.fontc", "link:hover", "<color=#66b3ff><outline color=#000000 size=1><shake amplitude=0.2>");
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
function set_style(fontc: string | Hash, name: string, style: string): void;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export {};
|