vanillajs-browser-helpers
Version:
Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS in the browser
26 lines (25 loc) • 572 B
TypeScript
interface BoxModelSectionMapping {
top: number;
left: number;
bottom: number;
right: number;
}
interface BoxModelMapping {
margin: BoxModelSectionMapping;
padding: BoxModelSectionMapping;
border: BoxModelSectionMapping;
}
/**
* Parses the box model numbers of an given Element (margin, padding and border widths)
*
* @param elm - The element to parse numbers from
* @returns The mapping of the box model
*
* @example
*
* ```ts
* boxModel(someDiv);
* ```
*/
export default function boxModel(elm: Element): BoxModelMapping;
export {};