veza/apps/web/src/hooks/index.ts
senke aad9461515 security: create useFormValidation hook for pre-validation
- Created useFormValidation hook with validate function
- Accepts validation type (e.g., "RegisterRequest", "LoginRequest")
- Calls /api/v1/validate endpoint with type and data
- Returns validation state: isValidating, errors, isValid, error
- Provides clear() function to reset validation state
- Handles both wrapped and direct API response formats
- Uses parseApiError for consistent error handling
- Exported from hooks/index.ts with types
- No TypeScript errors
- Follows existing hook patterns
- Action 5.2.1.3 complete
2026-01-15 20:06:30 +01:00

37 lines
1.1 KiB
TypeScript

/**
* Hooks exports
* FE-TYPE-012: Export all hook types for better type safety
*/
// Hook implementations
export { useAuth } from './useAuth';
export { useTranslation } from './useTranslation';
export { useToast } from './useToast';
export { useFormValidation } from './useFormValidation';
export type {
UseFormValidationReturn,
UseFormValidationOptions,
ValidationError,
} from './useFormValidation';
export { useLocalStorage } from './useLocalStorage';
export { useDebounce } from './useDebounce';
export { useIntersectionObserver } from './useIntersectionObserver';
export { useOnlineStatus } from './useOnlineStatus';
export { usePWA, usePWAInstallBanner, useOfflineDetection } from './usePWA';
export { useKeyboardNavigation } from './useKeyboardNavigation';
export { useGlobalKeyboardShortcuts } from './useGlobalKeyboardShortcuts';
export { usePreload, usePreloadRoute } from './usePreload';
// Hook types
export type {
UseAuthReturn,
UseTranslationReturn,
UseToastReturn,
UseChatReturn,
UsePWAReturn,
UsePWAInstallBannerReturn,
UseOfflineDetectionReturn,
} from './types';
// Toast type
export type { Toast } from './useToast';