Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

isCustomEvent.md

33 lines686 Bytes

function isCustomEvent<TName>(chunk, name): chunk is WellKnownCustomEvent<TName>;

Defined in: packages/ai/src/custom-events.ts:102

Type guard: is chunk a CUSTOM event with the given well-known name? Narrows the payload type when true, so consumers read chunk.value typed.

Type Parameters

TName

TName extends WellKnownCustomEventName

Parameters

chunk

AGUIEvent

name

TName

Returns

chunk is WellKnownCustomEvent<TName>