Search Docs
Loading...
Skip to content

Interface: AssetSource

A source of assets

Methods#

findAssets()#

findAssets(queryData): Promise<AssetsQueryResult<AssetResult>>;

Find all asset for the given type and the provided query data.

Parameters#

Parameter Type
queryData AssetQueryData

Returns#

Promise<AssetsQueryResult<AssetResult>>


addAsset()?#

optional addAsset(asset): void;

Adds the given asset to this source. Throws an error if the asset source does not support adding assets.

Parameters#

Parameter Type
asset AssetDefinition

Returns#

void


removeAsset()?#

optional removeAsset(assetId): void;

Removes the given asset from this source.

Parameters#

Parameter Type
assetId string

Returns#

void


getSupportedMimeTypes()?#

optional getSupportedMimeTypes(): string[];

Generates a list of supported mime types for this source.

Returns#

string[]

a list of the mime types should be supported by this source

Properties#

Property Type Description
id string The unique id of the API
fetchAsset? (id, params?) => Promise<AssetResult> Fetch an asset by id.
getGroups? () => Promise<string[]> Return every available group
credits? object Credits for the source/api
credits.name string -
credits.url? string -
license? object General license for all asset from this source
license.name string -
license.url? string -
canManageAssets? boolean Can the source add and remove assets dynamically? If false methods like addAsset and removeAsset will throw an error. Deprecated Will be removed in v1.11. Use canAdd and canRemove in the asset library configuration
applyAsset? (asset) => Promise<number> Apply the given asset result to the active scene. You can override this with custom behavior.
applyAssetToBlock? (asset, block) => Promise<void> Apply the given asset result to the given block. You can override this with custom behavior.
applyAssetProperty? (asset, property) => Promise<void> Apply a property of the given asset result to the active scene. You can override this with custom behavior.