···3344 import { base } from '$app/paths';
5566- import type { ParsedAtUri } from '$lib/types/at-uri';
66+ import type { AddressedAtUri } from '$lib/types/at-uri';
7788 import CircleBanSignOutlined from '$lib/components/central-icons/circle-ban-sign-outlined.svelte';
991010 interface Props {
1111 embed: Brand.Union<AppBskyEmbedRecord.ViewBlocked | AppBskyEmbedRecord.ViewDetached>;
1212- uri: ParsedAtUri;
1212+ uri: AddressedAtUri;
1313 }
14141515 const { embed, uri }: Props = $props();
+2-2
src/lib/constants.ts
···11-import type { AtUri } from './types/at-uri';
11+import type { At } from '@atcute/client/lexicons';
2233// Popular feeds that requires authentication to view
44-export const AUTHENTICATED_FEEDS: AtUri[] = [
44+export const AUTHENTICATED_FEEDS: At.CanonicalResourceUri[] = [
55 // "Popular With Friends" by @bsky.app
66 `at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/with-friends`,
77 // "Mutuals" by @skyfeed.xyz
···11import type { XRPC } from '@atcute/client';
22+import type { At } from '@atcute/client/lexicons';
2334import type { Did } from '$lib/types/identity';
4555-export const resolveHandle = async ({ rpc, handle }: { rpc: XRPC; handle: string }): Promise<Did> => {
66+export const resolveHandle = async ({ rpc, handle }: { rpc: XRPC; handle: At.Handle }): Promise<Did> => {
67 const { data } = await rpc.get('com.atproto.identity.resolveHandle', {
78 params: { handle },
89 });
+2-4
src/lib/queries/post.ts
···11import { XRPC, XRPCError } from '@atcute/client';
22-import type { AppBskyFeedDefs } from '@atcute/client/lexicons';
33-44-import type { AtUri } from '$lib/types/at-uri';
22+import type { AppBskyFeedDefs, At } from '@atcute/client/lexicons';
5364export interface GetPostReturn {
75 post: AppBskyFeedDefs.PostView;
86 threadgate?: AppBskyFeedDefs.ThreadgateView;
97}
1081111-export const getPost = async ({ rpc, uri }: { rpc: XRPC; uri: AtUri }): Promise<GetPostReturn> => {
99+export const getPost = async ({ rpc, uri }: { rpc: XRPC; uri: At.ResourceUri }): Promise<GetPostReturn> => {
1210 const { data } = await rpc.get('app.bsky.feed.getPostThread', {
1311 params: {
1412 uri: uri,
+3-11
src/lib/queries/timeline.ts
···11import type { XRPC } from '@atcute/client';
22-import type {
33- AppBskyActorDefs,
44- AppBskyFeedDefs,
55- AppBskyFeedGetTimeline,
66- AppBskyFeedPost,
77-} from '@atcute/client/lexicons';
22+import type { AppBskyActorDefs, AppBskyFeedDefs, AppBskyFeedGetTimeline, At } from '@atcute/client/lexicons';
8394import {
105 buildTimelineSlices,
···1510 type TimelineSlice,
1611 type UiTimelineItem,
1712} from '$lib/models/timeline';
1818-import type { AtUri } from '$lib/types/at-uri';
1913import type { Did } from '$lib/types/identity';
2014import { assertNever } from '$lib/utils/invariant';
2121-2222-type PostRecord = AppBskyFeedPost.Record;
23152416export const enum TimelineType {
2517 PROFILE,
···43354436export interface CustomFeedTimelineParams {
4537 type: TimelineType.CUSTOM_FEED;
4646- feed: AtUri;
3838+ feed: At.ResourceUri;
4739 cursor?: string;
4840}
49415042export interface UserListTimelineParams {
5143 type: TimelineType.USER_LIST;
5252- list: AtUri;
4444+ list: At.ResourceUri;
5345 cursor?: string;
5446}
5547
+2-4
src/lib/types/at-uri.ts
···11-import type { Records } from '@atcute/client/lexicons';
11+import type { At, Records } from '@atcute/client/lexicons';
2233import { assert } from '$lib/utils/invariant';
4455import { isDid, isHandle, type Did, type Handle } from './identity';
66import { isNsid, type Nsid } from './nsid';
77import { isRecordKey, type RecordKey } from './rkey';
88-99-export type AtUri = `at://${Did | Handle}/${Nsid}/${RecordKey}`;
108119const ATURI_RE =
1210 /^at:\/\/([a-zA-Z0-9._:%-]+)(?:\/([a-zA-Z0-9-.]+)(?:\/([a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(?:#(\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]/\\]*))?$/;
···6159 repo: Did | Handle,
6260 collection: keyof Records | (Nsid & {}),
6361 rkey: string,
6464-): AtUri => {
6262+): At.ResourceUri => {
6563 return `at://${repo}/${collection as Nsid}/${rkey}`;
6664};