class / @typed/template

SparseClassNameNode

Represents a sparse class name (e.g. class="foo ${bar}").

Package version
1.0.0-beta.7
Category
Class contributions
Since
1.0.0

Import

import { SparseClassNameNode } from "@typed/template";

Signatures

export declare class SparseClassNameNode {
    readonly _tag: "sparse-class-name";
    readonly nodes: Array<ClassNamePartNode | TextNode>;
    constructor(nodes: Array<ClassNamePartNode | TextNode>);
}

Why

Literal and reactive classes remain one locally managed class expression.

Ownership and lifetime

The model owns segments; the mounted part owns only classes it contributes.

Constructor

Creates sparse class syntax.

Property: _tag

Sparse-class discriminant.

Property: _tag: Why

Selects ordered literal/reactive class joining.

Property: _tag: Ownership and lifetime

Immutable AST metadata.

Property: nodes

Ordered literal and dynamic class segments.

Property: nodes: Why

Defines only this part’s class contribution.

Property: nodes: Ownership and lifetime

Retained AST array; mounted parts own live inputs.

Examples

import { SparseClassNameNode } from "@typed/template/Template"

const node = new SparseClassNameNode([])

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source