Interface: DesktopEngineStatic
Defined in: types/desktop-engine.d.ts:4622
The global DesktopEngine object
Extends
Properties
apiVersion
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
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
Canvas: CanvasConstructor;Defined in: types/desktop-engine.d.ts:4632
Canvas component constructor
CanvasImage
CanvasImage: CanvasImageConstructor;Defined in: types/desktop-engine.d.ts:4634
Canvas image constructor
Component
Component: ComponentConstructor;Defined in: types/desktop-engine.d.ts:4626
Basic component constructor
fonts
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
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
Image: ImageConstructor;Defined in: types/desktop-engine.d.ts:4630
Image component constructor
input
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
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
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
ScreenManager: ScreenManager;Defined in: types/desktop-engine.d.ts:4640
Screen manager instance (note: capitalized, but not a constructor)
syncStorage
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
system: System;Defined in: types/desktop-engine.d.ts:4642
System services instance
systemAudio
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
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
Video: VideoConstructor;Defined in: types/desktop-engine.d.ts:4628
Video component constructor
WebGL2RenderingContext
WebGL2RenderingContext: WebGLContextConstructor<WebGL2RenderingContext>;Defined in: types/desktop-engine.d.ts:4638
Same as the global WebGL2RenderingContext
WebGLRenderingContext
WebGLRenderingContext: WebGLContextConstructor<WebGLRenderingContext>;Defined in: types/desktop-engine.d.ts:4636
Same as the global WebGLRenderingContext
Window
Window: WindowConstructor;Defined in: types/desktop-engine.d.ts:4624
Window constructor
windows
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()
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
| Parameter | Type |
|---|---|
constructor | (...args) => T |
args | ArrayLike<any> |
Returns
T
Inherited from
base64Decode()
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
| Parameter | Type |
|---|---|
base64 | string |
Returns
ArrayBuffer | null
Inherited from
base64Encode()
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
| Parameter | Type |
|---|---|
buffer | ArrayBuffer |
Returns
string | null
Inherited from
clearInterval()
clearInterval(id): void;Defined in: types/desktop-engine.d.ts:4573
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:4571
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:4569
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:4567
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
