| 
 | 1 | +import React from 'react';  | 
 | 2 | + | 
 | 3 | +import { Client } from '@notionhq/client';  | 
 | 4 | + | 
 | 5 | +import type {  | 
 | 6 | +  PartialBlockObjectResponse,  | 
 | 7 | +  BlockObjectResponse,  | 
 | 8 | +  DatabaseObjectResponse,  | 
 | 9 | +  PartialDatabaseObjectResponse,  | 
 | 10 | +  PageObjectResponse,  | 
 | 11 | +  PartialPageObjectResponse,  | 
 | 12 | +  Heading1BlockObjectResponse,  | 
 | 13 | +  Heading2BlockObjectResponse,  | 
 | 14 | +  Heading3BlockObjectResponse,  | 
 | 15 | +  ParagraphBlockObjectResponse,  | 
 | 16 | +  DividerBlockObjectResponse,  | 
 | 17 | +  BulletedListItemBlockObjectResponse,  | 
 | 18 | +  ColumnListBlockObjectResponse,  | 
 | 19 | +  ColumnBlockObjectResponse,  | 
 | 20 | +  QuoteBlockObjectResponse,  | 
 | 21 | +  CodeBlockObjectResponse,  | 
 | 22 | +  RichTextItemResponse,  | 
 | 23 | +} from '@notionhq/client/build/src/api-endpoints';  | 
 | 24 | + | 
 | 25 | +export interface CustomComponentProps<T> {  | 
 | 26 | +  block: T;  | 
 | 27 | +  children?: React.ReactNode;  | 
 | 28 | +}  | 
 | 29 | + | 
 | 30 | +/**  | 
 | 31 | + * 自定义组件  | 
 | 32 | + */  | 
 | 33 | +export type CustomComponent<T> = React.FC<CustomComponentProps<T>>;  | 
 | 34 | + | 
 | 35 | +export interface CustomComponents {  | 
 | 36 | +  block?: React.FC<CustomComponentProps<Record<string, unknown>>>;  | 
 | 37 | +  heading_1?: CustomComponent<Heading1BlockObjectResponse>;  | 
 | 38 | +  heading_2?: CustomComponent<Heading2BlockObjectResponse>;  | 
 | 39 | +  heading_3?: CustomComponent<Heading3BlockObjectResponse>;  | 
 | 40 | +  paragraph?: CustomComponent<ParagraphBlockObjectResponse>;  | 
 | 41 | +  [key: string]: CustomComponent<any>;  | 
 | 42 | +}  | 
 | 43 | + | 
 | 44 | +/**  | 
 | 45 | + * heading 类型  | 
 | 46 | + */  | 
 | 47 | +export type HeadingBlockObjectResponse =  | 
 | 48 | +  | Heading1BlockObjectResponse  | 
 | 49 | +  | Heading2BlockObjectResponse  | 
 | 50 | +  | Heading3BlockObjectResponse;  | 
 | 51 | + | 
 | 52 | +/**  | 
 | 53 | + * notion 原生类型透传  | 
 | 54 | + */  | 
 | 55 | +export type {  | 
 | 56 | +  Client,  | 
 | 57 | +  PartialBlockObjectResponse,  | 
 | 58 | +  BlockObjectResponse,  | 
 | 59 | +  DatabaseObjectResponse,  | 
 | 60 | +  PartialDatabaseObjectResponse,  | 
 | 61 | +  PageObjectResponse,  | 
 | 62 | +  PartialPageObjectResponse,  | 
 | 63 | +  Heading1BlockObjectResponse,  | 
 | 64 | +  Heading2BlockObjectResponse,  | 
 | 65 | +  Heading3BlockObjectResponse,  | 
 | 66 | +  ParagraphBlockObjectResponse,  | 
 | 67 | +  DividerBlockObjectResponse,  | 
 | 68 | +  BulletedListItemBlockObjectResponse,  | 
 | 69 | +  ColumnListBlockObjectResponse,  | 
 | 70 | +  ColumnBlockObjectResponse,  | 
 | 71 | +  QuoteBlockObjectResponse,  | 
 | 72 | +  CodeBlockObjectResponse,  | 
 | 73 | +  RichTextItemResponse,  | 
 | 74 | +};  | 
0 commit comments