UNPKG

fumadocs-core

Version:

The library for building a documentation website in any React.js framework

67 lines (64 loc) 2 kB
export { GetGithubLastCommitOptions, getGithubLastEdit } from '../content/github.js'; import { Metadata } from 'next'; import { NextRequest } from 'next/server'; import { LoaderOutput, LoaderConfig, InferPageType } from '../source/index.js'; export { getTableOfContents } from '../content/toc.js'; export { TOCItemType, TableOfContents } from '../toc.js'; export { SortedResult } from '../search/index.js'; export { findNeighbour, findPath, flattenTree, getPageTreePeers, getPageTreeRoots } from '../page-tree/index.js'; export { d as PageTree } from '../definitions-Q95-psoo.js'; import '../i18n/index.js'; import 'react'; import 'unified'; import 'vfile'; interface ImageMeta { alt: string; url: string; width: number; height: number; } /** * @deprecated Use the SEO features of your own React.js framework instead */ declare function createMetadataImage<S extends LoaderOutput<LoaderConfig>>(options: { source: S; /** * the route of your OG image generator. * * @example '/docs-og' * @defaultValue '/docs-og' */ imageRoute?: string; /** * The filename of generated OG Image * * @defaultValue 'image.png' */ filename?: string; }): { getImageMeta: (slugs: string[]) => ImageMeta; /** * Add image meta tags to metadata */ withImage: (slugs: string[], metadata?: Metadata) => Metadata; /** * Generate static params for OG Image Generator */ generateParams: () => { slug: string[]; lang?: string; }[]; /** * create route handler for OG Image Generator */ createAPI: (handler: (page: InferPageType<S>, request: NextRequest, options: { params: { slug: string[]; lang?: string; } | Promise<{ slug: string[]; lang?: string; }>; }) => Response | Promise<Response>) => (request: NextRequest, options: any) => Response | Promise<Response>; }; export { createMetadataImage };