Search
Loading...
Skip to content

Interface: AssetSource

A source of assets

Methods#

findAssets()#

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

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

Parameters#

ParameterType
queryDataAssetQueryData

Returns#

Promise< | undefined | 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#

ParameterType
assetAssetDefinition

Returns#

void


removeAsset()?#

optional removeAsset(assetId): void;

Removes the given asset from this source.

Parameters#

ParameterType
assetIdstring

Returns#

void


getSupportedMimeTypes()?#

optional getSupportedMimeTypes(): undefined | string[];

Generates a list of supported mime types for this source.

Returns#

undefined | string[]

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

Properties#

PropertyTypeDescription
idstringThe unique id of the API
getGroups?() => Promise<string[]>Return every available group
credits?objectCredits for the source/api
credits.namestring-
credits.url?string-
license?objectGeneral license for all asset from this source
license.namestring-
license.url?string-
canManageAssets?booleanCan 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<undefinednumber>
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.