UNPKG

@smkit/ui

Version:

UI Kit of SberMarketing

23 lines (22 loc) 893 B
export declare enum ITooltipMode { FollowCursor = "followCursor", FollowElement = "followElement", TopOfElement = "topOfElement", RightOfElement = "rightOfElement", LeftOfElement = "leftOfElement", BottomOfElement = "bottomOfElement" } export type Mode = 'cursor' | 'element'; export type Position = 'top' | 'bottom' | 'left' | 'right'; export type Animations = 'gelatine' | 'fade' | 'blur'; export type Axis = 'x' | 'y'; export type CalculationsHandler = (targetElement: HTMLElement, targetElementRect: DOMRect, scroll: number, tooltopElement: HTMLElement, position: Position) => number; export interface ITooltipPosition { x: number; y: number; } export interface WindowScroll { x: number; y: number; } export type PositionHandler = (tooltipElement: HTMLElement, position: Position, evt: MouseEvent, scroll?: WindowScroll) => ITooltipPosition | null;