@dvcol/neo-svelte
Version:
Neomorphic ui library for svelte 5
10 lines (9 loc) • 817 B
TypeScript
export type SizeValue<Size extends 'width' | 'height' = 'width' | 'height'> = `${number}px` | Size extends 'width' ? CSSStyleDeclaration['width'] : Size extends 'height' ? CSSStyleDeclaration['height'] : CSSStyleDeclaration['height'] | CSSStyleDeclaration['width'];
export type SizeOption<Size extends 'width' | 'height' = 'width' | 'height', Value = SizeValue<Size>> = {
absolute?: Value;
min?: Value;
max?: Value;
};
export type SizeInput<Size extends 'width' | 'height' = 'width' | 'height'> = number | SizeValue<Size> | SizeOption<Size, number | SizeValue<Size>>;
export declare const toPixel: (value?: number | string) => string | undefined;
export declare const toSize: <Size extends "width" | "height" = "width" | "height">(size?: SizeInput<Size>) => SizeOption<Size, SizeValue<Size>> | undefined;