/// <reference types="react" />
import { type Demo, type DemoProps } from "./Demo";
import { type Doc, type DocProps } from "./Doc";
export type DocExport = {
    default: JSX.Element;
} & Record<string, JSX.Element>;
export type DocElement = React.ReactElement<DocProps, typeof Doc> & ElementSource;
type ElementSource = {
    _source: {
        fileName: string;
        lineNumber: number;
        columnNumber: number;
    };
};
type DemoElement = React.ReactElement<DemoProps<Record<string, unknown>>, typeof Demo> & ElementSource;
type DemoSet = Record<string, DemoElement>;
export type PageParent = Site | SiteSection | Category | SubCategory;
export type Site = {
    __typename: "Site";
    name: never;
    path: never;
    children: SiteSection[];
    parent: never;
};
export declare function isSite(parent: PageOrParent): parent is Site;
export type Page = {
    __typename: "Page";
    path: string;
    name: string;
    doc: DocElement;
    demos: DemoSet;
    parent: PageParent;
    order?: number;
};
export type HomePage = {
    __typename: "HomePage";
    path: "/";
    doc: DocElement;
    demos: DemoSet;
    parent: Site;
};
export type PageOrParent = Page | HomePage | PageParent;
export declare function isHomePage(page: PageOrParent): page is HomePage;
export declare function isPage(page: PageOrParent): page is Page;
export type SiteSection = {
    __typename: "SiteSection";
    path: string;
    name: string;
    children: (Page | Category)[];
    order?: number;
    parent: Site;
};
export declare function isSiteSection(parent: PageOrParent): parent is SiteSection;
export type Category = {
    __typename: "Category";
    path: string;
    name: string;
    children: (Page | SubCategory)[];
    parent: SiteSection;
    order?: number;
};
export declare function isCategory(parent: PageOrParent): parent is Category;
export type SubCategory = {
    __typename: "SubCategory";
    path: string;
    name: string;
    children: Page[];
    parent: SiteSection | Category;
    order?: number;
};
export declare function isSubCategory(parent: PageOrParent): parent is SubCategory;
export declare function isParentWithPageChildren(parent: PageParent): parent is SiteSection | Category | SubCategory;
export declare function getPageChildren({ __typename, children, }: SiteSection | Category | SubCategory): Page[];
export declare function getCategoryChildren({ __typename, children, }: SiteSection): Category[];
export declare function getSubCategoryChildren(category: SiteSection | Category | undefined): SubCategory[];
/**
 * Takes all of the doc exports and builds a tree of nested
 * site/section/category/subcategory/page objects with parents, children, and
 * all the necessary metadata we need to render them.
 */
export declare const buildTree: (untypedDocs: DocExport[]) => Record<string, PageOrParent>;
/**
 * Takes a page and returns arrays of sections, categories, etc such that we
 * could render the page layout.
 */
export declare const getNav: (page: Page) => {
    site: Site;
    currentSection: SiteSection;
    categories: Category[];
    currentCategory: Category | undefined;
    subCategories: SubCategory[];
    currentSubCategory: SubCategory | undefined;
    pages: Page[];
};
export {};
