Nude Element API Docs - v0.1.3
    Preparing search index...

    Per-element wrapper around a Prop spec. Holds the current input and derived value for one prop on one element, and the per-element behavior (get, set, update, cascade) for that prop.

    The two-slot model:

    • internalValue stores the user-supplied input (parsed, not yet converted). undefined means "no user input; fall through to default."
    • value stores the derived/visible value: convert(input), where input is internalValue if set, otherwise the resolved default. It is eagerly cached on every write and on every dep-cascade recompute.

    Separating the slots means a dep cascade re-derives value from the untouched internalValue rather than re-running convert on an already-converted value, which is incorrect for non-idempotent converts.

    Index

    Constructors

    Properties

    internalValue: any

    Parsed-but-not-converted input from a user write. undefined when no user input has landed (the prop is showing its default), including after an attribute removal collapses the input back to undefined.

    oldValue: any

    Value prior to the most recent change.

    props: ElementProps
    source: any

    Origin label for the most recent user write: "property", "attribute", or undefined if no write has ever landed (the mount-time default fires with undefined). Persists across dep-cascade recomputes and across attribute removal — describes the origin of the input shape, not whether input is currently present. Use internalValue !== undefined to check "is the prop user-owned right now?" (see dependsOn).

    Plugins may introduce additional source values via set; the built-in code only emits "property", "attribute", or undefined.

    spec: Prop
    value: any
    sources: string[] = ...

    For validation and to distinguish user vs. cascade writes

    Accessors

    Methods

    • Read this prop's current value, lazily deriving if the cache is empty. Object.hasOwn is the sentinel because a legitimately-cached undefined (e.g. a prop with no input and no default) must not trigger re-derivation on every read.

      Returns any

    • Write a user-supplied value: parse, store as input, re-derive, reflect to attribute when applicable.

      Parameters

      • value: any

        Raw value (string from an attribute, any from a property write).

      • Optionaloptions: { name?: string; oldAttributeValue?: string; source?: string } = {}

      Returns void