/** * Types for PureRichText visualization * Slate.js-based rich text editor implementation */ import { BaseEditor, Descendant } from 'slate'; import { ReactEditor } from 'slate-react'; /** Custom element types supported by the editor */ export type CustomElementType = 'paragraph' | 'bulleted-list' | 'numbered-list' | 'list-item' | 'link'; /** Horizontal text alignment options */ export type TextAlign = 'left' | 'center' | 'right' | 'justify'; /** Vertical alignment options */ export type VerticalAlign = 'top' | 'middle' | 'bottom'; /** List type options */ export type ListType = 'unordered' | 'ordered' | null; /** Font size preset options */ export type FontSizePreset = 'extraSmall' | 'small' | 'default' | 'large' | 'extraLarge' | 'custom'; /** Custom element with formatting properties */ export interface CustomElement { type: CustomElementType; align?: TextAlign; lineHeight?: string; children: (CustomText | CustomElement)[]; url?: string; } /** Custom text node with marks (inline formatting) */ export interface CustomText { text: string; bold?: boolean; italic?: boolean; underline?: boolean; strikethrough?: boolean; color?: string; backgroundColor?: string; fontSize?: string; fontFamily?: string; tokenName?: string; tokenOccurrence?: number; isRawToken?: boolean; isEscapedDollar?: boolean; } declare module 'slate' { interface CustomTypes { Editor: BaseEditor & ReactEditor; Element: CustomElement; Text: CustomText; } } /** Complete text styles state */ export interface TextStyles { bold: boolean; italic: boolean; underline: boolean; strikethrough: boolean; color: string | null; backgroundColor: string | null; fontSize: string | null; fontFamily: string | null; textAlign: TextAlign | null; verticalAlign?: VerticalAlign | null; lineHeight?: string | null; listType: ListType; } /** Default text styles */ export declare const DEFAULT_TEXT_STYLES: TextStyles; /** All supported format commands */ export type FormatCommand = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'foreColor' | 'backColor' | 'fontSize' | 'fontName' | 'fontFamily' | 'justifyLeft' | 'justifyCenter' | 'justifyRight' | 'justifyFull' | 'lineHeight' | 'insertUnorderedList' | 'insertOrderedList' | 'createLink' | 'unlink' | 'formatBlock' | 'verticalAlign' | 'undo'; /** Mark types for inline formatting */ export type MarkType = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'color' | 'backgroundColor' | 'fontSize' | 'fontFamily'; /** Border configuration for the container */ export interface BorderConfig { color?: string; width?: number; style?: 'solid' | 'dashed' | 'dotted' | 'none'; radius?: number; } /** Padding configuration (can be a single value or array) */ export type PaddingConfig = number | [number, number] | [number, number, number, number]; export interface TokenMatchMetadata { namespace: string; name: string; filters: string[]; match: string; start: number; end: number; value: string | number | boolean | (string | number | boolean)[] | null; } /** Token metadata injected by the dashboard framework. Keys are option field names. */ export type RichTextTokenMetadata = Record; /** Props for the PureRichText component */ export interface PureRichTextProps { width?: string | number; height?: string | number; richTextContent?: string; backgroundColor?: string; verticalAlign?: VerticalAlign; border?: BorderConfig; padding?: PaddingConfig; fontColor?: string; highlightColor?: string; fontFamily?: string; fontSize?: FontSizePreset; customFontSize?: number; lineHeight?: string | number; bold?: boolean; italic?: boolean; underline?: boolean; strikethrough?: boolean; defaultTextStyles?: Partial; listType?: ListType; horizontalAlignment?: TextAlign; link?: string; mode?: 'view' | 'edit'; previewTokenValues?: boolean; richTextTokenMetadata?: RichTextTokenMetadata; onOptionsChange?: (options: Record) => void; onRichtextClick?: (event: unknown) => void; onLinkOpen?: (event: { payload: { url: string; }; }) => void; hasEventHandlers?: boolean; } /** Initial empty Slate value */ export declare const EMPTY_SLATE_VALUE: Descendant[]; /** Font size preset values in pixels */ export declare const FONT_SIZE_PRESETS: Record; /** Preloaded system fonts available by default */ export declare const PRELOADED_FONTS: readonly ["Splunk Data Sans", "Splunk Platform Sans Mono", "Arial", "Helvetica", "Times New Roman", "Comic Sans MS"]; /** Font family with fallbacks */ export declare const FONT_FAMILY_WITH_FALLBACKS: Record; //# sourceMappingURL=types.d.ts.map