Home | Interpret
Complete export reference. For detailed documentation, follow the links to individual wiki pages.
| Export |
Kind |
Description |
Details |
interpretText |
function |
Parse DSL text + interpret in one call |
Interpret |
interpretTokens |
function |
Walk a token tree and yield output nodes |
Interpret |
flattenText |
function |
Extract plain text from a token value |
Interpret |
createRuleset |
helper |
Identity function for type inference |
Interpret |
fromHandlerMap |
helper |
Build interpret from a handler record |
Interpret |
dropToken |
helper |
Handler that emits nothing |
Interpret |
unwrapChildren |
helper |
Handler that passes through children |
Interpret |
wrapHandlers |
helper |
Wrap every handler with shared logic |
Interpret |
debugUnhandled |
helper |
Render unhandled tokens as placeholders |
Interpret |
collectNodes |
helper |
Array.from sugar for generators |
Interpret |
| Export |
Kind |
Description |
Details |
lintStructural |
function |
Run rules, return sorted diagnostics |
Lint |
applyLintFixes |
function |
Apply fixable diagnostics atomically |
Lint |
| Export |
Kind |
Description |
Details |
parseSlice |
function |
Re-parse a region with position mapping (optional fullTree for shorthand fallback optimization) |
Structural Slice |
| Export |
Kind |
Description |
Details |
toSliceEdit |
function |
Convert SourceSpan to IncrementalEdit
|
Incremental Sugar |
replaceSliceText |
function |
Pure string replace by span offsets |
Incremental Sugar |
createSliceSession |
function |
Create an incremental session |
Incremental Sugar |
applyIncrementalEditBySpan |
function |
Apply span edit to session |
Incremental Sugar |
| Export |
Kind |
Description |
Details |
interpretTextAsync |
function |
Async parse + interpret |
Async Interpret |
interpretTokensAsync |
function |
Async token tree walk |
Async Interpret |
fromAsyncHandlerMap |
helper |
Async version of fromHandlerMap
|
Async Interpret |
wrapAsyncHandlers |
helper |
Async version of wrapHandlers
|
Async Interpret |
collectNodesAsync |
helper |
Collect AsyncIterable to array |
Async Interpret |
| Type |
What it is |
Details |
InterpretRuleset<TNode, TEnv> |
The ruleset you pass to interpretTokens — createText, interpret, onUnhandled?, onError?
|
Interpret |
InterpretResult<TNode> |
Return type of interpret — 5 variants: nodes, text, flatten, unhandled, drop
|
Interpret |
ResolvedResult<TNode> |
InterpretResult minus unhandled — return type for onUnhandled strategy functions |
Interpret |
InterpretHelpers<TNode, TEnv> |
Object passed to interpret — interpretChildren, flattenText, env
|
Interpret |
UnhandledStrategy<TNode, TEnv> |
"throw" | "flatten" | "drop" | function — what to do with unhandled tokens |
Interpret |
TokenHandler<TNode, TEnv> |
Shorthand for a single sync handler function: (token, helpers) => ResolvedResult
|
Interpret |
TextResult |
{ type: "text"; text: string } — return type of debugUnhandled's callback |
Interpret |
| Type |
What it is |
Details |
AsyncInterpretRuleset<TNode, TEnv> |
Async version of InterpretRuleset — interpret can return Promise
|
Async Interpret |
AsyncInterpretResult<TNode> |
Like InterpretResult but nodes can be AsyncIterable
|
Async Interpret |
AsyncResolvedResult<TNode> |
AsyncInterpretResult minus unhandled
|
Async Interpret |
AsyncInterpretHelpers<TNode, TEnv> |
Like InterpretHelpers but interpretChildren returns AsyncIterable
|
Async Interpret |
AsyncUnhandledStrategy<TNode, TEnv> |
Like UnhandledStrategy but callback can return Awaitable
|
Async Interpret |
AsyncTokenHandler<TNode, TEnv> |
Shorthand for an async handler function |
Async Interpret |
Awaitable<T> |
T | Promise<T> — used throughout async API signatures |
Async Interpret |
| Type |
What it is |
Details |
ParserLike |
Any object with parse(input, overrides?) — createParser(...) satisfies this |
Structural Slice |
ParseOverrides |
Options for ParserLike.parse — trackPositions, baseOffset, tracker
|
Structural Slice |
| Type |
What it is |
Details |
SliceSession |
Stateful incremental session — getDocument, applyEdit, rebuild
|
Incremental Sugar |
SliceSessionApplyResult |
Result of applyEdit — doc, mode, fallbackReason?
|
Incremental Sugar |
| Type |
What it is |
Details |
StructuralTagNode |
Extract<StructuralNode, { type: "inline" | "raw" | "block" }> — narrowed tag node |
Structural Query |
StructuralVisitContext |
{ parent, depth, index } — context for predicates and visitors |
Structural Query |
StructuralPredicate |
(node, ctx) => boolean — predicate for findFirst / findAll
|
Structural Query |
StructuralVisitor |
(node, ctx) => void — visitor for walkStructural
|
Structural Query |
| Type |
What it is |
Details |
LintRule |
Rule interface — id, severity?, check(ctx)
|
Lint |
LintContext |
Context in check — source, tree, report, findFirst, findAll, walk
|
Lint |
LintOptions |
Options for lintStructural — rules, overrides?, parseOptions?, onRuleError?, failFast?
|
Lint |
Diagnostic |
Lint result — ruleId, severity, message, span, node?, fix?
|
Lint |
DiagnosticSeverity |
"error" | "warning" | "info" | "hint" |
Lint |
Fix |
Auto-fix — description, edits: TextEdit[]
|
Lint |
TextEdit |
Source edit — span: SourceSpan, newText: string
|
Lint |
ReportInfo |
Argument to ctx.report() — Diagnostic minus ruleId, severity optional |
Lint |