import * as zustand_middleware from 'zustand/middleware'; import { StateStorage } from 'zustand/middleware'; import * as zustand from 'zustand'; declare const secureStorage: StateStorage; interface RbacPermission { id: string; name: string; description: string; module: string; } interface RbacRole { id: string; name: string; description: string; permissions: string[]; } interface SystemUser { id: string; name: string; email: string; roleId: string; } interface RbacState { roles: Record; users: Record; availablePermissions: Record; addRole: (role: RbacRole) => void; updateRole: (id: string, role: Partial) => void; deleteRole: (id: string) => void; addUser: (user: SystemUser) => void; updateUser: (id: string, user: Partial) => void; deleteUser: (id: string) => void; assignRoleToUser: (userId: string, roleId: string) => void; registerPermission: (permission: RbacPermission) => void; assignPermissionToRole: (roleId: string, permissionId: string) => void; removePermissionFromRole: (roleId: string, permissionId: string) => void; hasPermission: (roleId: string, permissionId: string) => boolean; } declare const useRbacStore: zustand.UseBoundStore, "persist"> & { persist: { setOptions: (options: Partial>) => void; clearStorage: () => void; rehydrate: () => Promise | void; hasHydrated: () => boolean; onHydrate: (fn: (state: RbacState) => void) => () => void; onFinishHydration: (fn: (state: RbacState) => void) => () => void; getOptions: () => Partial>; }; }>; type UserRole = 'creator' | 'admin' | 'user' | 'demo' | 'developer' | 'optimizador' | 'ventas' | 'despacho'; type LicenseType = 'personal' | 'enterprise'; interface LicenseTarget { type: LicenseType; id: string; name: string; enabledPlugins?: string[]; systemPrompt?: string; swarmKey?: string; websocketRelayUrl?: string; } interface AuthState { isAuthenticated: boolean; userRole: UserRole | null; userName: string | null; availableLicenses: LicenseTarget[]; activeContext: LicenseTarget | null; hasCompletedWelcome: boolean; hasSeenTour: boolean; login: (role: UserRole, name: string, licenses?: LicenseTarget[]) => void; loginWithCredentials: (email: string, password: string) => Promise<{ success: boolean; error?: string; }>; loginWithPin: (email: string, pin: string) => Promise<{ success: boolean; error?: string; }>; updateProfile: (updates: { name?: string; pin?: string; currentPassword?: string; newPassword?: string; }) => Promise<{ success: boolean; error?: string; }>; joinSwarm: (token: string) => Promise; setActiveContext: (licenseId: string) => void; setHasCompletedWelcome: (val: boolean) => void; setHasSeenTour: (val: boolean) => void; logout: () => void; } declare const useAuthStore: zustand.UseBoundStore, "persist"> & { persist: { setOptions: (options: Partial>) => void; clearStorage: () => void; rehydrate: () => Promise | void; hasHydrated: () => boolean; onHydrate: (fn: (state: AuthState) => void) => () => void; onFinishHydration: (fn: (state: AuthState) => void) => () => void; getOptions: () => Partial>; }; }>; export { type AuthState, type LicenseTarget, type LicenseType, type RbacPermission, type RbacRole, type SystemUser, type UserRole, secureStorage, useAuthStore, useRbacStore };