Home Reference Source
import YXmlHook from 'yjs/src/Types/YXml/YXmlHook.js'
public class | source

YXmlHook

Extends:

ItemTypeYMap → YXmlHook

You can manage binding to a custom type with YXmlHook.

Constructor Summary

Public Constructor
public

constructor(hookName: String)

Member Summary

Public Members
public

Method Summary

Public Methods
public

toDom(_document: Document, hooks: Object<key:hookDefinition>, binding: DomBinding): Element

Creates a Dom Element that mirrors this YXmlElement.

Inherited Summary

From class Type
public

getPathTo(type: YType): Array<string>

Compute the path from this type to the specified target.

public

Observe all events that are created on this type.

public

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

public

Unregister an observer function.

public

Unregister an observer function.

From class YMap
public

Remove a specified element from this YMap.

public

get(key: encodable): *

Returns a specified element from this YMap.

public

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

public

keys(): Array

Returns the keys for each element in the YMap Type.

public

set(key: encodable, value: encodable | YType): *

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

public

Transforms this Shared Type to a JSON object.

Public Constructors

public constructor(hookName: String) source

Override:

Type#constructor

Params:

NameTypeAttributeDescription
hookName String

nodeName of the Dom Node.

Public Members

public hookName: * source

Public Methods

public toDom(_document: Document, hooks: Object<key:hookDefinition>, binding: DomBinding): Element source

Creates a Dom Element that mirrors this YXmlElement.

Params:

NameTypeAttributeDescription
_document Document
  • optional
  • default: document

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

hooks Object<key:hookDefinition>
  • optional

Optional property to customize how hooks are presented in the DOM

binding DomBinding
  • optional

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