From 39c38c737114dc7f946b1895b2a4ba27a5546c60 Mon Sep 17 00:00:00 2001
From: HampusM <hampus@hampusmat.com>
Date: Tue, 6 Jul 2021 13:07:07 +0200
Subject: Migrated frontend to typescript

---
 packages/client/src/components/RepositoryTreeTree.vue | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

(limited to 'packages/client/src/components/RepositoryTreeTree.vue')

diff --git a/packages/client/src/components/RepositoryTreeTree.vue b/packages/client/src/components/RepositoryTreeTree.vue
index 821251e..a17dc93 100644
--- a/packages/client/src/components/RepositoryTreeTree.vue
+++ b/packages/client/src/components/RepositoryTreeTree.vue
@@ -47,10 +47,11 @@
 	</table>
 </template>
 
-<script>
-const { formatDistance } = require("date-fns");
+<script lang="ts">
+import { defineComponent } from "vue";
+import { formatDistance } from "date-fns";
 
-export default {
+export default defineComponent({
 	name: "RepositoryTreeTree",
 	props: {
 		repository: {
@@ -67,19 +68,19 @@ export default {
 		}
 	},
 	methods: {
-		stopClick(event) {
+		stopClick(event: Event) {
 			event.preventDefault();
 		},
-		routeToCommit(commit_id, event) {
+		routeToCommit(commit_id: string, event: Event) {
 			event.stopPropagation();
 			event.preventDefault();
 			this.$router.push(`/${this.repository}/log/${commit_id}`);
 		},
-		getPrettyLastUpdated(date) {
+		getPrettyLastUpdated(date: number) {
 			return formatDistance(new Date(date * 1000), new Date(), { addSuffix: true });
 		}
 	}
-};
+});
 </script>
 
 <style lang="scss" scoped>
-- 
cgit v1.2.3-18-g5258

