@cds/core
Version:
Clarity Design System - common components, themes, and utilties
19 lines (18 loc) • 795 B
TypeScript
import { LitElement } from 'lit';
export declare type ResponsiveComponent = LitElement & {
layout: string;
responsive: boolean;
layoutStable: boolean;
};
export interface LayoutConfig {
layouts: string[];
initialLayout: string;
}
export declare function elementResize(element: HTMLElement, callbackFn: () => void, async?: boolean): ResizeObserver;
export declare function elementVisible(element: HTMLElement, callbackFn: () => void): IntersectionObserver;
/**
* Given a ResponsiveComponent this function will loop through a list of layout
* options and change the layout of the component until the components layout
* condition is satisfied.
*/
export declare function calculateOptimalLayout(component: ResponsiveComponent, layoutConfig: LayoutConfig): Promise<boolean>;