import type { AppEmbedData, AudioData, BlockquoteData, BulletedListData, ButtonData, CodeBlockData, CollapsibleListData, DividerData, EmbedData, FileData, GalleryData, GIFData, HeadingData, HTMLData, ImageData, LinkPreviewData, MapData, Node, NodeStyle, OrderedListData, ParagraphData, PollData, RichContent, Struct, TableCellData, TableData, TextData, VideoData } from 'ricos-schema'; import { Node_Type } from 'ricos-schema'; export type NodeType = keyof typeof Node_Type; type Identified = { id: Node['id']; }; type Styled = { style?: NodeStyle; }; export type RichText = { nodes: RichTextNode[]; metadata?: RichContent['metadata']; }; export type RichTextNode = ParagraphNode | HeadingNode | CodeBlockNode | BlockquoteNode; type TextNodeContainer = Identified & Styled & { nodes: TextNode[]; }; export type TextNode = Leaf & { textData: TextData; type: Node_Type.TEXT; id: ''; }; export declare const isTextNode: (node: Node) => node is TextNode; export type ParagraphNode = TextNodeContainer & { paragraphData?: ParagraphData; type: Node_Type.PARAGRAPH; }; export declare const isParagraphNode: (node: Node) => node is ParagraphNode; export type HeadingNode = TextNodeContainer & { headingData: HeadingData; type: Node_Type.HEADING; }; export type CodeBlockNode = TextNodeContainer & { codeBlockData: CodeBlockData; type: Node_Type.CODE_BLOCK; }; export type BlockquoteNode = Identified & Styled & { type: Node_Type.BLOCKQUOTE; nodes: ParagraphNode[]; blockquoteData?: BlockquoteData; }; export type ListItemNode = Identified & Styled & { type: Node_Type.LIST_ITEM; nodes: ParagraphNode[]; }; export type ListNode = OrderedListNode | BulletedListNode; export declare const isListNode: (node: Node) => node is ListNode; export type OrderedListNode = Identified & Styled & { type: Node_Type.ORDERED_LIST; nodes: ListItemNode[]; orderedListData: OrderedListData; }; export type BulletedListNode = Identified & Styled & { type: Node_Type.BULLETED_LIST; nodes: ListItemNode[]; bulletedListData: BulletedListData; }; export type RichContentNodeWithContainerData = CollapsibleListNode | TableNode | AppEmbedNode | ButtonNode | DividerNode | EmbedNode | FileNode | GalleryNode | GifNode | HtmlNode | ImageNode | LinkPreviewNode | MapNode | VideoNode | AudioNode | PollNode | ExternalNode; export type RichContentNode = RichTextNode | ListNode | RichContentNodeWithContainerData; type RichContainer = { nodes: RichContentNode[]; }; export type CollapsibleListNode = Identified & Styled & { type: Node_Type.COLLAPSIBLE_LIST; nodes: CollapsibleItemNode[]; collapsibleListData: CollapsibleListData; }; export type CollapsibleItemNode = Identified & Styled & { type: Node_Type.COLLAPSIBLE_ITEM; nodes: [CollapsibleItemTitleNode, CollapsibleItemBodyNode]; }; export type CollapsibleItemTitleNode = Identified & Styled & { type: Node_Type.COLLAPSIBLE_ITEM_TITLE; nodes: RichTextNode[]; }; export type CollapsibleItemBodyNode = Identified & Styled & RichContainer & { type: Node_Type.COLLAPSIBLE_ITEM_BODY; }; export type TableNode = Identified & Styled & { type: Node_Type.TABLE; nodes: TableRowNode[]; tableData: TableData; }; export type TableRowNode = Identified & Styled & { type: Node_Type.TABLE_ROW; nodes: TableCellNode[]; }; export type TableCellNode = Identified & Styled & RichContainer & { type: Node_Type.TABLE_CELL; tableCellData: TableCellData; }; type Leaf = Omit & { nodes: never[]; }; export type DividerNode = Identified & Styled & Leaf & { type: Node_Type.DIVIDER; dividerData: DividerData; }; export type ButtonNode = Identified & Styled & Leaf & { type: Node_Type.BUTTON; buttonData: ButtonData; }; export type FileNode = Identified & Styled & Leaf & { type: Node_Type.FILE; fileData: FileData; }; export type GalleryNode = Identified & Styled & Leaf & { type: Node_Type.GALLERY; galleryData: GalleryData; }; export type GifNode = Identified & Styled & Leaf & { type: Node_Type.GIF; gifData: GIFData; }; export type HtmlNode = Identified & Styled & Leaf & { type: Node_Type.HTML; htmlData: HTMLData; }; export type ImageNode = Identified & Styled & Leaf & { type: Node_Type.IMAGE; imageData: ImageData; }; export type LinkPreviewNode = Identified & Styled & Leaf & { type: Node_Type.LINK_PREVIEW; linkPreviewData: LinkPreviewData; }; export type MapNode = Identified & Styled & Leaf & { type: Node_Type.MAP; mapData: MapData; }; export type AppEmbedNode = Identified & Styled & Leaf & { type: Node_Type.APP_EMBED; appEmbedData: AppEmbedData; }; export type EmbedNode = Identified & Styled & Leaf & { type: Node_Type.EMBED; embedData: EmbedData; }; export type VideoNode = Identified & Styled & Leaf & { type: Node_Type.VIDEO; videoData: VideoData; }; export type AudioNode = Identified & Styled & Leaf & { type: Node_Type.AUDIO; audioData: AudioData; }; export type PollNode = Identified & Styled & Leaf & { type: Node_Type.POLL; pollData: PollData; }; export type ExternalNode = Identified & Styled & Leaf & { type: Node_Type.EXTERNAL; externalData: Struct; }; export type RefinedNode = RichContentNode | TextNode | ListItemNode | CollapsibleItemNode | CollapsibleItemBodyNode | CollapsibleItemTitleNode | TableCellNode | TableRowNode; export {}; //# sourceMappingURL=node-refined-types.d.ts.map