Human-Like
Usage

API Index

Complete searchable index for all Human-Like APIs

Use this page to find any prop, callback, hook method, or config key fast. Each item links to its canonical section.

Component Props

Event Callbacks

  • onStart – Typing started → Events
  • onComplete – Typing finished → Events
  • onChar – Character typed → Events
  • onMistake – Mistake made → Events
  • onBackspace – Backspace pressed → Events
  • onPause – Typing paused → Events
  • onResume – Typing resumed → Events
  • onKey – Key pressed → Events
  • onStateChange – State changed → Events
  • onKeyboardReset – Keyboard reset → Events
  • onError – Error occurred → Events

Hook Methods

Hook Return Values

Display State

  • displayText (string) – Current typed text → Hook API
  • isTyping (boolean) – Currently typing → Hook API
  • isPaused (boolean) – Currently paused → Hook API
  • isCompleted (boolean) – Finished typing → Hook API
  • currentState (TypingState) – Detailed state → Hook API

Progress & Performance

  • progress (number) – Progress 0-100 → Hook API
  • currentWPM (number) – Words per minute → Hook API
  • mistakeCount (number) – Total mistakes → Hook API
  • totalDuration (number) – Time elapsed (ms) → Hook API

Cursor State & Control

  • showCursor (boolean) – Cursor visibility → Hook API
  • cursorChar (string) – Cursor character → Hook API
  • cursorBlinkSpeed (number) – Blink speed → Hook API
  • setCursorVisible (function) – Set cursor visibility → Hook API
  • setCursorChar (function) – Set cursor character → Hook API
  • setCursorBlinkSpeed (function) – Set blink speed → Hook API

Configuration Keys

Core Timing

Platform & Mistakes

  • keyboardMode ('mobile'|'desktop') – Platform → Configuration
  • mistakeFrequency (number) – Error probability → Configuration
  • mistakeTypes (object) – Enabled mistake kinds → Configuration

Human Behavior

  • fatigueEffect (boolean) – Gradual slowdown → Configuration
  • concentrationLapses (boolean) – Random pauses → Configuration
  • overcorrection (boolean) – Correction mistakes → Configuration

Advanced Timing

  • sentencePause (number) – Pause after . ! ? → Configuration
  • wordPause (number) – Pause between words → Configuration
  • thinkingPause (number) – Pause before complex words → Configuration
  • backspaceSpeed (number) – Correction speed → Configuration
  • realizationDelay (number) – Time to notice mistakes → Configuration
  • correctionPause (number) – Pause before retyping → Configuration

Development

Constants & Utilities

Timing Constants

  • TIMING_CONSTANTS.BASE_SPEED – Default typing speed → Constants
  • TIMING_CONSTANTS.SPEED_VARIATION – Random variation → Constants
  • TIMING_CONSTANTS.SENTENCE_PAUSE – Pause after sentences → Constants
  • TIMING_CONSTANTS.WORD_SPACE – Pause between words → Constants
  • TIMING_CONSTANTS.BACKSPACE_SPEED – Correction speed → Constants
  • TIMING_CONSTANTS.THINKING_PAUSE – Complex word pauses → Constants

Behavior Constants

  • BEHAVIOR_RATES.MISTAKE_FREQUENCY – Base mistake rate → Constants
  • BEHAVIOR_RATES.CONCENTRATION_LAPSE – Random pause rate → Constants
  • BEHAVIOR_RATES.BURST_TYPING – Rapid sequence rate → Constants
  • BEHAVIOR_RATES.OVERCORRECTION_RATE – Correction mistake rate → Constants

Adjacent Key Maps

  • DESKTOP_ADJACENT – QWERTY adjacent keys → Constants
  • MOBILE_ADJACENT – Touch-optimized keys → Constants
  • QWERTY_ADJACENT – Legacy desktop keys → Constants
  • getAdjacentKeys(mode) – Get platform keys → Constants

Specialized Constants

  • COMMON_TYPOS – Real-world typo mapping → Constants
  • SPECIAL_CHARS – Special character set → Constants
  • SHIFT_CHARS – Shift-requiring characters → Constants
  • NUMBER_CHARS – Number character set → Constants
  • DEFAULT_CONFIG – Complete default config → Constants

Keyboard Components

TypeScript Types

Core Interfaces

  • HumanLikeProps – Component props interface → Types
  • HumanLikeHookOptions – Hook options interface → Types
  • HumanLikeHookReturn – Hook return interface → Types
  • HumanLikeConfig – Configuration interface → Types

Event & State Types

  • MistakeInfo – Mistake event data → Types
  • KeyInfo – Key press event data → Types
  • StateChangeEvent – State transition data → Types
  • ErrorEvent – Error event data → Types
  • TypingState – Typing state enum → Types

Utility Types

  • Platform – Platform detection type → Types
  • KeyType – Key classification type → Types
  • MistakeType – Mistake classification → Types
  • KeyboardView – Keyboard view enum → Types
  • ShiftState – Shift key state enum → Types

Type Guards

  • isTypingState() – Type guard for states → Types
  • isMistakeType() – Type guard for mistakes → Types
  • isKeyType() – Type guard for key types → Types