docs: adding jsdoc and updating README

nulfrost 5f03b918 2ed94d4c

+3 -2
README.md
··· 15 15 16 16 ## Usage 17 17 18 - ### Build-time loader: leafletStaticLoader (recommended) 19 - 18 + <details> 19 + <summary>Build-time loader: leafletStaticLoader (recommended)</summary> 20 20 ```ts 21 21 // src/content.config.ts 22 22 import { defineCollection, z } from "astro:content"; ··· 81 81 82 82 <Content /> 83 83 ``` 84 + </details> 84 85 85 86 ### Live loader: leafletLiveLoader 86 87
+3 -2
lib/leaftlet-static-loader.ts
··· 19 19 export function leafletStaticLoader( 20 20 options: StaticLeafletLoaderOptions, 21 21 ): Loader { 22 - const { repo, limit } = options; 22 + const { repo, limit, reverse } = options; 23 23 24 24 if (!repo || typeof repo !== "string") { 25 25 throw new LiveLoaderError( ··· 63 63 rpc, 64 64 repo, 65 65 cursor, 66 - limit: 100, 66 + reverse, 67 + limit: 50, 67 68 }); 68 69 for (const document of documents) { 69 70 if (limit && count >= limit) {
+6 -1
lib/types.ts
··· 15 15 * @description Your repo is your DID (did:plc... or did:web...). You can find this information using: https://pdsls.dev 16 16 */ 17 17 repo: string; 18 - filter?: string; 19 18 /** 19 + * The number of records leaflet records to return for getCollection, the default being 50. The range can be from 1 to 100. 20 20 * @default 50 21 21 */ 22 22 limit?: number; 23 + /** 24 + * Whether or not the records should be returned in reversed order. 25 + * @default undefined 26 + */ 27 + reverse?: boolean; 23 28 } 24 29 25 30 export interface LeafletDocumentRecord {
+1 -1
lib/utils.ts
··· 1 1 import type {} from "@atcute/atproto"; 2 - import { type Handle, is } from "@atcute/lexicons"; 2 + import { is } from "@atcute/lexicons"; 3 3 import { AtUri, UnicodeString } from "@atproto/api"; 4 4 import katex from "katex"; 5 5 import sanitizeHTML from "sanitize-html";