UNPKG

@pagenote/notion-database

Version:

make notion as a real-database for server

21 lines (20 loc) 995 B
import { Client } from '@notionhq/client'; import { NotionToMarkdown } from 'notion-to-md'; import { AppendNotionDetailDocumentFields, NotionObjectSchema, ResponseNotionPropertiesDocument } from './types/base'; interface PageOption { pageId: string; notion?: Client; token?: string; } type FieldsType = 'markdown' | 'blocks' | 'properties'; export default class Page<T extends NotionObjectSchema> { readonly shortPageId: string; readonly notion: Client; readonly n2m: NotionToMarkdown; constructor(option: PageOption); properties(): Promise<ResponseNotionPropertiesDocument<Partial<T>> | undefined>; blocks(): Promise<(import("@notionhq/client/build/src/api-endpoints").PartialBlockObjectResponse | import("@notionhq/client/build/src/api-endpoints").BlockObjectResponse)[]>; markdown(): Promise<string>; detail(parts?: FieldsType[]): Promise<(ResponseNotionPropertiesDocument<Partial<T>> & AppendNotionDetailDocumentFields) | undefined>; } export {};