Home Reference Source
public class | source

PackAsset

Extends:

Asset → PackAsset

Pack asset loader. It serves also as fetch engine (it's subassets container).

Static Method Summary

Static Public Methods
public static

factory(args: *): PackAsset

Asset factory.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

data: {"descriptor": *, "raw": *}

Method Summary

Public Methods
public
public

entryText(path: string, noThrow: boolean): string

Gets text representation of given subasset.

public

entryView(path: string, noThrow: boolean): ArrayBufferView | null

Gets Array buffer view of given subasset.

public

fetchSubAsset(path: *, options: *, fallbackEngine: *): *

public

Tells if pack has subasset of given path.

public

load(): *

Inherited Summary

From class Asset
public get

data: *

public set

data: *

public get
public get

options: *

public get
public get
public

Destructor (disposes internal resources).

public

fetchSubAsset(path: string, options: *): Promise

Use this asset as fetch engine and load part of it's content as asset.

public abstract

Load asset.

public

makeFetchEngine(fallbackEngine: *): *: Function

public

Called when asset is loaded and ready to use.

Static Public Methods

public static factory(args: *): PackAsset source

Asset factory.

Params:

NameTypeAttributeDescription
args *

Factory parameters.

Return:

PackAsset

Asset instance.

Example:

system.registerProtocol('pack', PackAsset.factory);

Public Constructors

public constructor() source

Constructor.

Override:

Asset#constructor

Public Members

public data: {"descriptor": *, "raw": *} source

Override:

Asset#data

Public Methods

public dispose() source

Destructor (disposes internal resources).

Override:

Asset#dispose

public entryText(path: string, noThrow: boolean): string source

Gets text representation of given subasset.

Params:

NameTypeAttributeDescription
path string

Subasset path.

noThrow boolean

Tells if function should not throw exceptions on fail.

Return:

string

Text representation of subasset.

public entryView(path: string, noThrow: boolean): ArrayBufferView | null source

Gets Array buffer view of given subasset.

Params:

NameTypeAttributeDescription
path string

Subasset path.

noThrow boolean

Tells if function should not throw exceptions on fail.

Return:

ArrayBufferView | null

Subasset array view if exists or null otherwise.

public fetchSubAsset(path: *, options: *, fallbackEngine: *): * source

Use this asset as fetch engine and load part of it's content as asset.

Override:

Asset#fetchSubAsset

Params:

NameTypeAttributeDescription
path *
options *
fallbackEngine *

Return:

*

public hasEntry(path: string): boolean source

Tells if pack has subasset of given path.

Params:

NameTypeAttributeDescription
path string

Subasset path.

Return:

boolean

True if entry exists, false otherwise.

public load(): * source

Load asset.

Override:

Asset#load

Return:

*