Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IModuleCompilerOptions

Hierarchy

Index

Properties

Optional otherSelectCaseKey

otherSelectCaseKey: string

The key that is used as the default for select.

default

"other"

Optional runtimeImportPath

runtimeImportPath: string

The path from which runtime dependencies are imported.

default

"@mfml/runtime"

Optional typingsEnabled

typingsEnabled: boolean

If set to true then TypeScript interfaces and function types are rendered.

default

false

Methods

Optional extractComment

  • extractComment(messageName: string, message: IMessage): Maybe<string>

Optional onError

  • onError(error: unknown, messageName: string, message: IMessage): void

Optional provideDefaultLocale

  • provideDefaultLocale(messageName: string, message: IMessage): string

Optional provideFunctionType

  • provideFunctionType(functionName: string): Maybe<string>
  • Returns the TypeScript type of the argument that a function expects. If omitted then arguments of all functions are typed as unknown.

    Parameters

    • functionName: string

      The name of the function.

    Returns Maybe<string>

Optional renameInterface

  • renameInterface(messageName: string, message: IMessage): string

Optional renameMessageFunction

  • renameMessageFunction(messageName: string, message: IMessage): string

Optional renderMetadata

Optional rewriteTranslation

  • rewriteTranslation(translation: string, locale: string): string
  • Receives a message translation and returns a new translation.

    Use this to apply preprocessors (such as markdown-to-HTML) or typography re-writers.

    Parameters

    • translation: string

      The text of the translation.

    • locale: string

      The translation locale.

    Returns string

Optional transformTranslationNode

  • transformTranslationNode(node: Node, locale: string, messageName: string, message: IMessage): void | Node
  • Transforms a translation node before it is compiled.

    Parameters

    • node: Node

      The node that represents the parsed translation.

    • locale: string

      The translation locale.

    • messageName: string

      The name of the message.

    • message: IMessage

      The message that contains the translation.

    Returns void | Node

    The transformed node. If undefined is returned then node would be used for compilation.

Generated using TypeDoc