Skip to main content

Module addon

Module addon 

Source
Expand description

Binding a browser add-on’s described functions into the hosts, on every target. Binding a browser add-on’s functions into the script hosts.

An add-on describes its functions as data (lumen_ir::addon::Addon), and every target binds the same description: a page to the JavaScript module it loaded, a compile to a body that is never called, and everything else (a build-time render, a server, a desktop run) to a body that says the function runs only in a browser. One description, one signature per function, so a program compiled against one of them binds against all of them.

An asynchronous function takes a tag after its declared arguments and returns nothing: its result arrives later as the <event> handler, called with the tag and the value, or <event>_error, called with the tag and the reason.

Constants§

TAG_PARAM
The name of the argument an asynchronous function takes its tag in.

Functions§

browser_only_fns
Every function addon offers, bound to a body that raises <namespace>::<function> runs only in a browser in the script that called it.
error_event
The event an asynchronous function’s failure arrives as.
script_fns
Every function addon offers, bound to the body body builds for it.
signature
The signature a script sees for function: its declared parameters, a trailing tag for an asynchronous one, and what it returns.

Type Aliases§

OnBrowserOnlyCall
Something told about a call a target answered with “only in a browser”.