@gravatar-com/hovercards
Version:
Add profile hovercards to Gravatar images.
23 lines • 985 B
TypeScript
export type Placement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
type Options = Partial<{
placement: Placement;
offset: number;
autoFlip: boolean;
}>;
interface ReturnValues {
x: number;
y: number;
padding: 'paddingBottom' | 'paddingTop' | 'paddingRight' | 'paddingLeft';
paddingValue: number;
}
/**
* Computes the position of a card relative to a ref element.
*
* @param {HTMLElement} ref - The ref element.
* @param {HTMLDivElement} card - The card element.
* @param {Options} [options={}] - The placement, offset, and auto-flip options.
* @return {ReturnValues} - The computed position values.
*/
export default function computingPosition(ref: HTMLElement, card: HTMLDivElement, { placement, offset, autoFlip }?: Options): ReturnValues;
export {};
//# sourceMappingURL=compute-position.d.ts.map