Skip to content

Interface: DesktopEngineStatic ​

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

The global DesktopEngine object

Extends ​

Properties ​

apiVersion ​

ts
readonly apiVersion: number;

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

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.


audioSettings ​

ts
readonly audioSettings: AudioSettings | undefined;

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

The sound as the user set it for the content: muted, and its volume; undefined without the "audio" permission (API 9)


Canvas ​

ts
Canvas: CanvasConstructor;

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

Canvas component constructor


CanvasImage ​

ts
CanvasImage: CanvasImageConstructor;

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

Canvas image constructor


Component ​

ts
Component: ComponentConstructor;

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

Basic component constructor


fonts ​

ts
readonly fonts: FontFaceSet;

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

The content's own fonts for its canvases: add FontFace objects to it (API 9). See FontFace


fs ​

ts
readonly fs: FileSystem;

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

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:4630

Image component constructor


input ​

ts
input: Input;

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

The mouse anywhere on screen, over other apps too; needs the "mouse" permission (API 3)


launchOptions ​

ts
readonly launchOptions: Readonly<LaunchOptions>;

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

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:4685

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:4640

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


syncStorage ​

ts
readonly syncStorage: SyncStorage;

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

Keys and values that follow the user to their other Macs signed in to the same DesktopEngine account, e.g. a to-do list or a counter, unlike localStorage (API 7). See SyncStorage


system ​

ts
system: System;

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

System services instance


systemAudio ​

ts
readonly systemAudio: SystemAudio | null;

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

What the Mac plays, as an analysis for music visualizers; null without the "system-audio" permission (API 6)


systemStatus ​

ts
readonly systemStatus: SystemStatus | null;

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

How the Mac is doing: processor, memory, network, power, temperature, disk; null without the "system-info" permission (API 8)


Video ​

ts
Video: VideoConstructor;

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

Video component constructor


WebGL2RenderingContext ​

ts
WebGL2RenderingContext: WebGLContextConstructor<WebGL2RenderingContext>;

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

Same as the global WebGL2RenderingContext


WebGLRenderingContext ​

ts
WebGLRenderingContext: WebGLContextConstructor<WebGLRenderingContext>;

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

Same as the global WebGLRenderingContext


Window ​

ts
Window: WindowConstructor;

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

Window constructor


windows ​

ts
readonly windows: Windows | null;

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

Where other apps' windows are; null without the "window-positions" permission (API 6)

Methods ​

applyNew() ​

ts
applyNew<T>(constructor, args): T;

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

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:4577

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:4575

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:4573

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:4571

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:4569

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:4567

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