Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

  • SelectorFactory

Index

Constructors

constructor

Properties

Protected _base

_base: Attribute | undefined

Protected _children

_children: Map<string, AttrValue> = new Map()

Private _hasValues

_hasValues: boolean = false

Protected _parent

_parent: BlockClass | null

Private _presenceRule

_presenceRule: AttrValue | undefined

Protected _root

_root: Block | Attribute

Private _sourceAttributes

_sourceAttributes: Attr[] | undefined

Protected _token

_token: AttrToken

Accessors

Protected ChildConstructor

base

  • Get the style that this style inherits from, if any.

    This walks down the declared styles of the parent's inheritance chain, and attempts to find a matching directly declared style on each.

    The result is cached because it never changes and is decidable as soon as the style is instantiated.

    Returns Attribute | undefined

block

  • The block property is an alias for root. This isn't the dryest place to put this line, but every extension re-declared this interface itself and I wanted it in one place.

    Returns Block

    The base node in this tree.

blockClass

hasValues

  • get hasValues(): boolean

isBooleanAttribute

  • get isBooleanAttribute(): boolean

name

  • get name(): string

namespace

  • get namespace(): string | null

Protected parent

presenceRule

Protected root

token

Protected uid

  • get uid(): string

Methods

all

asSource

  • asSource(scope?: Block | boolean): string
  • Retrieve this Attribute's selector as it appears in the Block source code.

    Parameters

    • Optional scope: Block | boolean

      Optional scope to resolve this name relative to. If true, return the Block name instead of :scope. If a Block object, return with the local name instead of :scope.

    Returns string

    The Attribute's attribute selector.

asSourceAttributes

  • asSourceAttributes(): Attr[]

Protected children

Protected childrenHash

  • childrenHash(): ObjectDictionary<AttrValue>

Protected childrenMap

cssClass

Protected ensureChild

  • ensureChild(token: Child["token"], key?: undefined | string): AttrValue
  • Ensure a child node exists on this object at key. If it does not, create it. If key is not provided, use the child name as the key.

    Parameters

    • token: Child["token"]
    • Optional key: undefined | string

      string The key at which this child object should be (optional)

    Returns AttrValue

    The child node.

ensureValue

  • Ensures that a AttrValue of name name exists in this Attribute. If no AttrValue exists, one is created. If no name is passed, it ensures the "presence" AttrValue.

    Parameters

    • Default value name: string = ATTR_PRESENT

      string The AttrValue name to ensure.

    Returns AttrValue

    The AttrValue

Protected getChild

  • getChild(token: Child["token"]): AttrValue | null

getParsedSelectors

  • getParsedSelectors(rule: Rule): ParsedSelector[]
  • Every Block tree maintains its own local cache of parsed selectors. From any sub-inheritable, or from the root inheritable itself, given a PostCSS Rule, ensure it is present in the root Block's parsed rule selectors cache, and return the ParsedSelector array.

    Parameters

    • rule: Rule

      PostCSS Rule

    Returns ParsedSelector[]

    ParsedSelector array

getValue

  • Get am Attribute's own (read: non-inherited) AttrValue of name name from this Attribute. If no name is passed, it tries to retrieve the "presence" AttrValue.

    Parameters

    • Default value name: string = ATTR_PRESENT

      string The name of the AttrValue to retrieve.

    Returns AttrValue | null

    The AttrValue or undefined.

hasResolvedValues

  • hasResolvedValues(): boolean

Protected newChild

Protected resolveChild

  • resolveChild(token: Child["token"]): AttrValue | null

Protected resolveChildren

Protected resolveChildrenHash

  • resolveChildrenHash(): ObjectDictionary<AttrValue>

Protected resolveChildrenMap

  • resolveChildrenMap(): Map<string, AttrValue>

resolveInheritance

  • Compute all block objects that are implied by this block object through inheritance. Does not include this object or the styles it implies through other relationships to this object.

    The values are returned in inheritance order, with the first value returned (if any) having no base, and the the last value returned (if any) being the base of this object.

    If nothing is inherited, this returns an empty array.

    Returns Attribute[]

    The array of nodes this node inherits from.

resolveValue

  • resolveValue(name?: string): AttrValue | null
  • Get am Attribute's own or inherited AttrValue of name name from this Attribute or its base. If no name is passed, it tries to retrieve the "presence" AttrValue.

    Parameters

    • Default value name: string = ATTR_PRESENT

      string The name of the AttrValue to retrieve.

    Returns AttrValue | null

    The AttrValue or undefined.

resolveValues

resolveValuesHash

  • resolveValuesHash(): ObjectDictionary<AttrValue>

resolveValuesMap

resolvedValues

Protected setChild

Protected tokenToUid

values

valuesHash

valuesMap

Generated using TypeDoc