UNPKG

notion-page-tree

Version:

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

19 lines (18 loc) 969 B
import { QueryDatabaseParameters } from '@notionhq/client/build/src/api-endpoints'; import { Entity, RequestParameters, GetBlockResponseWithMetadata } from '../../types'; declare const createChildrenRequest: (parent: Entity, requestParameters: RequestParameters, databaseQueryFilter: QueryDatabaseParameters['filter']) => Promise<Entity[]>; interface getBlockChildrenAllParameters { requestParameters: RequestParameters; parent: Entity; _entity_list?: Entity[]; _cursor?: string; } /** * Get all entities (with properties) from the database. */ export declare const getBlockChildrenAll: ({ requestParameters, parent, _entity_list, _cursor }: getBlockChildrenAllParameters) => Promise<Entity[]>; /** * Reduce block types into three types : page, database and block (all the others) */ export declare const normalizeBlockType: (entity_type: GetBlockResponseWithMetadata['type']) => "page" | "database" | "block"; export default createChildrenRequest;