Home Reference Source Repository
import {TemplateElement} from 'esast/src/ast.js'
public class | source

TemplateElement

Extends:

Node → TemplateElement

Part of a TemplateLiteral.

Static Member Summary

Static Public Members
public static get

empty: *

TemplateElement with empty value.

Static Method Summary

Static Public Methods
public static

forRawString(str: string): *

TemplateElement whose raw source is `str`.
public static

forString(str: string): *

TemplateElement evaluating to `str`.

Constructor Summary

Public Constructor
public

constructor(tail: *, value: *)

Member Summary

Public Members
public
Use this to mark the last TemplateElement.
public

value: {cooked: string, raw: string}

Inherited Summary

From class Node
public get

type: *

For compatibility with other AST representations, all Node instances have a 'type' property that is the name of that type.
public

toJSON(): *

Convert to JSON.
public

toString(): *

Static Public Members

public static get empty: * source

TemplateElement with empty value.

Static Public Methods

public static forRawString(str: string): * source

TemplateElement whose raw source is str.

Params:

NameTypeAttributeDescription
str string

Return:

*

public static forString(str: string): * source

TemplateElement evaluating to str. Uses escape sequences as necessary.

Params:

NameTypeAttributeDescription
str string

Return:

*

Public Constructors

public constructor(tail: *, value: *) source

Params:

NameTypeAttributeDescription
tail *
value *

Public Members

public tail: boolean source

Use this to mark the last TemplateElement.

public value: {cooked: string, raw: string} source