UNPKG

1.32 kBTypeScriptView Raw
1// Type definitions for ag-grid v18.1.2
2// Project: http://www.ag-grid.com/
3// Definitions by: Niall Crosby <https://github.com/ag-grid/>
4import { Promise } from "../utils";
5export interface IAfterGuiAttachedParams {
6 hidePopup: () => void;
7}
8export interface IComponent<T> {
9 /** Return the DOM element of your editor, this is what the grid puts into the DOM */
10 getGui(): HTMLElement;
11 /** Gets called once by grid after editing is finished - if your editor needs to do any cleanup, do it here */
12 destroy?(): void;
13 /** A hook to perform any necessary operation just after the gui for this component has been renderer
14 in the screen.
15 If the filter popup is closed and reopened, this method is called each time the filter is shown.
16 This is useful for any
17 logic that requires attachment before executing, such as putting focus on a particular DOM
18 element. The params has one callback method 'hidePopup', which you can call at any later
19 point to hide the popup - good if you have an 'Apply' button and you want to hide the popup
20 after it is pressed. */
21 afterGuiAttached?(params?: IAfterGuiAttachedParams): void;
22 /** The init(params) method is called on the filter once. See below for details on the parameters. */
23 init?(params: T): Promise<void> | void;
24}