flaschengeist-frontend/src/plugins.d.ts

66 lines
1.4 KiB
TypeScript
Raw Normal View History

import { RouteRecordRaw } from 'vue-router';
import { Module } from 'vuex';
import { Component, ComputedRef } from 'vue';
declare namespace FG_Plugin {
interface ShortCutLink {
link: string;
icon: string;
permissions?: string[];
}
interface PluginRouteConfig {
title: string | ComputedRef<string>;
icon: string;
route: RouteRecordRaw;
shortcut?: boolean;
children?: PluginRouteConfig[];
permissions?: string[];
}
interface Widget {
name: string;
priority: number;
permissions: FG.Permission[];
widget: Component;
}
interface Plugin {
name: string;
version: string;
widgets: Widget[];
requiredModules: string[];
requiredBackendModules: string[];
mainRoutes?: PluginRouteConfig[];
outRoutes?: PluginRouteConfig[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
store?: Map<string, Module<any, any>>;
}
interface PluginMainLink extends PluginChildLink {
children: PluginChildLink[];
}
interface PluginChildLink {
name: string;
title: string;
link: string;
icon: string;
permissions?: string[];
}
interface LoadedPlugin {
name: string;
version: string;
}
2021-02-04 01:42:49 +00:00
interface Flaschengeist {
plugins: LoadedPlugin[];
routes: RouteRecordRaw[];
mainLinks: PluginMainLink[];
shortcuts: ShortCutLink[];
shortcutsOut: ShortCutLink[];
widgets: Widget[];
}
}