@ori-community/wotw-map 0.1.1 → 0.1.2
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/index.d.ts +263 -0
- package/package.json +2 -2
- package/godot.d.ts +0 -275
- /package/{wotw-map.audio.position.worklet.js → dist/wotw-map.audio.position.worklet.js} +0 -0
- /package/{wotw-map.audio.worklet.js → dist/wotw-map.audio.worklet.js} +0 -0
- /package/{wotw-map.pck → dist/wotw-map.pck} +0 -0
- /package/{wotw-map.wasm → dist/wotw-map.wasm} +0 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Engine configuration object.
|
|
3
|
+
*
|
|
4
|
+
* An object used to configure the Engine instance based on godot export options,
|
|
5
|
+
* and to override those in custom HTML templates if needed.
|
|
6
|
+
*/
|
|
7
|
+
export declare interface EngineConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the unload the engine automatically after the instance is initialized.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
unloadAfterInit?: boolean;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The HTML DOM Canvas object to use.
|
|
16
|
+
*
|
|
17
|
+
* By default, the first canvas element in the document will be used if none is specified.
|
|
18
|
+
* @default null
|
|
19
|
+
*/
|
|
20
|
+
canvas?: HTMLCanvasElement | null;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The name of the WASM file without the extension. (Set by Godot Editor export process).
|
|
24
|
+
* @default ""
|
|
25
|
+
*/
|
|
26
|
+
executable?: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An alternative name for the game pck to load. The executable name is used otherwise.
|
|
30
|
+
* @default null
|
|
31
|
+
*/
|
|
32
|
+
mainPack?: string | null;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Specify a language code to select the proper localization for the game.
|
|
36
|
+
*
|
|
37
|
+
* The browser locale will be used if none is specified.
|
|
38
|
+
* @default null
|
|
39
|
+
*/
|
|
40
|
+
locale?: string | null;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The canvas resize policy determines how the canvas should be resized by Godot.
|
|
44
|
+
*
|
|
45
|
+
* - `0` means Godot won't do any resizing. This is useful if you want to control the canvas size from javascript code in your template.
|
|
46
|
+
* - `1` means Godot will resize the canvas on start, and when changing window size via engine functions.
|
|
47
|
+
* - `2` means Godot will adapt the canvas size to match the whole browser window.
|
|
48
|
+
*
|
|
49
|
+
* @default 2
|
|
50
|
+
*/
|
|
51
|
+
canvasResizePolicy?: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The arguments to be passed as command line arguments on startup.
|
|
55
|
+
*
|
|
56
|
+
* Note: `startGame()` will always add the `--main-pack` argument.
|
|
57
|
+
* @default []
|
|
58
|
+
*/
|
|
59
|
+
args?: string[];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
63
|
+
*/
|
|
64
|
+
emscriptenPoolSize?: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
68
|
+
*/
|
|
69
|
+
ensureCrossOriginIsolationHeaders?: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
73
|
+
*/
|
|
74
|
+
experimentalVK?: boolean;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
78
|
+
*/
|
|
79
|
+
fileSizes?: Record<string, number>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
83
|
+
*/
|
|
84
|
+
focusCanvas?: boolean;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
88
|
+
*/
|
|
89
|
+
gdextensionLibs?: string[];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
93
|
+
*/
|
|
94
|
+
godotPoolSize?: number;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
98
|
+
*/
|
|
99
|
+
serviceWorker?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A callback function for handling Godot's `OS.execute` calls.
|
|
103
|
+
*
|
|
104
|
+
* This is for example used in the Web Editor template to switch between Project Manager and editor, and for running the game.
|
|
105
|
+
* @param path The path that Godot's wants executed.
|
|
106
|
+
* @param args The arguments of the "command" to execute.
|
|
107
|
+
*/
|
|
108
|
+
onExecute?: (path: string, args: string[]) => void;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* A callback function for being notified when the Godot instance quits.
|
|
112
|
+
*
|
|
113
|
+
* Note: This function will not be called if the engine crashes or become unresponsive.
|
|
114
|
+
* @param statusCode The status code returned by Godot on exit.
|
|
115
|
+
*/
|
|
116
|
+
onExit?: (statusCode: number) => void;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A callback function for displaying download progress.
|
|
120
|
+
*
|
|
121
|
+
* The function is called once per frame while downloading files, so the usage of `requestAnimationFrame()` is not necessary.
|
|
122
|
+
*
|
|
123
|
+
* If the callback function receives a total amount of bytes as 0, this means that it is impossible to calculate.
|
|
124
|
+
* Possible reasons include:
|
|
125
|
+
* - Files are delivered with server-side chunked compression
|
|
126
|
+
* - Files are delivered with server-side compression on Chromium
|
|
127
|
+
* - Not all file downloads have started yet (usually on servers without multi-threading)
|
|
128
|
+
*
|
|
129
|
+
* @param current The current amount of downloaded bytes so far.
|
|
130
|
+
* @param total The total amount of bytes to be downloaded.
|
|
131
|
+
*/
|
|
132
|
+
onProgress?: (current: number, total: number) => void;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* A callback function for handling the standard output stream. This method should usually only be used in debug pages.
|
|
136
|
+
*
|
|
137
|
+
* By default, `console.log()` is used.
|
|
138
|
+
* @param varArgs A variadic number of arguments to be printed.
|
|
139
|
+
*/
|
|
140
|
+
onPrint?: (...varArgs: unknown[]) => void;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* A callback function for handling the standard error stream. This method should usually only be used in debug pages.
|
|
144
|
+
*
|
|
145
|
+
* By default, `console.error()` is used.
|
|
146
|
+
* @param varArgs A variadic number of arguments to be printed as errors.
|
|
147
|
+
*/
|
|
148
|
+
onPrintError?: (...varArgs: unknown[]) => void;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Paths that are supposed to be persisted between sessions
|
|
152
|
+
*/
|
|
153
|
+
persistentPaths?: string[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The Engine class provides methods for loading and starting exported projects on the Web.
|
|
158
|
+
*
|
|
159
|
+
* For default export settings, this is already part of the exported HTML page.
|
|
160
|
+
* This API is built in an asynchronous manner and requires basic understanding of Promises.
|
|
161
|
+
*/
|
|
162
|
+
export declare class Engine {
|
|
163
|
+
/**
|
|
164
|
+
* Create a new Engine instance with the given configuration.
|
|
165
|
+
* @param initConfig The initial config for this instance.
|
|
166
|
+
*/
|
|
167
|
+
constructor(initConfig: EngineConfig);
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Load the engine from the specified base path.
|
|
171
|
+
* @param basePath Base path of the engine to load.
|
|
172
|
+
* @returns A Promise that resolves once the engine is loaded.
|
|
173
|
+
*/
|
|
174
|
+
static load(basePath: string): Promise<void>;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Unload the engine to free memory.
|
|
178
|
+
*
|
|
179
|
+
* This method will be called automatically depending on the configuration. See `unloadAfterInit`.
|
|
180
|
+
*/
|
|
181
|
+
static unload(): void;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Check whether WebGL is available. Optionally, specify a particular version of WebGL to check for.
|
|
185
|
+
* @param majorVersion The major WebGL version to check for.
|
|
186
|
+
* @returns If the given major version of WebGL is available.
|
|
187
|
+
*/
|
|
188
|
+
static isWebGLAvailable(majorVersion?: number): boolean;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
192
|
+
*/
|
|
193
|
+
static getMissingFeatures(features: Record<string, boolean>): string[];
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Initialize the engine instance. Optionally, pass the base path to the engine to load it,
|
|
197
|
+
* if it hasn't been loaded yet. See `Engine.load`.
|
|
198
|
+
*
|
|
199
|
+
* @param basePath Base path of the engine to load.
|
|
200
|
+
* @returns A Promise that resolves once the engine is loaded and initialized.
|
|
201
|
+
*/
|
|
202
|
+
init(basePath?: string): Promise<void>;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Load a file so it is available in the instance's file system once it runs. Must be called **before** starting the instance.
|
|
206
|
+
*
|
|
207
|
+
* If not provided, the `path` is derived from the URL of the loaded file.
|
|
208
|
+
* @param file The file to preload.
|
|
209
|
+
* If a string the file will be loaded from that path.
|
|
210
|
+
* If an ArrayBuffer or a view on one, the buffer will used as the content of the file.
|
|
211
|
+
* @param path Path by which the file will be accessible. Required, if `file` is not a string.
|
|
212
|
+
* @returns A Promise that resolves once the file is loaded.
|
|
213
|
+
*/
|
|
214
|
+
preloadFile(file: string | ArrayBuffer, path?: string): Promise<void>;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Start the engine instance using the given override configuration (if any).
|
|
218
|
+
* `startGame()` can be used in typical cases instead.
|
|
219
|
+
*
|
|
220
|
+
* This will initialize the instance if it is not initialized. For manual initialization, see `init()`.
|
|
221
|
+
* The engine must be loaded beforehand.
|
|
222
|
+
*
|
|
223
|
+
* Fails if a canvas cannot be found on the page, or not specified in the configuration.
|
|
224
|
+
*
|
|
225
|
+
* @param override An optional configuration override.
|
|
226
|
+
* @returns Promise that resolves once the engine started.
|
|
227
|
+
*/
|
|
228
|
+
start(override?: EngineConfig): Promise<void>;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Start the game instance using the given configuration override (if any).
|
|
232
|
+
*
|
|
233
|
+
* This will initialize the instance if it is not initialized. For manual initialization, see `init()`.
|
|
234
|
+
* This will load the engine if it is not loaded, and preload the main pck.
|
|
235
|
+
*
|
|
236
|
+
* This method expects the initial config (or the override) to have both the `executable` and `mainPack`
|
|
237
|
+
* properties set (normally done by the editor during export).
|
|
238
|
+
*
|
|
239
|
+
* @param override An optional configuration override.
|
|
240
|
+
* @returns Promise that resolves once the game started.
|
|
241
|
+
*/
|
|
242
|
+
startGame(override?: EngineConfig): Promise<void>;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Create a file at the specified `path` with the passed as `buffer` in the instance's file system.
|
|
246
|
+
* @param path The location where the file will be created.
|
|
247
|
+
* @param buffer The content of the file.
|
|
248
|
+
*/
|
|
249
|
+
copyToFS(path: string, buffer: ArrayBuffer): void;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Request that the current instance quit.
|
|
253
|
+
*
|
|
254
|
+
* This is akin the user pressing the close button in the window manager, and will
|
|
255
|
+
* have no effect if the engine has crashed, or is stuck in a loop.
|
|
256
|
+
*/
|
|
257
|
+
requestQuit(): void;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* NOTE: This is not in the docs, but is present in the generated code.
|
|
261
|
+
*/
|
|
262
|
+
installServiceWorker(): void;
|
|
263
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ori-community/wotw-map",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/ori-community/wotw-map#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "Timo Schwarzer",
|
|
15
|
-
"type": "
|
|
15
|
+
"type": "module"
|
|
16
16
|
}
|
package/godot.d.ts
DELETED
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
declare module "@ori-community/wotw-map" {
|
|
2
|
-
/**
|
|
3
|
-
* The Engine configuration object.
|
|
4
|
-
*
|
|
5
|
-
* An object used to configure the Engine instance based on godot export options,
|
|
6
|
-
* and to override those in custom HTML templates if needed.
|
|
7
|
-
*/
|
|
8
|
-
declare interface EngineConfig {
|
|
9
|
-
/**
|
|
10
|
-
* Whether the unload the engine automatically after the instance is initialized.
|
|
11
|
-
* @default true
|
|
12
|
-
*/
|
|
13
|
-
unloadAfterInit?: boolean;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The HTML DOM Canvas object to use.
|
|
17
|
-
*
|
|
18
|
-
* By default, the first canvas element in the document will be used if none is specified.
|
|
19
|
-
* @default null
|
|
20
|
-
*/
|
|
21
|
-
canvas?: HTMLCanvasElement | null;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The name of the WASM file without the extension. (Set by Godot Editor export process).
|
|
25
|
-
* @default ""
|
|
26
|
-
*/
|
|
27
|
-
executable?: string;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* An alternative name for the game pck to load. The executable name is used otherwise.
|
|
31
|
-
* @default null
|
|
32
|
-
*/
|
|
33
|
-
mainPack?: string | null;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Specify a language code to select the proper localization for the game.
|
|
37
|
-
*
|
|
38
|
-
* The browser locale will be used if none is specified.
|
|
39
|
-
* @default null
|
|
40
|
-
*/
|
|
41
|
-
locale?: string | null;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The canvas resize policy determines how the canvas should be resized by Godot.
|
|
45
|
-
*
|
|
46
|
-
* - `0` means Godot won't do any resizing. This is useful if you want to control the canvas size from javascript code in your template.
|
|
47
|
-
* - `1` means Godot will resize the canvas on start, and when changing window size via engine functions.
|
|
48
|
-
* - `2` means Godot will adapt the canvas size to match the whole browser window.
|
|
49
|
-
*
|
|
50
|
-
* @default 2
|
|
51
|
-
*/
|
|
52
|
-
canvasResizePolicy?: number;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* The arguments to be passed as command line arguments on startup.
|
|
56
|
-
*
|
|
57
|
-
* Note: `startGame()` will always add the `--main-pack` argument.
|
|
58
|
-
* @default []
|
|
59
|
-
*/
|
|
60
|
-
args?: string[];
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
64
|
-
*/
|
|
65
|
-
emscriptenPoolSize?: number;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
69
|
-
*/
|
|
70
|
-
ensureCrossOriginIsolationHeaders?: boolean;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
74
|
-
*/
|
|
75
|
-
experimentalVK?: boolean;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
79
|
-
*/
|
|
80
|
-
fileSizes?: Record<string, number>;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
84
|
-
*/
|
|
85
|
-
focusCanvas?: boolean;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
89
|
-
*/
|
|
90
|
-
gdextensionLibs?: string[];
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
94
|
-
*/
|
|
95
|
-
godotPoolSize?: number;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
99
|
-
*/
|
|
100
|
-
serviceWorker?: boolean;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* A callback function for handling Godot's `OS.execute` calls.
|
|
104
|
-
*
|
|
105
|
-
* This is for example used in the Web Editor template to switch between Project Manager and editor, and for running the game.
|
|
106
|
-
* @param path The path that Godot's wants executed.
|
|
107
|
-
* @param args The arguments of the "command" to execute.
|
|
108
|
-
*/
|
|
109
|
-
onExecute?: (path: string, args: string[]) => void;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* A callback function for being notified when the Godot instance quits.
|
|
113
|
-
*
|
|
114
|
-
* Note: This function will not be called if the engine crashes or become unresponsive.
|
|
115
|
-
* @param statusCode The status code returned by Godot on exit.
|
|
116
|
-
*/
|
|
117
|
-
onExit?: (statusCode: number) => void;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* A callback function for displaying download progress.
|
|
121
|
-
*
|
|
122
|
-
* The function is called once per frame while downloading files, so the usage of `requestAnimationFrame()` is not necessary.
|
|
123
|
-
*
|
|
124
|
-
* If the callback function receives a total amount of bytes as 0, this means that it is impossible to calculate.
|
|
125
|
-
* Possible reasons include:
|
|
126
|
-
* - Files are delivered with server-side chunked compression
|
|
127
|
-
* - Files are delivered with server-side compression on Chromium
|
|
128
|
-
* - Not all file downloads have started yet (usually on servers without multi-threading)
|
|
129
|
-
*
|
|
130
|
-
* @param current The current amount of downloaded bytes so far.
|
|
131
|
-
* @param total The total amount of bytes to be downloaded.
|
|
132
|
-
*/
|
|
133
|
-
onProgress?: (current: number, total: number) => void;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* A callback function for handling the standard output stream. This method should usually only be used in debug pages.
|
|
137
|
-
*
|
|
138
|
-
* By default, `console.log()` is used.
|
|
139
|
-
* @param varArgs A variadic number of arguments to be printed.
|
|
140
|
-
*/
|
|
141
|
-
onPrint?: (...varArgs: unknown[]) => void;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* A callback function for handling the standard error stream. This method should usually only be used in debug pages.
|
|
145
|
-
*
|
|
146
|
-
* By default, `console.error()` is used.
|
|
147
|
-
* @param varArgs A variadic number of arguments to be printed as errors.
|
|
148
|
-
*/
|
|
149
|
-
onPrintError?: (...varArgs: unknown[]) => void;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Paths that are supposed to be persisted between sessions
|
|
153
|
-
*/
|
|
154
|
-
persistentPaths?: string[];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The Engine class provides methods for loading and starting exported projects on the Web.
|
|
159
|
-
*
|
|
160
|
-
* For default export settings, this is already part of the exported HTML page.
|
|
161
|
-
* This API is built in an asynchronous manner and requires basic understanding of Promises.
|
|
162
|
-
*/
|
|
163
|
-
declare class Engine {
|
|
164
|
-
/**
|
|
165
|
-
* Create a new Engine instance with the given configuration.
|
|
166
|
-
* @param initConfig The initial config for this instance.
|
|
167
|
-
*/
|
|
168
|
-
constructor(initConfig: EngineConfig);
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Load the engine from the specified base path.
|
|
172
|
-
* @param basePath Base path of the engine to load.
|
|
173
|
-
* @returns A Promise that resolves once the engine is loaded.
|
|
174
|
-
*/
|
|
175
|
-
static load(basePath: string): Promise<void>;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Unload the engine to free memory.
|
|
179
|
-
*
|
|
180
|
-
* This method will be called automatically depending on the configuration. See `unloadAfterInit`.
|
|
181
|
-
*/
|
|
182
|
-
static unload(): void;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Check whether WebGL is available. Optionally, specify a particular version of WebGL to check for.
|
|
186
|
-
* @param majorVersion The major WebGL version to check for.
|
|
187
|
-
* @returns If the given major version of WebGL is available.
|
|
188
|
-
*/
|
|
189
|
-
static isWebGLAvailable(majorVersion?: number): boolean;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
193
|
-
*/
|
|
194
|
-
static getMissingFeatures(features: Record<string, boolean>): string[];
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Initialize the engine instance. Optionally, pass the base path to the engine to load it,
|
|
198
|
-
* if it hasn't been loaded yet. See `Engine.load`.
|
|
199
|
-
*
|
|
200
|
-
* @param basePath Base path of the engine to load.
|
|
201
|
-
* @returns A Promise that resolves once the engine is loaded and initialized.
|
|
202
|
-
*/
|
|
203
|
-
init(basePath?: string): Promise<void>;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Load a file so it is available in the instance's file system once it runs. Must be called **before** starting the instance.
|
|
207
|
-
*
|
|
208
|
-
* If not provided, the `path` is derived from the URL of the loaded file.
|
|
209
|
-
* @param file The file to preload.
|
|
210
|
-
* If a string the file will be loaded from that path.
|
|
211
|
-
* If an ArrayBuffer or a view on one, the buffer will used as the content of the file.
|
|
212
|
-
* @param path Path by which the file will be accessible. Required, if `file` is not a string.
|
|
213
|
-
* @returns A Promise that resolves once the file is loaded.
|
|
214
|
-
*/
|
|
215
|
-
preloadFile(file: string | ArrayBuffer, path?: string): Promise<void>;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Start the engine instance using the given override configuration (if any).
|
|
219
|
-
* `startGame()` can be used in typical cases instead.
|
|
220
|
-
*
|
|
221
|
-
* This will initialize the instance if it is not initialized. For manual initialization, see `init()`.
|
|
222
|
-
* The engine must be loaded beforehand.
|
|
223
|
-
*
|
|
224
|
-
* Fails if a canvas cannot be found on the page, or not specified in the configuration.
|
|
225
|
-
*
|
|
226
|
-
* @param override An optional configuration override.
|
|
227
|
-
* @returns Promise that resolves once the engine started.
|
|
228
|
-
*/
|
|
229
|
-
start(override?: EngineConfig): Promise<void>;
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Start the game instance using the given configuration override (if any).
|
|
233
|
-
*
|
|
234
|
-
* This will initialize the instance if it is not initialized. For manual initialization, see `init()`.
|
|
235
|
-
* This will load the engine if it is not loaded, and preload the main pck.
|
|
236
|
-
*
|
|
237
|
-
* This method expects the initial config (or the override) to have both the `executable` and `mainPack`
|
|
238
|
-
* properties set (normally done by the editor during export).
|
|
239
|
-
*
|
|
240
|
-
* @param override An optional configuration override.
|
|
241
|
-
* @returns Promise that resolves once the game started.
|
|
242
|
-
*/
|
|
243
|
-
startGame(override?: EngineConfig): Promise<void>;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Create a file at the specified `path` with the passed as `buffer` in the instance's file system.
|
|
247
|
-
* @param path The location where the file will be created.
|
|
248
|
-
* @param buffer The content of the file.
|
|
249
|
-
*/
|
|
250
|
-
copyToFS(path: string, buffer: ArrayBuffer): void;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Request that the current instance quit.
|
|
254
|
-
*
|
|
255
|
-
* This is akin the user pressing the close button in the window manager, and will
|
|
256
|
-
* have no effect if the engine has crashed, or is stuck in a loop.
|
|
257
|
-
*/
|
|
258
|
-
requestQuit(): void;
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* NOTE: This is not in the docs, but is present in the generated code.
|
|
262
|
-
*/
|
|
263
|
-
installServiceWorker(): void;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
type GodotBridge = {
|
|
268
|
-
call: (ipcName: string, args: unknown[]) => void,
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
declare global {
|
|
272
|
-
interface Window {
|
|
273
|
-
__godotBridge?: GodotBridge
|
|
274
|
-
}
|
|
275
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|