flaschengeist-frontend/src/plugins.d.ts

62 lines
1.3 KiB
TypeScript
Raw Normal View History

import { RouteConfig } from 'vue-router';
import { Module } from 'vuex';
import { StateInterface } from 'src/store';
import { AsyncComponentPromise } from 'vue/types/options';
declare namespace FG_Plugin {
interface ShortCutLink {
link: string;
icon: string;
permissions?: string[];
}
interface PluginRouteConfig extends RouteConfig {
shortcut?: boolean;
title: string;
icon: string;
children?: PluginRouteConfig[];
meta?: { permissions?: string[] };
}
interface Plugin {
name: string;
mainRoutes?: PluginRouteConfig[];
outRoutes?: PluginRouteConfig[];
store?: Map<string, Module<any, StateInterface>>;
widget?: Widget;
requiredModules: string[];
version: string;
}
interface PluginMainLink extends PluginChildLink {
children: PluginChildLink[];
}
interface PluginChildLink {
name: string;
title: string;
link: string;
icon: string;
permissions?: string[];
}
interface LoadedPlugin {
name: string;
version: string;
}
interface Widget {
widget: AsyncComponentPromise;
priority: number;
}
interface LoadedPlugins {
plugins: LoadedPlugin[];
routes: RouteConfig[];
mainLinks: PluginMainLink[];
shortcuts: ShortCutLink[];
shortcutsOut: ShortCutLink[];
widgets: Widget[];
}
}