createBookmarkFromUrl

See source code

Creates a bookmark shape from a URL with unfurled metadata.

function createBookmarkFromUrl(
  editor: Editor,
  {
    url,
    center,
  }: {
    center?: {
      x: number
      y: number
    }
    url: string
  }
): Promise<Result<TLBookmarkShape, string>>

Parameters

NameDescription

editor

Editor

{ url, center, }

{
  center?: {
    x: number
    y: number
  }
  url: string
}

Returns

Promise<Result<TLBookmarkShape, string>>

A Result containing the created bookmark shape or an error

Prev
copyAs
Next
createEmptyBookmarkShape