A class for building and working with messages grouped by keys.

Hierarchy

  • Messages

Implements

Constructors

Properties

messages: {
    [key: string]: string[];
} = {}

Type declaration

  • [key: string]: string[]

Methods

  • Return all messages in a flat array.

    Parameters

    • Optional forKey: string

      if provided, only search the given key

    Returns string[]

  • Returns true if any messages are found.

    Parameters

    • Optional forKeys: string[]

      if provided, only search the given keys

    Returns boolean

  • Get the total number of messages.

    Parameters

    • Optional forKey: string

      if provided, only search the given key

    Returns number

  • Returns the first message.

    Parameters

    • Optional forKey: string

      if provided, only search the given key

    Returns undefined | string

  • Returns true if the given group has the message.

    Parameters

    • key: string
    • message: string

    Returns boolean

  • Returns {
        [key: string]: string[];
    }

    • [key: string]: string[]
  • Flat array of only distinct messages.

    Parameters

    • Optional forKey: string

      if provided, only search the given key

    Returns string[]