createShapesForAssets

See source code

A helper function for an external content handler. It creates bookmarks, images or video shapes corresponding to the type of assets provided.

function createShapesForAssets(
  editor: Editor,
  assets: TLAsset[],
  position: VecLike,
): Promise<TLShapeId[]>;

Parameters

NameDescription

editor

Editor;

The editor instance

assets

TLAsset[];

An array of asset Ids

position

VecLike;

the position at which to create the shapes

Returns

Promise<TLShapeId[]>;
Prev
createEmptyBookmarkShape
Next
defaultAddFontsFromNode