Object “tabris”

Object > NativeObject > Tabris

The main object exported by the tabris module hosting all the classes and singletons it provides (not listed here). It also provides low-level framework API required for bootstrapping and for some extensions/plug-ins. Caution!: These APIs interact with the internals of the framework. Only use them if you know what you are doing.

This object is also available in the global namespace as tabris. For technical reasons the low-level API is available in TypeScript only when the object is explicitly imported.

Type: Tabris extends NativeObject
Constructor: private
Singleton: tabris
Namespace: tabris
Direct subclasses: None
JSX Support: No

See also:

Modules

Methods

_defineModule(id, loaderFunction)

Adds a module to the internal module registry with an id relative to the app directory.

Parameter Type Description
id string  
loaderFunction ModuleLoader  

Returns: Module

_init(client, options?)

Initializes the framework and triggers the ‘start’ event.

Parameter Type Description
client any The client bridge provided by the native client.
options {
  headless: boolean // optional
}
Optional.

Returns: undefined

_notify(cid, eventType, eventData)

Callback for the native client to issue JavaScript events to the NativeObject with the given cid. Triggers a flush event afterwards. Errors are caught and logged to the console. Returns true if the event object has a defaultPrevented field set to true.

Parameter Type Description
cid string  
eventType string  
eventData object  

Returns: boolean

flush()

Sends all queued native operations to the native client and triggers the ‘flush’ event.

Returns: undefined

Properties

started

Indicates that the framework has been fully initialized. This happens before the main application module is parsed and executed, so it is only relevant for framework and plug-in developers.

Type: boolean
Default: false
Settable: No
Change Event: startedChanged

symbols

Type: {[symbol]: Symbol}
Settable: Yes
Change Event: symbolsChanged

version

The version of the tabris module.

Type: string
Settable: No
Change Event: Not supported

Events

start

Fired after the client bridge has been installed but before started has been set to true.

EventObject Type: EventObject<Tabris>

This event has no additional parameter.

flush

Fired after a native event has been processed.

EventObject Type: EventObject<Tabris>

This event has no additional parameter.

log

Fired when a message is about to be printed to the console.

EventObject Type: TabrisLogEvent<Tabris>

Property Type Description
level 'debug'
| 'info'
| 'log'
| 'warn'
| 'error'
 
message string  

layout

Fired before certain native operations to render all modified layoutData objects.

EventObject Type: EventObject<Tabris>

This event has no additional parameter.

Change Events

startedChanged

Fired when the started property has changed.

EventObject Type: PropertyChangedEvent<Tabris, boolean>

Property Type Description
value boolean The new value of started.

symbolsChanged

Fired when the symbols property has changed.

EventObject Type: PropertyChangedEvent<Tabris, Object>

Property Type Description
value {[symbol]: Symbol} The new value of symbols.