mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
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.
19 lines
938 B
TypeScript
19 lines
938 B
TypeScript
/**
|
|
* 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>;
|
|
};
|