App

App Types

Type reference

  ---@class WindowDimensions
  ---@field width? number
  ---@field height? number
  ---@field minWidth? number
  ---@field minHeight? number
  ---@field maxWidth? number
  ---@field maxHeight? number

  ---@class WindowActions
  ---@field isResizable? boolean
  ---@field isMaximizable? boolean
  ---@field isClosable? boolean
  ---@field isMinimizable? boolean
  ---@field isDraggable? boolean

  ---@class WindowDefaultStates
  ---@field isMaximized boolean
  ---@field isMinimized boolean

  ---@class AppStoreOptions
  ---@field description? string
  ---@field author? string
  ---@field installTime? number
  ---@field images? string[]

  ---@class LaptopApp
  ---@field id string
  ---@field name string
  ---@field icon string
  ---@field isDefaultApp boolean
  ---@field isInstalled? boolean
  ---@field isInternal? boolean
  ---@field ignoreInternalLoading? boolean
  ---@field deviceId? string
  ---@field needsUpdate? boolean
  ---@field resourceName? string
  ---@field ui? string
  ---@field appstore? AppStoreOptions
  ---@field keepAlive? boolean
  ---@field windowDimensions? WindowDimensions
  ---@field windowActions? WindowActions
  ---@field windowDefaultStates? WindowDefaultStates
  ---@field onUse? function
  ---@field onUseServer? function
  ---@field onClose? function
  ---@field onCloseServer? function

WindowDimensions

widthnumber
700
Initial window width, once app is opened.
minWidthnumber
500
Minimum window width, if resize is enabled.
maxWidthnumber
1000
Maximum window width, if resize is enabled
heightnumber
600
Initial window height, once app is opened.
minHeightnumber
500
Minimum window height, if resize is enabled.
maxHeightnumber
1000
Maximum window height, if resize is enabled

WindowActions

isResizableboolean
true
Defines if window is resizable.
isMaximizableboolean
true
Defines if window maximizable.
isClosableboolean
true
Defines if window is closable.
isMinimizableboolean
true
Initial window height, once app is opened.
isDraggableboolean
true
Minimum window height, if resize is enabled.

WindowDefaultStates

isMaximizedboolean
false
Defines if window is maximized on open.
isMinimizedboolean
false
Defines if window is minimized on open.

AppStoreOptions

descriptionboolean
App description for app store.
authorstring
Custom app author.
installTimenumber
Time in miliseconds, which defines how long it takes to install app.
imagesstring[]
Array of preview images links.

LaptopApp

idstring
Unique App ID, if same exists, app will be overridden.
namestring
App name.
iconstring
App icon url.
isDefaultAppboolean
false
Defines if app is always shown, without installing it.
isInstalledboolean
false
For internal usage.
isInternalboolean
false
For internal usage.
ignoreInternalLoadingboolean
false
Defines if opening window should ignore loading indicator.
deviceIdstring
Device id, for apps who needs external device put into the laptop storage, for app to show up.
needsUpdateboolean
false
App icon url.
resourceNamestring
Set automatically while invoking addCustomApp export.
uistring
Custom app iframe url.
keepAliveboolean
false
Defines if app should be kept alive, even if window is closed. Mostly used for other already existing apps.
windowDimensionsWindowDimensions
Defines default window dimensions on app opening
windowActionsWindowActions
Defines default window dimensions on app opening
windowDefaultStatesWindowDefaultStates
Defines default window states on app opening
onUsefunction
if defined, gets triggered on client side once app is opened.
onUseServerfunction
if defined, gets triggered on server side once app is opened. Source is passed an param.
onClosefunction
if defined, gets triggered on client side once app is closed.
onCloseServerfunction
if defined, gets triggered on server side once app is closed. Source is passed an param.

Notification

summarystring
Title for notification
detailstring
Description for notification