Skip to content

Interface: System ​

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

System services (DesktopEngine.system)

Extends ​

Properties ​

appearance ​

ts
readonly appearance: Appearance;

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

The current system appearance


onappearancechange ​

ts
onappearancechange: 
  | EventHandler<System, {
  appearance: Appearance;
}>
  | null
  | undefined;

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

appearancechange callback


onparameterschange ​

ts
onparameterschange: 
  | EventHandler<System, ParametersChangePayload>
  | null
  | undefined;

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

parameterschange callback

Methods ​

addEventListener() ​

ts
addEventListener<K>(type, listener): void;

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

Adds an event listener; type may be given with or without the on prefix

Type Parameters ​

Type Parameter
K extends "appearancechange" | "parameterschange"

Parameters ​

ParameterType
typeK | `on${K}`
listenerEventHandler<System, SystemEventMap[K]>

Returns ​

void

Inherited from ​

EventedObject.addEventListener


cpuUsage() ​

ts
cpuUsage(): number;

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

CPU usage of the whole system since the previous call (0–1); the first call returns the average since boot. Needs the system-info permission, throws without it

Returns ​

number


destroy() ​

ts
destroy(): void;

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

Clears all event listeners and on callbacks so the object can be garbage-collected; components also process their children recursively

Returns ​

void

Inherited from ​

EventedObject.destroy


memoryUsage() ​

ts
memoryUsage(): object;

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

Memory usage in bytes; used matches Memory Used in Activity Monitor. Needs the system-info permission, throws without it

Returns ​

object

NameTypeDefined in
freenumbertypes/desktop-engine.d.ts:3412
totalnumbertypes/desktop-engine.d.ts:3412
usednumbertypes/desktop-engine.d.ts:3412

offappearancechange() ​

ts
offappearancechange(): void;

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

Removes the onappearancechange callback

Returns ​

void


offparameterschange() ​

ts
offparameterschange(): void;

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

Removes the onparameterschange callback

Returns ​

void


removeEventListener() ​

ts
removeEventListener<K>(type, listener): void;

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

Removes the given event listener

Type Parameters ​

Type Parameter
K extends "appearancechange" | "parameterschange"

Parameters ​

ParameterType
typeK | `on${K}`
listenerEventHandler<System, SystemEventMap[K]>

Returns ​

void

Inherited from ​

EventedObject.removeEventListener


triggerGC() ​

ts
triggerGC(): void;

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

Asks the runtime to run a garbage collection (asynchronously)

Returns ​

void

The SDK is released under the Apache License 2.0