Provide information for the class `Picker`, as this is not given to the outside world...
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 25 Sep 2024 11:10:28 +0000 (13:10 +0200)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 14 Oct 2024 07:20:14 +0000 (09:20 +0200)
ts/WoltLabSuite/WebComponent/emoji-picker.ts

index 054e4b195d83a7412264f48ea313bdf72aae9396..84a3856ed7d4eb9eb41bd2c5f7bce2e84c40ac8a 100644 (file)
@@ -41,17 +41,20 @@ function getDataSource(locale: string): string {
   return `${window.WSC_API_URL}emoji/index.php?l=${locale}`;
 }
 
-void customElements.whenDefined("emoji-picker").then(() => {
-  class WoltlabCoreEmojiPicker extends Picker {
-    // Properties and methods from the base class
-    protected _ctx!: {
+declare module "emoji-picker-element" {
+  interface Picker {
+    _ctx: {
       locale: string;
       dataSource: string;
       customEmoji?: CustomEmoji[];
       i18n: I18n;
     };
-    protected _dbFlush!: () => void;
+    _dbFlush: () => void;
+  }
+}
 
+void customElements.whenDefined("emoji-picker").then(() => {
+  class WoltlabCoreEmojiPicker extends Picker {
     constructor(props: PickerConstructorOptions | null | undefined) {
       const locale = (props && props.locale) || window.LANGUAGE_CODE;