UNPKG

fumadocs-core

Version:

The React.js library for building a documentation website

74 lines • 1.98 kB
import { n as StructuredData } from "./remark-structure-CV606E7e.js"; import { D as LoaderOutput, T as LoaderConfig } from "./index-Dyo_baWl.js"; import { t as Awaitable } from "./types-Dvkw0Kd0.js"; import { Algoliasearch } from "algoliasearch"; interface DocumentRecord { /** * The ID of document, must be unique */ _id: string; title: string; description?: string; breadcrumbs?: string[]; /** * URL to the page */ url: string; structured: StructuredData; /** * Tag to filter results */ tag?: string; /** * Data to be added to each section index */ extra_data?: object; } /** * Build the search indexes of every page in a source. */ declare function toDocuments<C extends LoaderConfig>(source: LoaderOutput<C> | (() => Awaitable<LoaderOutput<C>>), options?: { /** Tag to filter results by. */ tag?: (page: C['page']) => string; }): Promise<DocumentRecord[]>; interface SyncOptions { /** * Index Name for documents. */ indexName?: string; /** * Search indexes */ documents: DocumentRecord[]; } /** * Update index settings and replace all objects * * @param client - Algolia Admin Client * @param options - Index Options */ declare function sync(client: Algoliasearch, options: SyncOptions): Promise<void>; declare function setIndexSettings(client: Algoliasearch, indexName: string): Promise<void>; declare function updateDocuments(client: Algoliasearch, indexName: string, documents: DocumentRecord[]): Promise<void>; interface BaseIndex { objectID: string; title: string; url: string; tag?: string; /** * The id of page, used for distinct */ page_id: string; /** * Heading content */ section?: string; /** * Heading (anchor) id */ section_id?: string; breadcrumbs?: string[]; content: string; table?: string; } export { sync as a, setIndexSettings as i, DocumentRecord as n, toDocuments as o, SyncOptions as r, updateDocuments as s, BaseIndex as t };