Interface: DesktopEngineStatic
Defined in: types/desktop-engine.d.ts:3618
The global DesktopEngine object
Extends
Properties
apiVersion
readonly apiVersion: number;Defined in: types/desktop-engine.d.ts:3651
Runtime API version, incremented when APIs are added. If you need a newer API, declare apiVersion in manifest.json; the app refuses to import the content when it has an older API. You can also check it at runtime and fall back.
Canvas
Canvas: CanvasConstructor;Defined in: types/desktop-engine.d.ts:3628
Canvas component constructor
CanvasImage
CanvasImage: CanvasImageConstructor;Defined in: types/desktop-engine.d.ts:3630
Canvas image constructor
Component
Component: ComponentConstructor;Defined in: types/desktop-engine.d.ts:3622
Basic component constructor
fs
readonly fs: FileSystem;Defined in: types/desktop-engine.d.ts:3640
The file system: package files, and the content's own files that are kept between launches
Image
Image: ImageConstructor;Defined in: types/desktop-engine.d.ts:3626
Image component constructor
launchOptions
readonly launchOptions: Readonly<LaunchOptions>;Defined in: types/desktop-engine.d.ts:3646
Read-only options passed in by the app at launch (size, display, position, user settings, etc.), injected before index.js runs. parameters follow the user's changes (DesktopEngine.system's parameterschange): read them from here each time. Provided when the DesktopEngine app launches the content; desktopengine dev simulates them from its command-line arguments; {} when loaded directly from the Develop menu.
preferredFramesPerSecond
preferredFramesPerSecond: number;Defined in: types/desktop-engine.d.ts:3659
The frame rate the content wants, e.g. 30 for slow scenery; 0 (the default) follows the display. Frames it skips don't run at all, which saves more power than skipping them in a requestAnimationFrame callback: the thread isn't even woken. Applies when the display's refresh rate is a multiple of it (60 Hz: 60, 30, 20, 15, 12…), otherwise every frame runs. The app's own limit (e.g. 30 fps on battery) still applies, the lower one wins. Can change at any time.
ScreenManager
ScreenManager: ScreenManager;Defined in: types/desktop-engine.d.ts:3636
Screen manager instance (note: capitalized, but not a constructor)
system
system: System;Defined in: types/desktop-engine.d.ts:3638
System services instance
Video
Video: VideoConstructor;Defined in: types/desktop-engine.d.ts:3624
Video component constructor
WebGL2RenderingContext
WebGL2RenderingContext: WebGLContextConstructor<WebGL2RenderingContext>;Defined in: types/desktop-engine.d.ts:3634
Same as the global WebGL2RenderingContext
WebGLRenderingContext
WebGLRenderingContext: WebGLContextConstructor<WebGLRenderingContext>;Defined in: types/desktop-engine.d.ts:3632
Same as the global WebGLRenderingContext
Window
Window: WindowConstructor;Defined in: types/desktop-engine.d.ts:3620
Window constructor
Methods
applyNew()
applyNew<T>(constructor, args): T;Defined in: types/desktop-engine.d.ts:3561
Calls a constructor with an argument array: new ctor(...args); returns null unless there are exactly 2 arguments, throws a TypeError if constructor isn't one or args isn't an object
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
constructor | (...args) => T |
args | ArrayLike<any> |
Returns
T
Inherited from
base64Decode()
base64Decode(base64): ArrayBuffer | null;Defined in: types/desktop-engine.d.ts:3573
Decodes a Base64 string into an ArrayBuffer; returns null on failure or if empty
Parameters
| Parameter | Type |
|---|---|
base64 | string |
Returns
ArrayBuffer | null
Inherited from
base64Encode()
base64Encode(buffer): string | null;Defined in: types/desktop-engine.d.ts:3571
Encodes an ArrayBuffer (TypedArrays aren't supported) as Base64; returns null on failure
Parameters
| Parameter | Type |
|---|---|
buffer | ArrayBuffer |
Returns
string | null
Inherited from
clearInterval()
clearInterval(id): void;Defined in: types/desktop-engine.d.ts:3569
Cancels a setInterval
Parameters
| Parameter | Type |
|---|---|
id | number | null | undefined |
Returns
void
Inherited from
clearTimeout()
clearTimeout(id): void;Defined in: types/desktop-engine.d.ts:3567
Cancels a setTimeout
Parameters
| Parameter | Type |
|---|---|
id | number | null | undefined |
Returns
void
Inherited from
setInterval()
setInterval<A>(
callback,
delay?,
...args
): number;Defined in: types/desktop-engine.d.ts:3565
Runs a callback repeatedly, see the global setInterval
Type Parameters
| Type Parameter |
|---|
A extends any[] |
Parameters
| Parameter | Type |
|---|---|
callback | (...args) => void |
delay? | number |
...args? | A |
Returns
number
Inherited from
setTimeout()
setTimeout<A>(
callback,
delay?,
...args
): number;Defined in: types/desktop-engine.d.ts:3563
Runs a callback after a delay, see the global setTimeout
Type Parameters
| Type Parameter |
|---|
A extends any[] |
Parameters
| Parameter | Type |
|---|---|
callback | (...args) => void |
delay? | number |
...args? | A |
Returns
number
