This is the dev preview website. Check out the document at lynxjs.org

Home > @lynx-js/genui > normalizePayloadToMessages

normalizePayloadToMessages() function

Normalize an arbitrary payload (string, array, object) into a flat list of ServerToClientMessage records. Pass-through for already-structured messages; falls back to wrapping plain text in a Text/Card surface.

Signature:

export declare function normalizePayloadToMessages(payload: unknown): ServerToClientMessage[];

Parameters

Parameter

Type

Description

payload

unknown

Returns:

ServerToClientMessage[]