Add `WCFMessageQuoteManager` interface to replace temporary `any` type (#3949)
authorMatthias Schmidt <gravatronics@live.com>
Fri, 5 Feb 2021 12:59:50 +0000 (13:59 +0100)
committerGitHub <noreply@github.com>
Fri, 5 Feb 2021 12:59:50 +0000 (13:59 +0100)
ts/WoltLabSuite/Core/Ui/Message/Quote.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js

index f4c29aaf5c14aa16223d9b2495b8ec90c825a72c..9c051e9e3f1b084acae6a0681056da2a4384a351 100644 (file)
@@ -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,
index 26a26724a7dd01594418a9812842858e47b26f27..12961b24370ca09a4a18f53f1de64e3b1454930d 100644 (file)
@@ -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 = "";