Tagscript

IParser

TagScript


Interface: IParser

Defined in: packages/tagscript/src/lib/interfaces/index.ts:19

Parsers are used to parse a tag and return a value based on the tag.

Properties

parse

parse: (ctx) => Awaitable<string | null | undefined>

Defined in: packages/tagscript/src/lib/interfaces/index.ts:28

Parses the given tag.

Returning null or undefined means this parser did not handle the tag, and the interpreter moves on to the next one that accepted it.

Parameters

ctx

Context

The context of the tag.

Returns

Awaitable<string | null | undefined>


willAccept

willAccept: (ctx) => Awaitable<boolean>

Defined in: packages/tagscript/src/lib/interfaces/index.ts:34

Whether the parser can handle the given tag.

Parameters

ctx

Context

The context of the tag.

Returns

Awaitable<boolean>

On this page