BlockSuite API Documentation / @blocksuite/blocks / DatabaseBlockModel
Class: DatabaseBlockModel ​
Contents ​
- Extends
 - Constructors
 - Properties
 - Accessors
 - Methods
- addColumn()
 - addView()
 - applyColumnUpdate()
 - applyViewsUpdate()
 - clone()
 - copyCellsByColumn()
 - deleteColumn()
 - deleteView()
 - dispose()
 - duplicateView()
 - findColumnIndex()
 - firstChild()
 - getCell()
 - getColumn()
 - getViewList()
 - initConvert()
 - initEmpty()
 - initTemplate()
 - isEmpty()
 - lastChild()
 - lastItem()
 - moveViewTo()
 - updateCell()
 - updateCells()
 - updateColumn()
 - updateView()
 
 
Extends ​
Constructors ​
new DatabaseBlockModel(undefined) ​
new DatabaseBlockModel():
DatabaseBlockModel
Returns ​
Inherited from ​
@blocksuite/store.BaseBlockModel.constructor
Source ​
packages/store/dist/schema/base.d.ts:100
Properties ​
cells ​
cells:
SerializedCells
Inherited from ​
BaseBlockModel.cells
Source ​
packages/blocks/src/database-block/database-model.ts:17
childrenUpdated ​
childrenUpdated:
Slot<void>
Inherited from ​
@blocksuite/store.BaseBlockModel.childrenUpdated
Source ​
packages/store/dist/schema/base.d.ts:116
columns ​
columns:
Column<Record<string,unknown>>[]
Inherited from ​
BaseBlockModel.columns
Source ​
packages/blocks/src/database-block/database-model.ts:18
created ​
created:
Slot<void>
Inherited from ​
@blocksuite/store.BaseBlockModel.created
Source ​
packages/store/dist/schema/base.d.ts:111
deleted ​
deleted:
Slot<void>
Inherited from ​
@blocksuite/store.BaseBlockModel.deleted
Source ​
packages/store/dist/schema/base.d.ts:112
flavour ​
flavour:
string
Inherited from ​
@blocksuite/store.BaseBlockModel.flavour
Source ​
packages/store/dist/schema/base.d.ts:102
id ​
id:
string
Inherited from ​
@blocksuite/store.BaseBlockModel.id
Source ​
packages/store/dist/schema/base.d.ts:105
keys ​
keys:
string[]
Inherited from ​
@blocksuite/store.BaseBlockModel.keys
Source ​
packages/store/dist/schema/base.d.ts:107
page ​
page:
Page
Inherited from ​
@blocksuite/store.BaseBlockModel.page
Source ​
packages/store/dist/schema/base.d.ts:104
pop ​
pop: (
prop) =>void
Parameters ​
• prop: "views" | "title" | "cells" | "columns"
Returns ​
void
Inherited from ​
@blocksuite/store.BaseBlockModel.pop
Source ​
packages/store/dist/schema/base.d.ts:109
propsUpdated ​
propsUpdated:
Slot<Object>
Type declaration ​
key ​
key:
string
Inherited from ​
@blocksuite/store.BaseBlockModel.propsUpdated
Source ​
packages/store/dist/schema/base.d.ts:113
role ​
role:
"root"|"hub"|"content"
Inherited from ​
@blocksuite/store.BaseBlockModel.role
Source ​
packages/store/dist/schema/base.d.ts:103
stash ​
stash: (
prop) =>void
Parameters ​
• prop: "views" | "title" | "cells" | "columns"
Returns ​
void
Inherited from ​
@blocksuite/store.BaseBlockModel.stash
Source ​
packages/store/dist/schema/base.d.ts:108
text? ​
text?:
Text
Inherited from ​
@blocksuite/store.BaseBlockModel.text
Source ​
packages/store/dist/schema/base.d.ts:110
title ​
title:
Text
Inherited from ​
BaseBlockModel.title
Source ​
packages/blocks/src/database-block/database-model.ts:16
views ​
views: (
TableViewData&CommonViewDataType&Object|KanbanViewData&CommonViewDataType&Object)[]
Inherited from ​
BaseBlockModel.views
Source ​
packages/blocks/src/database-block/database-model.ts:15
yBlock ​
yBlock:
YBlock
Inherited from ​
@blocksuite/store.BaseBlockModel.yBlock
Source ​
packages/store/dist/schema/base.d.ts:106
Accessors ​
childMap ​
getchildMap():Map<string,number>
Returns ​
Map<string, number>
Source ​
packages/store/dist/schema/base.d.ts:117
children ​
getchildren():BaseBlockModel<object>[]
Returns ​
BaseBlockModel<object>[]
Source ​
packages/store/dist/schema/base.d.ts:118
Methods ​
addColumn() ​
addColumn(
position,column):string
Parameters ​
• position: InsertToPosition
• column: Omit<Column<Record<string, unknown>>, "id"> & Object
Returns ​
string
Source ​
packages/blocks/src/database-block/database-model.ts:167
addView() ​
addView(
type):TableViewData&CommonViewDataType&Object|KanbanViewData&CommonViewDataType&Object
Parameters ​
• type: "table" | "kanban"
Returns ​
TableViewData & CommonViewDataType & Object | KanbanViewData & CommonViewDataType & Object
Source ​
packages/blocks/src/database-block/database-model.ts:90
applyColumnUpdate() ​
applyColumnUpdate():
void
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:153
applyViewsUpdate() ​
applyViewsUpdate():
void
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:147
clone() ​
clone():
DatabaseBlockModel
Returns ​
Inherited from ​
@blocksuite/store.BaseBlockModel.clone
Source ​
packages/store/dist/schema/base.d.ts:124
copyCellsByColumn() ​
copyCellsByColumn(
fromId,toId):void
Parameters ​
• fromId: string
• toId: string
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:242
deleteColumn() ​
deleteColumn(
columnId):void
Parameters ​
• columnId: string
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:203
deleteView() ​
deleteView(
id):void
Parameters ​
• id: string
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:115
dispose() ​
dispose():
void
Returns ​
void
Inherited from ​
@blocksuite/store.BaseBlockModel.dispose
Source ​
packages/store/dist/schema/base.d.ts:123
duplicateView() ​
duplicateView(
id):string
Parameters ​
• id: string
Returns ​
string
Source ​
packages/blocks/src/database-block/database-model.ts:99
findColumnIndex() ​
findColumnIndex(
id):number
Parameters ​
• id: string
Returns ​
number
Source ​
packages/blocks/src/database-block/database-model.ts:159
firstChild() ​
firstChild():
null|BaseBlockModel<object>
Returns ​
null | BaseBlockModel<object>
Inherited from ​
@blocksuite/store.BaseBlockModel.firstChild
Source ​
packages/store/dist/schema/base.d.ts:120
getCell() ​
getCell(
rowId,columnId):null|Cell
Parameters ​
• rowId: string
• columnId: string
Returns ​
null | Cell
Source ​
packages/blocks/src/database-block/database-model.ts:212
getColumn() ​
getColumn(
id):undefined|Column<Record<string,unknown>>
Parameters ​
• id: string
Returns ​
undefined | Column<Record<string, unknown>>
Source ​
packages/blocks/src/database-block/database-model.ts:163
getViewList() ​
getViewList(): (
TableViewData&CommonViewDataType&Object|KanbanViewData&CommonViewDataType&Object)[]
Returns ​
(TableViewData & CommonViewDataType & Object | KanbanViewData & CommonViewDataType & Object)[]
Source ​
packages/blocks/src/database-block/database-model.ts:30
initConvert() ​
initConvert(
viewType):void
Parameters ​
• viewType: "table" | "kanban"
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:42
initEmpty() ​
initEmpty(
viewType):void
Parameters ​
• viewType: "table" | "kanban"
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:34
initTemplate() ​
initTemplate(
viewType):void
Parameters ​
• viewType: "table" | "kanban"
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:50
isEmpty() ​
isEmpty():
boolean
Returns ​
boolean
Inherited from ​
@blocksuite/store.BaseBlockModel.isEmpty
Source ​
packages/store/dist/schema/base.d.ts:119
lastChild() ​
lastChild():
null|BaseBlockModel<object>
Returns ​
null | BaseBlockModel<object>
Inherited from ​
@blocksuite/store.BaseBlockModel.lastChild
Source ​
packages/store/dist/schema/base.d.ts:121
lastItem() ​
lastItem():
null|BaseBlockModel<object>
Returns ​
null | BaseBlockModel<object>
Inherited from ​
@blocksuite/store.BaseBlockModel.lastItem
Source ​
packages/store/dist/schema/base.d.ts:122
moveViewTo() ​
moveViewTo(
id,position):void
Parameters ​
• id: string
• position: InsertToPosition
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:136
updateCell() ​
updateCell(
rowId,cell):void
Parameters ​
• rowId: string
• cell: Cell
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:229
updateCells() ​
updateCells(
columnId,cells):void
Parameters ​
• columnId: string
• cells: Record<string, unknown>
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:256
updateColumn() ​
updateColumn(
id,updater):undefined|string
Parameters ​
• id: string
• updater: ColumnUpdater
Returns ​
undefined | string
Source ​
packages/blocks/src/database-block/database-model.ts:191
updateView() ​
updateView(
id,update):void
Parameters ​
• id: string
• update: (data) => Partial<TableViewData & CommonViewDataType & Object | KanbanViewData & CommonViewDataType & Object>
Returns ​
void
Source ​
packages/blocks/src/database-block/database-model.ts:122
Generated using typedoc-plugin-markdown and TypeDoc