Files
frontend/src/hooks/index.ts

114 lines
2.8 KiB
TypeScript
Raw Normal View History

/**
* Hooks
*/
// ==================== 新的响应式 Hooks (推荐) ====================
export {
// 核心 hooks
useBreakpoint,
useFineBreakpoint,
useBreakpointGTE,
useBreakpointLT,
useBreakpointBetween,
useScreenSize,
useWindowDimensions,
useOrientation,
usePlatform,
useMediaQuery,
useResponsiveValue,
useResponsiveStyle,
useColumnCount,
useResponsiveSpacing,
// 兼容层
useResponsive,
useLegacyResponsive,
// 工具函数
getBreakpoint,
getFineBreakpoint,
isBreakpointGTE,
isBreakpointLT,
isBreakpointBetween,
// 常量
BREAKPOINTS,
FINE_BREAKPOINTS,
} from '../presentation/hooks/responsive';
export type {
BreakpointKey,
FineBreakpointKey,
BreakpointValue,
ResponsiveValue,
Orientation,
PlatformInfo,
ScreenSize,
MediaQueryOptions,
// 兼容层类型
ResponsiveInfo,
} from '../presentation/hooks/responsive';
// ==================== 旧版响应式 Hooks (保持向后兼容) ====================
// 注意:这些导出将在未来版本中移除,请使用新的 hooks
export {
BREAKPOINTS as BREAKPOINTS_OLD,
FINE_BREAKPOINTS as FINE_BREAKPOINTS_OLD,
} from './useResponsive';
export type {
ResponsiveInfo as ResponsiveInfo_OLD,
BreakpointKey as BreakpointKey_OLD,
BreakpointValue as BreakpointValue_OLD,
FineBreakpointKey as FineBreakpointKey_OLD,
ResponsiveValue as ResponsiveValue_OLD,
} from './useResponsive';
// ==================== 其他 Hooks ====================
export {
usePrefetch,
prefetchPosts,
prefetchConversations,
prefetchUserInfo,
prefetchOnAppLaunch,
prefetchMessageScreen,
prefetchHomeScreen,
} from './usePrefetch';
// ==================== 分页 Hooks ====================
export {
usePagination,
usePaginationManager,
} from './usePagination';
export type {
UsePaginationOptions,
UsePaginationReturn,
} from './usePagination';
// ==================== 游标分页 Hooks ====================
export { useCursorPagination } from './useCursorPagination';
// ==================== 连接状态 Hooks ====================
export { useConnectionState } from './useConnectionState';
export type { UseConnectionStateResult } from './useConnectionState';
// ==================== 媒体缓存 Hooks ====================
export { useMediaCache } from './useMediaCache';
export type { UseMediaCacheReturn } from './useMediaCache';
// ==================== 差异更新 Hooks ====================
export { useDifferentialMessages } from './useDifferentialMessages';
export type {
UseDifferentialMessagesOptions,
UseDifferentialMessagesResult,
} from './useDifferentialMessages';
export { useDifferentialPosts } from './useDifferentialPosts';
export type {
UseDifferentialPostsOptions,
UseDifferentialPostsResult,
DiffUpdatesInfo,
} from './useDifferentialPosts';