Skip to content

Commit

Permalink
Better typings
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodevx committed Mar 6, 2023
1 parent cb2b137 commit 1432695
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/FxParallax.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export { classes as class }
* - value of 0 effectively makes the element scroll fixed with the page
*/
export let factor = 0.75
/** @type {Object|undefined} bindable reference to this component */
/** @type {HTMLImageElement|undefined} bindable reference to <img> element */
export let ref = undefined
let mounted = false
Expand Down
2 changes: 1 addition & 1 deletion src/lib/FxReveal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { onMount } from 'svelte'
/** @type {Object[]} imagetools import */
export let src = []
/** @type {Object|undefined} bindable reference to this component */
/** @type {HTMLImageElement|undefined} bindable reference to <img> element */
export let ref = undefined
let sources = []
Expand Down
2 changes: 1 addition & 1 deletion src/lib/SvelteImg.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export let height = undefined
export let loading = 'lazy'
/** @type {'async'|'auto'|'sync'} */
export let decoding = 'async'
/** @type {Object|undefined} bindable reference to this component */
/** @type {HTMLImageElement|undefined} bindable reference to <img> element */
export let ref = undefined
const priority = ['heic', 'heif', 'avif', 'webp', 'jpeg', 'jpg', 'png', 'gif', 'tiff']
Expand Down
2 changes: 2 additions & 0 deletions src/lib/_observe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @type {IntersectionObserver} */
let observer

/** @param {Element} node */
export default function (node) {
observer =
observer ||
Expand Down

0 comments on commit 1432695

Please sign in to comment.