Skip to main content

MessageArgs

The parameters a Message carries: those of the key, except that a text placeholder may also hold another message, which is formatted first (a distance inside "Total distance {distance}"), and a list of strings may hold messages among its items. A key with no other placeholders can still take an optional count.

This is a type alias exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import type { MessageArgs } from "@mapcairn/core";

type MessageArgs<P> = P extends Record<string, never> ? P : {
readonly [Name in keyof P]: P[Name] extends string ? P[Name] | Message | HostText : P[Name] extends readonly string[] ? readonly MessagePart[] : P[Name];
};

Type parameters​

  • P

See also​

Source: packages/core/src/ports/messages.ts:1203