Inheritable constructor
Name for this Inheritable instance.
The parent Inheritable of this node.
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.
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.
The base node in this tree.
A boolean indicating if this is the root node in the Inheritable tree or not.
The parent node in this tree.
The root node in this tree.
The token object used to create this node.
The unique name of this node.
TypeScript can't figure out that this
is the Self
so this private
method casts it in a few places where it's needed.
A child object's Token
identifier.
The UID of this child's Token
.
Returns an array of all children nodes in the order they were added for Self.
The children array.
Returns a hash of all children nodes at the keys they are stored.. TODO: Cache this maybe? Convert entire model to only use hash?...
The children hash.
Returns a map of all children nodes at the keys they are stored..
The children map.
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.
string The key at which this child object should be (optional)
The child node.
Retrieve a child node from this object at key
.
The child node.
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.
PostCSS Rule
ParsedSelector array
The new child object's Token
identifier.
The new child object created from token
Resolves the child with the given name from this node's inheritance chain. Returns null if the child is not found.
The child node, or null
Returns an array of all children nodes in the order they were added for self and all inherited children.
The children array.
Returns a map of all children nodes at the keys they are stored..
The children map.
Returns a map of all children nodes at the keys they are stored..
The children map.
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.
The array of nodes this node inherits from.
Set a child node on this object at key
.
The child node.
The tokenToUid
method would ideally be a static method, but
Typescript doesn't expose class generics to static methods, so it
needs to be a protected method.
In order to map children to generic Tokens
, we need a way to map
any given Token
shape to a UID. By default, we stringify the token
passed to us. If more complex behavior is required, this method can
be overridden.
A unique string that represents this token.
Generated using TypeDoc