Skip to content

Latest commit

 

History

History
277 lines (124 loc) · 3.3 KB

kit.domproxy_properties.md

File metadata and controls

277 lines (124 loc) · 3.3 KB

Home > @holoflows/kit > DOMProxy_Properties

DOMProxy_Properties interface

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

Signature:

export interface DOMProxy_Properties<ProxiedElement extends Node, Before extends Element, After extends Element> 

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)

Properties

Property

Modifiers

Type

Description

after

readonly

After

Returns the after element, if it doesn't exist, create it implicitly.

afterShadow

readonly

ShadowRoot

Returns the ShadowRoot of the after element.

before

readonly

Before

Returns the before element, if it doesn't exist, create it implicitly.

beforeShadow

readonly

ShadowRoot

Returns the ShadowRoot of the before element.

current

readonly

ProxiedElement

A proxy that always point to realCurrent, and if realCurrent changes, all action will be forwarded to new realCurrent

destroyed

readonly

boolean

observer

readonly

DOMProxy_MutationObserver

Observer for the current node. You need to set callback and init to activate it.

realCurrent

ProxiedElement | null

The real current of the current

Methods

Method

Description

destroy()

Destroy the DOMProxy

has(type)

Get weak reference to before node

has(type)

Get weak reference to after node

has(type)

Get weak reference to beforeShadow or afterShadow node