import AssistedSearchStore from './AssistedSearchStore'; import { SyntheticEvent } from 'react'; /** * Manages user events and translates them into one or more actions performed on the store */ export default class UserEventDispatcher { private readonly store; _handler: any; handler: (e: SyntheticEvent) => any; constructor(store: AssistedSearchStore); private _before; /** Delegates the "home" key function to the store */ home: (e: SyntheticEvent) => void; /** Delegates the "end" key function to the store */ end: (e: SyntheticEvent) => void; /** * If not all text selected, select all text. * If all text selected, select all entries. * @param {SyntheticEvent} e */ selectAll: (e: SyntheticEvent) => void; /** move up a page (of dropdown items) */ pageUp: (e: SyntheticEvent) => void; /** move down a page (of dropdown items) */ pageDown: (e: SyntheticEvent) => void; /** move down (dropdown item) */ up: (e: SyntheticEvent) => void; /** move down (dropdown item) */ down: (e: SyntheticEvent) => void; /** * Moves to the left. * * @param {SyntheticEvent} e */ left: (e: SyntheticEvent) => void; /** move to the right (text|entry) */ right: (e: SyntheticEvent) => void; /** * Select or commit the current value to the input. * * We will do the default browser behavior (lose focus) if no value is selected in the dropdown and no value is in * the input. * * @param e */ tab: (e: SyntheticEvent) => void; /** * Leave the current context * Will deselect the selected items, or remove the dropdown * @param {SyntheticEvent} e */ escape: (e: SyntheticEvent) => void; /** An override to enter, if in faceted mode, will accept value as an faceted value */ enter: (e: SyntheticEvent) => void; /** * "Windows" Delete * If cursor != end, delete characaters * If cursor = end and in entry input, delete next entry * If cursor = end and in main input, do nothing */ del: () => void; /** * If cursor != 0, or text selected, delete characters * If cursor = 0 and no text selected, delete entry behind us * If no entry behind us, do nothing */ backspace: (e: SyntheticEvent) => void; /** * Is true if the target is a valid input generated for react-assisted-search * @private */ private _isInput; /** * Toggle the selected status of the highlighted item in the dropdown */ space(): void; }