2021-01-30 03:19:30 +00:00
|
|
|
import { RouteRecordRaw } from 'vue-router';
|
2020-10-31 14:09:02 +00:00
|
|
|
import { Module } from 'vuex';
|
2021-01-30 03:19:30 +00:00
|
|
|
import { Component } from 'vue';
|
2020-11-10 00:33:55 +00:00
|
|
|
|
2020-10-31 14:09:02 +00:00
|
|
|
declare namespace FG_Plugin {
|
|
|
|
interface ShortCutLink {
|
|
|
|
link: string;
|
|
|
|
icon: string;
|
2020-10-31 16:33:09 +00:00
|
|
|
permissions?: string[];
|
2020-10-31 14:09:02 +00:00
|
|
|
}
|
|
|
|
|
2021-01-30 03:19:30 +00:00
|
|
|
interface PluginRouteConfig {
|
2020-10-31 14:09:02 +00:00
|
|
|
title: string;
|
|
|
|
icon: string;
|
2021-01-30 03:19:30 +00:00
|
|
|
route: RouteRecordRaw;
|
|
|
|
shortcut?: boolean;
|
2020-10-31 14:09:02 +00:00
|
|
|
children?: PluginRouteConfig[];
|
2021-01-30 03:19:30 +00:00
|
|
|
permissions?: string[];
|
2020-10-31 14:09:02 +00:00
|
|
|
}
|
|
|
|
|
2020-11-13 03:01:53 +00:00
|
|
|
interface Widget {
|
|
|
|
name: string;
|
|
|
|
priority: number;
|
|
|
|
permissions: FG.Permission[];
|
2021-01-30 03:19:30 +00:00
|
|
|
widget: Component;
|
2020-11-13 03:01:53 +00:00
|
|
|
}
|
|
|
|
|
2020-10-31 14:09:02 +00:00
|
|
|
interface Plugin {
|
|
|
|
name: string;
|
2020-11-13 03:01:53 +00:00
|
|
|
version: string;
|
|
|
|
widgets: Widget[];
|
|
|
|
requiredModules: string[];
|
2020-11-13 12:42:15 +00:00
|
|
|
requiredBackendModules: string[];
|
2020-10-31 14:09:02 +00:00
|
|
|
mainRoutes?: PluginRouteConfig[];
|
|
|
|
outRoutes?: PluginRouteConfig[];
|
2021-01-30 07:38:44 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2021-01-30 03:19:30 +00:00
|
|
|
store?: Map<string, Module<any, any>>;
|
2020-10-31 14:09:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface PluginMainLink extends PluginChildLink {
|
|
|
|
children: PluginChildLink[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface PluginChildLink {
|
|
|
|
name: string;
|
|
|
|
title: string;
|
|
|
|
link: string;
|
|
|
|
icon: string;
|
2020-11-04 22:53:10 +00:00
|
|
|
permissions?: string[];
|
2020-10-31 14:09:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface LoadedPlugin {
|
|
|
|
name: string;
|
|
|
|
version: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LoadedPlugins {
|
|
|
|
plugins: LoadedPlugin[];
|
2021-01-30 03:19:30 +00:00
|
|
|
routes: RouteRecordRaw[];
|
2020-10-31 14:09:02 +00:00
|
|
|
mainLinks: PluginMainLink[];
|
|
|
|
shortcuts: ShortCutLink[];
|
|
|
|
shortcutsOut: ShortCutLink[];
|
2020-11-10 00:33:55 +00:00
|
|
|
widgets: Widget[];
|
2020-10-31 14:09:02 +00:00
|
|
|
}
|
|
|
|
}
|