Packages
Package Manager
Handles indexing, loading and launching of OS.js packages
Constructor Summary
Public Constructor | ||
public |
constructor(core: Core) Create package manage |
Member Summary
Public Members | ||
public |
Core instance reference |
|
public |
If inited |
|
public |
The lost of loaded package metadata |
|
public |
A list of registered packages |
|
public |
Preloader |
Private Members | ||
private |
A list of running application names |
Method Summary
Public Methods | ||
public |
addPackages(list: PackageMetadata[]): PackageMetadata[] Adds a set of packages |
|
public |
destroy() Destroy package manager |
|
public |
getCompatiblePackages(mimeType: string): PackageMetadata[] Gets a list of packages compatible with the given mime type |
|
public |
getMetadataFromName(name: string): PackageMetadata Gets the package metadata for a given package name |
|
public |
getPackages(filter: Function): PackageMetadata[] Gets a list of packages (metadata) |
|
public |
Initializes package manager |
|
public |
launch(name: string, args: {foo: *}, options: PackageLaunchOptions): Promise<Application> Launches a (application) package |
|
public |
Registers a package |
|
public |
Gets a list of running packages |
Private Methods | ||
private |
Autostarts tagged packages |
|
private |
_getPreloads(metadata: Metadata, fileType: string, packageType: string): string[] Returns preloads |
|
private |
_launch(name: string, args: {foo: *}, options: PackageLaunchOptions): Promise<Application> Wrapper for launching a (application) package |
|
private |
_launchApplication(name: string, metadata: Metadata, args: {foo: *}, options: PackageLaunchOptions): Promise<Application> Launches an application package |
|
private |
_launchTheme(name: string, metadata: Metadata): Promise<object> Launches a (theme) package |
|
private |
_preloadBackgroundFiles(list: PackageMetadata[]): * Preloads background files of a set of packages |
Public Constructors
Public Members
Private Members
Public Methods
public addPackages(list: PackageMetadata[]): PackageMetadata[] source
Adds a set of packages
Params:
Name | Type | Attribute | Description |
list | PackageMetadata[] | Package list |
public getCompatiblePackages(mimeType: string): PackageMetadata[] source
Gets a list of packages compatible with the given mime type
Params:
Name | Type | Attribute | Description |
mimeType | string | MIME Type |
public getMetadataFromName(name: string): PackageMetadata source
Gets the package metadata for a given package name
Params:
Name | Type | Attribute | Description |
name | string |
public getPackages(filter: Function): PackageMetadata[] source
Gets a list of packages (metadata)
Params:
Name | Type | Attribute | Description |
filter | Function |
|
A filter function |
public launch(name: string, args: {foo: *}, options: PackageLaunchOptions): Promise<Application> source
Launches a (application) package
Params:
Name | Type | Attribute | Description |
name | string | Package name |
|
args | {foo: *} |
|
Launch arguments |
options | PackageLaunchOptions |
|
Launch options |
Throw:
Private Methods
private _getPreloads(metadata: Metadata, fileType: string, packageType: string): string[] source
Returns preloads
private _launch(name: string, args: {foo: *}, options: PackageLaunchOptions): Promise<Application> source
Wrapper for launching a (application) package
Params:
Name | Type | Attribute | Description |
name | string | Package name |
|
args | {foo: *} | Launch arguments |
|
options | PackageLaunchOptions | Launch options |
private _launchApplication(name: string, metadata: Metadata, args: {foo: *}, options: PackageLaunchOptions): Promise<Application> source
Launches an application package
Params:
Name | Type | Attribute | Description |
name | string | Application package name |
|
metadata | Metadata | Application metadata |
|
args | {foo: *} | Launch arguments |
|
options | PackageLaunchOptions | Launch options |
private _launchTheme(name: string, metadata: Metadata): Promise<object> source
Launches a (theme) package
Params:
Name | Type | Attribute | Description |
name | string | Package name |
|
metadata | Metadata | Application metadata |
Throw:
private _preloadBackgroundFiles(list: PackageMetadata[]): * source
Preloads background files of a set of packages
Params:
Name | Type | Attribute | Description |
list | PackageMetadata[] | Package list |
Return:
* |