easier ovdashboard shim
This commit is contained in:
parent
ac13f60b81
commit
1ebaf9389f
2 changed files with 3 additions and 27 deletions
28
ui/src/d.ts/shims-ovdashboard.d.ts
vendored
28
ui/src/d.ts/shims-ovdashboard.d.ts
vendored
|
@ -1,34 +1,10 @@
|
||||||
|
import { OVDashboardPlugin } from "@/plugins/ovdashboard";
|
||||||
import { AxiosInstance } from "axios";
|
import { AxiosInstance } from "axios";
|
||||||
|
|
||||||
declare module 'vue/types/vue' {
|
declare module 'vue/types/vue' {
|
||||||
interface Vue {
|
interface Vue {
|
||||||
$axios: AxiosInstance;
|
$axios: AxiosInstance;
|
||||||
|
$ovdashboard: OVDashboardPlugin;
|
||||||
$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<string, unknown>) => void
|
|
||||||
) => void;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import axios, { AxiosInstance } from 'axios';
|
import axios, { AxiosInstance } from 'axios';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
class OVDashboardPlugin {
|
export class OVDashboardPlugin {
|
||||||
private axios: AxiosInstance;
|
private axios: AxiosInstance;
|
||||||
|
|
||||||
public constructor() {
|
public constructor() {
|
||||||
|
|
Loading…
Reference in a new issue