marcj / css-element-queries

CSS Element-Queries aka Container Queries. High-speed element dimension/media queries in valid css.
http://marcj.github.io/css-element-queries/
MIT License
4.27k stars 487 forks source link

Export Size type for typescript #292

Closed Maximaximum closed 3 years ago

Maximaximum commented 4 years ago

This is not a huge issue, but it would be just a little bit more convenient if the library also exported a Size type within its typings:

export declare interface Size { width: number; height: number; }
export declare type ResizeSensorCallback = (size: Size) => void;

instead of just

export declare type ResizeSensorCallback = (size: { width: number; height: number; }) => void;

The issue is that the type of the ResizeSensorCallback argument sometimes has to be specified explicitly, so this minor change would help to avoid retyping { width: number; height: number; } in such cases

marcj commented 3 years ago

@Maximaximum feel free to create a PR covering this change. 👍

marcj commented 3 years ago

Ops, you already did :D thanks!

Maximaximum commented 3 years ago

@marcj thank you. Could you please give a hint regarding when you plan to reslease a new version containing this change?