Sign up (with export icon)

ViewElementAttributeValue

Api-interface icon interface

Properties

  • Chevron-right icon

    isEmpty : boolean
    readonly

    Returns true if attribute has no value set.

  • Chevron-right icon

    size : number
    readonly

    Number of tokens (styles, classes or other tokens) defined.

Methods

  • Chevron-right icon

    _canMergeFrom( other ) → boolean

    Used by _canMergeAttributesFrom to verify if the given attribute can be merged without conflicts into the attribute.

    This method is indirectly used by the ViewDowncastWriter while down-casting an ViewAttributeElement to merge it with other ViewAttributeElement.

    Parameters

    other : this

    Returns

    boolean
  • Chevron-right icon

    _clone() → this

    Clones the attribute value.

    Returns

    this
  • Chevron-right icon

    _getConsumables( [ name ] ) → Array<string>

    Returns a list of consumables for the attribute. This includes related tokens (for example other forms of notation of the same style property).

    Could be filtered by the given token name (class name, style property, etc.).

    Parameters

    [ name ] : string

    Returns

    Array<string>
  • Chevron-right icon

    _getTokensMatch( tokenPattern, [ valuePattern ] ) → undefined | Array<string>

    Used by the Matcher to collect matching attribute tokens.

    Parameters

    tokenPattern : string | true | RegExp

    The matched token name pattern.

    [ valuePattern ] : string | true | RegExp

    The matched token value pattern.

    Returns

    undefined | Array<string>

    An array of matching tokens.

  • Chevron-right icon

    _isMatching( other ) → boolean

    Used by _canSubtractAttributesOf to verify if the given attribute can be fully subtracted from the attribute.

    This method is indirectly used by the ViewDowncastWriter while down-casting an ViewAttributeElement to unwrap the ViewAttributeElement.

    Parameters

    other : this

    Returns

    boolean
  • Chevron-right icon

    _mergeFrom( other ) → void

    Used by _mergeAttributesFrom to merge a given attribute into the attribute.

    This method is indirectly used by the ViewDowncastWriter while down-casting an ViewAttributeElement to merge it with other ViewAttributeElement.

    Parameters

    other : this

    Returns

    void
  • Chevron-right icon

    clear() → void

    Removes all tokens.

    Returns

    void
  • Chevron-right icon

    has( name ) → boolean

    Checks if a given token (style, class, token) is set.

    Parameters

    name : string

    Returns

    boolean
  • Chevron-right icon

    isSimilar( other ) → boolean

    Returns true if both attributes have the same content.

    Parameters

    other : this

    Returns

    boolean
  • Chevron-right icon

    keys() → Array<string>

    Returns all tokens (styles, classes, other tokens).

    Returns

    Array<string>
  • Chevron-right icon

    remove( tokens ) → void

    Removes given token (style, class, other token).

    Parameters

    tokens : ArrayOrItem<string>

    Returns

    void
  • Chevron-right icon

    set( stylesOrTokens ) → void

    Sets a given token (for style also a record of properties).

    Parameters

    stylesOrTokens : Styles | ArrayOrItem<string>

    Returns

    void
  • Chevron-right icon

    set( name, value ) → void

    Sets a given style property and value.

    Parameters

    name : string
    value : StyleValue

    Returns

    void
  • Chevron-right icon

    setTo( value ) → this

    Resets the value to the given one.

    Parameters

    value : string

    Returns

    this
  • Chevron-right icon

    toString() → string

    Returns a normalized tokens string (styles, classes, etc.).

    Returns

    string