@posiwise/dashboard-module 0.0.140 → 0.0.142

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.
@@ -251,6 +251,7 @@ interface RouteInfo {
251
251
  permissionKeys?: string[];
252
252
  order?: number;
253
253
  menus?: RouteInfo[];
254
+ featureFlag?: string;
254
255
  }
255
256
 
256
257
  declare const ROUTES: RouteInfo[];
@@ -259,5 +260,19 @@ declare const ENTERPRISE_MENU: RouteInfo;
259
260
  declare const CHAT_MENU: RouteInfo;
260
261
  declare const BLOG_MENU: RouteInfo;
261
262
 
262
- export { BLOG_MENU, CHAT_MENU, CurrentNotificationsComponent, DashboardContentModule, DashboardLibModule, DismissedNotificationsComponent, DocumentationComponent, ENTERPRISE_MENU, FAQ_Menu, FaqComponent, FaqDetailsComponent, HomeComponent, NotificationsPageComponent, ROUTES, SearchComponent, UserFeedbackComponent };
263
+ /**
264
+ * Drops menu items gated behind a feature flag the current user isn't entitled
265
+ * to. An item with no `featureFlag` always passes; one with a `featureFlag`
266
+ * passes only when `isEnabled(item.featureFlag)` returns true. Non-destructive
267
+ * — returns a new array and never mutates the input.
268
+ *
269
+ * Shared so every frontend's sidebar gates flag-protected menus identically
270
+ * (e.g. alpha-only pages) instead of copy-pasting the predicate.
271
+ *
272
+ * @param menus - the menu items to filter (one level; pass the specific list to gate)
273
+ * @param isEnabled - predicate resolving a flag key to enabled/disabled for the user
274
+ */
275
+ declare const filterMenusByFeatureFlag: (menus: RouteInfo[], isEnabled: (flagKey: string) => boolean) => RouteInfo[];
276
+
277
+ export { BLOG_MENU, CHAT_MENU, CurrentNotificationsComponent, DashboardContentModule, DashboardLibModule, DismissedNotificationsComponent, DocumentationComponent, ENTERPRISE_MENU, FAQ_Menu, FaqComponent, FaqDetailsComponent, HomeComponent, NotificationsPageComponent, ROUTES, SearchComponent, UserFeedbackComponent, filterMenusByFeatureFlag };
263
278
  export type { GroupedFaqs, RouteInfo };