refactor: streamline widget and integration architecture
This commit is contained in:
1 parent
ec295fe26e
commit
425cb653a1
243 files changed
+5722
-2255
No files matched your search
@@ -0,0 +1,24 @@
|
||||
// This file is generated by pnpm widgets:sync. Do not edit it directly.
|
||||
|
||||
import type { AnyTRPCRouter } from "@trpc/server";
|
||||
|
||||
import type { WidgetKind } from "@homarr/definitions";
|
||||
|
||||
const registerGeneratedWidgetRouter = <TRouter extends AnyTRPCRouter>(
|
||||
widgetKinds: readonly [WidgetKind, ...WidgetKind[]],
|
||||
loadRouter: () => Promise<TRouter>,
|
||||
mcp: false | true | string,
|
||||
) => ({ widgetKinds, loadRouter, mcp });
|
||||
|
||||
export const generatedWidgetRouterRegistry = {
|
||||
downloads: registerGeneratedWidgetRouter(
|
||||
["downloads"],
|
||||
() => import("./downloads").then((module) => module.downloadsRouter),
|
||||
true,
|
||||
),
|
||||
weather: registerGeneratedWidgetRouter(
|
||||
["clock", "weather"],
|
||||
() => import("./weather").then((module) => module.weatherRouter),
|
||||
false,
|
||||
),
|
||||
};
|
||||
Reference in new issue
Block a user