BlockSuite API Documentation / @blocksuite/blocks / DatabaseBlockService
Class: DatabaseBlockService
Deprecated
BlockService is deprecated. You should reconsider where to put your feature.
BlockService is a legacy extension that is used to provide services to the block. In the previous version of BlockSuite, block service provides a way to extend the block. However, in the new version, we recommend using the new extension system.
Extends
Constructors
new DatabaseBlockService()
new DatabaseBlockService(
std
,flavourProvider
):DatabaseBlockService
Parameters
• std: BlockStdScope
• flavourProvider
• flavourProvider.flavour: string
Returns
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:28
Properties
addColumn()
addColumn: (
model
,position
,column
) =>string
=addProperty
Parameters
• model: DatabaseBlockModel
• position: InsertToPosition
• column: Omit
<Column
<Record
<string
, unknown
>>, "id"
> & object
Returns
string
Defined in
packages/blocks/src/database-block/database-service.ts:26
applyColumnUpdate()
applyColumnUpdate: (
model
) =>void
=applyPropertyUpdate
Parameters
• model: DatabaseBlockModel
Returns
void
Defined in
packages/blocks/src/database-block/database-service.ts:28
databaseViewAddView()
databaseViewAddView: (
model
,viewType
) =>void
Parameters
• model: DatabaseBlockModel
• viewType: string
Returns
void
Defined in
packages/blocks/src/database-block/database-service.ts:30
databaseViewInitEmpty()
databaseViewInitEmpty: (
model
,viewType
) =>void
Parameters
• model: DatabaseBlockModel
• viewType: string
Returns
void
Defined in
packages/blocks/src/database-block/database-service.ts:32
disposables
readonly
disposables:DisposableGroup
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:20
flavour
readonly
flavour:string
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:21
flavourProvider
readonly
flavourProvider:object
flavour
flavour:
string
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:16
specSlots
readonly
specSlots:BlockSpecSlots
<BlockService
>
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:22
std
readonly
std:BlockStdScope
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:15
updateCell()
updateCell: (
model
,rowId
,cell
) =>void
Parameters
• model: DatabaseBlockModel
• rowId: string
• cell: Cell
Returns
void
Defined in
packages/blocks/src/database-block/database-service.ts:34
updateView()
updateView: <
ViewData
>(model
,id
,update
) =>void
Type Parameters
• ViewData extends ViewBasicDataType
Parameters
• model: DatabaseBlockModel
• id: string
• update
Returns
void
Defined in
packages/blocks/src/database-block/database-service.ts:36
viewPresets
viewPresets:
object
kanbanViewMeta
kanbanViewMeta:
ViewMeta
<"kanban"
,KanbanViewData
>
tableViewMeta
tableViewMeta:
ViewMeta
<"table"
,TableViewData
>
Defined in
packages/blocks/src/database-block/database-service.ts:38
flavour
readonly
static
flavour:"affine:database"
=DatabaseBlockSchema.model.flavour
Overrides
Defined in
packages/blocks/src/database-block/database-service.ts:24
Accessors
collection
get
collection():DocCollection
Returns
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:23
doc
get
doc():Doc
Returns
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:24
host
get
host():EditorHost
Returns
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:25
selectionManager
get
selectionManager():SelectionManager
Returns
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:26
uiEventDispatcher
get
uiEventDispatcher():UIEventDispatcher
Returns
Inherited from
BlockService
.uiEventDispatcher
Defined in
packages/framework/block-std/dist/extension/service.d.ts:27
Methods
bindHotKey()
bindHotKey(
keymap
,options
?):void
Parameters
• keymap: Record
<string
, UIEventHandler
>
• options?
• options.global?: boolean
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:32
dispose()
dispose():
void
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:35
handleEvent()
handleEvent(
name
,fn
,options
?):void
Parameters
• name: "pan"
| "click"
| "blur"
| "focus"
| "doubleClick"
| "tripleClick"
| "pointerDown"
| "pointerMove"
| "pointerUp"
| "pointerOut"
| "dragStart"
| "dragMove"
| "dragEnd"
| "pinch"
| "keyDown"
| "keyUp"
| "selectionChange"
| "compositionStart"
| "compositionUpdate"
| "compositionEnd"
| "cut"
| "copy"
| "paste"
| "beforeInput"
| "drop"
| "contextMenu"
| "wheel"
• fn: UIEventHandler
• options?
• options.global?: boolean
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:36
initDatabaseBlock()
initDatabaseBlock(
doc
,model
,databaseId
,viewType
,isAppendNewRow
):void
Parameters
• doc: Doc
• model: BlockModel
<object
, SignaledProps
<object
>>
• databaseId: string
• viewType: string
• isAppendNewRow: boolean
= true
Returns
void
Defined in
packages/blocks/src/database-block/database-service.ts:40
mounted()
mounted():
void
Returns
void
Overrides
Defined in
packages/blocks/src/database-block/database-service.ts:62
unmounted()
unmounted():
void
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:40
setup()
static
setup(di
):void
Parameters
• di: Container
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/extension/service.d.ts:31