UNPKG

jb-core

Version:

jb design system core modules

23 lines 1.1 kB
/** * add type to event target for easier access to target */ export type EventTypeWithTarget<TEvent, TTarget> = TEvent & { target: TTarget; }; /** * this function will stop event from propagate even in capturing phase and will call handler only if event target is the element */ export declare function listenAndSilentEvent<TEvent extends Event, TTarget>(element: TTarget, eventName: string, handler: (e: TEvent) => void, options?: AddEventListenerOptions): void; /** * create a keyboardEvent based on `e` value and replace them with initObj */ export declare function createKeyboardEvent(eventName: string, e: KeyboardEvent, initObj: KeyboardEventInit): KeyboardEvent; /** * create a InputEvent based on `e` value and replace them with initObj */ export declare function createInputEvent(eventName: string, e: InputEvent, initObj: InputEventInit): InputEvent; /** * create a InputEvent based on `e` value and replace them with initObj */ export declare function createFocusEvent(eventName: string, e: FocusEvent, initObj: FocusEventInit): FocusEvent; //# sourceMappingURL=events.d.ts.map