mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
build(types): copy .d.ts files from src to types (#1218)
This commit is contained in:
parent
4d955900ad
commit
5209f329bd
13 changed files with 90 additions and 22 deletions
32
src/Breakpoint/breakpointObserver.d.ts
vendored
32
src/Breakpoint/breakpointObserver.d.ts
vendored
|
@ -6,17 +6,23 @@ import type { BreakpointSize, BreakpointValue } from "./breakpoints";
|
|||
* It also provides functions for creating derived stores used to do comparisons.
|
||||
*/
|
||||
export function breakpointObserver(): {
|
||||
subscribe: (this: void, run: Subscriber<any>, invalidate?: (value?: any) => void) => 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) => 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) => Readable<boolean>;
|
||||
subscribe: (
|
||||
this: void,
|
||||
run: Subscriber<any>,
|
||||
invalidate?: (value?: any) => void
|
||||
) => 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) => 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) => Readable<boolean>;
|
||||
};
|
||||
|
||||
export default breakpointObserver;
|
||||
|
|
|
@ -78,3 +78,5 @@ function checkSizeValid(size) {
|
|||
if (size in breakpoints == false)
|
||||
throw new Error(`"${size}" is not a valid breakpoint size.`);
|
||||
}
|
||||
|
||||
export default breakpointObserver;
|
||||
|
|
2
src/Breakpoint/breakpoints.d.ts
vendored
2
src/Breakpoint/breakpoints.d.ts
vendored
|
@ -7,3 +7,5 @@ export const breakpoints: Record<BreakpointSize, BreakpointValue>;
|
|||
export type BreakpointSize = "sm" | "md" | "lg" | "xlg" | "max";
|
||||
|
||||
export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584;
|
||||
|
||||
export default breakpoints;
|
||||
|
|
|
@ -9,3 +9,5 @@ export const breakpoints = Object.freeze({
|
|||
xlg: 1312,
|
||||
max: 1584,
|
||||
});
|
||||
|
||||
export default breakpoints;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue