import { Size, Coords } from './index'; /** * Calculated sizes of the image */ export interface Pos extends Size, Coords { /** * The initial width of the media element */ sourceWidth: number; /** * The initial width of the media element */ sourceHeight: number; /** * The calculated width */ width: number; /** * The calculated height */ height: number; /** * The x-axis coordinate of the top-left corner */ x: number; /** * The y-axis coordinate of the top-left corner */ y: number; } /** * Size / position algorythms */ export declare type PosRule = 'cover' | 'contain' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center'; /** * Base Properties */ export interface BaseProp { /** * Image source */ source: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement; /** * Size/position algorythm */ rule: PosRule; /** * Scaling */ scale?: number; /** * Source size (if known). This will reduce performance load */ sourceWidth?: number; /** * Source size (if known). This will reduce performance load */ sourceHeight?: number; } /** * Properties base */ export interface SizeProp extends BaseProp, Size { /** * Container width */ width: number; /** * Container height */ height: number; } export interface ContainerProp extends BaseProp { /** * Parent element according to which sizes will be calculated */ container: Element; } export declare type Prop = SizeProp | ContainerProp; /** * Get image size according to the selected rules. * Note that the resources must be loaded before applying sizes to them. */ export declare function getPos(data: Prop): Pos; //# sourceMappingURL=getPos.d.ts.map