Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yamada-ui/use-event-listener

Package Overview
Dependencies
Maintainers
0
Versions
545
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yamada-ui/use-event-listener - npm Package Compare versions

Comparing version 1.0.21 to 1.0.22-dev-20241006000212

8

dist/index.d.ts

@@ -1,8 +0,8 @@

type Events = keyof DocumentEventMap | keyof WindowEventMap | keyof GlobalEventHandlersEventMap;
type Target = EventTarget | null | (() => EventTarget | null);
type Options = boolean | AddEventListenerOptions;
type Events = keyof DocumentEventMap | keyof GlobalEventHandlersEventMap | keyof WindowEventMap;
type Target = (() => EventTarget | null) | EventTarget | null;
type Options = AddEventListenerOptions | boolean;
type Handler<E extends Events> = E extends keyof DocumentEventMap ? (event: DocumentEventMap[E]) => void : E extends keyof WindowEventMap ? (event: WindowEventMap[E]) => void : E extends keyof GlobalEventHandlersEventMap ? (event: GlobalEventHandlersEventMap[E]) => void : ((event: Event) => void) | undefined;
declare const useEventListener: <E extends Events>(target: Target, event: E, handler: Handler<E>, options?: Options) => () => void;
declare const useEventListeners: () => {
add: <E extends Events>(el: EventTarget, event: E, listener: any, options: boolean | AddEventListenerOptions) => void;
add: <E extends Events>(el: EventTarget, event: E, listener: any, options: AddEventListenerOptions | boolean) => void;
remove: <E extends Events>(el: EventTarget, event: E, listener: any, options: boolean | EventListenerOptions) => void;

@@ -9,0 +9,0 @@ };

@@ -34,3 +34,3 @@ "use client"

const el = typeof target === "function" ? target() : target != null ? target : document;
if (!handler || !el) return;
if (!el) return;
el.addEventListener(

@@ -63,3 +63,3 @@ event,

(el, event, listener, options) => {
listeners.current.set(listener, { event, el, options });
listeners.current.set(listener, { el, event, options });
el.addEventListener(

@@ -66,0 +66,0 @@ event,

{
"name": "@yamada-ui/use-event-listener",
"version": "1.0.21",
"version": "1.0.22-dev-20241006000212",
"description": "Yamada UI useEventListener custom hook",

@@ -28,3 +28,3 @@ "keywords": [

"dependencies": {
"@yamada-ui/utils": "1.5.2"
"@yamada-ui/utils": "1.5.3-dev-20241006000212"
},

@@ -31,0 +31,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc