@sota1235/notion-sdk-js-helper
Version:
Helper utilities for using @notion/client
84 lines (83 loc) • 4.08 kB
TypeScript
import type { BlockObjectRequestWithoutChildren } from "@notionhq/client/build/src/api-endpoints.js";
import type { Emoji, Language, NotionBlock, TextColor } from "./customTypes.js";
import { type RichText } from "./richTextObject.js";
type Text = string | RichText;
type TextForBlock = Text | Text[];
export declare const paragraph: (text: TextForBlock, options?: {
blockColor?: TextColor;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"paragraph">;
export declare const heading1: (text: TextForBlock, options?: {
blockColor?: TextColor;
isToggleable?: boolean;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"heading_1">;
export declare const heading2: (text: TextForBlock, options?: {
blockColor?: TextColor;
isToggleable?: boolean;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"heading_2">;
export declare const heading3: (text: TextForBlock, options?: {
blockColor?: TextColor;
isToggleable?: boolean;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"heading_3">;
export declare const callout: (text: TextForBlock, icon: Emoji, options?: {
blockColor?: TextColor;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"callout">;
export declare const quote: (text: TextForBlock, options?: {
blockColor?: TextColor;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"quote">;
export declare const bulletedListItem: (text: TextForBlock, options?: {
blockColor?: TextColor;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"bulleted_list_item">;
export declare const numberedListItem: (text: TextForBlock, options?: {
blockColor?: TextColor;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"numbered_list_item">;
export declare const todo: (text: TextForBlock, options?: {
checked?: boolean;
blockColor?: TextColor;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"to_do">;
export declare const toggle: (text: TextForBlock, options?: {
blockColor?: TextColor;
children?: BlockObjectRequestWithoutChildren[];
}) => NotionBlock<"toggle">;
export declare const code: (text: TextForBlock, language: Language) => NotionBlock<"code">;
export declare const embed: (url: string, options?: {
captions?: RichText[];
}) => NotionBlock<"embed">;
export declare const image: (url: string, options?: {
captions?: RichText[];
}) => NotionBlock<"image">;
export declare const video: (url: string, options?: {
captions?: RichText[];
}) => NotionBlock<"video">;
export declare const file: (url: string, options?: {
captions?: RichText[];
}) => NotionBlock<"file">;
export declare const pdf: (url: string, options?: {
captions?: RichText[];
}) => NotionBlock<"pdf">;
export declare const bookmark: (url: string, options?: {
captions?: RichText[];
}) => NotionBlock<"bookmark">;
export declare const equation: (expression: string) => NotionBlock<"equation">;
export declare const divider: () => NotionBlock<"divider">;
export declare const tableOfContents: (blockColor?: TextColor) => NotionBlock<"table_of_contents">;
export declare const breadcrumb: () => NotionBlock<"breadcrumb">;
export declare const columnList: (children: NotionBlock<"column">[]) => NotionBlock<"column_list">;
export declare const column: (children: BlockObjectRequestWithoutChildren[]) => NotionBlock<"column">;
export declare const template: (text: TextForBlock, children: BlockObjectRequestWithoutChildren[]) => NotionBlock<"template">;
export declare const linkToPage: (pageId: string) => NotionBlock<"link_to_page">;
export declare const syncedBlock: (blockId: string | undefined, children?: BlockObjectRequestWithoutChildren[]) => NotionBlock<"synced_block">;
export declare const table: (width: number, children: NotionBlock<"table_row">[], options?: {
has_column_header?: boolean;
has_row_header?: boolean;
}) => NotionBlock<"table">;
export declare const tableRow: (texts: TextForBlock[]) => NotionBlock<"table_row">;
export {};