BlockSuite API Documentation / @blocksuite/blocks / RootService
Class: RootService
Extends
Extended by
Constructors
new RootService()
new RootService(
options
):RootService
Parameters
• options: BlockServiceOptions
Returns
Inherited from
Source
packages/framework/block-std/dist/service/index.d.ts:16
Properties
_embedBlockRegistry
private
_embedBlockRegistry:Set
<EmbedOptions
>
Source
packages/blocks/src/root-block/root-service.ts:161
_exportOptions
private
_exportOptions:object
imageProxyEndpoint
imageProxyEndpoint:
string
=DEFAULT_IMAGE_PROXY_ENDPOINT
Source
packages/blocks/src/root-block/root-service.ts:157
_fileDropOptions
private
_fileDropOptions:FileDropOptions
Source
packages/blocks/src/root-block/root-service.ts:153
_getDocUpdatedAt()
private
_getDocUpdatedAt: (docId
) =>Date
Parameters
• docId: string
Returns
Date
Source
packages/blocks/src/root-block/root-service.ts:188
disposables
readonly
disposables:DisposableGroup
Inherited from
Source
packages/framework/block-std/dist/service/index.d.ts:14
docModeService
docModeService:
DocModeService
Source
packages/blocks/src/root-block/root-service.ts:176
editPropsStore
readonly
editPropsStore:EditPropsStore
Source
packages/blocks/src/root-block/root-service.ts:165
exportManager
exportManager:
ExportManager
Source
packages/blocks/src/root-block/root-service.ts:169
fileDropManager
fileDropManager:
FileDropManager
Source
packages/blocks/src/root-block/root-service.ts:167
flavour
readonly
flavour:string
Inherited from
Source
packages/framework/block-std/dist/service/index.d.ts:13
fontLoader
readonly
fontLoader:FontLoader
Source
packages/blocks/src/root-block/root-service.ts:163
notificationService
notificationService:
null
|NotificationService
=null
Source
packages/blocks/src/root-block/root-service.ts:172
peekViewService
peekViewService:
null
|PeekViewService
=null
Source
packages/blocks/src/root-block/root-service.ts:174
quickSearchService
quickSearchService:
null
|QuickSearchService
=null
Source
packages/blocks/src/root-block/root-service.ts:178
specSlots
readonly
specSlots:BlockSpecSlots
Inherited from
Source
packages/framework/block-std/dist/service/index.d.ts:15
std
readonly
std:BlockStdScope
Inherited from
Source
packages/framework/block-std/dist/service/index.d.ts:12
telemetryService
telemetryService:
null
|TelemetryService
=null
Source
packages/blocks/src/root-block/root-service.ts:180
transformers
transformers:
object
html
html:
object
=HtmlTransformer
html.exportDoc()
exportDoc: (
doc
) =>Promise
<void
>
Parameters
• doc: Doc
Returns
Promise
<void
>
markdown
markdown:
object
=MarkdownTransformer
markdown.exportDoc()
exportDoc: (
doc
) =>Promise
<void
>
Parameters
• doc: Doc
Returns
Promise
<void
>
markdown.importMarkdown()
importMarkdown: (
__namedParameters
) =>Promise
<void
>
Parameters
• __namedParameters: ImportMarkdownOptions
Returns
Promise
<void
>
zip
zip:
object
=ZipTransformer
zip.exportDocs()
exportDocs: (
collection
,docs
) =>Promise
<Blob
>
Parameters
• collection: DocCollection
• docs: Doc
[]
Returns
Promise
<Blob
>
zip.importDocs()
importDocs: (
collection
,imported
) =>Promise
<Doc
[]>
Parameters
• collection: DocCollection
• imported: Blob
Returns
Promise
<Doc
[]>
Source
packages/blocks/src/root-block/root-service.ts:182
Accessors
collection
get
collection():DocCollection
Returns
Source
packages/framework/block-std/dist/service/index.d.ts:17
doc
get
doc():Doc
Returns
Source
packages/framework/block-std/dist/service/index.d.ts:18
getDocUpdatedAt
get
getDocUpdatedAt(): (docId
) =>Date
set
getDocUpdatedAt(value
):void
Parameters
• value
Returns
Function
Parameters
• docId: string
Returns
Date
Source
packages/blocks/src/root-block/root-service.ts:123
host
get
host():HTMLElement
Returns
HTMLElement
Source
packages/framework/block-std/dist/service/index.d.ts:19
selectedBlocks
get
selectedBlocks():BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>[]
Returns
BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>[]
Source
packages/blocks/src/root-block/root-service.ts:131
selectedModels
get
selectedModels():BlockModel
<object
>[]
Returns
BlockModel
<object
>[]
Source
packages/blocks/src/root-block/root-service.ts:149
selectionManager
get
selectionManager():SelectionManager
Returns
Source
packages/framework/block-std/dist/service/index.d.ts:20
uiEventDispatcher
get
uiEventDispatcher():UIEventDispatcher
Returns
Source
packages/framework/block-std/dist/service/index.d.ts:21
viewportElement
get
viewportElement():HTMLElement
Returns
HTMLElement
Source
packages/blocks/src/root-block/root-service.ts:113
Methods
_getLastNoteBlock()
private
_getLastNoteBlock():null
|NoteBlockModel
Returns
null
| NoteBlockModel
Source
packages/blocks/src/root-block/root-service.ts:190
_getParentModelBySelection()
private
_getParentModelBySelection():object
Returns
object
index
index:
undefined
|number
model
model:
null
|BlockModel
<object
>
Source
packages/blocks/src/root-block/root-service.ts:208
_insertCard()
private
_insertCard(flavour
,targetStyle
,props
):void
Parameters
• flavour: string
• targetStyle: EmbedCardStyle
• props: Record
<string
, unknown
>
Returns
void
Source
packages/blocks/src/root-block/root-service.ts:251
_insertDoc()
private
_insertDoc(docId
):string
Parameters
• docId: string
Returns
string
Source
packages/blocks/src/root-block/root-service.ts:318
_insertLink()
private
_insertLink(url
):string
Parameters
• url: string
Returns
string
Source
packages/blocks/src/root-block/root-service.ts:300
appendParagraph()
appendParagraph(
text
):void
Parameters
• text: string
= ''
Returns
void
Source
packages/blocks/src/root-block/root-service.ts:395
bindHotKey()
bindHotKey(
keymap
,options
?):void
Parameters
• keymap: Record
<string
, UIEventHandler
>
• options?
• options.global?: boolean
Returns
void
Inherited from
Source
packages/framework/block-std/dist/service/index.d.ts:28
dispose()
dispose():
void
Returns
void
Inherited from
Source
packages/framework/block-std/dist/service/index.d.ts:22
getEmbedBlockOptions()
getEmbedBlockOptions(
url
):null
|EmbedOptions
Parameters
• url: string
Returns
null
| EmbedOptions
Source
packages/blocks/src/root-block/root-service.ts:331
handleEvent()
handleEvent(
name
,fn
,options
?):void
Parameters
• name: "click"
| "doubleClick"
| "tripleClick"
| "pointerDown"
| "pointerMove"
| "pointerUp"
| "pointerOut"
| "dragStart"
| "dragMove"
| "dragEnd"
| "keyDown"
| "keyUp"
| "selectionChange"
| "compositionStart"
| "compositionUpdate"
| "compositionEnd"
| "cut"
| "copy"
| "paste"
| "beforeInput"
| "blur"
| "focus"
| "drop"
| "contextMenu"
| "wheel"
• fn: UIEventHandler
• options?
• options.global?: boolean
Returns
void
Inherited from
Source
packages/framework/block-std/dist/service/index.d.ts:25
insertLinkByQuickSearch()
insertLinkByQuickSearch(
userInput
?,skipSelection
?):Promise
<undefined
|object
>
Parameters
• userInput?: string
• skipSelection?: boolean
Returns
Promise
<undefined
| object
>
Source
packages/blocks/src/root-block/root-service.ts:415
loadFonts()
loadFonts():
void
Returns
void
Source
packages/blocks/src/root-block/root-service.ts:391
mounted()
mounted():
void
Returns
void
Overrides
Source
packages/blocks/src/root-block/root-service.ts:345
registerEmbedBlockOptions()
registerEmbedBlockOptions(
options
):void
Parameters
• options: EmbedOptions
Returns
void
Source
packages/blocks/src/root-block/root-service.ts:327
unmounted()
unmounted():
void
Returns
void
Overrides
Source
packages/blocks/src/root-block/root-service.ts:340