From c7f411a52b922904e74b752411324d934b48b01a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 20 Apr 2023 15:07:17 +0200 Subject: [PATCH] Improve Ckeditor/Types.ts --- .../Core/Component/Ckeditor/Types.ts | 17 +++++++++++++++-- .../Core/Component/Ckeditor/Types.js | 10 +++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Types.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Types.ts index d58d208cf2..c13507cf1e 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Types.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Types.ts @@ -1,6 +1,19 @@ +/** + * Collects imports for core CKEditor types in a central location. + * + * @author Tim Duesterhus + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + export type { ClassicEditor } from "@ckeditor/ckeditor5-editor-classic"; export type { EditorConfig } from "@ckeditor/ckeditor5-core"; export type { Element } from "@ckeditor/ckeditor5-engine"; -import "@ckeditor/ckeditor5-autosave"; -import "@ckeditor/ckeditor5-mention"; +// We only want these for the configuration augmentation. +// `import type "foo"` is not valid syntax, but simply importing +// nothing works properly. The augmentation will happen, but +// no symbols will be emitted. +import type {} from "@ckeditor/ckeditor5-autosave"; +import type {} from "@ckeditor/ckeditor5-mention"; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Types.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Types.js index 1aa7d8885c..dbca045dc8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Types.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Types.js @@ -1,4 +1,12 @@ -define(["require", "exports", "@ckeditor/ckeditor5-autosave", "@ckeditor/ckeditor5-mention"], function (require, exports) { +/** + * Collects imports for core CKEditor types in a central location. + * + * @author Tim Duesterhus + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ +define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); }); -- 2.20.1