Interface: GlobalCtxWithAPI
addons/api/api.GlobalCtxWithAPI
Hierarchy
GlobalCtx
↳
GlobalCtxWithAPI
Table of contents
Properties
Methods
- addListener
- emit
- eventNames
- getLocale
- listenerCount
- listeners
- off
- on
- once
- reloadAddonList
- removeAllListeners
- removeListener
Properties
addons
addons: Record
<string
, AddonManifest
>
Inherited from
GlobalCtx.addons
api
api: CharlotteAPI
app
app: __module
= app
Inherited from
GlobalCtx.app
instances
instances: Object
Type declaration
Name | Type |
---|---|
blockly? | RealBlockly |
vm? | VM |
loader
loader: src/core/loader/loader
= loader
Inherited from
GlobalCtx.loader
settings
settings: Settings
= settings
Inherited from
GlobalCtx.settings
version
version: string
Inherited from
GlobalCtx.version
Methods
addListener
addListener<T
>(event
, fn
, context?
): this
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn | (...args : any []) => void |
context? | any |
Returns
this
Inherited from
GlobalCtx.addListener
emit
emit<T
>(event
, ...args
): boolean
Calls each of the listeners registered for a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
...args | any [] |
Returns
boolean
Inherited from
GlobalCtx.emit
eventNames
eventNames(): (string
| symbol
)[]
Return an array listing the events for which the emitter has registered listeners.
Returns
(string
| symbol
)[]
Inherited from
GlobalCtx.eventNames
getLocale
getLocale(): string
Returns
string
Inherited from
GlobalCtx.getLocale
listenerCount
listenerCount(event
): number
Return the number of listeners listening to a given event.
Parameters
Name | Type |
---|---|
event | string | symbol |
Returns
number
Inherited from
GlobalCtx.listenerCount
listeners
listeners<T
>(event
): (...args
: any
[]) => void
[]
Return the listeners registered for a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
Returns
(...args
: any
[]) => void
[]
Inherited from
GlobalCtx.listeners
off
off<T
>(event
, fn?
, context?
, once?
): this
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn? | (...args : any []) => void |
context? | any |
once? | boolean |
Returns
this
Inherited from
GlobalCtx.off
on
on<T
>(event
, fn
, context?
): this
Add a listener for a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn | (...args : any []) => void |
context? | any |
Returns
this
Inherited from
GlobalCtx.on
once
once<T
>(event
, fn
, context?
): this
Add a one-time listener for a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn | (...args : any []) => void |
context? | any |
Returns
this
Inherited from
GlobalCtx.once
reloadAddonList
reloadAddonList(): void
Returns
void
Inherited from
GlobalCtx.reloadAddonList
removeAllListeners
removeAllListeners(event?
): this
Remove all listeners, or those of the specified event.
Parameters
Name | Type |
---|---|
event? | string | symbol |
Returns
this
Inherited from
GlobalCtx.removeAllListeners
removeListener
removeListener<T
>(event
, fn?
, context?
, once?
): this
Remove the listeners of a given event.
Type parameters
Name | Type |
---|---|
T | extends string | symbol |
Parameters
Name | Type |
---|---|
event | T |
fn? | (...args : any []) => void |
context? | any |
once? | boolean |
Returns
this
Inherited from
GlobalCtx.removeListener