fumadocs-core
Version:
The React.js library for building a documentation website
43 lines • 1.32 kB
TypeScript
import { i as Root, r as Node, t as Folder } from "./definitions-BQVehOBz.js";
import { ReactNode } from "react";
export interface BreadcrumbItem {
name: ReactNode;
url?: string;
}
export interface BreadcrumbOptions {
/**
* Include the root folders in the breadcrumb items array.
*
* @defaultValue false
*/
includeRoot?: boolean | {
/**
* Specify the url of root
*/
url: string;
};
/**
* Include the page itself in the breadcrumb items array
*
* @defaultValue false
*/
includePage?: boolean;
/**
* Count separator as an item
*
* @defaultValue false
*/
includeSeparator?: boolean;
}
export declare function useBreadcrumb(url: string, tree: Root | Folder, options?: BreadcrumbOptions): BreadcrumbItem[];
export declare function getBreadcrumbItems(url: string, tree: Root | Folder, options?: BreadcrumbOptions): BreadcrumbItem[];
export declare function getBreadcrumbItemsFromPath(tree: Root | Folder, path: Node[], options: BreadcrumbOptions): BreadcrumbItem[];
/**
* Search the path of a node in the tree by a specified url
*
* - When the page doesn't exist, return null
*
* @returns The path to the target node from root
* @internal Don't use this on your own
*/
export declare function searchPath(nodes: Node[], url: string): Node[] | null;