You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 18, 2026. It is now read-only.
It does not seem possible to narrow down the union of records when wanting to listen to everything:
import{CommitType,EventType,Jetstream}from"@skyware/jetstream";constjetstream=newJetstream();jetstream.on(EventType.Commit,(event)=>{constcommit=event.commit;if(commit.operation===CommitType.Create){constrecord=commit.record;if(record.$type==="app.bsky.feed.post"){record.text;// Property 'text' does not exist...}}});jetstream.start();
I would have expected record to be of type AppBskyFeedPost.Record, but it was still AppBskyActorProfile.Record | AppBskyFeedGenerator.Record | AppBskyFeedLike.Record | AppBskyFeedPost.Record | AppBskyFeedPostgate.Record | AppBskyFeedRepost.Record | AppBskyFeedThreadgate.Record | AppBskyGraphBlock.Record | AppBskyGraphFollow.Record | AppBskyGraphList.Record | AppBskyGraphListblock.Record | AppBskyGraphListitem.Record | AppBskyGraphStarterpack.Record | AppBskyLabelerService.Record | ChatBskyActorDeclaration.Record.
For now, just doing "text" in record suffices, I guess... unless I am being oblivious to something? If so, please let me know!
As a side note, I must skip the library check when type checking because it gives compile errors from partysocket. It's not strictly relevant to this package I guess.
Description
It does not seem possible to narrow down the union of records when wanting to listen to everything:
I would have expected
recordto be of typeAppBskyFeedPost.Record, but it was stillAppBskyActorProfile.Record | AppBskyFeedGenerator.Record | AppBskyFeedLike.Record | AppBskyFeedPost.Record | AppBskyFeedPostgate.Record | AppBskyFeedRepost.Record | AppBskyFeedThreadgate.Record | AppBskyGraphBlock.Record | AppBskyGraphFollow.Record | AppBskyGraphList.Record | AppBskyGraphListblock.Record | AppBskyGraphListitem.Record | AppBskyGraphStarterpack.Record | AppBskyLabelerService.Record | ChatBskyActorDeclaration.Record.tsconfig.json:
{ "compilerOptions": { "strict": true, "module": "NodeNext", "moduleResolution": "NodeNext", "lib": ["ESNext"], "target": "ESNext", } }For now, just doing
"text" in recordsuffices, I guess... unless I am being oblivious to something? If so, please let me know!As a side note, I must skip the library check when type checking because it gives compile errors from partysocket. It's not strictly relevant to this package I guess.
Versions