import { LexicalCommand, createCommand, TextFormatType } from 'lexical'; export interface CopiedFormat { textFormatFlags: number; // 从node.getFormat() style: string; // 从node.getStyle() // todo: p 标签的样式 } export interface ActivateFormatPainterPayload { sticky: boolean; } // activate the format painter and copy the current selection's format export const ACTIVATE_FORMAT_PAINTER_COMMAND: LexicalCommand = createCommand('ACTIVATE_FORMAT_PAINTER_COMMAND'); // deactivate the format painter export const DEACTIVATE_FORMAT_PAINTER_COMMAND: LexicalCommand = createCommand('DEACTIVATE_FORMAT_PAINTER_COMMAND'); // dispatched by the plugin to inform UI about state changes export interface FormatPainterState { isActive: boolean; isSticky: boolean; } export const FORMAT_PAINTER_STATE_UPDATE_COMMAND: LexicalCommand = createCommand('FORMAT_PAINTER_STATE_UPDATE_COMMAND');