From 1ebaf9389f5c936f4fbd4d65c767fd001588d168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Fri, 16 Sep 2022 21:28:56 +0000 Subject: [PATCH] easier ovdashboard shim --- ui/src/d.ts/shims-ovdashboard.d.ts | 28 ++-------------------------- ui/src/plugins/ovdashboard.ts | 2 +- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/ui/src/d.ts/shims-ovdashboard.d.ts b/ui/src/d.ts/shims-ovdashboard.d.ts index 9158190..40994d2 100644 --- a/ui/src/d.ts/shims-ovdashboard.d.ts +++ b/ui/src/d.ts/shims-ovdashboard.d.ts @@ -1,34 +1,10 @@ +import { OVDashboardPlugin } from "@/plugins/ovdashboard"; import { AxiosInstance } from "axios"; declare module 'vue/types/vue' { interface Vue { $axios: AxiosInstance; - - $ovdashboard: { - api_url: (endpoint?: string) => string; - - fail: (name: string) => ((arg0: unknown) => void); - - api_query_simple: ( - endpoint: string, - on_success: (data: unknown) => void - ) => void; - - api_query_simple_string: ( - endpoint: string, - on_success: (data: string) => void - ) => void; - - api_query_simple_list: ( - endpoint: string, - on_success: (data: string[]) => void - ) => void; - - api_query_simple_object: ( - endpoint: string, - on_success: (data: Record) => void - ) => void; - } + $ovdashboard: OVDashboardPlugin; } } diff --git a/ui/src/plugins/ovdashboard.ts b/ui/src/plugins/ovdashboard.ts index 0c5a50e..8942b07 100644 --- a/ui/src/plugins/ovdashboard.ts +++ b/ui/src/plugins/ovdashboard.ts @@ -1,7 +1,7 @@ import axios, { AxiosInstance } from 'axios'; import Vue from 'vue'; -class OVDashboardPlugin { +export class OVDashboardPlugin { private axios: AxiosInstance; public constructor() {