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