The listener to notify.
Compiles an executable function that renders a translation.
The translations to compile.
The MFML parser instance.
Compiler options.
Compiles a JavaScript function body that renders a localeNodeMap
.
The map from locale to an AST node.
The compiler options.
Compiles mapping from locale to AST node to a source code.
The map from locale to an AST node.
The compiler options.
Compiles a message function and an interface that describes its arguments.
The map from locale to an AST node.
Compilation options.
Compiles messages as a module that exports functions and corresponding interfaces. May return an empty string is module has no translations.
The map from the message name to an actual message.
The MFML parser instance.
Compiler options.
Compiles an AST node to a source code. This may return an empty string if an AST nodes doesn't describe any meaningful value.
The node to compile.
The compiler options.
Creates a compiler that produces message functions.
import {createAtRuntimeCompiler} from '@mfml/compiler/lib/at-runtime';
import {stringRuntime} from '@mfml/runtime';
const compile = createAtRuntimeCompiler();
const message = compile({
en: 'Bye, {name}!',
ru: 'Пока, {name}!',
es: 'Adiós, {name}!',
});
message(stringRuntime, 'en', {name: 'Karen'}); // → 'Bye, Karen!'
Compiler options.
Creates a compiler that produces message functions.
import {createAtRuntimeCompiler} from '@mfml/compiler/lib/at-runtime';
import {stringRuntime} from '@mfml/runtime';
const compile = createAtRuntimeCompiler();
const message = compile({
en: 'Bye, {name}!',
ru: 'Пока, {name}!',
es: 'Adiós, {name}!',
});
message(stringRuntime, 'en', {name: 'Karen'}); // → 'Bye, Karen!'
Creates an ICU MessageFormat + XML/HTML DOM parser.
Triggers callback for each node in the AST.
The node to traverse.
Callbacks to invoke.
Generated using TypeDoc
Compiles an empty fragment and notifies a listener.