From 1d73e1498fcbc2953670460620f8aed4be4d6e02 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 5 Feb 2021 13:59:50 +0100 Subject: [PATCH] Add `WCFMessageQuoteManager` interface to replace temporary `any` type (#3949) --- ts/WoltLabSuite/Core/Ui/Message/Quote.ts | 10 ++++++++-- .../files/js/WoltLabSuite/Core/Ui/Message/Quote.js | 3 +-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ts/WoltLabSuite/Core/Ui/Message/Quote.ts b/ts/WoltLabSuite/Core/Ui/Message/Quote.ts index f4c29aaf5c..9c051e9e3f 100644 --- a/ts/WoltLabSuite/Core/Ui/Message/Quote.ts +++ b/ts/WoltLabSuite/Core/Ui/Message/Quote.ts @@ -23,6 +23,12 @@ interface ElementBoundaries { top: number; } +// see WCF.Message.Quote.Manager +interface WCFMessageQuoteManager { + supportPaste: () => boolean; + updateCount: (number, object) => void; +} + export class UiMessageQuote implements AjaxCallbackObject { private activeMessageId = ""; @@ -46,13 +52,13 @@ export class UiMessageQuote implements AjaxCallbackObject { private isMouseDown = false; - private readonly quoteManager: any; + private readonly quoteManager: WCFMessageQuoteManager; /** * Initializes the quote handler for given object type. */ constructor( - quoteManager: any, // TODO + quoteManager: WCFMessageQuoteManager, className: string, objectType: string, containerSelector: string, diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js index 26a26724a7..12961b2437 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js @@ -12,8 +12,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Event/ /** * Initializes the quote handler for given object type. */ - constructor(quoteManager, // TODO - className, objectType, containerSelector, messageBodySelector, messageContentSelector, supportDirectInsert) { + constructor(quoteManager, className, objectType, containerSelector, messageBodySelector, messageContentSelector, supportDirectInsert) { this.activeMessageId = ""; this.containers = new Map(); this.containerSelector = ""; -- 2.20.1