Skip to content

Home > @theweave/api > WeaveServices

WeaveServices interface

Signature:

typescript
export interface WeaveServices

Properties

Property

Modifiers

Type

Description

appletInfo

(appletHash: any) => Promise<AppletInfo | undefined>

Returns Applet info of the specified Applet

appletParticipants

() => Promise<AgentPubKey[]>

Gets all the agents that joined the Tool instance of the Tool calling this function

assets

AssetServices

createCloneCell

(req: CreateCloneCellRequest, publicToGroupMembers: boolean) => Promise<CreateCloneCellResponse>

Create a cloned cell and optionally have it be registered in the group DNA for other group members or always-online nodes to be able to automatically join it too.

disableCloneCell

(req: DisableCloneCellRequest) => Promise<void>

enableCloneCell

(req: EnableCloneCellRequest) => Promise<CreateCloneCellResponse>

groupProfile

(groupHash: any) => Promise<any>

Get the group profile of the specified group

mossVersion

() => string

myGroupPermissionType

() => Promise<GroupPermissionType>

Gets the group permission type. May be used to restrict certain actions in the UI.

notifyFrame

(notifications: Array<FrameNotification>) => Promise<any>

Sends notifications to We and depending on user settings and urgency level further to the operating system.

onBeforeUnload

(callback: () => void) => UnsubscribeFunction

Event listener allowing to register a callback that will get executed before the applet gets reloaded, for example to save intermediate user input (e.g. commit the most recent changes of a document to the source chain).

If this callback takes too long, users may be offered to force reload, thereby ignoring/cancelling the pending callback.

onPeerStatusUpdate

(callback: (payload: PeerStatusUpdate) => any) => UnsubscribeFunction

Event handler for peer status updates.

onRemoteSignal

(callback: (payload: Uint8Array) => any) => UnsubscribeFunction

Event listener allowing to register a callback that will get executed if a remote signal that had been sent with WeaveClient.sendRemoteSignal() arrives.

openAppletBlock

(appletHash: any, block: string, context: any) => Promise<void>

Open the specified block view of the specified Applet

openAppletMain

(appletHash: EntryHash) => Promise<void>

Open the main view of the specified Applet

openAsset

(wal: WAL, mode?: OpenAssetMode) => Promise<void>

Open the asset associated to the specified WAL

openCrossGroupBlock

(appletBundleId: string, block: string, context: any) => Promise<void>

Open the specified block view of the specified Applet Type

openCrossGroupMain

(appletBundleId: string) => Promise<void>

Open the cross-applet main view of the specified Applet Type.

requestClose

() => Promise<void>

Requests to close the containing window. Will only work if the applet is being run in its own window

sendRemoteSignal

(payload: Uint8Array) => Promise<void>

Allows to send small sized "fire-and-forget" signals to all group participants that are currently online.

userSelectScreen

() => Promise<string>

Let's the user select a Screen or Window and returns the selected id. Useful for screen sharing applications.