Skip to content

Commit 1f88e0f

Browse files
committed
chore(intersect): re-expose public typedef
1 parent dab2ff5 commit 1f88e0f

5 files changed

Lines changed: 15 additions & 4 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@svelte-put/intersect': patch
3+
---
4+
5+
re-expose public typedef (following https://github.com/Rich-Harris/dts-buddy/pull/82)

packages/intersect/src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Copyright (c) Quang Phan. All rights reserved. Licensed under the MIT license.
22

33
export * from './intersect.js';
4+
export * from './types.public.js';
5+

packages/intersect/src/intersect.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
* <Component use:intersect/>
8585
* ```
8686
* @param {HTMLElement} node - HTMLElement to observe
87-
* @param {import('./public').IntersectParameter} param - svelte action parameters
88-
* @returns {import('./public').IntersectActionReturn}
87+
* @param {import('./types.public').IntersectParameter} param - svelte action parameters
88+
* @returns {import('./types.public').IntersectActionReturn}
8989
*/
9090
export function intersect(node, param = { enabled: true }) {
9191
let hasIntersect = false;
@@ -98,7 +98,7 @@ export function intersect(node, param = { enabled: true }) {
9898
const y = entries[0].boundingClientRect.y ?? 0;
9999
if (entries.some((e) => !!e.intersectionRatio)) {
100100
const direction = y < previousY ? 'down' : 'up';
101-
/** @type {import('./public').IntersectDetail} */
101+
/** @type {import('./types.public').IntersectDetail} */
102102
const detail = {
103103
observer,
104104
entries,
@@ -159,5 +159,6 @@ export function intersect(node, param = { enabled: true }) {
159159

160160
/**
161161
* Deprecated, use `IntersectParameter` and `IntersectConfig` instead
162-
* @typedef {import('./public').IntersectConfig} IntersectParameters
162+
* @typedef {import('./types.public').IntersectConfig} IntersectParameters
163163
*/
164+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/** to provide typing only, see types.public.d.ts */
2+
export {};
3+

0 commit comments

Comments
 (0)