atproto icon indicating copy to clipboard operation
atproto copied to clipboard

Missing types for PostView.Record in @atproto/api

Open sameoldlab opened this issue 1 year ago • 2 comments

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

sameoldlab avatar May 01 '23 18:05 sameoldlab

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.

tom-sherman avatar Jun 04 '23 20:06 tom-sherman

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

dholms avatar Jun 06 '23 01:06 dholms