UNPKG

@ckeditor/ckeditor5-collaboration-core

Version:

Base utilities used by CKEditor 5 collaboration features to support multiple users working together in a rich text editor.

35 lines (34 loc) 1.27 kB
/** * @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 collaboration-core/utils/confirmmixin */ import type { View } from "@ckeditor/ckeditor5-ui"; import type { Constructor, Locale, Mixed } from "@ckeditor/ckeditor5-utils"; /** * Constructor returned by {@link ~ConfirmMixin}. Use it to name a mixin base class before extending it. * * ```ts * const MyConfirmBase: ConfirmMixinConstructor<typeof BaseClass> = ConfirmMixin( BaseClass ); * * class MyConfirm extends MyConfirmBase {} * ``` */ export type ConfirmMixinConstructor<Base extends Constructor<View>> = Mixed<Base, ConfirmApi>; /** * Adds interface for showing confirmation view in the specific for `CommentThreadView` and `CommentView` structure * Confirm is always set to the `content` collection at the last position. */ export declare function ConfirmMixin<Base extends Constructor<View>>(base: Base): ConfirmMixinConstructor<Base>; export interface ConfirmApi { isConfirm: boolean; locale: Locale; showConfirm(message: string, element: Element): Promise<unknown>; cancelConfirm(): void; } export type RemoveConfirmEvent = { name: "removeConfirm"; args: []; };