import type ModeIndependentColor from './ModeIndependentColor'; import type { ContentMetadata } from './ContentMetadata'; /** * State for an entity. This is used for storing entity undo snapshot */ export interface EntityState { /** * Type of the entity */ type: string; /** * Id of the entity */ id: string; /** * The state of this entity to store into undo snapshot. * The state can be any string, or a serialized JSON object. * We are using string here instead of a JSON object to make sure the whole state is serializable. */ state: string; } /** * A serializable snapshot of editor content, including the html content and metadata */ export default interface Snapshot { /** * HTML content string */ html: string; /** * Metadata of the editor content state */ metadata: ContentMetadata | null; /** * Known colors for dark mode */ knownColors: Readonly[]; /** * Entity states related to this undo snapshots. When undo/redo to this snapshot, each entity state will trigger * an EntityOperation event with operation = EntityOperation.UpdateEntityState */ entityStates?: EntityState[]; }