import { MaybeAccessor } from '@solidjs-use/shared'; type KeyPredicate = (event: KeyboardEvent) => boolean; type KeyFilter = true | string | string[] | KeyPredicate; type KeyStrokeEventName = 'keydown' | 'keypress' | 'keyup'; interface OnKeyStrokeOptions { eventName?: KeyStrokeEventName; target?: MaybeAccessor; passive?: boolean; /** * Set to `true` to ignore repeated events when the key is being held down. * * @default false */ dedupe?: MaybeAccessor; } declare function onKeyStroke(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): () => void; declare function onKeyStroke(handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): () => void; /** * Listen for keyboard keys being stroked. */ declare function onKeyStroke(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): () => void; declare function onKeyStroke(handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): () => void; /** * Listen to the keydown event of the given key. * * @see https://solidjs-use.github.io/solidjs-use/core/onKeyDown */ declare function onKeyDown(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: Omit): () => void; /** * Listen to the keypress event of the given key. */ declare function onKeyPressed(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: Omit): () => void; /** * Listen to the keyup event of the given key. */ declare function onKeyUp(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: Omit): () => void; export { KeyFilter, KeyPredicate, KeyStrokeEventName, OnKeyStrokeOptions, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp };