ttabs-svelte
Version:
A flexible layout management system with draggable, resizable tiles and tabs for Svelte applications. Like in VSCode
29 lines (28 loc) • 1.02 kB
TypeScript
import type { SizeInfo } from "../types/tile-types";
/**
* Represents the computed size information for an element
*/
export type ComputedSizeInfo = {
/** Unique identifier of the element */
id: string;
/** Calculated size in pixels */
computedSize: number;
/** Indicates whether the element was scaled down to fit in the container */
scaledDown: boolean;
};
/**
* Parses a size value string into a SizeInfo object
* @param size String representation of size (e.g., "100%", "260px")
* @returns Parsed SizeInfo object
*/
export declare function parseSizeValue(size: string): SizeInfo;
/**
* Calculates sizes for a set of elements in a container
* @param containerSize Size of the container in pixels
* @param elements Array of elements with their size information
* @returns Array of calculated sizes in pixels with possible scale indicators
*/
export declare function calculateSizes(containerSize: number, elements: Array<{
id: string;
size: SizeInfo;
}>): Array<ComputedSizeInfo>;