UNPKG

1.57 kBTypeScriptView Raw
1/**
2 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5import type { DowncastDispatcher } from 'ckeditor5/src/engine';
6import type MediaRegistry from './mediaregistry';
7import type { MediaOptions } from './utils';
8/**
9 * Returns a function that converts the model "url" attribute to the view representation.
10 *
11 * Depending on the configuration, the view representation can be "semantic" (for the data pipeline):
12 *
13 * ```html
14 * <figure class="media">
15 * <oembed url="foo"></oembed>
16 * </figure>
17 * ```
18 *
19 * or "non-semantic" (for the editing view pipeline):
20 *
21 * ```html
22 * <figure class="media">
23 * <div data-oembed-url="foo">[ non-semantic media preview for "foo" ]</div>
24 * </figure>
25 * ```
26 *
27 * **Note:** Changing the model "url" attribute replaces the entire content of the
28 * `<figure>` in the view.
29 *
30 * @param registry The registry providing
31 * the media and their content.
32 * @param options options object with following properties:
33 * - elementName When set, overrides the default element name for semantic media embeds.
34 * - renderMediaPreview When `true`, the converter will create the view in the non-semantic form.
35 * - renderForEditingView When `true`, the converter will create a view specific for the
36 * editing pipeline (e.g. including CSS classes, content placeholders).
37 */
38export declare function modelToViewUrlAttributeConverter(registry: MediaRegistry, options: MediaOptions): (dispatcher: DowncastDispatcher) => void;