Clean up onPostSuccess

This commit is contained in:
Eric Bailey
2025-05-21 17:15:26 -05:00
parent 6dd71ebae2
commit a16f5ecbff
7 changed files with 50 additions and 22 deletions
+14
View File
@@ -2,6 +2,7 @@ import React from 'react'
import {
type AppBskyActorDefs,
type AppBskyFeedDefs,
type AppBskyUnspeccedGetPostThreadV2,
type ModerationDecision,
} from '@atproto/api'
import {msg} from '@lingui/macro'
@@ -24,9 +25,22 @@ export interface ComposerOptsPostRef {
moderation?: ModerationDecision
}
export type OnPostSuccessData =
| {
type: 'post'
posts: AppBskyUnspeccedGetPostThreadV2.ThreadItem[]
}
| {
type: 'reply'
parent: AppBskyUnspeccedGetPostThreadV2.ThreadItem
replies: AppBskyUnspeccedGetPostThreadV2.ThreadItem[]
}
| undefined
export interface ComposerOpts {
replyTo?: ComposerOptsPostRef
onPost?: (postUri: string | undefined) => void
onPostSuccess?: (data: OnPostSuccessData) => void
quote?: AppBskyFeedDefs.PostView
mention?: string // handle of user to mention
openEmojiPicker?: (pos: EmojiPickerPosition | undefined) => void