textmode.synth.js / setFunction
Function: setFunction()
ts
function setFunction(definitions, options?): ExtensionRegistration;Register one or more transform definitions using Hydra's setFunction() contract.
Accepts a single definition or an array of definitions installed atomically (the whole batch validates before any state changes). The default conflict policy is replace, so a definition can redefine a built-in or an earlier registration; pass { conflict: 'error' } to reject name collisions instead. Previously created chains keep their captured definition.
A src-type definition becomes a standalone function returned in sources and, in browser global mode, on window.
Parameters
| Parameter | Type | Description |
|---|---|---|
definitions | | TransformDefinition | readonly TransformDefinition[] | A single definition or an array of definitions |
options? | ExtensionOptions | Conflict policy and global exposure |
Returns
A registration handle whose dispose() restores the prior bindings