Make option key as optional

This commit is contained in:
Kovács Vince 2017-05-17 11:28:08 +02:00
parent 3fc4d30f76
commit 5fcc2eb15a
2 changed files with 9 additions and 5 deletions

View File

@ -5,3 +5,7 @@ const div = document.getElementById('div-to-measure');
if (div !== null) {
const dimensions = getNodeDimensions(div);
}
if (div !== null) {
const dimensionsWithMargin = getNodeDimensions(div, {margin: true});
}

View File

@ -14,11 +14,11 @@ declare module 'get-node-dimensions' {
}
interface NodeDimensionsOptions {
margin: boolean;
clone: boolean;
display: string;
width: string;
height: string;
margin?: boolean;
clone?: boolean;
display?: string;
width?: string;
height?: string;
}
function getNodeDimensions(element: HTMLElement, options?: NodeDimensionsOptions): NodeDimensions;