API Reference
This reference is generated from the SDK's type declarations, types/desktop-engine.d.ts, which describe only the APIs the runtime really provides. desktopengine create copies the same declarations into a project's types/, for completion and type checking in editors. For how to use these APIs, see the guide.
The global DesktopEngine
DesktopEngine is where the runtime starts:
| Member | Description |
|---|---|
launchOptions | Launch options: the display, position, option values, language and permissions, see Launch Options |
apiVersion | The runtime's API version, see API versions |
preferredFramesPerSecond | The frame rate the content wants, see Frame rate |
Window | A native window, the root of the content, see Windows |
Canvas | A canvas component: 2D, WebGL and WebGL 2 |
CanvasImage | An image to draw on canvases |
Component, Image, Video | The other components of a window, styled with ComponentStyle |
system | The system's appearance, CPU and memory usage |
ScreenManager | The displays |
fs | Package files and the content's own files, see Storage and Files |
All the types are in the DesktopEngine namespace.
Web standard APIs
The runtime also has these globals, which behave as in browsers; the differences are in their descriptions:
- Timers and frames:
setTimeout,setInterval,requestAnimationFrame,performance,console - Events:
Event,EventTarget,DOMException - Network:
fetch,Request,Response,Headers,AbortController,WebSocket,XMLHttpRequest, see Network - Data:
Blob,File,FormData,URL,URLSearchParams,TextEncoder,TextDecoder,ReadableStream, see Data - Storage:
localStorage,sessionStorage, see Storage and Files - Audio:
Audio,AudioContextand the audio nodes, see Audio
See all declarations for the full list.
