67 lines
1.3 KiB
TypeScript
67 lines
1.3 KiB
TypeScript
import { RouteRecordRaw } from 'vue-router';
|
|
import { Component, ComputedRef } from 'vue';
|
|
|
|
declare global {
|
|
type Validator = (value: unknown) => boolean | string;
|
|
}
|
|
|
|
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[];
|
|
}
|
|
|
|
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 Flaschengeist {
|
|
plugins: LoadedPlugin[];
|
|
routes: RouteRecordRaw[];
|
|
mainLinks: PluginMainLink[];
|
|
shortcuts: ShortCutLink[];
|
|
shortcutsOut: ShortCutLink[];
|
|
widgets: Widget[];
|
|
}
|
|
}
|