UNPKG

notion-page-tree

Version:

Recursively fetch nested Notion pages from the root page/database/block node.

11 lines (10 loc) 602 B
import { Entity, SubTreeEntity } from '../../types'; /** * Find child with id and retrieve its subtree to some depth. * @param root Root entity to search from. * @param id Id of target child to search for. * @param maxDepth Depth of target child's own children. If undefined, retrieve the full subtree. * @returns Subtree from child to some depth/ */ export declare const retrieveSubtree: (root: Entity, id: string, maxDepth?: number | undefined) => Entity | SubTreeEntity; export declare const cutSubtreeToDepth: (root: SubTreeEntity, maxDepth: number, _currentDepth?: number) => SubTreeEntity;