Pular para o conteúdo principal

validateOfficialPostContent

@raizfc/contracts


@raizfc/contracts / validateOfficialPostContent

Function: validateOfficialPostContent()

validateOfficialPostContent(type, media, link): string | undefined

Defined in: assets.ts:47

Each type maps to an exclusive content shape — never a photo with a link, never an attachment on plain text — so the composer and the feed card can each render one unambiguous professional template per post instead of a single generic card guessing from whatever fields happen to be set. Shared by mocks and the real API so the rule cannot drift between them. Returns a human-readable reason when invalid, undefined when valid.

Parameters

type

OfficialPostContentType

media

Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }> | undefined

Readonly<{ label?: string; url: string; }> | undefined

Returns

string | undefined