@marshal604/react-game-dialogue
Version:
A React UI library for creating dialogue systems with a game-like interface | 一個專為 React 應用開發的對話系統 UI 套件,提供類遊戲風格的對話介面
31 lines (30 loc) • 649 B
TypeScript
interface TypewriterOptions {
/**
* 打字速度(毫秒/字符)
*/
speed?: number;
/**
* 是否開始打字
*/
startTyping?: boolean;
/**
* 打字完成時的回調
*/
onComplete?: () => void;
/**
* 標點符號停頓時間(毫秒)
*/
punctuationDelay?: Record<string, number>;
}
/**
* 打字機效果鉤子
* @param text 要顯示的文本
* @param options 選項
*/
export declare function useTypewriter(text: string, options?: TypewriterOptions): {
displayText: string;
isComplete: boolean;
complete: () => void;
reset: () => void;
};
export {};