@lars_hagemann/mediaserver-frontend-plugin-types 1.2.0-beta → 1.3.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/plugin.d.ts +29 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lars_hagemann/mediaserver-frontend-plugin-types",
3
- "version": "1.2.0-beta",
3
+ "version": "1.3.0-beta",
4
4
  "files": [
5
5
  "types"
6
6
  ],
package/types/plugin.d.ts CHANGED
@@ -10023,3 +10023,32 @@ export type ThemePlugin = {
10023
10023
  background: string;
10024
10024
  };
10025
10025
  };
10026
+ export type PluginApi = {
10027
+ baseUrl: string;
10028
+ fetch: (path: string, init?: RequestInit) => Promise<Response>;
10029
+ };
10030
+ export type RouteContext = {
10031
+ React: typeof React;
10032
+ api: PluginApi;
10033
+ };
10034
+ export type NavItem = {
10035
+ id: string;
10036
+ path: string;
10037
+ label: string;
10038
+ icon: (icons: ReactIcons) => IconType;
10039
+ permission?: string;
10040
+ priority?: number;
10041
+ };
10042
+ export type PluginRoute = {
10043
+ path: string;
10044
+ Component: React.FC<RouteContext>;
10045
+ };
10046
+ export type FrontendPlugin = {
10047
+ id: string;
10048
+ name: string;
10049
+ description?: string;
10050
+ fileType?: FileTypePlugin;
10051
+ theme?: ThemePlugin;
10052
+ navItems?: NavItem[];
10053
+ routes?: PluginRoute[];
10054
+ };