import { LucideIcon } from 'lucide-react';
import { A as ApiRequestDataTypeInterface, F as FieldSelector } from './ApiRequestDataTypeInterface-CUKFDBx2.js';
import { A as ApiDataInterface } from './ApiDataInterface-DPP8s46n.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<T, U = PermissionUser> = boolean | ((user?: U | string, data?: T) => boolean);
/**
 * Page URL configuration for modules
 */
type PageUrl = {
    pageUrl?: string;
};
/**
 * Module permission definition wrapper
 */
type ModulePermissionDefinition<T> = {
    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<string, {
        types?: string[];
        fields?: FieldSelector<any>[];
    }>;
};
/**
 * 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;
    inclusions?: Record<string, {
        types?: string[];
        fields?: FieldSelector<any>[];
    }>;
}) => ModuleWithPermissions;

interface ModuleInterface extends ApiDataInterface {
    get name(): string;
    get permissions(): {
        create: boolean | string;
        read: boolean | string;
        update: boolean | string;
        delete: boolean | string;
    };
}

interface FeatureInterface extends ApiDataInterface {
    get name(): string;
    get isCore(): boolean;
    get modules(): ModuleInterface[];
}

type CompanyInput = {
    id: string;
    name?: string;
    logo?: string;
    configurations?: any;
    license?: string;
    privateKey?: string;
    featureIds?: string[];
    moduleIds?: string[];
};
interface CompanyInterface extends ApiDataInterface {
    get name(): string;
    get configurations(): any;
    get logo(): string | undefined;
    get logoUrl(): string | undefined;
    get licenseExpirationDate(): Date | undefined;
    get features(): FeatureInterface[];
    get modules(): ModuleInterface[];
}

type RoleInput = {
    id: string;
    name: string;
    description?: string;
};
interface RoleInterface extends ApiDataInterface {
    get name(): string;
    get description(): string;
    get isSelectable(): boolean;
    get requiredFeature(): FeatureInterface | undefined;
}

type UserInput = {
    id: string;
    email?: string | undefined | null;
    name?: string;
    title?: string;
    bio?: string;
    password?: string | undefined;
    roleIds?: string[];
    sendInvitationEmail?: boolean;
    companyId?: string;
    adminCreated?: boolean;
    avatar?: string;
    phone?: string;
    rate?: number;
};
interface UserInterface extends ApiDataInterface {
    get email(): string;
    get name(): string;
    get title(): string;
    get bio(): string;
    get avatar(): string | undefined;
    get avatarUrl(): string | undefined;
    get phone(): string | undefined;
    get rate(): number | undefined;
    get isActivated(): boolean;
    get isDeleted(): boolean;
    get lastLogin(): Date | undefined;
    get relevance(): number | undefined;
    get roles(): RoleInterface[];
    get company(): CompanyInterface | undefined;
    get modules(): ModuleInterface[];
}

type NotificationInput = {
    id: string;
    isRead: boolean;
};
interface NotificationInterface extends ApiDataInterface {
    get notificationType(): string;
    get isRead(): boolean;
    get message(): string | undefined;
    get actionUrl(): string | undefined;
    get actor(): UserInterface | undefined;
}

export { Action as A, type CompanyInput as C, type FeatureInterface as F, type ModuleWithPermissions as M, type NotificationInterface as N, type PermissionCheck as P, type RoleInput as R, type UserInterface as U, type PageUrl as a, type ModulePermissionDefinition as b, type ModuleDefinition as c, type PermissionConfig as d, type PermissionModule as e, type PermissionUser as f, type ModuleFactory as g, type CompanyInterface as h, type ModuleInterface as i, type NotificationInput as j, type RoleInterface as k, type UserInput as l };
