appview-less bluesky client
1import type { Did } from '@atcute/lexicons';
2import { cdnUrl } from '$lib/at';
3
4export const cdn = cdnUrl.origin;
5
6export type ImageKind = 'avatar_thumbnail' | 'avatar' | 'feed_thumbnail' | 'feed_fullsize';
7export type ImageFormat = 'webp' | 'png' | 'jpg';
8
9export const img = (kind: ImageKind, did: Did, blob: string, format: ImageFormat = 'webp') =>
10 `${cdn}/img/${kind}/plain/${did}/${blob}@${format}`;
11
12export const blob = (pds: string, did: Did, cid: string) =>
13 `${pds}/xrpc/com.atproto.sync.getBlob?did=${did}&cid=${cid}`;