1import type { Agent } from "@atproto/api"; 2import type { PubLeafletRichtextFacet } from "./__generated__/lexicons/index.js"; 3 4export interface LeafletLoaderOptions { 5 /** 6 * @description Your repo is either your handle (@you.some.url) or your DID (did:plc... or did:web...). You can find this information using: https://pdsls.dev 7 */ 8 repo: string; 9} 10 11export interface LeafletDocumentRecord { 12 $type: "pub.leaflet.document"; 13 pages: { [x: string]: unknown }; 14 title: string; 15 author: string; 16 description: string; 17 publication: string; 18 publishedAt: string; 19} 20 21export interface LeafletDocumentView { 22 rkey: string; 23 cid: string; 24 title: string; 25 pages: { [x: string]: unknown }; 26 description: string; 27 author: string; 28 publication: string; 29 publishedAt: string; 30} 31 32export interface MiniDoc { 33 did: string; 34 handle: string; 35 pds: string; 36 signing_key: string; 37} 38 39export interface CollectionFilter { 40 limit?: number; 41 reverse?: boolean; 42 cursor?: string; 43} 44 45export interface EntryFilter { 46 id?: string; 47} 48 49export interface GetLeafletDocumentsParams { 50 repo: string; 51 agent: Agent; 52 cursor?: string; 53 limit?: number; 54 reverse?: boolean; 55} 56 57export interface GetSingleLeafletDocumentParams { 58 repo: string; 59 agent: Agent; 60 id: string; 61} 62 63export interface Facet extends PubLeafletRichtextFacet.Main {} 64export interface RichTextSegment { 65 text: string; 66 facet?: Exclude<Facet["features"], { $type: string }>; 67}