Skip to content

API > @blocksuite/block-std > SelectionManager

Class: SelectionManager ​

Constructors ​

constructor ​

new SelectionManager(std): SelectionManager

Parameters ​

ParameterType
stdBlockStdProvider

Returns ​

SelectionManager

Defined In ​

block-std/src/selection/manager.ts:29

Properties ​

_selectionConstructors ​

private _selectionConstructors: Record< string, SelectionConstructor > = {}

Defined In ​

block-std/src/selection/manager.ts:22


disposables ​

disposables: DisposableGroup

Defined In ​

block-std/src/selection/manager.ts:21


slots ​

slots: object

Type declaration ​

slots.changed ​

changed: Slot< BaseSelection[] >

slots.remoteChanged ​

remoteChanged: Slot< Map< number, BaseSelection[] > >

Defined In ​

block-std/src/selection/manager.ts:24


std ​

std: BlockStdProvider

Defined In ​

block-std/src/selection/manager.ts:29

Accessors ​

_store ​

private get _store(): AwarenessStore< BlockSuiteFlags >

Defined In ​

block-std/src/selection/manager.ts:40


remoteSelections ​

get remoteSelections(): Map< number, BaseSelection[] >

Defined In ​

block-std/src/selection/manager.ts:127


value ​

get value(): BaseSelection[]

Defined In ​

block-std/src/selection/manager.ts:72

Methods ​

_itemAdded ​

private _itemAdded(event): void

Parameters ​

ParameterType
eventobject
event.stackItemStackItem

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:140


_itemPopped ​

private _itemPopped(event): void

Parameters ​

ParameterType
eventobject
event.stackItemStackItem

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:144


_jsonToSelection ​

private _jsonToSelection(json): BaseSelection

Parameters ​

ParameterType
jsonRecord< string, unknown >

Returns ​

BaseSelection

Defined In ​

block-std/src/selection/manager.ts:53


_setupDefaultSelections ​

private _setupDefaultSelections(): void

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:44


clear ​

clear(types?): void

Parameters ​

ParameterType
types?string[]

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:104


dispose ​

dispose(): void

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:173


filter ​

filter<T>(type): SelectionInstance[T][]

Type parameters ​

Parameter
T extends keyof Selection

Parameters ​

ParameterType
typeT

Returns ​

SelectionInstance[T][]

Defined In ​

block-std/src/selection/manager.ts:121


find ​

find<T>(type): undefined | SelectionInstance[T]

Type parameters ​

Parameter
T extends keyof Selection

Parameters ​

ParameterType
typeT

Returns ​

undefined | SelectionInstance[T]

Defined In ​

block-std/src/selection/manager.ts:115


fromJSON ​

fromJSON(json): void

Parameters ​

ParameterType
jsonRecord< string, unknown >[]

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:78


getGroup ​

getGroup(group): BaseSelection[]

Parameters ​

ParameterType
groupstring

Returns ​

BaseSelection[]

Defined In ​

block-std/src/selection/manager.ts:95


getInstance ​

getInstance<T>(type, ...args): SelectionInstance[T]

Type parameters ​

Parameter
T extends keyof Selection

Parameters ​

ParameterType
typeT
...argsConstructorParameters< Selection[T] >

Returns ​

SelectionInstance[T]

Defined In ​

block-std/src/selection/manager.ts:61


mount ​

mount(): void

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:151


register ​

register(ctor): SelectionManager

Parameters ​

ParameterType
ctorSelectionConstructor | SelectionConstructor[]

Returns ​

SelectionManager

Defined In ​

block-std/src/selection/manager.ts:33


set ​

set(selections): void

Parameters ​

ParameterType
selectionsBaseSelection[]

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:85


setGroup ​

setGroup(group, selections): void

Parameters ​

ParameterType
groupstring
selectionsBaseSelection[]

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:90


unmount ​

unmount(): void

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:165


update ​

update(fn): void

Parameters ​

ParameterType
fnfunction

Returns ​

void

Defined In ​

block-std/src/selection/manager.ts:99