import * as react_jsx_runtime from 'react/jsx-runtime';
import React__default, { ReactNode, ReactElement } from 'react';
import { J as JsonApiHydratedDataInterface } from '../ApiRequestDataTypeInterface-DIEOFn9s.js';
import { h as CompanyInterface, N as NotificationInterface, k as RoleInterface, U as UserInterface, M as ModuleWithPermissions, A as Action } from '../notification.interface-CqwaOIgM.js';
import { B as BreadcrumbItemData } from '../breadcrumb.item.data.interface-CgB4_1EE.js';
import { u as useSocket } from '../useSocket-Dwt8cz1x.js';
import * as jotai from 'jotai';
import * as jotai_utils from 'jotai/utils';
import 'lucide-react';

interface CompanyContextType {
    company: CompanyInterface | undefined;
    setCompany: (value: CompanyInterface | undefined) => void;
}
type CompanyProviderProps = {
    children: ReactNode;
    dehydratedCompany?: JsonApiHydratedDataInterface;
};
declare const CompanyProvider: ({ children, dehydratedCompany }: CompanyProviderProps) => react_jsx_runtime.JSX.Element;
declare const useCompanyContext: () => CompanyContextType;

interface NotificationContextType {
    notifications: NotificationInterface[];
    setNotifications: (notifications: NotificationInterface[]) => void;
    addNotification: (notification: NotificationInterface) => void;
    addSocketNotifications: (socketNotifications: NotificationInterface[]) => void;
    loadNotifications: () => Promise<void>;
    generateNotification: (notification: NotificationInterface, closePopover: () => void) => ReactElement<any>;
    generateToastNotification: (notification: NotificationInterface, t: any, generateUrl: any) => {
        title: string;
        description: string | ReactElement<any>;
        action?: {
            label: string;
            onClick: () => void;
        };
    };
    markNotificationsAsRead: (ids: string[]) => Promise<void>;
    isLoading: boolean;
    error: string | null;
    lastLoaded: number;
    shouldRefresh: boolean;
}
type NotificationContextProviderProps = {
    children: React__default.ReactNode;
};
declare const NotificationContextProvider: ({ children }: NotificationContextProviderProps) => react_jsx_runtime.JSX.Element;
declare const useNotificationContext: () => NotificationContextType;

interface RoleContextType {
    role: RoleInterface | undefined;
    setRole: (value: RoleInterface | undefined) => void;
}
type RoleProviderProps = {
    children: ReactNode;
    dehydratedRole?: JsonApiHydratedDataInterface;
};
declare const RoleProvider: ({ children, dehydratedRole }: RoleProviderProps) => react_jsx_runtime.JSX.Element;
declare const useRoleContext: () => RoleContextType;

interface CurrentUserContextType<T extends UserInterface = UserInterface> {
    currentUser: T | null;
    company: CompanyInterface | null;
    setUser: (user?: T) => void;
    hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
        module: M;
        action: Action;
        data?: any;
    }) => boolean;
    hasPermissionToModules: <M extends ModuleWithPermissions>(params: {
        modules: M[];
        action: Action;
        data?: any;
    }) => boolean;
    hasPermissionToPath: (path: string) => boolean;
    hasAccesToFeature: (featureIdentifier: string) => boolean;
    matchUrlToModule: (prarms?: {
        path: string;
    }) => ModuleWithPermissions | undefined;
    hasRole: (roleId: string) => boolean;
}
declare const CurrentUserProvider: ({ children }: {
    children: React__default.ReactNode;
}) => react_jsx_runtime.JSX.Element;
declare function useCurrentUserContext<T extends UserInterface = UserInterface>(): CurrentUserContextType<T>;

interface UserContextType {
    user: UserInterface | undefined;
    setUser: (value: UserInterface | undefined) => void;
}
type UserProviderProps = {
    children: ReactNode;
    dehydratedUser?: JsonApiHydratedDataInterface;
};
declare const UserProvider: ({ children, dehydratedUser }: UserProviderProps) => react_jsx_runtime.JSX.Element;
declare const useUserContext: () => UserContextType;

interface CommonContextType {
}
type CommonProviderProps = {
    children: ReactNode;
};
declare const CommonProvider: ({ children }: CommonProviderProps) => react_jsx_runtime.JSX.Element;
declare const useCommonContext: () => CommonContextType;

interface SharedProviderProps {
    children: ReactNode;
    value: {
        breadcrumbs: BreadcrumbItemData[];
        title: {
            type: string;
            element?: string;
            functions?: ReactNode;
        };
    };
}
declare const SharedProvider: ({ children, value }: SharedProviderProps) => react_jsx_runtime.JSX.Element;
declare const useSharedContext: () => {
    breadcrumbs: BreadcrumbItemData[];
    title: {
        type: string | string[];
        element?: string;
        functions?: ReactNode;
    };
};

interface SocketContextProps {
    socket: ReturnType<typeof useSocket>["socket"];
    isConnected: boolean;
    messages: any[];
    socketNotifications: NotificationInterface[];
    sendMessage: (event: string, data: any) => void;
    removeMessage: (index: number) => void;
    removeSocketNotification: (index: number) => void;
    clearMessages: () => void;
    clearSocketNotifications: () => void;
}
declare const SocketContext: React__default.Context<SocketContextProps>;
interface SocketProviderProps {
    token?: string;
    children: React__default.ReactNode;
}
declare const SocketProvider: React__default.FC<SocketProviderProps>;
declare const useSocketContext: () => SocketContextProps;

interface RecentPage {
    url: string;
    title: string;
    moduleType: string;
    timestamp: number;
}
declare const recentPagesAtom: jotai.WritableAtom<RecentPage[], [typeof jotai_utils.RESET | RecentPage[] | ((prev: RecentPage[]) => typeof jotai_utils.RESET | RecentPage[])], void>;

export { CommonProvider, CompanyProvider, type CurrentUserContextType, CurrentUserProvider, NotificationContextProvider, type RecentPage, RoleProvider, SharedProvider, SocketContext, SocketProvider, UserProvider, recentPagesAtom, useCommonContext, useCompanyContext, useCurrentUserContext, useNotificationContext, useRoleContext, useSharedContext, useSocketContext, useUserContext };
