import { RichTextContentSegment } from 'expo-schema'; export type BlockType = { id: string; // etc -- other block fields richTextContent: RichTextContentSegment[]; }; export type RichTextVariant = 'message' | 'comment'; export interface RichTextProps { variant: RichTextVariant; block: BlockType; } export type RichTextActionProps = { /** * updateSegment will be called when we want tot update a segment value/style or any property * html element containing the segment value to be updated * */ updateSegment: (item: HTMLElement) => void; /** * addAndUpdateSegment will be called when user added more values inside segment(span). Now we want to update 1st and add remaining into values segment array. For new added segment may be we also need to trigger backend API as well * item html element containing the segment values */ addAndUpdateSegment: (item: HTMLElement) => void; /** * We will trigger this function at the end of above functions calling. * segmentIds will contain all the segments ids */ removeSegments: (segmentIds: string[]) => void; };