UNPKG

1.35 kBTypeScriptView Raw
1import type { Deserializer, JSONOutput, Serializer } from "../../serialization";
2import { type CommentDisplayPart } from "../comments";
3import { Reflection, type TraverseCallback } from "./abstract";
4/**
5 * Non-TS reflection type which is used to represent markdown documents included in the docs.
6 */
7export declare class DocumentReflection extends Reflection {
8 readonly variant = "document";
9 /**
10 * The content to be displayed on the page for this reflection.
11 */
12 content: CommentDisplayPart[];
13 /**
14 * Frontmatter included in document
15 */
16 frontmatter: Record<string, unknown>;
17 /**
18 * A precomputed boost derived from the searchCategoryBoosts and searchGroupBoosts options, used when
19 * boosting search relevance scores at runtime. May be modified by plugins.
20 */
21 relevanceBoost?: number;
22 /**
23 * Child documents, if any are present.
24 */
25 children?: DocumentReflection[];
26 constructor(name: string, parent: Reflection, content: CommentDisplayPart[], frontmatter: Record<string, unknown>);
27 addChild(child: DocumentReflection): void;
28 isDocument(): this is DocumentReflection;
29 traverse(callback: TraverseCallback): void;
30 toObject(serializer: Serializer): JSONOutput.DocumentReflection;
31 fromObject(de: Deserializer, obj: JSONOutput.DocumentReflection): void;
32}