@ertekinno/human-like
Version:
A sophisticated React typewriter effect library with realistic human typing behavior, mobile/desktop keyboards, and comprehensive theming support
79 lines (78 loc) • 2.15 kB
TypeScript
import { KeySequence, KeyboardState, KeyboardAnalyzerConfig } from './types';
/**
* Analyzes characters and converts them to realistic keyboard key sequences
* Handles both mobile and desktop keyboard behaviors
*/
export declare class KeyboardAnalyzer {
private config;
private layout;
private state;
private timingProfile;
constructor(config?: Partial<KeyboardAnalyzerConfig>);
/**
* Analyzes a character and returns the key sequence needed to type it
*/
analyzeCharacter(character: string, charIndex: number, fullText: string): KeySequence;
/**
* Analyzes mobile keyboard character input
*/
private analyzeMobileCharacter;
/**
* Analyzes desktop keyboard character input
*/
private analyzeDesktopCharacter;
/**
* Determines which keyboard view a character belongs to (mobile)
*/
private getCharacterView;
/**
* Gets the sequence of view switch keys needed
*/
private getViewSwitchSequence;
/**
* Creates a caps lock key press
*/
private createCapsKey;
/**
* Creates a shift key press
*/
private createShiftKey;
/**
* Creates a letter key press
*/
private createLetterKey;
/**
* Creates a character key press
*/
private createCharacterKey;
/**
* Updates recent characters for caps lock detection
*/
private updateRecentCharacters;
/**
* Analyzes whether character is part of a caps lock sequence
* Uses the same logic as the original TypingEngine
*/
private analyzeCapsLockSequence;
/**
* Check if a symbol is considered complex (requires more precise movement)
*/
private isComplexSymbol;
/**
* Debug logging
*/
private debug;
/**
* Reset keyboard state (useful for testing)
*/
resetState(): void;
/**
* Analyzes a backspace key press and returns the key sequence
*/
analyzeBackspace(): KeySequence;
/**
* Get current keyboard state (useful for debugging)
*/
getState(): KeyboardState;
}
//# sourceMappingURL=KeyboardAnalyzer.d.ts.map