/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module engine/view/elementdefinition */ import type { ArrayOrItem } from "@ckeditor/ckeditor5-utils"; /** * A plain object that describes a view element in a way that a concrete, exact view element could be created from that description. * * ```ts * const viewDefinition = { * name: 'h1', * classes: [ 'foo', 'bar' ] * }; * ``` * * Above describes a view element: * * ```html *
* ``` * * An example with styles and attributes: * * ```ts * const viewDefinition = { * name: 'span', * styles: { * 'font-size': '12px', * 'font-weight': 'bold' * }, * attributes: { * 'data-id': '123' * } * }; * ``` * * Describes: * * ```ts * * ``` */ export interface ViewElementObjectDefinition { /** * View element name. */ name: string; /** * Class name or array of class names to match. Each name can be provided in a form of string. */ classes?: ArrayOrItem