forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1/**
2 * Types for draft display and local media tracking.
3 * Server draft types come from @atproto/api.
4 */
5import {type AppBskyDraftDefs} from '@atproto/api'
6
7/**
8 * Reference to locally cached media file for display
9 */
10export type LocalMediaDisplay = {
11 /** Path stored in server draft (used as key for local lookup) */
12 localPath: string
13 /** Alt text */
14 altText: string
15 /** Whether the local file exists on this device */
16 exists: boolean
17}
18
19/**
20 * GIF display data (parsed from external embed URL)
21 */
22export type GifDisplay = {
23 /** Full URL with dimensions */
24 url: string
25 /** Width */
26 width: number
27 /** Height */
28 height: number
29 /** Alt text */
30 alt: string
31}
32
33/**
34 * Post content for display in draft list
35 */
36export type DraftPostDisplay = {
37 id: string
38 /** Full text content */
39 text: string
40 /** Image references for display */
41 images?: LocalMediaDisplay[]
42 /** Video reference */
43 video?: LocalMediaDisplay
44 /** GIF data (from URL) */
45 gif?: GifDisplay
46}
47
48/**
49 * Draft summary for list display
50 */
51export type DraftSummary = {
52 id: string
53 /** ISO timestamp of creation */
54 createdAt: string
55 /** ISO timestamp of last update */
56 updatedAt: string
57 /** The full draft data from the server */
58 draft: AppBskyDraftDefs.Draft
59 /** All posts in the draft for full display */
60 posts: DraftPostDisplay[]
61 /** Metadata about the draft for display purposes */
62 meta: {
63 /** Whether this device is the originating device for the draft */
64 isOriginatingDevice: boolean
65 /** Number of posts in thread */
66 postCount: number
67 /** Number of replies to anchor post */
68 replyCount: number
69 /** Whether the draft has media */
70 hasMedia: boolean
71 /** Whether some media is missing (saved on another device) */
72 hasMissingMedia?: boolean
73 /** Number of media items */
74 mediaCount: number
75 /** Whether any posts in the draft has quotes */
76 hasQuotes: boolean
77 /** Number of quotes in the draft */
78 quoteCount: number
79 }
80}