Skip to content

BlockSuite API Documentation / @blocksuite/blocks / EdgelessRootService

Class: EdgelessRootService

Extends

Constructors

new EdgelessRootService(options)

new EdgelessRootService(options): EdgelessRootService

Parameters

options: BlockServiceOptions

Returns

EdgelessRootService

Inherited from

@blocksuite/blocks.RootService.constructor

Source

packages/framework/block-std/dist/service/index.d.ts:16

Properties

TemplateJob

TemplateJob: typeof TemplateJob = TemplateJob

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:54


_frame

private _frame: EdgelessFrameManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:82


_layer

private _layer: LayerManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:81


_selection

private _selection: EdgelessSelectionManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:84


_snap

private _snap: EdgelessSnapManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:83


_surface

private _surface: SurfaceBlockModel

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:80


_tool

private _tool: EdgelessToolsManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:86


_viewport

private _viewport: Viewport

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:85


disposables

readonly disposables: DisposableGroup

Inherited from

@blocksuite/blocks.RootService.disposables

Source

packages/framework/block-std/dist/service/index.d.ts:14


editSession

readonly editSession: EditSessionStorage

Inherited from

@blocksuite/blocks.RootService.editSession

Source

packages/blocks/src/root-block/root-service.ts:52


exportManager

exportManager: ExportManager

Inherited from

@blocksuite/blocks.RootService.exportManager

Source

packages/blocks/src/root-block/root-service.ts:55


fileDropManager

fileDropManager: FileDropManager

Inherited from

@blocksuite/blocks.RootService.fileDropManager

Source

packages/blocks/src/root-block/root-service.ts:54


flavour

readonly flavour: string

Inherited from

@blocksuite/blocks.RootService.flavour

Source

packages/framework/block-std/dist/service/index.d.ts:13


fontLoader

readonly fontLoader: FontLoader

Inherited from

@blocksuite/blocks.RootService.fontLoader

Source

packages/blocks/src/root-block/root-service.ts:51


slots

slots: Object

Type declaration

copyAsPng

copyAsPng: Slot<Object>

Type declaration
blocks

blocks: TopLevelBlockModel[]

shapes

shapes: CanvasElement[]

cursorUpdated

cursorUpdated: Slot<string>

docLinkClicked

docLinkClicked: Slot<Object>

Type declaration
blockId?

blockId?: string

docId

docId: string

draggingAreaUpdated

draggingAreaUpdated: Slot<void>

edgelessToolUpdated

edgelessToolUpdated: Slot<EdgelessTool>

elementResizeEnd

elementResizeEnd: Slot<void>

elementResizeStart

elementResizeStart: Slot<void>

fullScreenToggled

fullScreenToggled: Slot<void>

navigatorFrameChanged: Slot<FrameBlockModel>

navigatorSettingUpdated: Slot<Object>

Type declaration
blackBackground?

blackBackground?: boolean

fillScreen?

fillScreen?: boolean

hideToolbar?

hideToolbar?: boolean

pressShiftKeyUpdated

pressShiftKeyUpdated: Slot<boolean>

readonlyUpdated

readonlyUpdated: Slot<boolean>

toggleNoteSlicer

toggleNoteSlicer: Slot<void>

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:56


specSlots

readonly specSlots: BlockSpecSlots

Inherited from

@blocksuite/blocks.RootService.specSlots

Source

packages/framework/block-std/dist/service/index.d.ts:15


std

readonly std: BlockStdScope

Inherited from

@blocksuite/blocks.RootService.std

Source

packages/framework/block-std/dist/service/index.d.ts:12


transformers

transformers: Object

Type declaration

html

html: Object = HtmlTransformer

html.exportDoc

html.exportDoc: (doc) => Promise<void>

Parameters

doc: Doc

Returns

Promise<void>

markdown

markdown: Object = MarkdownTransformer

markdown.exportDoc

markdown.exportDoc: (doc) => Promise<void>

Parameters

doc: Doc

Returns

Promise<void>

markdown.importMarkdown

markdown.importMarkdown: (__namedParameters) => Promise<void>

Parameters

__namedParameters: ImportMarkdownOptions

Returns

Promise<void>

zip

zip: Object = ZipTransformer

zip.exportDocs

zip.exportDocs: (workspace, docs) => Promise<Blob>

Parameters

workspace: Workspace

docs: Doc[]

Returns

Promise<Blob>

zip.importDocs

zip.importDocs: (workspace, imported) => Promise<Doc[]>

Parameters

workspace: Workspace

imported: Blob

Returns

Promise<Doc[]>

Inherited from

@blocksuite/blocks.RootService.transformers

Source

packages/blocks/src/root-block/root-service.ts:57

Accessors

blocks

get blocks(): EdgelessBlock<EdgelessSelectableProps>[]

Returns

EdgelessBlock<EdgelessSelectableProps>[]

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:159


doc

get doc(): Doc

Returns

Doc

Source

packages/framework/block-std/dist/service/index.d.ts:18


elements

get elements(): ElementModel<BaseProps>[]

sorted canvas elements

Returns

ElementModel<BaseProps>[]

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:151


frame

get frame(): EdgelessFrameManager

Returns

EdgelessFrameManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:140


frames

get frames(): FrameBlockModel[]

Returns

FrameBlockModel[]

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:155


getDocUpdatedAt

get getDocUpdatedAt(): (docId) => Date

set getDocUpdatedAt(value): void

Parameters

value: (docId) => Date

Returns

Function

Parameters

docId: string

Returns

Date

Source

packages/blocks/src/root-block/root-service.ts:94


getEditorMode

get getEditorMode(): (docId) => "edgeless" | "page"

set getEditorMode(value): void

Parameters

value: (docId) => "edgeless" | "page"

Returns

Function

Parameters

docId: string

Returns

"edgeless" | "page"

Source

packages/blocks/src/root-block/root-service.ts:84


host

get host(): EditorHost

Returns

EditorHost

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:167


layer

get layer(): LayerManager

Returns

LayerManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:128


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:213


selectedModels

get selectedModels(): BlockModel<object>[]

Returns

BlockModel<object>[]

Source

packages/blocks/src/root-block/root-service.ts:232


selection

get selection(): EdgelessSelectionManager

Returns

EdgelessSelectionManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:132


selectionManager

get selectionManager(): SelectionManager

Returns

SelectionManager

Source

packages/framework/block-std/dist/service/index.d.ts:20


snap

get snap(): EdgelessSnapManager

Returns

EdgelessSnapManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:144


surface

get surface(): SurfaceBlockModel

Returns

SurfaceBlockModel

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:124


tool

get tool(): EdgelessToolsManager

Returns

EdgelessToolsManager

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:120


uiEventDispatcher

get uiEventDispatcher(): UIEventDispatcher

Returns

UIEventDispatcher

Source

packages/framework/block-std/dist/service/index.d.ts:21


viewport

get viewport(): Viewport

Returns

Viewport

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:136


viewportElement

get viewportElement(): HTMLElement

Returns

HTMLElement

Source

packages/blocks/src/root-block/root-service.ts:71


workspace

get workspace(): Workspace

Returns

Workspace

Source

packages/framework/block-std/dist/service/index.d.ts:17


zoom

get zoom(): number

Returns

number

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:163

Methods

_initReadonlyListener()

private _initReadonlyListener(): void

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:188


_initSlotEffects()

private _initSlotEffects(): void

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:171


addBlock()

addBlock(flavour, props, parent?, parentIndex?): string

Parameters

flavour: string

props: Record<string, unknown>

parent?: string | BlockModel<object>

parentIndex?: number

Returns

string

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:221


addElement()

addElement<T>(type, props): string

Type parameters

T = Record<string, unknown>

Parameters

type: string

props: T

Returns

string

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:207


appendParagraph()

appendParagraph(): void

Returns

void

Inherited from

@blocksuite/blocks.RootService.appendParagraph

Source

packages/blocks/src/root-block/root-service.ts:258


bindHotKey()

bindHotKey(keymap, options?): void

Parameters

keymap: Record<string, UIEventHandler>

options?: Object

options.global?: boolean

Returns

void

Inherited from

@blocksuite/blocks.RootService.bindHotKey

Source

packages/framework/block-std/dist/service/index.d.ts:28


createGroup()

createGroup(elements): string

Parameters

elements: string[] | EdgelessModel[]

Returns

string

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:435


createGroupFromSelected()

createGroupFromSelected(): undefined | string

Returns

undefined | string

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:455


createTemplateJob()

createTemplateJob(type): TemplateJob

Parameters

type: "template" | "sticker"

Returns

TemplateJob

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:529


dispose()

dispose(): void

Returns

void

Inherited from

@blocksuite/blocks.RootService.dispose

Source

packages/framework/block-std/dist/service/index.d.ts:22


generateIndex()

generateIndex(type): string

Parameters

type: string

Returns

string

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:202


getConnectors()

getConnectors(element): ConnectorElementModel[]

Parameters

element: string | EdgelessModel

Returns

ConnectorElementModel[]

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:523


getElementById()

getElementById(id): ElementModel<BaseProps> | EdgelessBlock<EdgelessSelectableProps>

Parameters

id: string

Returns

ElementModel<BaseProps> | EdgelessBlock<EdgelessSelectableProps>

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:265


getElementsByType()

getElementsByType<K>(type): ElementModelMap[K][]

Type parameters

K extends keyof ElementModelMap

Parameters

type: K

Returns

ElementModelMap[K][]

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:234


getEmbedBlockOptions()

getEmbedBlockOptions(url): null | EmbedOptions

Parameters

url: string

Returns

null | EmbedOptions

Inherited from

@blocksuite/blocks.RootService.getEmbedBlockOptions

Source

packages/blocks/src/root-block/root-service.ts:108


getFitToScreenData()

getFitToScreenData(padding): Object

Parameters

padding: [number, number, number, number]= undefined

Returns

Object

centerX

centerX: number

centerY

centerY: number

zoom

zoom: number

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:578


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?: Object

options.global?: boolean

Returns

void

Inherited from

@blocksuite/blocks.RootService.handleEvent

Source

packages/framework/block-std/dist/service/index.d.ts:25


loadFonts()

loadFonts(): void

Returns

void

Inherited from

@blocksuite/blocks.RootService.loadFonts

Source

packages/blocks/src/root-block/root-service.ts:236


mounted()

mounted(): void

Returns

void

Overrides

@blocksuite/blocks.RootService.mounted

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:88


pickElement()

pickElement(x, y, options)

pickElement(x, y, options): EdgelessModel[]

Parameters

x: number

y: number

options: Object

options.all: true

Returns

EdgelessModel[]

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:272

pickElement(x, y, options)

pickElement(x, y, options?): null | EdgelessModel

Parameters

x: number

y: number

options?: Object

options.all?: false

Returns

null | EdgelessModel

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:273


pickElementInGroup()

pickElementInGroup(x, y, options?): null | EdgelessModel

This method is used to pick element in group, if the picked element is in a group, we will pick the group instead. If that picked group is currently selected, then we will pick the element itself.

Parameters

x: number

y: number

options?: HitTestOptions

Returns

null | EdgelessModel

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:384


pickElementsByBound()

pickElementsByBound(bound, type)

pickElementsByBound(bound, type?): EdgelessModel[]

Parameters

bound: IBound | Bound

type?: "all"

Returns

EdgelessModel[]

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:332

pickElementsByBound(bound, type)

pickElementsByBound(bound, type): EdgelessBlock<EdgelessSelectableProps>[]

Parameters

bound: IBound | Bound

type: "blocks"

Returns

EdgelessBlock<EdgelessSelectableProps>[]

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:333


registerEmbedBlockOptions()

registerEmbedBlockOptions(options): void

Parameters

options: EmbedOptions

Returns

void

Inherited from

@blocksuite/blocks.RootService.registerEmbedBlockOptions

Source

packages/blocks/src/root-block/root-service.ts:104


registerTool()

registerTool(Tool): void

Parameters

Tool: EdgelessToolConstructor

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:519


removeElement()

removeElement(id): void

Parameters

id: string | EdgelessModel

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:253


reorderElement()

reorderElement(element, direction): void

Parameters

element: EdgelessModel

direction: ReorderingDirection

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:422


setZoomByAction()

setZoomByAction(action): void

Parameters

action: ZoomAction

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:613


setZoomByStep()

setZoomByStep(step): void

Parameters

step: number

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:569


ungroup()

ungroup(group): void

Parameters

group: GroupElementModel

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:489


unmounted()

unmounted(): void

Returns

void

Overrides

@blocksuite/blocks.RootService.unmounted

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:110


updateElement()

updateElement(id, props): void

Parameters

id: string

props: Record<string, unknown>

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:240


zoomToFit()

zoomToFit(): void

Returns

void

Source

packages/blocks/src/root-block/edgeless/edgeless-root-service.ts:573


Generated using TypeDoc and typedoc-plugin-markdown.