BlockSuite API Documentation / @blocksuite/affine-block-embed / EmbedIframeProvider
Interface: EmbedIframeProvider
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:29
Service for handling embeddable URLs
Properties
addEmbedIframeBlock()
addEmbedIframeBlock: (
props,parentId,index?) =>undefined|string
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:65
Parse an embeddable URL and add an EmbedIframeBlock to doc
Parameters
props
Partial<EmbedIframeBlockProps>
parentId
string
Parent block ID
index?
number
Optional index to insert at
Returns
undefined | string
Created block id if successful, undefined if the URL cannot be embedded
buildOEmbedUrl()
buildOEmbedUrl: (
url) =>undefined|string
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:42
Build a API URL for fetching embed data
Parameters
url
string
URL to build API URL
Returns
undefined | string
API URL if the URL can be embedded, undefined otherwise
canEmbed()
canEmbed: (
url) =>boolean
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:35
Check if a URL can be embedded
Parameters
url
string
URL to check
Returns
boolean
true if the URL can be embedded, false otherwise
getConfig()
getConfig: (
url) =>undefined|EmbedIframeConfig
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:49
Get the embed iframe config
Parameters
url
string
URL to get embed iframe config
Returns
undefined | EmbedIframeConfig
Embed iframe config if the URL can be embedded, undefined otherwise
getEmbedIframeData()
getEmbedIframeData: (
url) =>Promise<null|EmbedIframeData>
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:56
Get embed iframe data
Parameters
url
string
URL to get embed iframe data
Returns
Promise<null | EmbedIframeData>
Embed iframe data if the URL can be embedded, undefined otherwise