Skip to main content

Type Alias: AmnesiaShortcutsTarget

AmnesiaShortcutsTarget = HTMLElement | Document | Window | "document" | "window" | null

Defined in: shortcuts.tsx:32

Acceptable values for AmnesiaShortcutsProps.target.

  • "window" (the default) — listen on window.
  • "document" — listen on document. Useful when something stops propagation before reaching window.
  • An HTMLElement / Document / Window — listen on that exact target. Useful for region-scoped surfaces (canvas, custom editor).
  • null — do not attach a listener at all.

The string forms are resolved at handler-attach time inside useEffect, so they are SSR-safe — passing "document" from a component that may render on the server will not throw.