diff --git a/lib/types.ts b/lib/types.ts index 8c0b660..28ed33e 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -101,7 +101,7 @@ type Options = { }; type CustomShadow = { - el: HTMLElement; + el: HTMLElement | null; /** * The drag offset from the top left corner of the element. * @default { x: 0, y: 0 } @@ -111,8 +111,10 @@ type CustomShadow = { type EventHandler = ( event: Event, - context: Pick & - Partial>, + context: Pick< + Context, + "origin" | "zone" | "zones" | "originZone" | "shadow" | "multiple" + >, ) => T; export { Context, Options }; diff --git a/lib/utils.ts b/lib/utils.ts index a1d0520..e20d99b 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -5,10 +5,11 @@ const isElement = (target: EventTarget | null): target is HTMLElement => { }; const getContext = (context: Context) => { - const { origin, zone, shadow, multiple, zones } = context; + const { origin, zone, originZone, shadow, multiple, zones } = context; return { origin, + originZone, zone, shadow, multiple,