Skip to content

API > @blocksuite/store > Y > XmlHook

Class: XmlHook ​

You can manage binding to a custom type with YXmlHook.

Extends ​

Constructors ​

constructor ​

new XmlHook(hookName): XmlHook

Parameters ​

ParameterTypeDescription
hookNamestringnodeName of the Dom Node.

Returns ​

XmlHook

Overrides ​

Map.constructor

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YXmlHook.d.ts:10

Properties ​

_dEH ​

_dEH: EventHandler< YEvent< any >[], Transaction >

Deep event handlers

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:46

Inherited from ​

Map._dEH


_eH ​

_eH: EventHandler< YMapEvent< any >, Transaction >

Event handlers

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:41

Inherited from ​

Map._eH


_item ​

_item: null | Item

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:23

Inherited from ​

Map._item


_length ​

_length: number

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:36

Inherited from ​

Map._length


_map ​

_map: Map< string, Item >

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:27

Inherited from ​

Map._map


_searchMarker ​

_searchMarker: null | ArraySearchMarker[]

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:50

Inherited from ​

Map._searchMarker


_start ​

_start: null | Item

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:31

Inherited from ​

Map._start


doc ​

doc: null | Doc

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:35

Inherited from ​

Map.doc


hookName ​

hookName: string

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YXmlHook.d.ts:14

Accessors ​

_first ​

get _first(): null | Item

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:81

Inherited from ​

Map._first


parent ​

get parent(): null | AbstractType< any >

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:54

Inherited from ​

Map.parent


size ​

get size(): number

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:65

Inherited from ​

Map.size

Methods ​

[iterator] ​

[iterator](): IterableIterator< [string, any] >

Returns an Iterator of [key, value] pairs

Returns ​

IterableIterator< [string, any] >

Inherited from ​

Map.[iterator]

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:128


_callObserver ​

_callObserver(transaction, _parentSubs): void

Creates YEvent and calls all type observers. Must be implemented by each type.

Parameters ​

ParameterTypeDescription
transactionTransaction-
_parentSubsSet< null | string >Keys changed on this type. null if list was modified.

Returns ​

void

Inherited from ​

Map._callObserver

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:89


_copy ​

_copy(): XmlHook

Creates an Item with the same effect as this Item (without position effect)

Returns ​

XmlHook

Overrides ​

Map._copy

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YXmlHook.d.ts:18


_integrate ​

_integrate(y, item): void

Integrate this type into the Yjs instance.

  • Save this struct in the os
  • This type is sent to other client
  • Observer functions are fired

Parameters ​

ParameterTypeDescription
yDocThe Yjs instance
itemItem-

Returns ​

void

Inherited from ​

Map._integrate

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:43


_write ​

_write(_encoder): void

Parameters ​

ParameterType
_encoderUpdateEncoderV1 | UpdateEncoderV2

Returns ​

void

Inherited from ​

Map._write

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:77


clear ​

clear(): void

Removes all elements from this YMap.

Returns ​

void

Inherited from ​

Map.clear

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:122


clone ​

clone(): XmlHook

Returns ​

XmlHook

Overrides ​

Map.clone

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YXmlHook.d.ts:22


delete ​

delete(key): void

Remove a specified element from this YMap.

Parameters ​

ParameterTypeDescription
keystringThe key of the element to remove.

Returns ​

void

Inherited from ​

Map.delete

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:95


entries ​

entries(): IterableIterator< [string, any] >

Returns an Iterator of [key, value] pairs

Returns ​

IterableIterator< [string, any] >

Inherited from ​

Map.entries

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:83


forEach ​

forEach(f): void

Executes a provided function on once on every key-value pair.

Parameters ​

ParameterTypeDescription
ffunctionA function to execute on every element of this YArray.

Returns ​

void

Inherited from ​

Map.forEach

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:89


get ​

get(key): any

Returns a specified element from this YMap.

Parameters ​

ParameterType
keystring

Returns ​

any

Inherited from ​

Map.get

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:111


has ​

has(key): boolean

Returns a boolean indicating whether the specified key exists or not.

Parameters ​

ParameterTypeDescription
keystringThe key to test.

Returns ​

boolean

Inherited from ​

Map.has

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:118


keys ​

keys(): IterableIterator< string >

Returns the keys for each element in the YMap Type.

Returns ​

IterableIterator< string >

Inherited from ​

Map.keys

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:71


observe ​

observe(f): void

Observe all events that are created on this type.

Parameters ​

ParameterTypeDescription
ffunctionObserver function

Returns ​

void

Inherited from ​

Map.observe

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:95


observeDeep ​

observeDeep(f): void

Observe all events that are created by this type and its children.

Parameters ​

ParameterTypeDescription
ffunctionObserver function

Returns ​

void

Inherited from ​

Map.observeDeep

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:101


set ​

set<VAL>(key, value): VAL

Adds or updates an element with a specified key and value.

Type parameters ​

Parameter
VAL extends any

Parameters ​

ParameterTypeDescription
keystringThe key of the element to add to this YMap
valueVALThe value of the element to add

Returns ​

VAL

Inherited from ​

Map.set

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:104


toDOM ​

toDOM( _document?, hooks?, binding?): Element

Creates a Dom Element that mirrors this YXmlElement.

Parameters ​

ParameterTypeDescription
_document?DocumentThe document object (you must define
this when calling this method in
nodejs)
hooks?objectOptional property to customize how hooks
are presented in the DOM
binding?anyYou should not set this property. This is
used if DomBinding wants to create a
association to the created DOM type

Returns ​

Element

The Element

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YXmlHook.d.ts:38


toJSON ​

toJSON(): object

Transforms this Shared Type to a JSON object.

Returns ​

object

Inherited from ​

Map.toJSON

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:57


unobserve ​

unobserve(f): void

Unregister an observer function.

Parameters ​

ParameterTypeDescription
ffunctionObserver function

Returns ​

void

Inherited from ​

Map.unobserve

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:107


unobserveDeep ​

unobserveDeep(f): void

Unregister an observer function.

Parameters ​

ParameterTypeDescription
ffunctionObserver function

Returns ​

void

Inherited from ​

Map.unobserveDeep

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/AbstractType.d.ts:113


values ​

values(): IterableIterator< any >

Returns the values for each element in the YMap Type.

Returns ​

IterableIterator< any >

Inherited from ​

Map.values

Defined In ​

node_modules/.pnpm/yjs@13.6.10/node_modules/yjs/dist/src/types/YMap.d.ts:77