Skip to content

Commit

Permalink
fix(types): threshold prop can also be an array of numbers (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkace committed Jul 20, 2023
1 parent 96c67e1 commit 6992399
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ As an alternative to binding the `intersecting` prop, you can listen to the `int
| intersecting | `true` if the observed element is intersecting the viewport | `boolean` | `false` |
| root | Containing element | `null` or `HTMLElement` | `null` |
| rootMargin | Margin offset of the containing element | `string` | `"0px"` |
| threshold | Percentage of element visibile to trigger an event | `number` between 0 and 1 | `0` |
| threshold | Percentage of element visibile to trigger an event | `number` between 0 and 1, or an array of `number`s between 0 and 1 | `0` |
| entry | Observed element metadata | [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry) | `null` |
| observer | `IntersectionObserver` instance | [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) | `null` |

Expand Down
4 changes: 2 additions & 2 deletions types/IntersectionObserver.svelte.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export interface IntersectionObserverProps {

/**
* Percentage of element visibility to trigger an event.
* Value must be between 0 and 1.
* Value must be a number between 0 and 1, or an array of numbers between 0 and 1.
* @default 0
*/
threshold?: number;
threshold?: number | number[];

/**
* Observed element metadata.
Expand Down

0 comments on commit 6992399

Please sign in to comment.