import type { Availability, TypeId } from "../navigation"; import type { ObjectProperty, TypeDefinition } from "./latest"; import type { TypeShapeOrReference } from "./types"; /** * A path through the type tree, used to identify a type definition. * * i.e. it may be represented as a jq: * * - a.b.c.d * - a[].b.c * - a.b[key].c * * We collect the true shape of the path here so that the frontend can determine how to render it. */ export type KeyPathItem = { type: "meta"; value: string; displayName: string | null | undefined; } | { type: "objectProperty"; key: string; optional: boolean | undefined; } | { type: "undiscriminatedUnionVariant"; displayName: string | null | undefined; idx: number; } | { type: "discriminatedUnionVariant"; discriminant: string; discriminantDisplayName: string | null | undefined; discriminantValue: string; } | { type: "list" | "set" | "mapValue" | "extra"; } | { type: "enumValue"; value: string; }; export interface TypeDefinitionTreeItem { /** * The path to the type definition */ path: KeyPathItem[]; descriptions: string[]; availability: Availability | null | undefined; } interface CollectTypeDefinitionTreeOptions { path?: KeyPathItem[]; availability?: Availability | null; maxDepth?: number; } /** * This function is intended to be used to generate a tree of all type definitions, and is intended to be used * for indexing the type tree and their descriptions into algolia. */ export declare function collectTypeDefinitionTree(type: TypeShapeOrReference, types: Record, { availability: rootAvailability, maxDepth, path: rootpath }?: CollectTypeDefinitionTreeOptions): TypeDefinitionTreeItem[]; export declare function collectTypeDefinitionTreeForObjectProperty(property: ObjectProperty, types: Record, rootPath?: KeyPathItem[], maxDepth?: number): TypeDefinitionTreeItem[]; export {}; //# sourceMappingURL=collect-type-tree.d.ts.map