Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
18 lines
1.0 KiB
Plaintext
18 lines
1.0 KiB
Plaintext
import { type CompiledMessage } from './types.js';
|
|
export type { CompiledMessage } from './types.js';
|
|
export type FormatValues<RichTextElement = unknown> = Record<string, string | number | boolean | Date | ((chunks: Array<string | RichTextElement>) => RichTextElement)>;
|
|
export type Formats = {
|
|
dateTime?: Record<string, Intl.DateTimeFormatOptions>;
|
|
number?: Record<string, Intl.NumberFormatOptions>;
|
|
};
|
|
export type FormatOptions = {
|
|
formats?: Formats;
|
|
formatters: {
|
|
getDateTimeFormat(...args: ConstructorParameters<typeof Intl.DateTimeFormat>): Intl.DateTimeFormat;
|
|
getNumberFormat(...args: ConstructorParameters<typeof Intl.NumberFormat>): Intl.NumberFormat;
|
|
getPluralRules(...args: ConstructorParameters<typeof Intl.PluralRules>): Intl.PluralRules;
|
|
};
|
|
timeZone?: string;
|
|
};
|
|
export default function format<RichTextElement = string>(message: CompiledMessage, locale: string, values: FormatValues<RichTextElement> | undefined, options: FormatOptions): string | RichTextElement | Array<string | RichTextElement>;
|