The type of the object it wraps.
ReadonlyboundReadonlychildReadonlychildrenReadonlysiblingReadonlysiblingsReadonlyreifectsReadonlyonReadonlyonReadonlyisReadonlyclosestReadonlysubstratesReadonlyonOptionalclasses: string | string[]String of classes separated by spaces, or array of strings.
Optionalforce: boolean(Optional) Boolean that turns the toggle into a one way-only operation. If set to false, then the class will only be removed, but not added. If set to true, then token will only be added, but not removed.
Itself, allowing for method chaining.
FunctionsetProperties
The HTML tag of the element (for accurate autocompletion of available properties).
The properties object.
OptionalsetOnlyBaseProperties: booleanIf set to true, will only set the base turbo properties (classes, text, style, id, children, parent, etc.) and ignore all other properties not explicitly defined in TurboProperties.
Itself, allowing for method chaining.
FunctionsetMvc
The properties to configure the MVC structure.
Sets MVC properties for a certain object. If no mvc field exists on the object, a new
Mvc object will be created with the given properties.
Functionon
The type of the element.
The type of the event.
The function that receives a notification.
Optionaloptions: AddEventListenerOptionsAn options object that specifies characteristics about the event listener.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
Itself, allowing for method chaining.
FunctiononTool
The type of the element.
The type of the event.
The name of the tool. Set to null or undefined to check for listeners not bound to a tool.
The function that receives a notification.
Optionaloptions: AddEventListenerOptionsAn options object that specifies characteristics about the event listener.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
Itself, allowing for method chaining.
FunctionexecuteAction
The type of the event.
The name of the tool. Set to null or undefined to fire listeners not bound to a tool.
The event to pass as parameter to the listeners.
Optionaloptions: AddEventListenerOptionsOptions object that specifies characteristics about the event listeners to fire.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
FunctionhasListener
The type of the event. Set to null or undefined to get all event types.
The function that receives a notification.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
FunctionhasToolListener
The type of the event. Set to null or undefined to get all event types.
The name of the tool the listener is attached to. Set to null or undefined to check for listeners not bound to a tool.
The function that receives a notification.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
FunctionhasListenersByType
The type of the event. Set to null or undefined to get all event types.
OptionaltoolName: stringThe name of the tool to consider (if any). Set to null or undefined to check for listeners not bound to a tool.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
FunctionremoveListener
The type of the event.
The function that receives a notification.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
Itself, allowing for method chaining.
FunctionremoveToolListener
The type of the event.
The name of the tool the listener is attached to. Set to null or undefined to check for listeners not bound to a tool.
The function that receives a notification.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
Itself, allowing for method chaining.
FunctionremoveListenersByType
The type of the event. Set to null or undefined to consider all types.
OptionaltoolName: stringThe name of the tool associated (if any). Set to null or undefined to check for listeners not bound to a tool.
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
Itself, allowing for method chaining.
FunctionremoveAllListeners
Optionalmanager: TurboEventManagerThe associated event manager. Defaults to the first created manager, or a new instantiated one if none already exist.
Itself, allowing for method chaining.
Optionaloptions: PreventDefaultOptionsAn options object to customize the behavior of the function.
FunctionaddToParent
The parent node to attach the element to.
Optionalindex: numberThe position at which to add the element relative to the parent's child list. Leave undefined to add the element at the end.
OptionalreferenceList: Node[] | NodeListOf<Node>The child list to
use as computation reference for index placement. Defaults to the parent's childrenArray.
Itself, allowing for method chaining.
FunctionaddChild
Optionalchildren: Node | Node[]Array of (or single) child nodes.
Optionalindex: numberThe position at which to add the child relative to the parent's child list. Leave undefined to add the child at the end.
OptionalreferenceList: Node[] | NodeListOf<Node>The child list to
use as computation reference for index placement. Defaults to the node's childrenArray.
Itself, allowing for method chaining.
FunctionremoveChildAt
Itself, allowing for method chaining.
FunctionchildAt
The child at the given index, or null if the index is invalid.
FunctionindexOfChild
The index of the child node in the provided list, or -1 if the child is not found.
FunctionindexInParent
OptionalreferenceList: Node[]The siblings list to use as computation
reference for index placement. Defaults to the node's siblings.
True if the children belong to the node, false otherwise.
Functionclosest
The (valid) CSS selector string. constructor/class to match.
The matching ancestor element, or null if no match is found.
FunctionapplyDefaults
Key/value map of defaults to apply on the object.
Optionaloptions: ApplyDefaultsOptionsOptional configuration for merging keys.
The same selector instance for chaining.
Whether to show the element or not
Optionaloptions: ReifectAppliedOptions<Shown>Itself, allowing for method chaining.
FunctionattachReifect
The reifect(s) to attach.
FunctiondetachReifect
The reifect(s) to detach.
FunctioninitializeReifect
The type of the reifect's states.
Optionalreifect: StatefulReifect<State>The reifect to initialize.
Optionalstate: StateThe state to initialize to (if the reifect is not stateless).
Optionaloptions: ReifectAppliedOptions<State>Optional overrides for the default values.
Set to null to not set anything on the object.
FunctionapplyReifect
The type of the reifect's states.
The reifect to apply.
Optionalstate: StateThe state to initialize to (if the reifect is not stateless).
Optionaloptions: ReifectAppliedOptions<State>Optional overrides for the default values.
Set to null to not set anything on the object.
FunctiontoggleReifect
The type of the reifect's states.
The reifect to toggle.
Optionaloptions: ReifectAppliedOptions<State>Optional overrides for the default values.
Set to null to not set anything on the object.
FunctionreifectEnabledState
Optionalreifect: StatefulReifectThe target reifect.
FunctionenableReifect
The new state.
Optionalreifect: StatefulReifectThe target reifect.
FunctionsetStyle
A string representing the style attribute to set.
THe value to append.
Optionalinstant: booleanIf true, will set the fields directly. Otherwise, will set them on next animation frame.
Itself, allowing for method chaining.
FunctionappendStyle
A string representing the style attribute to append to.
The value to append.
Optionalseparator: stringThe separator to use between the existing and new values.
Optionalinstant: booleanIf true, will set the fields directly. Otherwise, will set them on next animation frame.
Itself, allowing for method chaining.
FunctionsetStyles
Acceptable styles to set.
Optionalinstant: booleanIf true, will set the fields directly. Otherwise, will set them on next animation frame.
Itself, allowing for method chaining.
FunctionmakeSubstrate
The name of the new substrate.
Optionaloptions: MakeSubstrateOptionsOptions parameter to configure the newly-created substrate.
FunctiononSubstrateActivate
Optionalsubstrate: stringThe name of the targeted substrate. Defaults to the current substrate.
Get the delegate fired when the substrate of the given name is activated (set as currentSubstrate).
FunctiononSubstrateDeactivate
Optionalsubstrate: stringThe name of the targeted substrate. Defaults to the current substrate.
FunctiongetSubstrateObjectList
Optionalsubstrate: stringThe name of the targeted substrate. Defaults to the current substrate.
Set. To modify the list, use
addObjectToSubstrate and removeObjectFromSubstrate.FunctionsetSubstrateObjectList
The list of objects to constrain.
Optionalsubstrate: stringThe name of the targeted substrate. Defaults to the current substrate.
FunctionwasObjectProcessedBySubstrate
The object to check.
Optionalsubstrate: stringThe name of the targeted substrate. Defaults to the current substrate.
Check whether the given object was already processed by the substrate in the current resolving loop (resolveSubstrate). Can be useful in solvers.
FunctionaddSolver
The solver function to execute when calling resolveSubstrate.
Optionalsubstrate: stringThe name of the targeted substrate. Defaults to the current substrate.
FunctionremoveSolver
The solver function to remove.
Optionalsubstrate: stringThe name of the targeted substrate. Defaults to the current substrate.
FunctionresolveSubstrate
Optionalproperties: SubstrateSolverPropertiesOptions object to configure the context of the resolving call.
Optionalsubstrate: stringThe name of the targeted substrate. Defaults to the current substrate.
FunctionmakeTool
The unique name of the tool to register under the manager. Reusing an existing
toolName will make this element another instance of toolName.
Optionaloptions: MakeToolOptionsTool creation options (custom activation, click mode, key mapping, manager).
FunctionisTool
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
True if the element is a tool, false otherwise.
FunctiongetToolNames
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
The list of tool names.
FunctiongetToolName
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
The first tool name, if any.
FunctiononToolActivate
OptionaltoolName: stringThe name of the tool.
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
FunctiononToolDeactivate
OptionaltoolName: stringThe name of the tool.
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
FunctionaddToolBehavior
The type of the event (e.g., "pointerdown", "click", custom turbo event).
The behavior function. Return true to stop propagation.
OptionaltoolName: stringTool name to bind the behavior to. Defaults to this element's first tool.
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
Itself for chaining.
FunctionhasToolBehavior
The type of the event (e.g., "pointerdown", "click", custom turbo event).
OptionaltoolName: stringThe tool name to check under. Defaults to this element's first tool.
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
True if one or more behaviors are registered.
FunctionremoveToolBehaviors
The type of the event (e.g., "pointerdown", "click", custom turbo event).
OptionaltoolName: stringThe tool name whose behaviors will be removed. Defaults to this element's first tool.
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
Itself for chaining.
FunctionapplyTool
The name of the tool whose behaviors should run.
The type of the event (e.g., "pointerdown", "click", custom turbo event).
The triggering event instance.
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
True if at least one behavior returned true (to stop propagation of the event).
FunctionclearToolBehaviors
Optionalmanager: TurboEventManagerThe associated event manager (defaults to TurboEventManager.instance).
Itself for chaining.
FunctionembedTool
The node to manipulate when interacting with the tool element itself.
Optionalmanager: TurboEventManagerThe associated manager (defaults to TurboEventManager.instance).
Itself for chaining.
FunctionisEmbeddedTool
Optionalmanager: TurboEventManagerThe associated manager (defaults to TurboEventManager.instance).
True if an embedded target is present.
FunctiongetEmbeddedToolTarget
Optionalmanager: TurboEventManagerThe associated manager (defaults to TurboEventManager.instance).
The embedded tool's target node, if any.
FunctionignoreTool
The name of the tool to ignore.
Optionaltype: stringThe type of the event. If undefined, all event types will be considered.
Optionalignore: booleanWhether to ignore the tool. Defaults to true.
Optionalmanager: TurboEventManagerThe associated manager (defaults to TurboEventManager.instance).
Itself for chaining.
FunctionignoreTool
Optionalignore: booleanWhether to ignore the tools. Defaults to true.
Optionalmanager: TurboEventManagerThe associated manager (defaults to TurboEventManager.instance).
Itself for chaining.
FunctionisToolIgnored
The name of the tool to check for.
Optionaltype: stringThe type of the event. If undefined, all event types will be considered.
Optionalmanager: TurboEventManagerThe associated manager (defaults to TurboEventManager.instance).
Whether the tool is ignored for the provided event type.
TurboSelector
Description
Selector class that wraps an object and augments it with useful functions to manipulate it. It also proxies the object, so you can access properties and methods on the underlying object directly through the selector.