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

HtmlChunk overview

Added in v1.0.0


Table of contents


utils

AttrValue (type alias)

Signature

export type AttrValue = string | null | undefined | ReadonlyArray<AttrValue>

Added in v1.0.0

HtmlChunk (type alias)

Signature

export type HtmlChunk = TextChunk | PartChunk | SparsePartChunk

Added in v1.0.0

PartChunk (class)

Signature

export declare class PartChunk { constructor(
    readonly node: PartNode,
    readonly render: (value: unknown) => string
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "part"

SparsePartChunk (class)

Signature

export declare class SparsePartChunk { constructor(
    readonly node: SparseAttrNode | SparseClassNameNode,
    readonly render: (value: AttrValue) => string
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "sparse-part"

TextChunk (class)

Signature

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

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "text"

escape

Signature

export declare function escape(s: unknown): string

Added in v1.0.0

escapeHtml

Signature

export declare function escapeHtml(str: string): string

Added in v1.0.0

templateToHtmlChunks

Signature

export declare function templateToHtmlChunks({ hash, nodes }: Template, isStatic: boolean)

Added in v1.0.0

unescape

Signature

export declare function unescape(s: string)

Added in v1.0.0

unescapeHtml

Signature

export declare function unescapeHtml(html: string)

Added in v1.0.0