bluesky-social / atproto

Social networking technology created by Bluesky
Other
6.07k stars 426 forks source link

Missing types for PostView.Record in @atproto/api #946

Open sameoldlab opened 1 year ago

sameoldlab commented 1 year ago

Interface for PostView has an empty object as the properties on record.

Closest type I can find is this? https://github.com/bluesky-social/atproto/blob/0b70f50eb44bf6a936115f0e24690a42585b69a6/packages/api/src/client/types/app/bsky/feed/post.ts#L15-L29 but seems it's for creating records not viewing them

tom-sherman commented 1 year ago

I'm struggling with this also.

Reading https://github.com/bluesky-social/atproto/issues/999#issuecomment-1538905166 though it seems like this is mostly on purpose. It's down to the application to validate and narrow this object to something more specific. It should really be typed as Record<string, unknown> though.

dholms commented 1 year ago

Yes that should probably be an open union with a ref to app.bsky.feed.post

See my comment here as well: https://github.com/bluesky-social/atproto/issues/999#issuecomment-1577769209