    import YXmlHook from 'yjs/src/Types/YXml/YXmlHook.js'

public class | source

# YXmlHook

#### Extends:

Item → Type → YMap → YXmlHook

You can manage binding to a custom type with YXmlHook.

## Constructor Summary

Public Constructor
public | constructor (hookName: String) |

## Member Summary

Public Members
public | hookName : * |

## 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 (f: Function) Observe all events that are created on this type. |
public | observeDeep (f: Function) Observe all events that are created by this type and its children. |
public | unobserve (f: Function) Unregister an observer function. |
public | unobserveDeep (f: Function) Unregister an observer function. |

From class YMap
public | delete (key: encodable) Remove a specified element from this YMap. |
public | get (key: encodable): * Returns a specified element from this YMap. |
public | has (key: encodable): boolean 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 | toJSON (): Object Transforms this Shared Type to a JSON object. |

## Public Constructors

### public constructor(hookName: String) source

#### Override:

Type#constructor

#### Params:

Name | Type | Attribute | Description
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:

Name | Type | Attribute | Description

_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

#### Return:

Element | The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}