Skip to content

application

application contains the application related funtionalities such as:

  • Access to developer tools
  • OS information
  • Cursor position
  • Common paths
  • Command line parameters
  • And more...
import { application } from `miletus`;

application.openDevTools();

Methods

isMiletus()

Returns boolean - Can be used to detect if the application is running as a Miletus application ( = has been bundled with the Miletus packager).

openDevTools()

Open the developer tools.

For macOS the developer tools can be accessed through the Safari browser. See our guide on Debugging.

terminate()

Terminate the running application.

getCursorPosition()

Returns CursorPosition - The screen position of the cursor.

getPath(type)

  • type string - Path to request:
    • appdata - User's application data directory.
    • application - Current application folder.
    • desktop - User's desktop directory.
    • documents - User's documents directory.
    • downloads - User's downloads directory.
    • exe - The current executable file.
    • home - User's home directory.
    • music - User's music directory.
    • userdata
    • pictures - User's pictures directory.
    • temp - Temporary directory.
    • videos - User's videos directory.

Returns Promise<string> - Resolves with the path.

getOSInfo()

Returns Promise<OSInfo> - Resolves with an object containing the OS information. See OSInfo.

appParams()

Returns Promise<MiletusParams> - Resolves with an object containing the command line parameters and parameter count. See MiletusParams.

setMenu(menu)

  • menu Menu

Sets the application menu bar. See Menu for details.

loadLibrary(path)

  • path string - Path to a shared library.

Load a shared library.

Returns Promise<boolean> - Resolves with the success of the library loading.

unloadLibrary(path)

  • path string - Path to the shared library.

Unload a loaded shared library.

callLibProc(path, proc[, data])

  • path string - Path to a shared library.
  • proc string - Procedure name to call.
  • data string (optional) - Optional data to send along.

Call a procedure from the shared library. data can be optionally sent. See Executing procedures for further details.

Returns Promise - Resolves when the procedure is executed.

callLibFunc(path, func[, data])

  • path string - Path to a shared library.
  • func string - Function name to call.
  • data string (optional) - Optional data to send along.

Call a function from the shared library. data can be optionally sent. See Executing function for further details.

Returns Promise<string> - Resolves with the result of the called function.

Events

'custom-message'

Event triggered when a custom message is sent from a shared library through a callback. See Custom extensibility for further details.