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

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

() => Promise<WAL | undefined>

Prompts the user with the search bar and Moss pocket to select an Asset. Returns the associated WAL as soon as the user has selected an asset or undefined if the user cancels the selection process.