mono/packages/ui/dist-lib/contexts/FeedCacheContext.d.ts
babayaga 7f63b07df5 lib
2026-01-20 12:14:45 +01:00

20 lines
585 B
TypeScript

import { default as React } from 'react';
import { FeedPost } from '../lib/db';
interface FeedCacheState {
posts: FeedPost[];
page: number;
hasMore: boolean;
scrollY: number;
timestamp: number;
}
interface FeedCacheContextType {
saveCache: (key: string, state: Omit<FeedCacheState, 'timestamp'>) => void;
getCache: (key: string) => FeedCacheState | null;
clearCache: (key?: string) => void;
}
export declare const FeedCacheProvider: React.FC<{
children: React.ReactNode;
}>;
export declare const useFeedCache: () => FeedCacheContextType;
export {};