import type { LineData } from "./lines"; import { BottomBar } from "./bottom-bar"; export declare type TermynalOptions = Partial<{ /** * Prefix to use for data attributes. */ prefix: string; /** * Delay before animation, in ms. */ startDelay: number; /** * Delay between each typed character, in ms. */ typeDelay: number; /** * Delay between each line, in ms. */ lineDelay: number; /** * Character to use for cursor, defaults to ▋. */ cursor: string; /** * Don't initialise the animation. */ noInit: boolean; /** * Enable automatic scrolling to the bottom of the terminal until the * user scrolls up. */ autoScroll: boolean; /** * Element containing TerminHTML or user-provided branding */ brandingElement: HTMLElement; }>; /** Generate a terminal widget. */ export declare class Termynal { /** * Outer container for the terminal to where all styling extends. */ container: HTMLElement; /** * Inner container element for only the printed lines. */ linesContainer: HTMLElement; /** * Element for the top bar of the terminal. */ topBar: HTMLElement; /** * Bottom bar of the terminal: contains the element and functions to control it. */ bottomBar: BottomBar; /** * The prefix for attributes to control Termynal, including data-. * Defaults to "data-ty". */ pfx: string; /** * The custom part of the prefix for attributes to control Termynal, excluding data-. * Defaults to "ty". */ customPfx: string; originalStartDelay: number; originalTypeDelay: number; originalLineDelay: number; cursor: string; lines: HTMLElement[]; startDelay: number; typeDelay: number; lineDelay: number; autoScroll: boolean; origAutoScroll: boolean; speedMultiplier: number; copyText: string; /** * * @param container Query selector or container element. * @param options Custom settings. */ constructor(container?: string | HTMLElement, lineData?: LineData[], options?: TermynalOptions); /** * Initialise the widget, get lines, clear container and start animation. */ init(): void; private _wipeLines; private _scrollToBottom; private _toggleAutoScrollBasedOnUserInteraction; private _distanceFromBottom; private _isAtBottom; /** * Start the animation and render the lines depending on their data attributes. */ private _start; private _generateBottomBar; private _generateLinesContainer; private _addLine; /** * Animate a typed line. * @param line - The line element to render. */ private _type; /** * Helper function for animation delays, called with `await`. * @param time - Timeout, in ms. */ private _wait; /** * Converts line data objects into line elements. * * @param lineData - Dynamically loaded lines. * @returns Array of line elements. */ private _lineDataToElements; }