Skip to content

Interface: DesktopEngineStatic ​

Defined in: types/desktop-engine.d.ts:3618

The global DesktopEngine object

Extends ​

Properties ​

apiVersion ​

ts
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 ​

ts
Canvas: CanvasConstructor;

Defined in: types/desktop-engine.d.ts:3628

Canvas component constructor


CanvasImage ​

ts
CanvasImage: CanvasImageConstructor;

Defined in: types/desktop-engine.d.ts:3630

Canvas image constructor


Component ​

ts
Component: ComponentConstructor;

Defined in: types/desktop-engine.d.ts:3622

Basic component constructor


fs ​

ts
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 ​

ts
Image: ImageConstructor;

Defined in: types/desktop-engine.d.ts:3626

Image component constructor


launchOptions ​

ts
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 ​

ts
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 ​

ts
ScreenManager: ScreenManager;

Defined in: types/desktop-engine.d.ts:3636

Screen manager instance (note: capitalized, but not a constructor)


system ​

ts
system: System;

Defined in: types/desktop-engine.d.ts:3638

System services instance


Video ​

ts
Video: VideoConstructor;

Defined in: types/desktop-engine.d.ts:3624

Video component constructor


WebGL2RenderingContext ​

ts
WebGL2RenderingContext: WebGLContextConstructor<WebGL2RenderingContext>;

Defined in: types/desktop-engine.d.ts:3634

Same as the global WebGL2RenderingContext


WebGLRenderingContext ​

ts
WebGLRenderingContext: WebGLContextConstructor<WebGLRenderingContext>;

Defined in: types/desktop-engine.d.ts:3632

Same as the global WebGLRenderingContext


Window ​

ts
Window: WindowConstructor;

Defined in: types/desktop-engine.d.ts:3620

Window constructor

Methods ​

applyNew() ​

ts
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 ​

ParameterType
constructor(...args) => T
argsArrayLike<any>

Returns ​

T

Inherited from ​

Utils.applyNew


base64Decode() ​

ts
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 ​

ParameterType
base64string

Returns ​

ArrayBuffer | null

Inherited from ​

Utils.base64Decode


base64Encode() ​

ts
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 ​

ParameterType
bufferArrayBuffer

Returns ​

string | null

Inherited from ​

Utils.base64Encode


clearInterval() ​

ts
clearInterval(id): void;

Defined in: types/desktop-engine.d.ts:3569

Cancels a setInterval

Parameters ​

ParameterType
idnumber | null | undefined

Returns ​

void

Inherited from ​

Utils.clearInterval


clearTimeout() ​

ts
clearTimeout(id): void;

Defined in: types/desktop-engine.d.ts:3567

Cancels a setTimeout

Parameters ​

ParameterType
idnumber | null | undefined

Returns ​

void

Inherited from ​

Utils.clearTimeout


setInterval() ​

ts
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 ​

ParameterType
callback(...args) => void
delay?number
...args?A

Returns ​

number

Inherited from ​

Utils.setInterval


setTimeout() ​

ts
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 ​

ParameterType
callback(...args) => void
delay?number
...args?A

Returns ​

number

Inherited from ​

Utils.setTimeout

The SDK is released under the Apache License 2.0