Skip to content

BlockSuite API Documentation / @blocksuite/store / Y / XmlHook

Class: XmlHook

You can manage binding to a custom type with YXmlHook.

Extends

Constructors

new XmlHook()

new XmlHook(hookName): XmlHook

Parameters

hookName: string

nodeName of the Dom Node.

Returns

XmlHook

Overrides

Map.constructor

Source

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

Properties

_dEH

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

Deep event handlers

Inherited from

Map._dEH

Source

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


_eH

_eH: EventHandler<YMapEvent<any>, Transaction>

Event handlers

Inherited from

Map._eH

Source

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


_item

_item: null | Item

Inherited from

Map._item

Source

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


_length

_length: number

Inherited from

Map._length

Source

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


_map

_map: Map<string, Item>

Inherited from

Map._map

Source

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


_searchMarker

_searchMarker: null | ArraySearchMarker[]

Inherited from

Map._searchMarker

Source

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


_start

_start: null | Item

Inherited from

Map._start

Source

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


doc

doc: null | Doc

Inherited from

Map.doc

Source

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


hookName

hookName: string

Source

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

Accessors

_first

get _first(): null | Item

The first non-deleted item

Returns

null | Item

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/AbstractType.d.ts:85


parent

get parent(): null | AbstractType<any>

Returns

null | AbstractType<any>

Source

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


size

get size(): number

Returns the size of the YMap (count of key/value pairs)

Returns

number

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:69

Methods

[iterator]()

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

Returns an Iterator of [key, value] pairs

Returns

IterableIterator<[string, any]>

Inherited from

Map.[iterator]

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:132


_callObserver()

_callObserver(transaction, _parentSubs): void

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

Parameters

transaction: Transaction

_parentSubs: Set<null | string>

Keys changed on this type. null if list was modified.

Returns

void

Inherited from

Map._callObserver

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/AbstractType.d.ts:93


_copy()

_copy(): XmlHook

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

Returns

XmlHook

Overrides

Map._copy

Source

node_modules/.pnpm/yjs@13.6.15/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

y: Doc

The Yjs instance

item: Item

Returns

void

Inherited from

Map._integrate

Source

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


_write()

_write(_encoder): void

Parameters

_encoder: UpdateEncoderV1 | UpdateEncoderV2

Returns

void

Inherited from

Map._write

Source

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


clear()

clear(): void

Removes all elements from this YMap.

Returns

void

Inherited from

Map.clear

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:126


clone()

clone(): XmlHook

Makes a copy of this data type that can be included somewhere else.

Note that the content is only readable after it has been included somewhere in the Ydoc.

Returns

XmlHook

Overrides

Map.clone

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YXmlHook.d.ts:26


delete()

delete(key): void

Remove a specified element from this YMap.

Parameters

key: string

The key of the element to remove.

Returns

void

Inherited from

Map.delete

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:99


entries()

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

Returns an Iterator of [key, value] pairs

Returns

IterableIterator<[string, any]>

Inherited from

Map.entries

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:87


forEach()

forEach(f): void

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

Parameters

f

A function to execute on every element of this YArray.

Returns

void

Inherited from

Map.forEach

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:93


get()

get(key): any

Returns a specified element from this YMap.

Parameters

key: string

Returns

any

Inherited from

Map.get

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:115


has()

has(key): boolean

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

Parameters

key: string

The key to test.

Returns

boolean

Inherited from

Map.has

Source

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


keys()

keys(): IterableIterator<string>

Returns the keys for each element in the YMap Type.

Returns

IterableIterator<string>

Inherited from

Map.keys

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:75


observe()

observe(f): void

Observe all events that are created on this type.

Parameters

f

Observer function

Returns

void

Inherited from

Map.observe

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/AbstractType.d.ts:99


observeDeep()

observeDeep(f): void

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

Parameters

f

Observer function

Returns

void

Inherited from

Map.observeDeep

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/AbstractType.d.ts:105


set()

set<VAL>(key, value): VAL

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

Type parameters

VAL extends any

Parameters

key: string

The key of the element to add to this YMap

value: VAL

The value of the element to add

Returns

VAL

Inherited from

Map.set

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:108


toDOM()

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

Creates a Dom Element that mirrors this YXmlElement.

Parameters

_document?: Document

The document object (you must define this when calling this method in nodejs)

hooks?

Optional property to customize how hooks are presented in the DOM

binding?: any

You should not set this property. This is used if DomBinding wants to create a association to the created DOM type

Returns

Element

The Element

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YXmlHook.d.ts:42


toJSON()

toJSON(): object

Transforms this Shared Type to a JSON object.

Returns

object

Inherited from

Map.toJSON

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:61


unobserve()

unobserve(f): void

Unregister an observer function.

Parameters

f

Observer function

Returns

void

Inherited from

Map.unobserve

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/AbstractType.d.ts:111


unobserveDeep()

unobserveDeep(f): void

Unregister an observer function.

Parameters

f

Observer function

Returns

void

Inherited from

Map.unobserveDeep

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/AbstractType.d.ts:117


values()

values(): IterableIterator<any>

Returns the values for each element in the YMap Type.

Returns

IterableIterator<any>

Inherited from

Map.values

Source

node_modules/.pnpm/yjs@13.6.15/node_modules/yjs/dist/src/types/YMap.d.ts:81