@goodpie/html-typer
Version:
Types out HTML into a view, supporting vanilla JS
16 lines (15 loc) • 555 B
TypeScript
export interface Chunk {
tagName: string;
classes?: string[];
content?: string;
children?: Chunk[];
}
/**
* Animates the rendering of HTML content by gradually adding text.
*
* @param container - The element to render content into.
* @param html - The HTML string to animate.
* @param speed - The interval in milliseconds between each character.
* @returns A promise that resolves when the animation is complete.
*/
export declare const animateHtmlRendering: (container: HTMLElement, html: string, speed?: number) => Promise<void>;