TypeDoc API
TagScript
Getting Started

Module: tagscript

Enumerations

Classes

Interfaces

Type Aliases

Awaitable

Ƭ Awaitable<T>: PromiseLike<T> | T

Represents a type that may or may not be a promise

Type parameters

NameDescription
TThe type of the value

TransformerFunction

Ƭ TransformerFunction: (tag: Lexer) => string

Type declaration

▸ (tag): string

Parameters
NameType
tagLexer
Returns

string

Variables

escapeRegex

Const escapeRegex: RegExp (opens in a new tab)


splitRegex

Const splitRegex: RegExp (opens in a new tab)

Functions

asyncFilter

asyncFilter<T>(values, fn): Promise (opens in a new tab)<T[]>

Identical to Array.filter() (opens in a new tab) but works with async filter functions.

Type parameters

NameDescription
TThe type of the values

Parameters

NameTypeDescription
valuesT[]The array of values
fn(t: T) => Awaitable<boolean>The filter function

Returns

Promise (opens in a new tab)<T[]>


escapeContent

escapeContent(content): string

Escapes special tagscript syntax in a string.

Parameters

NameTypeDescription
contentstringThe content to escape

Returns

string


implicitBool

implicitBool(str): null | boolean

Checks if the given value is 'true' or 'false'. If it is, it returns the boolean value. Otherwise, it returns null

Parameters

NameTypeDescription
strstringThe string to check

Returns

null | boolean


parseIf

parseIf(str): boolean

Parses an if statement. Returns a value based on the conditions.

Parameters

NameTypeDescription
strstringThe string to parse

Returns

boolean


parseListIf

parseListIf(str): boolean[]

Parses multiple if statements from a string.

Parameters

NameTypeDescription
strstringThe string to parse

Returns

boolean[]


split

split(str, extended?): string[]

Split a string by |, but ignore escaped characters.

Remarks

If extended if true, it will also split by ~ and ,

Parameters

NameTypeDefault valueDescription
strstringundefinedThe string to split
extendedbooleanfalseallow ~ or , as separators

Returns

string[]