@towns-protocol/react-sdk
Version:
React Hooks for Towns Protocol SDK
27 lines • 1.05 kB
TypeScript
import { type MessageTimeline } from '@towns-protocol/sdk';
import { type ActionConfig } from './internals/useAction';
/**
* Hook to get the scrollback action for a stream.
*
* Scrollback is the action of getting miniblocks from a stream before a certain point in time.
* Getting miniblocks means that new events that are possibly new messages, reactions and so on are fetched.
*
* @param streamId - The id of the stream to get the scrollback action for.
* @param config - Configuration options for the action.
* @returns The `scrollback` action and its loading state.
*/
export declare const useScrollback: (streamId: string, config?: ActionConfig<MessageTimeline["scrollback"]>) => {
data: {
terminus: boolean;
fromInclusiveMiniblockNum: bigint;
} | undefined;
error: Error | undefined;
isPending: boolean;
isSuccess: boolean;
isError: boolean;
scrollback: () => Promise<{
terminus: boolean;
fromInclusiveMiniblockNum: bigint;
}>;
};
//# sourceMappingURL=useScrollback.d.ts.map