Application
Extends:
Base class for an Application
Static Method Summary
Static Public Methods | ||
public static |
Kills all running applications |
|
public static |
Get a list of all running applications |
Constructor Summary
Public Constructor | ||
public |
constructor(core: Core, data: ApplicationData) Create application |
Member Summary
Public Members | ||
public |
args: {foo: *} Application arguments |
|
public |
Core instance reference |
|
public |
The application destruction state |
|
public |
Application metadata |
|
public |
Application options |
|
public |
The Application ID |
|
public |
Options for internal fetch/requests |
|
public |
settings: {foo: *} Application settings |
|
public |
Application WebSockets |
|
public |
Application started time |
|
public |
Window list |
|
public |
workers: Worker[] Worker instances |
Method Summary
Public Methods | ||
public |
createWindow(options: WindowOptions): Window Create a new window belonging to this application |
|
public |
Destroy application |
|
public |
this method was deprecated.
Emits an event across all (or filtered) applications |
|
public |
Gets a snapshot of the application session |
|
public |
relaunch() Re-launch this application |
|
public |
removeWindow(filter: Function) Removes window(s) based on given filter |
|
public |
Performs a request to the OS.js server with the application as the endpoint. |
|
public |
Gets a URI to a resource for this application |
|
public |
Saves settings |
|
public |
send() Sends a message over websocket via the core connection. |
|
public |
socket(path: string, options: WebsocketOptions): Websocket Creates a new Websocket |
|
public |
Creates a new Worker |
Static Public Methods
Public Constructors
public constructor(core: Core, data: ApplicationData) source
Create application
Params:
Name | Type | Attribute | Description |
core | Core | Core reference |
|
data | ApplicationData | Application data |
Public Members
Public Methods
public createWindow(options: WindowOptions): Window source
Create a new window belonging to this application
Params:
Name | Type | Attribute | Description |
options | WindowOptions |
|
Window options |
public destroy(remove: boolean) source
Destroy application
Params:
Name | Type | Attribute | Description |
remove | boolean |
|
public emitAll(filter: Function): Function source
Emits an event across all (or filtered) applications
Params:
Name | Type | Attribute | Description |
filter | Function |
|
A method to filter what applications to send to |
public removeWindow(filter: Function) source
Removes window(s) based on given filter
Params:
Name | Type | Attribute | Description |
filter | Function | Filter function |
public request(path: string, options: Options, type: string): Promise<*> source
Performs a request to the OS.js server with the application as the endpoint.
public resource(path: string, options: object): string source
Gets a URI to a resource for this application
If given path is an URI it will just return itself.
public send() source
Sends a message over websocket via the core connection.
This does not create a new connection, but rather uses the core connection. For subscribing to messages from the server use the 'ws:message' event
Params:
Name | Type | Attribute | Description |
...args | * | Arguments to pass to message |
public socket(path: string, options: WebsocketOptions): Websocket source
Creates a new Websocket
Params:
Name | Type | Attribute | Description |
path | string |
|
Append this to endpoint |
options | WebsocketOptions |
|
Connection options |