Component\<Events\>
Abstract Class: Component<Events>
Section titled “Abstract Class: Component<Events>”Defined in: view.svelte.ts:29
Base lifecycle helper used throughout the public API.
Components can own child components and cleanup callbacks so complex views and plugins can tear themselves down predictably.
Extends
Section titled “Extends”EventDispatcher<Events>
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”Events
Section titled “Events”Events extends ValidEventTypes = Record<string, any>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Component<
Events>():Component<Events>
Returns
Section titled “Returns”Component<Events>
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”children
Section titled “children”children:
Component<Record<string,any>>[] =[]
Defined in: view.svelte.ts:32
loaded
Section titled “loaded”loaded:
boolean=false
Defined in: view.svelte.ts:34
Accessors
Section titled “Accessors”containerEl
Section titled “containerEl”Get Signature
Section titled “Get Signature”get containerEl():
HTMLElement
Defined in: view.svelte.ts:38
Returns
Section titled “Returns”HTMLElement
Set Signature
Section titled “Set Signature”set containerEl(
el):void
Defined in: view.svelte.ts:42
Parameters
Section titled “Parameters”HTMLElement
Returns
Section titled “Returns”void
Methods
Section titled “Methods”addChild()
Section titled “addChild()”addChild<
T>(component):T
Defined in: view.svelte.ts:162
Adds a child component, loading it if this component is loaded
Type Parameters
Section titled “Type Parameters”T extends Component<Record<string, any>>
Parameters
Section titled “Parameters”component
Section titled “component”T
Returns
Section titled “Returns”T
dispatch()
Section titled “dispatch()”dispatch<
T>(eventName, …args):boolean
Defined in: events.ts:105
Type Parameters
Section titled “Type Parameters”T extends string | symbol
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…Parameters<EventListener<Events, T>>
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”emit()
Section titled “emit()”emit<
T>(eventName, …args):boolean
Defined in: events.ts:98
Type Parameters
Section titled “Type Parameters”T extends string | symbol
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…Parameters<EventListener<Events, T>>
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”load()
Section titled “load()”load():
void
Defined in: view.svelte.ts:51
Load this component and its children
Returns
Section titled “Returns”void
off<
T>(eventName,listener,context?,once?):void
Defined in: events.ts:78
Type Parameters
Section titled “Type Parameters”T extends string | symbol
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”EventListener<Events, T>
context?
Section titled “context?”any
boolean
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”offref()
Section titled “offref()”offref<
T>(ref):void
Defined in: events.ts:87
Type Parameters
Section titled “Type Parameters”T extends string | symbol
Parameters
Section titled “Parameters”EventRef<Events, T>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”on<
T>(eventName,listener,context?):EventRef<Events,T,any>
Defined in: events.ts:48
Type Parameters
Section titled “Type Parameters”T extends string | symbol
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”EventListener<Events, T>
context?
Section titled “context?”any
Returns
Section titled “Returns”EventRef<Events, T, any>
Inherited from
Section titled “Inherited from”once()
Section titled “once()”once<
T>(eventName,listener,context?):EventRef<Events,T,any>
Defined in: events.ts:63
Type Parameters
Section titled “Type Parameters”T extends string | symbol
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
listener
Section titled “listener”EventListener<Events, T>
context?
Section titled “context?”any
Returns
Section titled “Returns”EventRef<Events, T, any>
Inherited from
Section titled “Inherited from”onload()
Section titled “onload()”
abstractonload():void|Promise<void>
Defined in: view.svelte.ts:65
Override this to load your component
Returns
Section titled “Returns”void | Promise<void>
onunload()
Section titled “onunload()”
abstractonunload():void
Defined in: view.svelte.ts:122
Override this to unload your component
Returns
Section titled “Returns”void
register()
Section titled “register()”register(
cb):void
Defined in: view.svelte.ts:189
Registers a callback to be called when unloading
Parameters
Section titled “Parameters”() => any
Returns
Section titled “Returns”void
registerDomEvent()
Section titled “registerDomEvent()”Call Signature
Section titled “Call Signature”registerDomEvent<
K>(el,type,callback,options?):void
Defined in: view.svelte.ts:208
Registers an DOM event to be detached when unloading
Type Parameters
Section titled “Type Parameters”K extends keyof HTMLElementEventMap
Parameters
Section titled “Parameters”HTMLElement
K
callback
Section titled “callback”(this, ev) => any
options?
Section titled “options?”boolean | AddEventListenerOptions
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”registerDomEvent<
K>(el,type,callback,options?):void
Defined in: view.svelte.ts:214
Registers an DOM event to be detached when unloading
Type Parameters
Section titled “Type Parameters”K extends keyof DocumentEventMap
Parameters
Section titled “Parameters”Document
K
callback
Section titled “callback”(this, ev) => any
options?
Section titled “options?”boolean | AddEventListenerOptions
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”registerDomEvent<
K>(el,type,callback,options?):void
Defined in: view.svelte.ts:220
Registers an DOM event to be detached when unloading
Type Parameters
Section titled “Type Parameters”K extends keyof WindowEventMap
Parameters
Section titled “Parameters”Window
K
callback
Section titled “callback”(this, ev) => any
options?
Section titled “options?”boolean | AddEventListenerOptions
Returns
Section titled “Returns”void
registerEvent()
Section titled “registerEvent()”registerEvent<
T,K>(eventRef):void
Defined in: view.svelte.ts:193
Type Parameters
Section titled “Type Parameters”T extends ValidEventTypes
K extends string | symbol
Parameters
Section titled “Parameters”eventRef
Section titled “eventRef”EventRef<T, K, any>
Returns
Section titled “Returns”void
registerInterval()
Section titled “registerInterval()”registerInterval(
id):void
Defined in: view.svelte.ts:199
Parameters
Section titled “Parameters”Timeout
Returns
Section titled “Returns”void
removeChild()
Section titled “removeChild()”removeChild<
T>(component):T
Defined in: view.svelte.ts:176
Removes a child component, unloading it
Type Parameters
Section titled “Type Parameters”T extends Component<Record<string, any>>
Parameters
Section titled “Parameters”component
Section titled “component”T
Returns
Section titled “Returns”T
trigger()
Section titled “trigger()”trigger<
T>(eventName, …args):boolean
Defined in: events.ts:91
Type Parameters
Section titled “Type Parameters”T extends string | symbol
Parameters
Section titled “Parameters”eventName
Section titled “eventName”T
…Parameters<EventListener<Events, T>>
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”tryTrigger()
Section titled “tryTrigger()”tryTrigger<
T>(evt, …args):void
Defined in: events.ts:112
Type Parameters
Section titled “Type Parameters”T extends string | symbol
Parameters
Section titled “Parameters”EventRef<Events, T>
…Parameters<EventListener<Events, T>>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”unload()
Section titled “unload()”unload():
void
Defined in: view.svelte.ts:92
Unload this component and its children
Returns
Section titled “Returns”void