import { BindingEventService } from '@slickgrid-universal/binding'; import type { CancellablePromiseWrapper, Column, ContainerService, CustomDataView, CustomTooltipOption, Formatter, GridOption, RxJsFacade, SharedService, SlickEventData, SlickGrid, Subscription } from '@slickgrid-universal/common'; import { SlickEventHandler } from '@slickgrid-universal/common'; type CellType = 'slick-cell' | 'slick-header-column' | 'slick-headerrow-column'; export declare class SlickCustomTooltip { readonly pluginName = "CustomTooltip"; protected _addonOptions?: CustomTooltipOption; protected _cellAddonOptions?: CustomTooltipOption; protected _cellNodeElm?: HTMLElement; protected _cellType: CellType; protected _cancellablePromise?: CancellablePromiseWrapper; protected _observable$?: Subscription; protected _rxjs?: RxJsFacade | null; protected _sharedService?: SharedService | null; protected _tooltipBodyElm?: HTMLDivElement; protected _tooltipElm?: HTMLDivElement; protected _tooltipTriggerElm?: HTMLElement | null; protected _tooltipId?: string; protected _previousAriaDescribedBy?: string | null; protected _mouseTarget?: HTMLElement | null; protected _hasMultipleTooltips: boolean; protected _defaultOptions: CustomTooltipOption; protected _grid: SlickGrid; protected _eventHandler: SlickEventHandler; protected _hideTooltipTimeout?: any; protected _autoHideTimeout?: any; protected _isMouseOverTooltip: boolean; protected _isGridTooltip: boolean; protected _bindEventService: BindingEventService; constructor(); get addonOptions(): CustomTooltipOption | undefined; get cancellablePromise(): CancellablePromiseWrapper | undefined; get cellAddonOptions(): CustomTooltipOption | undefined; get bodyClassName(): string; get className(): string; get dataView(): CustomDataView; /** Getter for the Grid Options pulled through the Grid Object */ get gridOptions(): GridOption; /** Getter for the grid uid */ get gridUid(): string; get gridUidSelector(): string; get tooltipElm(): HTMLDivElement | undefined; addRxJsResource(rxjs: RxJsFacade): void; init(grid: SlickGrid, containerService: ContainerService): void; dispose(): void; protected handleGlobalMouseOver(event: MouseEvent): void; protected handleGlobalMouseOut(event: MouseEvent): void; protected handleOnMouseLeave(): void; /** * hide (remove) tooltip from the DOM, it will also remove it from the DOM and also cancel any pending requests (as mentioned below). * When using async process, it will also cancel any opened Promise/Observable that might still be pending. */ hideTooltip(): void; getOptions(): CustomTooltipOption | undefined; setOptions(newOptions: CustomTooltipOption): void; /** Clear all timeouts (hide and auto-hide) */ protected clearTimeouts(): void; /** Truncate text if it exceeds maxLength */ protected truncateText(text: string, maxLength?: number): string; /** Find the closest tooltip element based on attributes */ protected findTooltipElement(target: HTMLElement | null): HTMLElement | null; /** * Async process callback will hide any prior tooltip & then merge the new result with the item `dataContext` under a `__params` property * (unless a new prop name is provided) to provice as dataContext object to the asyncPostFormatter. */ protected asyncProcessCallback(asyncResult: any, cell: { row: number; cell: number; }, value: any, columnDef: Column, dataContext: any): void; /** depending on the selector type, execute the necessary handler code */ protected handleOnHeaderMouseOverByType(event: SlickEventData, args: any, selector: CellType): void; protected handleOnMouseOver(event: SlickEventData): Promise; /** * Parse the Custom Formatter (when provided) or return directly the text when it is already a string. * We will also sanitize the text in both cases before returning it so that it can be used safely. */ protected parseFormatterAndSanitize(formatterOrText: Formatter | string | undefined, cell: { row: number; cell: number; }, value: any, columnDef: Column, item: unknown): string; /** * Parse the cell formatter and assume it might be html * then create a temporary html element to easily retrieve the first [title=""] attribute text content * also clear the "title" attribute from the grid div text content so that it won't show also as a 2nd browser tooltip */ protected renderRegularTooltip(formatterOrText: Formatter | string | undefined, cell: { row: number; cell: number; }, value: any, columnDef: Column, item: any): void; protected renderTooltipFormatter(formatter: Formatter | string | undefined, cell: { row: number; cell: number; }, value: any, columnDef: Column, item: unknown, tooltipText?: string, inputTitleElm?: Element | null): void; /** Bind mouseenter/mouseleave events to tooltip when persistOnHover is disabled */ protected bindPersistOnHoverEvents(): void; /** * Reposition the Tooltip to be top-left position over the cell. * By default we use an "auto" mode which will allow to position the Tooltip to the best logical position in the window, also when we mention position, we are talking about the relative position against the grid cell. * We can assume that in 80% of the time the default position is top-right, the default is "auto" but we can also override it and use a specific position. * Most of the time positioning of the tooltip will be to the "top-right" of the cell is ok but if our column is completely on the right side then we'll want to change the position to "left" align. * Same goes for the top/bottom position, Most of the time positioning the tooltip to the "top" but if we are hovering a cell at the top of the grid and there's no room to display it then we might need to reposition to "bottom" instead. */ protected reposition(cell: { row: number; cell: number; }): void; /** Check if element has tooltip attribute (title or data-slick-tooltip) */ protected hasTooltipAttribute(element: HTMLElement | null): boolean; /** * Find title element - returns the element itself if it has a non-empty title attribute, * otherwise queries for a child element with a title attribute */ protected findElementWithTitle(element: HTMLElement): Element | null; /** Swap title attribute to data-slick-tooltip and clear title to prevent native browser tooltip */ protected swapTitleAttribute(element?: Element | null, tooltipText?: string): void; /** * swap and copy the "title" attribute into a new custom attribute then clear the "title" attribute * from the grid div text content so that it won't show also as a 2nd browser tooltip */ protected swapAndClearTitleAttribute(inputTitleElm?: Element | null, tooltipText?: string): void; } export {}; //# sourceMappingURL=slickCustomTooltip.d.ts.map