Skip to content

Home > @theweave/api > AssetServices

AssetServices interface

Signature:

typescript
export interface AssetServices

Properties

Property

Modifiers

Type

Description

addAssetRelation

(srcWal: WAL, dstWal: WAL, tags?: string[]) => Promise<void>

Adds a new asset relation. This function deliberately returns no value because Tool frontends should subscribe to the AssetStore(s) to update their frontend state.

addTagsToAsset

(wal: WAL, tags: string[]) => Promise<void>

Adds new tags to an asset

addTagsToAssetRelation

(relationHash: EntryHash, tags: string[]) => Promise<void>

Adds new tags to an existing asset relation

assetInfo

(wal: WAL) => Promise<AssetLocationAndInfo | undefined>

Gets information about an entry in any other Applet in We

assetStore

(wal: WAL) => AssetStore

Returns a Svelte readable store that can be subscribed to in order to get updated about the latest information about this asset (tags and other related assets)

assetToPocket

(wal: WAL) => Promise<void>

Adds the specified HRL to the We-internal clipboard

dragAsset

(wal: WAL) => Promise<void>

Communicate that an asset is being dragged

getAllAssetRelationTags

(crossGroup?: boolean) => Promise<string[]>

Get all asset relation tags that have been used so far in the group. Useful for example to display in a tag selection UI element.

removeAssetRelation

(relationHash: EntryHash) => Promise<void>

Removes an asset relation and all its tags. This function deliberately returns no value because Tool frontends should subscribe to the AssetStore(s) to update their frontend state.

removeTagsFromAsset

(wal: WAL, tags: string[]) => Promise<void>

Removes the given tags from an asset.

removeTagsFromAssetRelation

(relationHash: EntryHash, tags: string[]) => Promise<void>

Removes the specified tags from an asset relation

userSelectAsset

(from?: 'search' | 'pocket' | 'create') => Promise<WAL | undefined>

Prompts the user to select an Asset and returns the associated WAL as soon as the user has selected an asset or returns undefined if the user cancels the selection process. By default it will let the user select the Asset from the pocket but other means of selecting the asset can be specified optionally with the "from" argument.

userSelectAssetRelationTag

() => Promise<string | undefined>

Prompts the user with a dialog to select an asset relation tag. Returns the associated tag as a string as soon as the user has selected a tag or undefined it the user cancels the selection process.