PlopManager

Public Class

Table of Contents
Signature
class ExternalContentManager {}

Constructor

Public Constructor

Constructs a new instance of the ExternalContentManager class

Parameters
NameDescription

editor

Editor
References

Editor


Properties

editor

Public Property

Signature
editor: Editor
References

Editor


handleContent

Public Property

Signature
handleContent: (info: TLExternalContent) => Promise<void>
References

TLExternalContent, Promise


handleUrl

Public Property

Handle urls from an external source. Feeling lucky? Overwrite this at runtime to change the way this type of external content is handled.

Example
editor.this.handleUrl = myCustomMethod
Parameters
NameDescription

editor

The editor instance

info

The info object describing the external content.

Signature
handleUrl: (
  editor: Editor,
  {
    point,
    url,
  }: Extract<
    TLExternalContent,
    {
      type: 'url'
    }
  >
) => Promise<void>
References

Editor, Extract, TLExternalContent, Promise


Methods

createAssetFromFile()

Public Method

Override this method to change how assets are created from files.

Parameters
NameDescription

_editor

Editor

file

File

The file to create the asset from.

Returns
Promise<TLAsset>
References

Editor, File, Promise, TLAsset


createAssetFromUrl()

Public Method

Override me to change the way assets are created from urls.

Parameters
NameDescription

_editor

Editor

url

string

The url to create the asset from

Returns
Promise<TLAsset>
References

Editor, Promise, TLAsset


createShapesForAssets()

Public Method

Parameters
NameDescription

editor

Editor

assets

TLAsset[]

position

VecLike
Returns
Promise<void>
References

Editor, TLAsset, VecLike, Promise


handleEmbed()

Public Method

Handle embed info from an external source. Feeling lucky? Overwrite this at runtime to change the way this type of external content is handled.

Example
editor.this.handleEmbed = myCustomMethod
Parameters
NameDescription

editor

Editor

The editor instance

{ point, url, embed }

Extract<
  TLExternalContent,
  {
    type: 'embed'
  }
>
Returns
Promise<void>
References

Editor, Extract, TLExternalContent, Promise


handleFiles()

Public Method

Handle files from an external source. Feeling lucky? Overwrite this at runtime to change the way this type of external content is handled.

Example
editor.this.handleFiles = myCustomMethod
Parameters
NameDescription

editor

Editor

The editor instance

{ point, files }

Extract<
  TLExternalContent,
  {
    type: 'files'
  }
>
Returns
Promise<void>
References

Editor, Extract, TLExternalContent, Promise


handleSvgText()

Public Method

Handle svg text from an external source. Feeling lucky? Overwrite this at runtime to change the way this type of external content is handled.

Example
editor.this.handleSvgText = myCustomMethod
Parameters
NameDescription

editor

Editor

The editor instance.

{ point, text }

Extract<
  TLExternalContent,
  {
    type: 'svg-text'
  }
>
Returns
Promise<void>
References

Editor, Extract, TLExternalContent, Promise


handleText()

Public Method

Handle plain text from an external source. Feeling lucky? Overwrite this at runtime to change the way this type of external content is handled.

Example
editor.this.handleText = myCustomMethod
Parameters
NameDescription

editor

Editor

The editor instance

{ point, text }

Extract<
  TLExternalContent,
  {
    type: 'text'
  }
>
Returns
Promise<void>
References

Editor, Extract, TLExternalContent, Promise


Edit this page
Last edited on 15 June 2023
openWindowpreventDefault