Skip to content

fix: add type-safe preset names to HapticInput#37

Open
abed-daloopa wants to merge 3 commits intolochie:mainfrom
abed-daloopa:fix/trigger-preset-types
Open

fix: add type-safe preset names to HapticInput#37
abed-daloopa wants to merge 3 commits intolochie:mainfrom
abed-daloopa:fix/trigger-preset-types

Conversation

@abed-daloopa
Copy link
Copy Markdown

@abed-daloopa abed-daloopa commented Apr 6, 2026

Summary

  • HapticInput now uses DefaultPatternName (union of preset keys like "success", "error", "warning", etc.) instead of bare string, giving IDE autocomplete and compile-time safety
  • Exports DefaultPatternName type from the public API
  • Retains runtime guard for unknown preset names as a safety net
image

Test plan

  • Verify trigger("success") autocompletes in IDE
  • Verify trigger("invalid") shows a type error
  • Verify pnpm build passes

HapticInput now includes DefaultPatternName (a union of preset keys like
"success", "error", "warning", etc.) so IDEs provide autocomplete while
still accepting arbitrary strings via (string & {}).
HapticInput now uses DefaultPatternName (a union of preset keys like
"success", "error", "warning", etc.) instead of bare string, giving IDE
autocomplete and compile-time safety. Arbitrary strings are no longer
accepted since there is no custom pattern registration API.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

@abed-daloopa is attempting to deploy a commit to the Lochie Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant