Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IMessageCompilerOptions

Hierarchy

  • Pick<ILocaleNodeMapCompilerOptions, "otherSelectCaseKey" | "indexVarName" | "localeVarName" | "defaultLocale" | "locales" | "localesVarName">
    • IMessageCompilerOptions

Index

Properties

argsVarName

argsVarName: string

The name of the variable that holds the arguments object.

comment

comment: Maybe<string>

The doc comment of the rendering function.

Optional defaultLocale

defaultLocale: string

The default locale from locales. If omitted then an empty fragment would be returned if an unsupported locale is passed to a message function.

defaultLocaleVarName

defaultLocaleVarName: string

The name of the variable that holds the default locale.

functionName

functionName: string

The name of the message rendering function.

indexVarName

indexVarName: string

The name of the temporary variable used by plural, select and selectordinal to store the detected index.

interfaceName

interfaceName: string

The name of the TypeScript interface that describe the message arguments.

localeVarName

localeVarName: string

The name of the variable that holds the locale passed to the message function.

locales

locales: string[]

The list of all supported locales stored in localesVarName.

The attentive reader might ask why not use the keys from the localeNodeMap. The reason is to preserve the same order of locales between different messages.

localesVarName

localesVarName: string

The name of the variable that holds an array of locales supported by the message.

Optional otherSelectCaseKey

otherSelectCaseKey: string

The key that is used as the default for select.

default

"other"

runtimeVarName

runtimeVarName: string

The name of the variable that holds the runtime object.

Optional typingsEnabled

typingsEnabled: boolean

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

default

false

Methods

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 renderMetadata

Generated using TypeDoc