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

    Type adapter for prop values: defines equality, parsing from raw input (typically attribute strings), and stringification back to attributes.

    Instances are abstract, prop-agnostic type definitions. The registry keys concretes by JS constructor (is) and abstracts by name; derivatives are Object.create(parent) so option lookup walks the prototype chain. The parent comes from spec.extends or, failing that, registry.get(spec.is) — so e.g. {is: Array, extends: Iterable} decouples the chain parent from the produced JS type.

    init lifts every spec key onto the instance. Method overrides (equals / parse / stringify) go through their matching get_<name> transform on the prototype, which wraps them with the shared null/identity short-circuits and super-walking. Other methods are lifted verbatim and can call into the next implementation via the super proxy.

    Type Parameters

    Index

    Constructors

    Properties

    is: any

    The spec this instance was constructed with — stored verbatim, not cloned. Every own key is also lifted onto the instance by init.

    subTypes: string[]

    Spec keys whose values are sub-types (e.g. ["values"], ["keys", "values"]). init resolves them to PropType instances on the instance, defaulting to PropType.any so this.values.parse(v) works unconditionally.

    Shared fallback returned by PropType.for when no type is specified or matched.

    registry: Map<string | Function, PropType<PropTypeSpec>> = ...

    Methods

    • Null/undefined produce null (signaling attribute removal).

      Parameters

      • specStringify: any

      Returns (value: any) => any

    • Resolve an is identifier to its registry key: strings are looked up on globalThis (catches built-ins like "Array"); anything else passes through as-is (including named-only abstracts like "Iterable").

      Parameters

      • is: string | Function

      Returns string | Function