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

    Class-level collection of Prop specs for a custom element class. Per-element state lives in ElementProps.

    Hierarchy

    • Map
      • Props
    Index

    Constructors

    • Parameters

      • Class: Function

        The class to define props for.

      • Optionalspecs: any

        Props to define, as a map of name → spec.

      Returns Props

    Properties

    Class: Function
    dependents: {} = {}

    Dependency graph. Key is the name of the prop; value is the set of Props that depend on it.

    parent: any = null

    Methods

    • Define one or more props on the class.

      Parameters

      • nameOrProps: string | {}

        Prop name, or map of name → spec.

      • Optionalspec: any

        Prop spec, when the first argument is a name.

      Returns Prop | Prop[]

      The created prop, or array of created props.

    • Low-level: create a single prop and install its accessor on the class prototype. Does not call updateDependents; callers should batch and call it once. Clones spec before any normalization so the user's object is not mutated.

      Parameters

      • name: string
      • spec: any

      Returns Prop

    • Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

      Parameters

      • name: any

      Returns any

      Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

    • Parameters

      • name: any

      Returns any

      boolean indicating whether an element with the specified key exists or not.