-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
61 lines (57 loc) · 1.82 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import Vue from "vue";
import { AxiosStatic } from "axios";
import { NuxtAxiosInstance } from "@nuxtjs/axios";
import { SnackbarConfig } from "buefy/types/components";
declare module "*.vue" {
import Vue from "vue";
const _default: Vue;
export default _default;
}
declare global {
interface Window {
/*
* onNuxtReady - plugins/vue-typer.ts
*/
onNuxtReady(cb: Function): void;
}
/*
* setItems - plugins/vue-typer.ts
* removeItems - plugins/global-utils.ts
*/
interface Storage {
/** Set multiple storage items */
setItems(items: Object): void;
/** Remove multiple storage items */
removeItems(items: Array<string>): void;
}
}
/*
* $getResource - plugins/resource/index.ts
* $axios - @nuxtjs/axios module
* $sentry - @nuxtjs/sentry module
* $utils - middleware/utils.ts
*/
declare module "vue/types/vue" {
interface Vue {
/** Request resource data from the api */
$getResource(method: string): Promise<any>;
$axios: NuxtAxiosInstance;
$sentry: any;
$utils: {
/** Check if an Object is empty */
isEmptyObject(obj: Object): boolean;
/** Show snackbar specific for error messages */
alertError(errorMessage: string): void;
/** Show a buefy snackbar with my own default values */
snackbar(options: SnackbarConfig): void;
/** An async forEach function */
foreachAsync(array: ArrayLike<any>, cb: Function): Promise<void>;
/** Sleep x milliseconds */
sleep(ms: number): Promise<void>;
/** Show "not available" alert */
notAvailable(): void;
/** Encode an object */
encode(object: Object): string;
};
}
}