import { LucideIcon } from 'lucide-react'; import { A as ApiRequestDataTypeInterface, F as FieldSelector } from './ApiRequestDataTypeInterface-CYEcRUrh.js'; /** * Permission actions */ declare enum Action { Read = "read", Create = "create", Update = "update", Delete = "delete" } /** * Generic permission check type. * Can be a boolean or a function that checks permissions dynamically. * @template T - The data type being checked * @template U - The user type (defaults to PermissionUser) */ type PermissionCheck = boolean | ((user?: U | string, data?: T) => boolean); /** * Page URL configuration for modules */ type PageUrl = { pageUrl?: string; }; /** * Module permission definition wrapper */ type ModulePermissionDefinition = { interface: T; }; /** * Base module definition */ type ModuleDefinition = { pageUrl?: string; name: string; model: any; feature?: string; moduleId?: string; }; /** * Permission configuration for a module. * Can be a boolean (allow/deny all) or a string path for dynamic checks. */ interface PermissionConfig { create: boolean | string; read: boolean | string; update: boolean | string; delete: boolean | string; } /** * Generic interface for a module that has permissions. * Apps should ensure their Module class implements this. */ interface PermissionModule { id: string; permissions: PermissionConfig; } /** * Generic interface for a user that has modules with permissions. * Apps should ensure their User class implements this. */ interface PermissionUser { id: string; modules: PermissionModule[]; } /** * Module definition with permissions - extends ApiRequestDataTypeInterface */ type ModuleWithPermissions = ApiRequestDataTypeInterface & { pageUrl?: string; feature?: string; moduleId?: string; icon?: LucideIcon; inclusions?: Record[]; include?: string[]; }>; }; /** * Factory type for creating module definitions */ type ModuleFactory = (params: { pageUrl?: string; name: string; cache?: string | "days" | "default" | "hours" | "max" | "minutes" | "seconds" | "weeks"; model: any; feature?: string; moduleId?: string; icon?: LucideIcon; identifier?: string[]; inclusions?: Record[]; include?: string[]; }>; }) => ModuleWithPermissions; export { Action as A, type ModuleWithPermissions as M, type PageUrl as P, type ModuleFactory as a, type PermissionCheck as b, type ModulePermissionDefinition as c, type ModuleDefinition as d, type PermissionConfig as e, type PermissionModule as f, type PermissionUser as g };