Skip to content

Latest commit

 

History

History
54 lines (28 loc) · 1.39 KB

kit.domproxy.md

File metadata and controls

54 lines (28 loc) · 1.39 KB

Home > @holoflows/kit > DOMProxy

DOMProxy interface

DOMProxy provide an interface that be stable even dom is changed.

Signature:

export interface DOMProxy<ProxiedElement extends Node = HTMLElement, Before extends Element = HTMLSpanElement, After extends Element = HTMLSpanElement> extends DOMProxy_Properties<ProxiedElement, Before, After> 

Extends: DOMProxy_Properties<ProxiedElement, Before, After>

Remarks

DOMProxy provide 3 nodes. before, current and after. current is a fake dom node powered by Proxy, it will forward all your operations to the realCurrent.

before and after is a true span that always point to before and after of realCurrent

Special Handlers:

*forward*: forward to current realCurrent

*undo*: undo effect when realCurrent changes

*move*: move effect to new realCurrent

  • style (forward, undo, move) - addEventListener (forward, undo, move) - appendChild (forward, undo, move)

Methods

Method

Description

on(type, fn)