BlockSuite API Documentation / @blocksuite/affine-block-embed / EmbedIframeService
Class: EmbedIframeService
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:76
Service for handling embeddable URLs
Extends
Implements
Constructors
new EmbedIframeService()
new EmbedIframeService(
store):EmbedIframeService
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:84
Parameters
store
Returns
EmbedIframeService
Overrides
Properties
store
readonlystore:Store
Defined in: packages/framework/store/dist/extension/store-extension.d.ts:7
Inherited from
[storeExtensionSymbol]
readonlystatic[storeExtensionSymbol]:true=true
Defined in: packages/framework/store/dist/extension/store-extension.d.ts:12
Inherited from
StoreExtension.[storeExtensionSymbol]
key
statickey:string='embed-iframe-service'
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:80
Overrides
Methods
addEmbedIframeBlock()
addEmbedIframeBlock(
props,parentId,index?):undefined|string
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:144
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
Implementation of
EmbedIframeProvider.addEmbedIframeBlock
buildOEmbedUrl()
buildOEmbedUrl(
url):undefined|string
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:95
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
Implementation of
EmbedIframeProvider.buildOEmbedUrl
canEmbed()
canEmbed(
url):boolean
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:91
Check if a URL can be embedded
Parameters
url
string
URL to check
Returns
boolean
true if the URL can be embedded, false otherwise
Implementation of
disposed()
disposed():
void
Defined in: packages/framework/store/dist/extension/store-extension.d.ts:11
Returns
void
Inherited from
getConfig()
getConfig(
url):undefined|EmbedIframeConfig
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:99
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
Implementation of
getEmbedIframeData()
getEmbedIframeData(
url,signal?):Promise<null|EmbedIframeData>
Defined in: packages/affine/blocks/block-embed/src/embed-iframe-block/extension/embed-iframe-service.ts:103
Get embed iframe data
Parameters
url
string
URL to get embed iframe data
signal?
AbortSignal
Returns
Promise<null | EmbedIframeData>
Embed iframe data if the URL can be embedded, undefined otherwise
Implementation of
EmbedIframeProvider.getEmbedIframeData
loaded()
loaded():
void
Defined in: packages/framework/store/dist/extension/store-extension.d.ts:10
Returns
void
Inherited from
setup()
staticsetup(di):void
Defined in: packages/framework/store/dist/extension/store-extension.d.ts:13
Parameters
di
Container
Returns
void