import { Dimension, Insets, Point, Rectangle } from '../index'; export interface PrefSizeOptions { /** * When set to true the returned dimensions may contain fractional digits, otherwise the sizes are rounded up. Default is false. */ exact?: boolean; /** * Whether to include the margins in the returned size. Default is false. */ includeMargin?: boolean; /** * If true, the width and height properties are set to '' while measuring, thus allowing existing CSS rules to influence the sizes. * If set to false, the sizes are set to 'auto' or the corresponding hint values. Default is false. */ useCssSize?: boolean; /** * If useCssSize is false, this value is used as width (in pixels) instead of 'auto'. * Useful to get the preferred height for a given width. */ widthHint?: number; /** * Same as 'widthHint' but for the height. */ heightHint?: number; /** * Sets min/max-width/height in addition to with width/height if widthHint resp. heightHint is set. * The browser sometimes makes the element smaller or larger than specified by width/height, especially in a flex container. * To prevent that, set this option to true. Default is false, but may change in the future. */ enforceSizeHints?: boolean; /** * By default, the $elem's scrolling position is saved and restored during the execution of this method (because applying * intermediate styles for measurement might change the current position). If the calling method does that itself, you should * set this option to false in order to prevent overriding the stored scrolling position in $elem's data attributes. Default is true. */ restoreScrollPositions?: boolean; /** * If set, the $elem is checked for one of these classes. * If one of these classes is currently set on the $elem, a clone of the $elem without the classes is created and measured instead. See also {@link prefSizeWithoutAnimation}. */ animateClasses?: string[]; } export interface SizeOptions { /** * When set to true the returned dimensions may contain fractional digits, otherwise the sizes are rounded up. Default is false. */ exact?: boolean; /** * Whether to include the margins in the returned size. Default is false. */ includeMargin?: boolean; } export interface InsetsOptions { /** * Whether to include the margins in the returned insets. Default is false. */ includeMargin?: boolean; /** * Whether to include the paddings in the returned insets. Default is true. */ includePadding?: boolean; /** * Whether to include the borders in the returned insets. Default is true. */ includeBorder?: boolean; } export interface BoundsOptions { /** * When set to true the returned size may contain fractional digits, otherwise the sizes are rounded up. X and Y are not affected by this option. Default is false. */ exact?: boolean; /** * Whether to include the margins in the returned size. X and Y are not affected by this option. Default is false. */ includeMargin?: boolean; } declare function setBounds($comp: JQuery, x: number, y: number, width: number, height: number): any; declare function setBounds($comp: JQuery, bounds: Rectangle): any; declare function setSize($comp: JQuery, width: number, height: number): any; declare function setSize($comp: JQuery, size: Dimension): any; declare function setLocation($comp: JQuery, x: number, y: number): any; declare function setLocation($comp: JQuery, location: Point): any; /** * Helpers for graphical operations */ export declare const graphics: { /** * Returns the preferred size of $elem. * * Precondition: $elem and its parents must not be hidden ('display: none' - other styles like 'visibility: hidden' * or 'opacity: 0' would be ok because in this case the browser reserves the space the element would be using). * * The `style` and `class` properties are temporarily altered to allow the element to assume its "natural size". * A marker CSS class `measure` is added that can be used to reset element-specific CSS constraints (e.g. flexbox). * * @param $elem * the jQuery element to measure * @param options * an optional options object. Shorthand version: If a boolean is passed instead * of an object, the value is automatically converted to the option "includeMargin". */ prefSize($elem: JQuery, options?: PrefSizeOptions | boolean): Dimension; /** * Ensure resulting numbers are integers. getBoundingClientRect() might correctly return fractional values * (because of the browser's sub-pixel rendering). However, if we use those numbers to set the size * of an element using CSS, it gets rounded or cut off. The behavior is not defined amongst different * browser engines. *
* Example: * - Measured size from this method: h = 345.239990234375 * - Set the size to an element: $elem.css('height', h + 'px') * - Results: * Firefox & Chrome