VanillaInspector
An inspector that renders to a nominated DOM element, using VisuallyJs's default template renderer. You have to provide templateResolver which, for a given object, can return a template in VisuallyJs's default template syntax.
Extends
Extended by
Constructors
Constructor
new VanillaInspector(
options):VanillaInspector
Constructor for the vanilla inspector.
Parameters
options
Returns
VanillaInspector
Overrides
Inspector.constructor
Methods
bind()
bind<
T>(event,listener,insertAtStart?):EventGenerator
Bind a listener to the named event, optionally inserting the listener at the head of the queue for the given event.
Type Parameters
T
T = any
The type of the payload you expect to be passed to your callback. Using this is helpful to ensure your callbacks are typed correctly.
Parameters
event
any
Name of the event to bind
listener
(payload, evt?) => any
Function to bind to the event
insertAtStart?
boolean
Defaults to false. If true, this handler is inserted at the head of the list of listeners for the given event.
Returns
EventGenerator
Inherited from
bindAll()
bindAll<
T>(events,listener,insertAtStart?):EventGenerator
Bind a listener to all of the named events, optionally inserting each one at the head of the queue for the given event.
Type Parameters
T
T = any
The type of the payload you expect to be passed to your callback. Using this is helpful to ensure your callbacks are typed correctly.
Parameters
events
any[]
listener
(payload, evt?) => any
insertAtStart?
boolean
Returns
EventGenerator
Inherited from
bindUnchecked()
bindUnchecked<
T>(event,listener,insertAtStart?):EventGenerator
Bind an event listener. This method can be used with a type parameter by call sites; although it's not necessary it can be helpful to use this to ensure you've thought about what the payload to your event handler is going to be.
Type Parameters
T
T = any
The type of the payload you expect to be passed to your callback. Using this is helpful to ensure your callbacks are typed correctly.
Parameters
event
string
Name of the event(s) to bind to.
listener
(a, e?) => any
Function to bind to the given event(s)
insertAtStart?
boolean
Whether or not to insert this listener at the head of the listener queue. Defaults to false.
Returns
EventGenerator
Inherited from
ensureContext()
ensureContext<
T>(name,generator):T
Either get the named object from the context, or create it, set it, and then return it.
Type Parameters
T
T
Parameters
name
string
generator
() => T
Returns
T
Inherited from
getFromContext()
getFromContext<
T>(key):T
Gets the named object from the context. May return null. If you want to ensure the context has a certain value, use ensureContext instead of this method.
Type Parameters
T
T = any
Parameters
key
string
Returns
T
Inherited from
getValue()
getValue(
key):string
Gets the current value for the given key, may be null.
Parameters
key
string
Returns
string
Inherited from
hasPendingChanges()
hasPendingChanges():
boolean
Returns whether or not there are unsaved changes.
Returns
boolean
Inherited from
persist()
persist():
number
Persist any pending updates to the toolkit, then clear the list of pending updates. Returns the count of the number of changes made.
Returns
number
Inherited from
redraw()
redraw():
void
Redraw the inspector.
Returns
void
Inherited from
setValue()
setValue(
key,value,portId,repaintAfterwards?):void
For subclasses/wrapper classes to use.
Parameters
key
string
value
any
portId
string
repaintAfterwards?
boolean
Returns
void
Inherited from
unbind()
unbind(
eventOrListener?,listener?):EventGenerator
Unbind the given event listener, or all listeners. If you call this method with no arguments then all event listeners are unbound.
Parameters
eventOrListener?
Either an event name, or an event handler function
string | Function
listener?
Function
If eventOrListener is defined, this is the event handler to unbind.
Returns
EventGenerator
Inherited from
updateContext()
updateContext(
key,value):void
Update the context with the given value for the given key.
Parameters
key
string
value
any
Returns
void