Remove additional exports of breakpoint symbols.

Restore typedef entries in `Breakpoint` component.
Generate type definitions for `constants.js` and `breakpointObserver.js`.
Validate size passed to `smallerThan`/`largerThan`.
Document `breakpointObserver`/`breakpoints`.
Fix `Breakpoint` component docs/example.
This commit is contained in:
Harald Brunner 2022-02-20 16:50:22 +01:00
commit 213d4debe7
13 changed files with 97 additions and 14 deletions

19
src/Breakpoint/breakpointObserver.d.ts vendored Normal file
View file

@ -0,0 +1,19 @@
/**
* Creates a readable store that returns the current {@link BreakpointSize}.
* It also provides functions for creating derived stores used to do comparisons.
*/
export function breakpointObserver(): {
subscribe: (this: void, run: import("svelte/store").Subscriber<any>, invalidate?: (value?: any) => void) => import("svelte/store").Unsubscriber;
/**
* Returns a store readable store that returns whether the current
* breakpoint is smaller than {@link size}.
* @param {BreakpointSize} size Size to compare against.
*/
smallerThan: (size: BreakpointSize) => import("svelte/store").Readable<boolean>;
/**
* Returns a store readable store that returns whether the current
* breakpoint is larger than {@link size}.
* @param {BreakpointSize} size Size to compare against.
*/
largerThan: (size: BreakpointSize) => import("svelte/store").Readable<boolean>;
};