// Generated by dts-bundle-generator v6.13.0 import { ComponentType, MutableRefObject, PropsWithChildren, Ref, RefAttributes, RefObject } from 'react'; export type AnimationParameters = { /** * Easing function. * Takes an argument in range [0, 1] and returns value in range [0, 1]. */ easing: (t: number) => number; /** * Animation duration function. * Takes distance in pixels and returns duration in milliseconds. */ duration: (distance: number) => number; }; export type UseEndlessListConfig = { initialItems: T[]; items: T[]; getKey: (item: T) => string; compareItems: (a: T, b: T) => number; handleJump: (abortController: AbortController) => Promise; focusedItem?: T; visibleItemKeys: MutableRefObject>; lastScrolledItem: MutableRefObject; }; export type EndlessListRealItem = { type: "real"; value: TValue; index: number; array: TValue[]; itemKey: string; focused: boolean; }; export type EndlessListPlaceholderItem = { type: "placeholder"; itemKey: string; }; export type EndlessListItem = EndlessListRealItem | EndlessListPlaceholderItem; export declare const useEndlessList: ({ initialItems, items, getKey, focusedItem, compareItems, handleJump, visibleItemKeys, lastScrolledItem, }: UseEndlessListConfig) => EndlessListItem[]; export type ItemComponentProps = Omit, "type">; export type ItemComponentType = ComponentType & RefAttributes>; export type PlaceholderComponentProps = { itemKey: string; }; export type PlaceholderComponentType = ComponentType>; export type Frame = { begin: number; end: number; }; export type KeysOfType = { [K in keyof T]: T[K] extends V ? K : never; }[keyof T]; export type ContainerComponentProps = PropsWithChildren>; export type ItemKey = KeysOfType | ((value: T) => string); export type EndlessListProps = { ItemComponent: ItemComponentType; PlaceholderComponent: PlaceholderComponentType; ContainerComponent: ComponentType; initialItems: TItemType[]; items: TItemType[]; itemKey: ItemKey; triggerDistance: number; onTopReached?: () => void; onBottomReached?: () => void; compareItems: (first: TItemType, second: TItemType) => number; focusedItem?: TItemType; jumpAnimation?: AnimationParameters; canStickToBottom?: boolean; onVisibleFrameChange?: (frame: Frame) => void; containerReference?: Ref; }; export declare const EndlessList: ({ ItemComponent, initialItems, items, itemKey, triggerDistance, onTopReached, onBottomReached, compareItems, PlaceholderComponent, jumpAnimation, focusedItem, ContainerComponent, canStickToBottom, onVisibleFrameChange, containerReference: propsContainerReference, }: EndlessListProps) => import("react/jsx-runtime").JSX.Element; export type VisibleItemsBag = { observer: IntersectionObserver | undefined; visibleItemKeys: MutableRefObject>; }; export declare const useVisibleItems: (containerReference: RefObject, onVisibleItemsChange?: ((items: Set) => void) | undefined) => VisibleItemsBag; export type RChatContextType = { client: ChatClient; MessageComponent: ItemComponentType; PlaceholderComponent: PlaceholderComponentType; ContainerComponent: ComponentType; triggerDistance: number; itemKey: ItemKey; compareItems: (first: TMessageType, second: TMessageType) => number; }; export type ChatProps = PropsWithChildren>; export declare const Chat: ({ children, ...context }: ChatProps) => import("react/jsx-runtime").JSX.Element; export type MessageListProps = { initialMessagesState: MessageFetchResult; initialSearchResult?: MessageSearchResult; jumpAnimation?: AnimationParameters; }; export declare const MessageList: ({ jumpAnimation, initialMessagesState, initialSearchResult, }: MessageListProps) => import("react/jsx-runtime").JSX.Element; export type RoomProps = PropsWithChildren<{ identifier: string; }>; export declare const Room: ({ identifier, children }: RoomProps) => import("react/jsx-runtime").JSX.Element; export type UseMessagesBag = { messages: T[]; onTopReached: () => void; onBottomReached: () => void; noMessagesBefore: boolean; noMessagesAfter: boolean; onVisibleFrameChange: (frame: Frame) => void; containerReference: Ref; focusedItem?: T; }; export type UseMessagesConfig = { initialMessagesState: MessageFetchResult; initialSearchResult?: MessageSearchResult; compareItems: (a: T, b: T) => number; maxChunkSize: number; additionalChunkSize: number; chatClient: ChatClient; roomIdentifier: string; }; export declare const useMessages: ({ maxChunkSize, additionalChunkSize, chatClient, roomIdentifier, compareItems, initialMessagesState, initialSearchResult, }: UseMessagesConfig) => UseMessagesBag; export {};