2020-10-31 14:09:02 +00:00
|
|
|
import { RouteConfig } from 'vue-router';
|
|
|
|
import { Module } from 'vuex';
|
|
|
|
import { StateInterface } from 'src/store';
|
2020-11-10 00:33:55 +00:00
|
|
|
import { AsyncComponentPromise } from 'vue/types/options';
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
interface PluginRouteConfig extends RouteConfig {
|
|
|
|
shortcut?: boolean;
|
|
|
|
title: string;
|
|
|
|
icon: string;
|
|
|
|
children?: PluginRouteConfig[];
|
2020-11-04 22:53:10 +00:00
|
|
|
meta?: { permissions?: string[] };
|
2020-10-31 14:09:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface Plugin {
|
|
|
|
name: string;
|
|
|
|
mainRoutes?: PluginRouteConfig[];
|
|
|
|
outRoutes?: PluginRouteConfig[];
|
|
|
|
store?: Map<string, Module<any, StateInterface>>;
|
2020-11-10 00:33:55 +00:00
|
|
|
widget?: Widget;
|
2020-10-31 14:09:02 +00:00
|
|
|
requiredModules: string[];
|
|
|
|
version: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-11-10 00:33:55 +00:00
|
|
|
interface Widget {
|
|
|
|
widget: AsyncComponentPromise;
|
|
|
|
priority: number;
|
|
|
|
}
|
|
|
|
|
2020-10-31 14:09:02 +00:00
|
|
|
interface LoadedPlugins {
|
|
|
|
plugins: LoadedPlugin[];
|
|
|
|
routes: RouteConfig[];
|
|
|
|
mainLinks: PluginMainLink[];
|
|
|
|
shortcuts: ShortCutLink[];
|
|
|
|
shortcutsOut: ShortCutLink[];
|
2020-11-10 00:33:55 +00:00
|
|
|
widgets: Widget[];
|
2020-10-31 14:09:02 +00:00
|
|
|
}
|
|
|
|
}
|