import type { Client } from "@notionhq/client"; import { blockTextToRichText, markdownToBlocks } from "../markdown-to-blocks.js"; import { type PageParent } from "../notion-client.js"; import { type FetchContext } from "../server.js"; type CliIO = { stdout: { write(chunk: string): unknown; }; stderr: { write(chunk: string): unknown; }; stdin: NodeJS.ReadStream; env: NodeJS.ProcessEnv; cwd: string; }; type NotionOps = { createClient(token: string): Client; getMe(client: Client): Promise; listUsers(client: Client): Promise; search(client: Client, query: string, filter?: "pages" | "databases"): Promise; getDatabase(client: Client, databaseId: string): Promise; validateDatabaseEntriesTarget(client: Client, databaseId: string): Promise; buildTextFilter(client: Client, databaseId: string, text: string): Promise | undefined>; queryDatabase(client: Client, databaseId: string, filter?: Record, sorts?: unknown[]): Promise; createDatabaseEntry(client: Client, databaseId: string, properties: Record): Promise; updateDatabaseEntry(client: Client, pageId: string, properties: Record): Promise; getPage(client: Client, pageId: string): Promise; createPage(client: Client, parent: string | PageParent, title: string, blocks: ReturnType, icon?: string, cover?: string): Promise; updatePage(client: Client, pageId: string, props: { title?: string; icon?: string; cover?: string | { type: string; [key: string]: any; }; }): Promise; archivePage(client: Client, pageId: string): Promise; restorePage(client: Client, pageId: string): Promise; movePage(client: Client, pageId: string, newParentId: string): Promise; listChildren(client: Client, blockId: string): Promise; listComments(client: Client, pageId: string): Promise; addComment(client: Client, pageId: string, richText: ReturnType): Promise; uploadFile(client: Client, fileUrl: string): Promise<{ id: string; blockType: string; }>; paginatePageProperties(client: Client, page: unknown, opts: { maxPropertyItems: number; onlyTypes?: Array<"title" | "rich_text" | "relation" | "people">; }): Promise<{ page: unknown; warnings: unknown[]; }>; fetchBlocksRecursive(client: Client, pageId: string, ctx: FetchContext): Promise; fetchBlocksWithLimit(client: Client, pageId: string, maxBlocks: number, ctx: FetchContext): Promise<{ blocks: unknown[]; hasMore: boolean; }>; processFileUploads(client: Client, markdown: string): Promise; appendBlocks(client: Client, pageId: string, blocks: ReturnType): Promise; appendBlocksAfter(client: Client, pageId: string, blocks: ReturnType, afterBlockId?: string): Promise; deleteBlock(client: Client, blockId: string): Promise; retrieveBlock(client: Client, blockId: string): Promise; updateBlock(client: Client, blockId: string, payload: Record): Promise; replacePageMarkdown(client: Client, pageId: string, newStr: string, options?: { allowDeletingContent?: boolean; }): Promise; retrieveMarkdown(client: Client, pageId: string): Promise; updateMarkdown(client: Client, payload: Record): Promise; }; export type CliDeps = { ops?: Partial; configDir?: string; }; export declare function runCli(argv: string[], partialIo?: Partial, deps?: CliDeps): Promise; export {};