@chasi/ui
Advanced tools
Comparing version 0.1.50 to 0.1.51
@@ -10,5 +10,5 @@ type ObserverParams = { | ||
} | ||
export default function (node: HTMLElement, { onIntersect, once }: ObserverParams): { | ||
export default function (node: HTMLElement | SVGElement, { onIntersect, once }: ObserverParams): { | ||
destroy: () => void; | ||
}; | ||
export {}; |
@@ -1,6 +0,6 @@ | ||
export default function (node: HTMLElement, option: { | ||
target: string; | ||
export default function (node: HTMLElement | SVGElement, option: { | ||
target: string | Element; | ||
prepend?: boolean; | ||
}): { | ||
destroy: () => void; | ||
destroy(): void; | ||
}; |
export default function (node, option) { | ||
const targetNode = document.querySelector(option.target); | ||
const targetNode = option.target instanceof Element ? option.target : document.querySelector(option.target); | ||
if (!targetNode) | ||
@@ -4,0 +4,0 @@ throw 'Target Element must exist on the DOM'; |
{ | ||
"name": "@chasi/ui", | ||
"version": "0.1.50", | ||
"version": "0.1.51", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
174725