@convex-dev/agent
Version:
A agent component for Convex.
20 lines • 758 B
TypeScript
/**
* A hook that smoothly displays text as it is streamed.
*
* @param text The text to display. Pass in the full text each time.
* @param charsPerSec The number of characters to display per second.
* @returns A tuple of the visible text and the state of the smooth text,
* including the current cursor position and whether it's still streaming.
* This allows you to decide if it's too far behind and you want to adjust
* the charsPerSec or just prefer the full text.
*/
export declare function useSmoothText(text: string, { charsPerSec, }?: {
/**
* The number of characters to display per second.
*/
charsPerSec?: number;
}): [string, {
cursor: number;
isStreaming: boolean;
}];
//# sourceMappingURL=useSmoothText.d.ts.map