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:
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 | { |
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
logPushInterval
Set this property to a positive number to see the log output from the current worker on a connected CLI. Has no effect in the main UI thread.
Defines the maximum delay (in milliseconds) between the call of a Console
function (e.g. console.log()
) from inside a Worker
and the matching log event in the parent thread. Since this interrupts the UI thread smaller values could impact UI responsiveness.
The feature is disabled by default (value -1
), except for debug builds, where the default is 2000
.
Note: You do not need to set this property to see the console output on the built-in developer console, this is only for the CLI, or in cases where you record the log events in the UI thread. It also has no effect on the log output of the main thread.
Type: | number |
Default: | -1 |
Settable: | Yes |
Change Event: | Not supported |
propertyTypes
Type: | {[type]: PropertyType |
Settable: | By Constructor or JSX |
Change Event: | Not supported |
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: | Not supported |
symbols
Type: | {[symbol]: Symbol} |
Settable: | By Constructor or JSX |
Change Event: | Not supported |
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' |
|
message | string |
layout
Fired before certain native operations to render all modified layoutData objects.
EventObject Type: EventObject<Tabris>
This event has no additional parameter.