import type { IComponent } from '../../agStack/interfaces/iComponent'; import type { AgGridCommon } from '../../interfaces/iCommon'; import { Component } from '../../widgets/component'; export type OverlayType = 'loading' | 'noRows' | 'noMatchingRows' | 'exporting'; interface ProvidedOverlayUserParams { /** * Override the default text of the provided overlay. */ overlayText?: string; } export interface LoadingOverlayUserParams extends ProvidedOverlayUserParams { } export interface ExportingOverlayUserParams extends ProvidedOverlayUserParams { } export interface NoRowsOverlayUserParams extends ProvidedOverlayUserParams { } export interface NoMatchingRowsOverlayUserParams extends ProvidedOverlayUserParams { } export interface ILoadingOverlayParams extends AgGridCommon { /** * The default overlay the grid would show in the given state. */ overlayType: 'loading'; } export interface IExportingOverlayParams extends AgGridCommon { /** * The default overlay the grid would show in the given state. */ overlayType: 'exporting'; } export interface INoRowsOverlayParams extends AgGridCommon { /** * The default overlay the grid would show in the given state. */ overlayType: 'noRows'; } export interface INoMatchingRowsOverlayParams extends AgGridCommon { /** * The default overlay the grid would show in the given state. */ overlayType: 'noMatchingRows'; } /** * Parameters available to configure the provided overlays. */ export interface OverlayComponentUserParams { /** Parameters to customise the provided loading overlay. */ loading?: LoadingOverlayUserParams; /** Parameters to customise the provided no-rows overlay. */ noRows?: NoRowsOverlayUserParams; /** Parameters to customise the provided no-matching-rows overlay. */ noMatchingRows?: NoMatchingRowsOverlayUserParams; /** Parameters to customise the provided exporting overlay. */ exporting?: ExportingOverlayUserParams; } export type IOverlayParams = ILoadingOverlayParams | IExportingOverlayParams | INoRowsOverlayParams | INoMatchingRowsOverlayParams; export interface IOverlay> = IOverlayParams> { /** * Gets called when the `overlayComponentParams` grid option is updated */ refresh?(params: TParams): void; } export interface IOverlayComp> = IOverlayParams> extends IComponent, IOverlay { } export declare abstract class OverlayComponent> = IOverlayParams> extends Component implements IOverlayComp { constructor(); abstract init(params: IOverlayParams): void; } export type OverlaySelectorFunc = (params: IOverlayParams) => OverlaySelectorResult | undefined; export interface OverlaySelectorResult { /** Equivalent of setting `gridOptions.overlayComponent`. */ component?: any; /** Equivalent of setting `gridOptions.overlayComponentParams` */ params?: any; } export {};