import { SelectorType } from '../../types'; export declare const EVENT_DEFAULTS: { bubbles: boolean; cancelable: boolean; }; /** * Thin wrapper around element.dispatchEvent and new CustomEvent */ export declare function dispatch(this: Node | EventTarget, name: string, options?: CustomEventInit): CustomEvent; /** * Backwards compatibility function that hooks into dispatch. */ export declare function fire(element: EventTarget, name: string, options?: CustomEventInit): boolean; export declare function stopEverything(event: Event | CustomEvent): void; export declare const AJAX_EVENTS: { /** * Before the ajax event gets sent. * You can view what data will be sent via: `event.detail.formData` */ ajaxBefore: string; /** * Just prior to sending the fetch request */ ajaxBeforeSend: string; /** * When the fetch request is sent. You can view whats being sent via: * `event.detail.formData` */ ajaxSend: string; /** * When a response error occurs. IE: 400, 404, 422, 500, etc (any status code not between 200 - 299) * The response error can be viewed via: `event.detail.response` */ ajaxResponseError: string; /** * Catches errors with requests such as Network errors. */ ajaxRequestError: string; /** * When a >= 200 and <= 299 response is returned * You can view the full response via: `event.detail.response` */ ajaxSuccess: string; /** * A unified event to catch both Response and Request errors. * You can view the error via: `event.detail.error` * This will also generate an error in your console.log */ ajaxError: string; /** * After any fetch request, regardless of outcome * Does not have any accessible data besides the event itself */ ajaxComplete: string; ajaxStopped: string; ajaxBeforeNavigation: string; }; /** * Delegates events * to a specified parent `element`, which fires event `handler` * for the specified `selector` when an event of `eventType` is triggered * element:: * parent element that will listen for events e.g. document * selector:: * css selector; or an object that has `selector` and `exclude` properties (see: Rails.matches) * eventType:: * string representing the event e.g. 'submit', 'click' * handler:: * the event handler to be called */ export declare function delegate(element: Element, selector: SelectorType, eventType: string, handler: Function): void; //# sourceMappingURL=events.d.ts.map