Header menu logo issie

Bridge Module

The renderer's half of the bridge to the main process. Partner to src/Preload/preload.js and src/Main/Bridge.fs. This module is the only place the renderer reads anything the operating system knows, and it exists so that the rest of the code asks for `Bridge.staticDir` rather than reaching for `__static`, `process.platform` or `@electron/remote` - none of which survive contextIsolation. Everything here is a value rather than a function. These are constants for the life of the process, so the preload fetches them once and this module just reads the result: no round trip, no ordering to get wrong, and five operations that never have to exist on the bridge at all.

Functions and values

Function or value Description

buildCancel _jobId

Full Usage: buildCancel _jobId

Parameters:
    _jobId : string

_jobId : string

buildStart _stage _projectPath _name _device _profile

Full Usage: buildStart _stage _projectPath _name _device _profile

Parameters:
    _stage : string
    _projectPath : string
    _name : string
    _device : string
    _profile : string

Returns: string
_stage : string
_projectPath : string
_name : string
_device : string
_profile : string
Returns: string

buildStatus _jobId

Full Usage: buildStatus _jobId

Parameters:
    _jobId : string

Returns: int
_jobId : string
Returns: int

clearCache ()

Full Usage: clearCache ()

Parameters:
    () : unit

() : unit

clipboardWrite _text

Full Usage: clipboardWrite _text

Parameters:
    _text : string

_text : string

cwd

Full Usage: cwd

Returns: string
Returns: string

dialogOpen _options

Full Usage: dialogOpen _options

Parameters:
    _options : obj

Returns: string array
_options : obj
Returns: string array

dialogSave _options

Full Usage: dialogSave _options

Parameters:
    _options : obj

Returns: string
_options : obj
Returns: string

documents

Full Usage: documents

Returns: string
Returns: string

editCommand _op

Full Usage: editCommand _op

Parameters:
    _op : string

_op : string

getZoomLevel ()

Full Usage: getZoomLevel ()

Parameters:
    () : unit

Returns: float
() : unit
Returns: float

hasDebugSwitch

Full Usage: hasDebugSwitch

Returns: bool
Returns: bool

hasWSwitch

Full Usage: hasWSwitch

Returns: bool
Returns: bool

ipcListenerCounts ()

Full Usage: ipcListenerCounts ()

Parameters:
    () : unit

Returns: obj
() : unit
Returns: obj

isDev

Full Usage: isDev

Returns: bool
Returns: bool

isMac

Full Usage: isMac

Returns: bool
Returns: bool

isWindows

Full Usage: isWindows

Returns: bool

Platform tests, so that the string literals live here and not at thirty call sites.

Returns: bool

logSwitch

Full Usage: logSwitch

Returns: string
Returns: string

onApplicationMenuCommand _callback

Full Usage: onApplicationMenuCommand _callback

Parameters:
    _callback : string -> unit

_callback : string -> unit

onClosingWindow _callback

Full Usage: onClosingWindow _callback

Parameters:
    _callback : unit -> unit

_callback : unit -> unit

onContextMenuCommand _callback

Full Usage: onContextMenuCommand _callback

Parameters:
    _callback : string -> unit

_callback : string -> unit

onWindowLostFocus _callback

Full Usage: onWindowLostFocus _callback

Parameters:
    _callback : unit -> unit

_callback : unit -> unit

openExternal _url

Full Usage: openExternal _url

Parameters:
    _url : string

_url : string

platform

Full Usage: platform

Returns: string
Returns: string

processMemory ()

Full Usage: processMemory ()

Parameters:
    () : unit

Returns: Promise<obj>
() : unit
Returns: Promise<obj>

quit ()

Full Usage: quit ()

Parameters:
    () : unit

() : unit

resourceUsage ()

Full Usage: resourceUsage ()

Parameters:
    () : unit

Returns: obj
() : unit
Returns: obj

revealInFileManager _folderPath

Full Usage: revealInFileManager _folderPath

Parameters:
    _folderPath : string

Returns: Promise<string>

Unreachable under .NET: it is only called from the draw block's "open containing folder", which needs a window. Written as a throw rather than a lifted promise so that nothing has to construct one outside a JavaScript runtime.

_folderPath : string
Returns: Promise<string>

runDevTool _tool _args _dst

Full Usage: runDevTool _tool _args _dst

Parameters:
    _tool : string
    _args : string array
    _dst : string

_tool : string
_args : string array
_dst : string

setApplicationMenu _template

Full Usage: setApplicationMenu _template

Parameters:
    _template : obj array

_template : obj array

setZoomLevel _level

Full Usage: setZoomLevel _level

Parameters:
    _level : float

_level : float

showContextMenu _menuType

Full Usage: showContextMenu _menuType

Parameters:
    _menuType : string

_menuType : string

staticDir

Full Usage: staticDir

Returns: string
Returns: string

systemMemoryTotalKB ()

Full Usage: systemMemoryTotalKB ()

Parameters:
    () : unit

Returns: float

0 rather than an exception: under .NET there is no Electron to ask, and the simulator's memory budget reads that as "machine unknown" and falls back to its built-in figures.

() : unit
Returns: float

toggleDevTools ()

Full Usage: toggleDevTools ()

Parameters:
    () : unit

() : unit

toggleFullScreen ()

Full Usage: toggleFullScreen ()

Parameters:
    () : unit

() : unit

uartConnectAndRead _viewers

Full Usage: uartConnectAndRead _viewers

Parameters:
    _viewers : int

Returns: Promise<string array>
_viewers : int
Returns: Promise<string array>

uartContinue ()

Full Usage: uartContinue ()

Parameters:
    () : unit

() : unit

uartDisconnect ()

Full Usage: uartDisconnect ()

Parameters:
    () : unit

() : unit

uartPause ()

Full Usage: uartPause ()

Parameters:
    () : unit

() : unit

uartReadAllViewers _viewers

Full Usage: uartReadAllViewers _viewers

Parameters:
    _viewers : int

Returns: Promise<string array>
_viewers : int
Returns: Promise<string array>

uartSimpleConnect ()

Full Usage: uartSimpleConnect ()

Parameters:
    () : unit

Returns: Promise<unit>
() : unit
Returns: Promise<unit>

uartStep ()

Full Usage: uartStep ()

Parameters:
    () : unit

() : unit

uartStepAndReadAllViewers _viewers

Full Usage: uartStepAndReadAllViewers _viewers

Parameters:
    _viewers : int

Returns: Promise<string array>
_viewers : int
Returns: Promise<string array>

userData

Full Usage: userData

Returns: string
Returns: string

Type something to start searching.