import type { AppEmbedData, AudioData, BulletedListData, ButtonData, CodeBlockData, CollapsibleListData, DividerData, EmbedData, FileData, GalleryData, GIFData, HeadingData, HTMLData, ImageData, LinkPreviewData, MapData, Node, OrderedListData, ParagraphData, PollData, RichContent, TableCellData, TableData, TextData, VideoData } from 'ricos-schema'; import type { AddImageParams } from '../velo-adapter/types'; import type { RichText } from './node-refined-types'; import type { PickRenameMulti } from './typeUtils'; export type PartialDeep = { [P in keyof T]?: T[P] extends (infer U)[] ? PartialDeep[] : T[P] extends Record ? PartialDeep : T[P]; }; type AddListMethod = ({ items, data, index, before, after, content, }: { items: string | TextData | ListItemData | (string | TextData | ListItemData)[]; data?: ParagraphData; listData?: OrderedListData | BulletedListData; index?: number; before?: string; after?: string; content: RichContent; }) => RichContent; type AddLists = { addOrderedList: AddListMethod; addBulletList: AddListMethod; }; type AddMethod = { [P in keyof T]: ({ data, index, before, after, content, }: { data?: Partial; index?: number; before?: string; after?: string; content: RichContent; }) => RichContent; }; type AddTextMethod = { [P in keyof T]: ({ text, data, index, before, after, content, }: { text?: string | TextData | (string | TextData)[]; data?: Partial; index?: number; before?: string; after?: string; content: RichContent; }) => RichContent; }; type AddMap = { addButton: ButtonData; addDivider: DividerData; addFile: FileData; addGallery: GalleryData; addGif: GIFData; addMap: MapData; addHtml: HTMLData; addImage: ImageData; addVideo: VideoData; addAudio: AudioData; addAppEmbed: AppEmbedData; addEmbed: EmbedData; addLinkPreview: LinkPreviewData; addPoll: PollData; }; type AddTextMap = { addCode: CodeBlockData; addHeading: HeadingData; addParagraph: ParagraphData; }; export type ListItemData = { text: TextData[]; data: ParagraphData; }; export type TableCell = { data?: TableCellData; content: RichContent; }; export type CollapsibleListItem = { title: RichText; content: RichContent; }; type ContentBuilderType = AddMethod & AddTextMethod & AddLists & { addTable: ({ cells, data, index, before, after, content, }: { cells: TableCell[][]; data?: TableData; index?: number; before?: string; after?: string; content: RichContent; }) => RichContent; } & { addCollapsibleList: ({ items, data, index, before, after, content, }: { items: CollapsibleListItem[]; data?: CollapsibleListData; index?: number; before?: string; after?: string; content: RichContent; }) => RichContent; }; export interface ContentBuilder extends ContentBuilderType { } type RenamedBuilderFunctions = PickRenameMulti; export type BuilderFunctionsMetadata = 'content' | 'index' | 'before' | 'after'; type NodeCreators = { [key in keyof RenamedBuilderFunctions]: (args: Omit[0], BuilderFunctionsMetadata>) => Node; }; export interface NodeCreatorsCollection extends Omit { image: (args: { data: AddImageParams['data']; }) => Node; } export {}; //# sourceMappingURL=contentApi.d.ts.map