@worldware/msg
    Preparing search index...

    Class MsgMessage

    A single localizable message with a key, value, attributes, and notes.

    Supports MessageFormat 1, MessageFormat 2, and unformatted (NONE) strings.

    Implements

    Index
    • Formats the message with the given placeholder data.

      For NONE format messages, returns the raw value unchanged.

      Parameters

      • data: Record<string, any>
      • Optionaloptions: MessageFormatOptions<never, never>

      Returns string

    • Formats the message into structured parts with the given placeholder data.

      For NONE format messages, returns a single text part with the raw value.

      Parameters

      • data: Record<string, any>
      • Optionaloptions: MessageFormatOptions<never, never>

      Returns MessagePart<never>[]

    • Returns a plain data object for this message.

      Parameters

      • stripNotes: boolean = false

        When true, notes are omitted from the result.

      Returns {
          attributes: MsgAttributes;
          key: string;
          notes: MsgNote[] | undefined;
          value: string;
      }

    • Serializes this message to a formatted JSON string.

      Parameters

      • stripNotes: boolean = false

        When true, notes are omitted from the serialized data.

      Returns string