]> Repos - mime-chat/commitdiff
solve ts conflics in messageAnim compsable
authorriqo <hernandeze2@xavier.edu>
Sun, 25 Oct 2020 20:22:37 +0000 (15:22 -0500)
committerriqo <hernandeze2@xavier.edu>
Sun, 25 Oct 2020 20:24:11 +0000 (15:24 -0500)
src/components/UI/UIDetails/inputItem.vue
src/composables/anims/useMessageItemAnims.ts

index cc08402a16644b904dc5510297531bff063e23f0..858cc28a3efbfa0da9a209e3d16efc632822da53 100644 (file)
@@ -10,7 +10,7 @@
   </foreignObject>
 </template>
 
-<script>
+<script lang="ts">
 import useKeyDownHandler from "@/composables/keyDownHandler/useKeyDownHandler";
 import { defineComponent, onUnmounted } from "vue";
 export default defineComponent({
index c96fc46b4dd2a6306d9333e0d55568f818b819a6..ae9a9eab467041772c9944f66c32de40b53c358d 100644 (file)
@@ -4,22 +4,22 @@ interface Ref {
 }
 export default function useMessageItemAnims({ mr, tr }: { mr: Ref; tr: Ref }) {
   const signatureTranslate = ref("");
-  let messageRect: string | SVGRectElement | SVGSVGElement | any;
-  let messageText: string | SVGTextElement | SVGSVGElement | any;
+  let messageRect: SVGSVGElement & SVGRectElement;
+  let messageText: SVGSVGElement & SVGTextElement;
 
   onMounted(() => {
-    messageRect = mr.value;
-    messageText = tr.value;
+    messageRect = (mr.value as unknown) as SVGSVGElement & SVGRectElement;
+    messageText = (tr.value as unknown) as SVGSVGElement & SVGTextElement;
   });
 
   function adjustMessageRect(): void {
     // must get dimensions of text box to fit bubble around
     const padding = 20;
     const textBox = messageText.getBBox();
-    messageRect.setAttribute("x", textBox.x - padding);
-    messageRect.setAttribute("y", textBox.y - padding);
-    messageRect.setAttribute("width", textBox.width + 2 * padding);
-    messageRect.setAttribute("height", textBox.height + 2 * padding);
+    messageRect.setAttribute("x", String(textBox.x - padding));
+    messageRect.setAttribute("y", String(textBox.y - padding));
+    messageRect.setAttribute("width", String(textBox.width + 2 * padding));
+    messageRect.setAttribute("height", String(textBox.height + 2 * padding));
   }
 
   function translateMsgSignature(): void {