diff --git a/packages/vaul-svelte/src/lib/components/drawer/types.ts b/packages/vaul-svelte/src/lib/components/drawer/types.ts index 93ababe..a2c1b0b 100644 --- a/packages/vaul-svelte/src/lib/components/drawer/types.ts +++ b/packages/vaul-svelte/src/lib/components/drawer/types.ts @@ -1,7 +1,6 @@ import type { Dialog as DialogPrimitive, PrimitiveDivAttributes, WithChild } from "bits-ui"; import type { WithChildren, Without } from "svelte-toolbelt"; -import type { DrawerDirection, OnChangeFn } from "$lib/types.js"; -import type { OnDrag, OnRelease } from "$lib/vaul.svelte.js"; +import type { DrawerDirection, OnChangeFn, OnDrag, OnRelease } from "$lib/types.js"; export type BaseDrawerRootPropsWithoutHTML = WithChildren<{ /** diff --git a/packages/vaul-svelte/src/lib/index.ts b/packages/vaul-svelte/src/lib/index.ts index 57a6210..4431be8 100644 --- a/packages/vaul-svelte/src/lib/index.ts +++ b/packages/vaul-svelte/src/lib/index.ts @@ -1,2 +1,4 @@ export * from "./components/index.js"; +export * from "./components/drawer/index.js"; export * from "./types.js"; +export type { OnDrag, OnRelease } from "./vaul.svelte.js"; diff --git a/packages/vaul-svelte/src/lib/types.ts b/packages/vaul-svelte/src/lib/types.ts index f5943db..cb2ff71 100644 --- a/packages/vaul-svelte/src/lib/types.ts +++ b/packages/vaul-svelte/src/lib/types.ts @@ -1,3 +1,5 @@ export type * from "./components/drawer/types.js"; export type DrawerDirection = "left" | "right" | "top" | "bottom"; export type OnChangeFn = (value: T) => void; +export type OnDrag = (event: PointerEvent, percentageDragged: number) => void; +export type OnRelease = (event: PointerEvent, open: boolean) => void; diff --git a/packages/vaul-svelte/src/lib/vaul.svelte.ts b/packages/vaul-svelte/src/lib/vaul.svelte.ts index 22d9b08..cbea141 100644 --- a/packages/vaul-svelte/src/lib/vaul.svelte.ts +++ b/packages/vaul-svelte/src/lib/vaul.svelte.ts @@ -15,6 +15,7 @@ import { PositionFixed } from "./position-fixed.svelte.js"; import { createContext } from "./internal/createContext.js"; import { noop } from "./internal/helpers/noop.js"; import { SnapPoints } from "./snap-points.svelte.js"; +import type { DrawerDirection, OnDrag, OnRelease } from "./types.js"; export const DEFAULT_CLOSE_THRESHOLD = 0.25; export const DEFAULT_SCROLL_LOCK_TIMEOUT = 100; @@ -23,12 +24,6 @@ const NESTED_DISPLACEMENT = 16; const WINDOW_TOP_OFFSET = 26; const DRAG_CLASS = "vaul-dragging"; -export type DrawerDirection = "left" | "right" | "top" | "bottom"; - -export type OnDrag = (event: PointerEvent, percentageDragged: number) => void; -export type OnReleaseEvent = PointerEvent | MouseEvent | TouchEvent; -export type OnRelease = (event: PointerEvent, open: boolean) => void; - type DrawerRootStateProps = ReadableBoxedValues<{ closeThreshold: number; shouldScaleBackground: boolean; diff --git a/packages/vaul-svelte/tsconfig.json b/packages/vaul-svelte/tsconfig.json index 43ef443..0c1dbb2 100644 --- a/packages/vaul-svelte/tsconfig.json +++ b/packages/vaul-svelte/tsconfig.json @@ -9,8 +9,8 @@ "skipLibCheck": true, "sourceMap": true, "strict": true, - "module": "NodeNext", "moduleResolution": "NodeNext", + "module": "NodeNext", "verbatimModuleSyntax": true } }