A locally focused bluesky appview
at master 158 lines 2.6 kB view raw
1// ATProto/Bluesky data types 2export interface BlobRef { 3 $type: "blob"; 4 ref: { 5 $link: string; 6 }; 7 mimeType: string; 8 size: number; 9} 10 11export interface FacetFeature { 12 $type: string; 13 tag?: string; 14 did?: string; 15 uri?: string; 16} 17 18export interface Facet { 19 features: FacetFeature[]; 20 index: { 21 byteStart: number; 22 byteEnd: number; 23 }; 24} 25 26export interface EmbedImage { 27 alt: string; 28 aspectRatio?: { 29 height: number; 30 width: number; 31 }; 32 image: BlobRef; 33} 34 35export interface EmbedImages { 36 $type: "app.bsky.embed.images"; 37 images: EmbedImage[]; 38} 39 40export interface EmbedExternal { 41 $type: "app.bsky.embed.external"; 42 external: { 43 description: string; 44 thumb?: BlobRef; 45 title: string; 46 uri: string; 47 }; 48} 49 50export interface EmbedRecordView { 51 $type: string; 52 uri: string; 53 cid: string; 54 author?: AuthorInfo; 55 value?: FeedPost; 56 indexedAt?: string; 57} 58 59export interface EmbedRecord { 60 $type: "app.bsky.embed.record"; 61 record: EmbedRecordView | { 62 cid: string; 63 uri: string; 64 }; 65} 66 67export type Embed = EmbedImages | EmbedExternal | EmbedRecord; 68 69export interface FeedPost { 70 $type: "app.bsky.feed.post"; 71 createdAt: string; 72 langs?: string[]; 73 text: string; 74 facets?: Facet[]; 75 embed?: Embed; 76} 77 78export interface AuthorInfo { 79 handle: string; 80 did: string; 81 profile?: ActorProfile; 82} 83 84export interface PostCounts { 85 likes: number; 86 reposts: number; 87 replies: number; 88} 89 90export interface PostResponse { 91 missing: boolean; 92 uri: string; 93 cid: string; 94 post?: FeedPost; 95 author?: AuthorInfo; 96 counts?: PostCounts; 97 id: number; 98 replyTo?: number; 99 replyToUsr?: number; 100 inThread?: number; 101 viewerLike?: string; 102} 103 104export interface ThreadResponse { 105 posts: PostResponse[]; 106 rootPostId: number; 107} 108 109export interface ActorProfile { 110 $type: "app.bsky.actor.profile"; 111 avatar?: BlobRef; 112 banner?: BlobRef; 113 createdAt: string; 114 description?: string; 115 displayName?: string; 116 pinnedPost?: { 117 cid: string; 118 uri: string; 119 }; 120} 121 122export interface ApiError { 123 error: string; 124} 125 126export interface EngagementUser { 127 handle: string; 128 did: string; 129 profile?: ActorProfile; 130 time: string; 131} 132 133export interface EngagementResponse { 134 users: EngagementUser[]; 135 count: number; 136} 137 138export interface FeedResponse { 139 posts: PostResponse[]; 140 cursor: string; 141} 142 143export interface Notification { 144 id: number; 145 kind: 'reply' | 'like' | 'mention' | 'repost'; 146 author: AuthorInfo; 147 source: string; 148 sourcePost?: { 149 text: string; 150 uri: string; 151 }; 152 createdAt: string; 153} 154 155export interface NotificationsResponse { 156 notifications: Notification[]; 157 cursor: string; 158}