Skip to main content Link Search Menu Expand Document (external link)

Template overview

Added in v1.0.0


Table of contents


utils

AttrPartNode (class)

Signature

export declare class AttrPartNode { constructor(
    readonly name: string,
    readonly index: number
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "attr"

Attribute (type alias)

Signature

export type Attribute =
  | AttributeNode
  | AttrPartNode
  | SparseAttrNode
  | BooleanNode
  | BooleanPartNode
  | ClassNameNode
  | SparseClassNameNode
  | DataPartNode
  | EventPartNode
  | PropertyPartNode
  | PropertiesPartNode
  | RefPartNode

Added in v1.0.0

AttributeNode (class)

Signature

export declare class AttributeNode { constructor(
    readonly name: string,
    readonly value: string
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "attribute"

BooleanNode (class)

Signature

export declare class BooleanNode { constructor(readonly name: string) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "boolean"

BooleanPartNode (class)

Signature

export declare class BooleanPartNode { constructor(
    readonly name: string,
    readonly index: number
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "boolean-part"

ClassNameNode (type alias)

Signature

export type ClassNameNode = TextNode | ClassNamePartNode

Added in v1.0.0

ClassNamePartNode (class)

Signature

export declare class ClassNamePartNode { constructor(readonly index: number) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "className-part"

Comment (type alias)

Signature

export type Comment = CommentNode | CommentPartNode | SparseCommentNode

Added in v1.0.0

CommentNode (class)

Signature

export declare class CommentNode { constructor(readonly value: string) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "comment"

CommentPartNode (class)

Signature

export declare class CommentPartNode { constructor(readonly index: number) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "comment-part"

DataPartNode (class)

Signature

export declare class DataPartNode { constructor(readonly index: number) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "data"

DocType (class)

Signature

export declare class DocType { constructor(
    readonly name: string,
    readonly publicType?: string,
    readonly systemId?: string
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "doctype"

ElementNode (class)

Signature

export declare class ElementNode { constructor(
    readonly tagName: string,
    readonly attributes: Array<Attribute>,
    readonly children: Array<Node>
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "element"

EventPartNode (class)

Signature

export declare class EventPartNode { constructor(
    readonly name: string,
    readonly index: number
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "event"

Node (type alias)

Signature

export type Node = ElementNode | SelfClosingElementNode | TextOnlyElement | TextNode | NodePart | Comment | DocType

Added in v1.0.0

NodePart (class)

Signature

export declare class NodePart { constructor(readonly index: number) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "node"

ParentNode (type alias)

Signature

export type ParentNode = ElementNode | SelfClosingElementNode | TextOnlyElement

Added in v1.0.0

PartNode (type alias)

Signature

export type PartNode =
  | AttrPartNode
  | BooleanPartNode
  | ClassNamePartNode
  | DataPartNode
  | EventPartNode
  | NodePart
  | PropertyPartNode
  | PropertiesPartNode
  | RefPartNode
  | TextPartNode
  | CommentPartNode

Added in v1.0.0

PropertiesPartNode (class)

Signature

export declare class PropertiesPartNode { constructor(
    readonly index: number
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "properties"

PropertyPartNode (class)

Signature

export declare class PropertyPartNode { constructor(
    readonly name: string,
    readonly index: number
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "property"

RefPartNode (class)

Signature

export declare class RefPartNode { constructor(readonly index: number) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "ref"

SelfClosingElementNode (class)

Signature

export declare class SelfClosingElementNode { constructor(
    readonly tagName: string,
    readonly attributes: Array<Attribute>
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "self-closing-element"

SparseAttrNode (class)

Signature

export declare class SparseAttrNode { constructor(
    readonly name: string,
    readonly nodes: Array<AttrPartNode | TextNode>
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "sparse-attr"

SparseClassNameNode (class)

Signature

export declare class SparseClassNameNode { constructor(readonly nodes: Array<ClassNameNode>) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "sparse-class-name"

SparseCommentNode (class)

Signature

export declare class SparseCommentNode { constructor(readonly nodes: Array<TextNode | CommentPartNode>) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "sparse-comment"

SparsePartNode (type alias)

Signature

export type SparsePartNode = SparseAttrNode | SparseClassNameNode | SparseCommentNode

Added in v1.0.0

Template (class)

Signature

export declare class Template { constructor(
    readonly nodes: ReadonlyArray<Node>,
    readonly hash: string,
    // Parts are a array of Parts to the respective path from the root node to access it prior to rendering
    /// any nodes/elements into the template.
    readonly parts: ReadonlyArray<
      readonly [part: PartNode | SparsePartNode, path: Chunk<number> | NonEmptyChunk<number>]
    >
  ) }

Added in v1.0.0

toJSON (method)

Signature

toJSON()

[NodeInspectSymbol] (method)

Signature

;[NodeInspectSymbol]()

_tag (property)

Signature

readonly _tag: "template"

Text (type alias)

Signature

export type Text = TextNode | TextPartNode

Added in v1.0.0

TextNode (class)

Signature

export declare class TextNode { constructor(readonly value: string) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "text"

TextOnlyElement (class)

Signature

export declare class TextOnlyElement { constructor(
    readonly tagName: string,
    readonly attributes: Array<Attribute>,
    readonly children: Array<Text>
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "text-only-element"

TextPartNode (class)

Signature

export declare class TextPartNode { constructor(readonly index: number) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "text-part"