Header menu logo issie

JSHelpers Module

Functions and values

Function or value Description

alert msg

Full Usage: alert msg

Parameters:
    msg : 'a

msg : 'a

assertNotNull obj msg

Full Usage: assertNotNull obj msg

Parameters:
    obj : 'a
    msg : 'b

Returns: 'a

Assert js object is not null, and return it.

obj : 'a
msg : 'b
Returns: 'a

debugLevel

Full Usage: debugLevel

Returns: int
Returns: int

debugTraceUI

Full Usage: debugTraceUI

Returns: Set<string>

trace UI execution: "view" - mark view function. "update" print update messages.

Returns: Set<string>

delayedDispatch dispatch delayInMs msg

Full Usage: delayedDispatch dispatch delayInMs msg

Parameters:
    dispatch : 'a -> unit
    delayInMs : int
    msg : 'a

Returns: int
dispatch : 'a -> unit
delayInMs : int
msg : 'a
Returns: int

electronRemote

Full Usage: electronRemote

Returns: Remote

Fix to access the deprecated @electron.remote module. This must be enabled from main.fs NB the interface used here is not precisely correct, because it exposes the original electron-remote API. The @electron.remote API is a bit reduced, but with some extra code to control access. electronRemote replaces electron.remote and renderer.remote in old interface

Returns: Remote

emptyJsList ()

Full Usage: emptyJsList ()

Parameters:
    () : unit

Returns: 'a
() : unit
Returns: 'a

fshaprListToJsList list

Full Usage: fshaprListToJsList list

Parameters:
    list : 'a list

Returns: 'a0
list : 'a list
Returns: 'a0

getBigintEventValue event

Full Usage: getBigintEventValue event

Parameters:
Returns: BigInteger
event : Event
Returns: BigInteger

getFailIfNull jsObj fields

Full Usage: getFailIfNull jsObj fields

Parameters:
    jsObj : 'a
    fields : string list

Returns: 'b

Access nested fields of a js object, failing if at any point of the chain the requested field is null. Should be used when the fields are guaranteed to exist. For example ["a"; "b"; "c"] is equivalent to the jsCode `obj.a.b.c`, but with checks against null at every layer.

jsObj : 'a
fields : string list
Returns: 'b

getFloatEventValue event

Full Usage: getFloatEventValue event

Parameters:
Returns: float
event : Event
Returns: float

getInt64EventValue event

Full Usage: getInt64EventValue event

Parameters:
Returns: int64
event : Event
Returns: int64

getIntEventValue event

Full Usage: getIntEventValue event

Parameters:
Returns: int

Get the value for a change event in an input number box, making sure it is an F# integer (JS integer values may not be precise)

event : Event
Returns: int

getProcessPrivateMemory ()

Full Usage: getProcessPrivateMemory ()

Parameters:
    () : unit

Returns: int
() : unit
Returns: int

getTextEventValue event

Full Usage: getTextEventValue event

Parameters:
Returns: string

Get the value for a change event in an input textbox.

event : Event
Returns: string

getTextFocusEventValue event

Full Usage: getTextFocusEventValue event

Parameters:
Returns: string

Get the value for a blur event in an input textbox.

event : FocusEvent
Returns: string

globalGC

Full Usage: globalGC

Returns: unit -> unit
Returns: unit -> unit

isNull obj

Full Usage: isNull obj

Parameters:
    obj : obj

Returns: bool
obj : obj
Returns: bool

jsListToFSharpList jsList

Full Usage: jsListToFSharpList jsList

Parameters:
    jsList : 'a

Returns: 'b list

Transforms a js list of jsType into an f# list of jsType. If jsList is not a js list, fail.

jsList : 'a
Returns: 'b list

jsType var

Full Usage: jsType var

Parameters:
    var : obj

var : obj

log msg

Full Usage: log msg

Parameters:
    msg : 'a

msg : 'a

logChain msg

Full Usage: logChain msg

Parameters:
    msg : 'a

Returns: 'a
msg : 'a
Returns: 'a

logString msg

Full Usage: logString msg

Parameters:
    msg : 'a

msg : 'a

loggingMemory

Full Usage: loggingMemory

Returns: bool
Returns: bool

maxHeap ()

Full Usage: maxHeap ()

Parameters:
    () : unit

Returns: int
() : unit
Returns: int

memSize

Full Usage: memSize

Returns: int
Returns: int

periodicDispatch dispatch delayInMs msg

Full Usage: periodicDispatch dispatch delayInMs msg

Parameters:
    dispatch : 'a -> unit
    delayInMs : int
    msg : 'a

Returns: int
dispatch : 'a -> unit
delayInMs : int
msg : 'a
Returns: int

productionBuild

Full Usage: productionBuild

Returns: bool
Returns: bool

setDebugLevel ()

Full Usage: setDebugLevel ()

Parameters:
    () : unit

Hack to provide a constant global variable set from command line arguments of main process. 0 => production. 1 => dev. 2 => debug.

() : unit

startTimer label

Full Usage: startTimer label

Parameters:
    label : string

label : string

stopAndLogTimer label

Full Usage: stopAndLogTimer label

Parameters:
    label : string

label : string

traceIf traceCode debugAction

Full Usage: traceIf traceCode debugAction

Parameters:
    traceCode : string
    debugAction : unit -> string

Call debugAction() and print its result if debugTraceUI mutable contains string traceCode

traceCode : string
debugAction : unit -> string

usedHeap ()

Full Usage: usedHeap ()

Parameters:
    () : unit

Returns: int
() : unit
Returns: int

uuid ()

Full Usage: uuid ()

Parameters:
    () : unit

Returns: string

return a v4 (random) universally unique identifier (UUID)

() : unit
Returns: string

Type something to start searching.