@vrerv/md-to-notion
Version:
An upload of markdown files to a hierarchy of Notion pages.
27 lines • 1.2 kB
TypeScript
import { Client } from "@notionhq/client";
import { Folder } from "./read-md";
export type NotionPageLink = {
id: string;
link: string;
};
/**
* find the maximum depth of the req block
* @param block
* @param depth
*/
export declare const findMaxDepth: (block: any, depth?: number) => number;
export declare function collectCurrentFiles(notion: Client, rootPageId: string): Promise<Map<string, NotionPageLink>>;
/**
* Synchronizes a folder structure to a Notion page.
*
* @param notion
* @param pageId - The ID of the Notion page to sync the content to.
* @param dir - The folder structure to sync.
* @param linkMap
* @param deleteNonExistentFiles - Whether to delete pages in Notion that don't exist locally
* @returns A promise that resolves when the synchronization is complete.
*/
export declare function syncToNotion(notion: Client, pageId: string, dir: Folder, linkMap?: Map<string, NotionPageLink>, deleteNonExistentFiles?: boolean): Promise<void>;
export declare function archiveChildPages(notion: Client, pageId: string): Promise<void>;
export declare function archivePage(notion: Client, pageId: string): Promise<void>;
//# sourceMappingURL=sync-to-notion.d.ts.map