flip the state layer type imports to the generated lexicons

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-04 04:20:35 +03:00
parent 541a82c2dd
commit dd957dd123
83 changed files with 819 additions and 900 deletions
+12 -17
View File
@@ -1,13 +1,8 @@
import {
type $Typed,
type AppBskyFeedDefs,
type AppBskyFeedPost,
type AppBskyUnspeccedDefs,
type AppBskyUnspeccedGetPostThreadV2,
AtUri,
} from '@atproto/api'
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
import {type $Typed} from '@atproto/lex'
import {AtUri} from '@atproto/syntax'
import {app} from '#/lexicons'
import {moderatePost} from '#/lib/moderation/subjects'
import {makeProfileLink} from '#/lib/routes/links'
import {
@@ -26,7 +21,7 @@ export function threadPostNoUnauthenticated({
key: uri,
uri,
depth,
value: value as AppBskyUnspeccedDefs.ThreadItemNoUnauthenticated,
value: value as app.bsky.unspecced.defs.ThreadItemNoUnauthenticated,
// @ts-ignore populated by the traversal
ui: {},
}
@@ -42,7 +37,7 @@ export function threadPostNotFound({
key: uri,
uri,
depth,
value: value as AppBskyUnspeccedDefs.ThreadItemNotFound,
value: value as app.bsky.unspecced.defs.ThreadItemNotFound,
}
}
@@ -56,7 +51,7 @@ export function threadPostBlocked({
key: uri,
uri,
depth,
value: value as AppBskyUnspeccedDefs.ThreadItemBlocked,
value: value as app.bsky.unspecced.defs.ThreadItemBlocked,
}
}
@@ -69,7 +64,7 @@ export function threadPost({
}: {
uri: string
depth: number
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost>
value: $Typed<app.bsky.unspecced.defs.ThreadItemPost>
moderationOpts: ModerationOpts
threadgateHiddenReplies: Set<string>
}): Extract<ThreadItem, {type: 'threadPost'}> {
@@ -91,8 +86,8 @@ export function threadPost({
* Do not spread anything here, load bearing for post shadow strict
* equality reference checks.
*/
post: value.post as Omit<AppBskyFeedDefs.PostView, 'record'> & {
record: AppBskyFeedPost.Record
post: value.post as Omit<app.bsky.feed.defs.PostView, 'record'> & {
record: app.bsky.feed.post.Main
},
},
isBlurred,
@@ -161,10 +156,10 @@ export function skeleton({
}
export function postViewToThreadPlaceholder(
post: AppBskyFeedDefs.PostView,
post: app.bsky.feed.defs.PostView,
): $Typed<
Omit<AppBskyUnspeccedGetPostThreadV2.ThreadItem, 'value'> & {
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost>
Omit<app.bsky.unspecced.getPostThreadV2.ThreadItem, 'value'> & {
value: $Typed<app.bsky.unspecced.defs.ThreadItemPost>
}
> {
return {