import { SvelteComponentTyped } from "svelte"; import type { HTMLAttributes } from "svelte/elements"; type $RestProps = HTMLAttributes; type $Props = { /** * Specify the aspect ratio. Accepts one of the named ratios, or any * positive `"WxH"` string (decimals allowed, e.g. `"21x9"` or `"2.35x1"`) * for a ratio outside that list. A string that is neither a named ratio * nor a valid positive `WxH` pair falls back to `"2x1"`. * @default "2x1" */ ratio?: "2x1" | "2x3" | "16x9" | "4x3" | "1x1" | "3x4" | "3x2" | "9x16" | "1x2" | `${number}x${number}`; /** * Set to `true` to stretch the slotted content to fill the aspect box * @default false */ fill?: boolean; /** * Align the slotted content along the cross axis. Makes the aspect box a flex container. */ align?: "start" | "center" | "end" | undefined; /** * Justify the slotted content along the main axis. Makes the aspect box a flex container. */ justify?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly" | undefined; /** * Specify the HTML tag to render for the outer element. * @default "div" */ tag?: keyof HTMLElementTagNameMap; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type AspectRatioProps = Omit<$RestProps, keyof $Props> & $Props; export default class AspectRatio extends SvelteComponentTyped< AspectRatioProps, Record, { default: Record } > {}