MessageFormatter interface

A callable interface for formatting messages with optional interpolation data.

Call Signatures

MessageFormatter (1/2) interface

Signature

(message: string): string

Parameters

message

Message to format

Returns

The formatted message

MessageFormatter (2/2) interface

Signature

(template: string, values: Record<string, string | number>): string

Parameters

template

Message template to format

values

Replacement values keyed by placeholder name

Returns

The formatted message

Properties

defaultPrefix property

Type

string

Prefix added before each formatted message