// Type definitions for @dyna-grid/core v1.1.4 // Project: // Definitions by: zhangkun <> import { GridOptions } from "../../entities/gridOptions"; import { IComponent } from "../../interfaces/iComponent"; import { ColDef, ColGroupDef } from "../../entities/colDef"; import { DyGridRegisteredComponentInput } from "./userComponentRegistry"; import { ISetFilterParams } from "../../interfaces/iSetFilterParams"; import { IRichCellEditorParams } from "../../interfaces/iRichCellEditorParams"; import { ToolPanelDef } from "../../entities/sideBar"; import { DyPromise } from "../../utils"; import { IDateComp, IDateParams } from "../../rendering/dateComponent"; import { IHeaderComp, IHeaderParams } from "../../headerRendering/header/headerComp"; import { IHeaderGroupComp, IHeaderGroupParams } from "../../headerRendering/headerGroup/headerGroupComp"; import { ICellRendererComp, ICellRendererParams, ISetFilterCellRendererParams } from "../../rendering/cellRenderers/iCellRenderer"; import { GroupCellRendererParams } from "../../rendering/cellRenderers/groupCellRenderer"; import { ILoadingOverlayComp, ILoadingOverlayParams } from "../../rendering/overlays/loadingOverlayComponent"; import { INoRowsOverlayComp, INoRowsOverlayParams } from "../../rendering/overlays/noRowsOverlayComponent"; import { ITooltipComp, ITooltipParams } from "../../rendering/tooltipComponent"; import { IFilterComp, IFilterParams, IFilterDef } from "../../interfaces/iFilter"; import { IFloatingFilterComp, IFloatingFilterParams } from "../../filter/floating/floatingFilter"; import { ICellEditorComp, ICellEditorParams } from "../../interfaces/iCellEditor"; import { IToolPanelComp, IToolPanelParams } from "../../interfaces/iToolPanel"; import { IStatusPanelComp, IStatusPanelParams, StatusPanelDef } from "../../interfaces/iStatusPanel"; import { ComponentType } from "./componentTypes"; import { BeanStub } from "../../context/beanStub"; export declare type DefinitionObject = GridOptions | ColDef | ColGroupDef | IFilterDef | ISetFilterParams | IRichCellEditorParams | ToolPanelDef | StatusPanelDef; export declare type DyComponentPropertyInput, TParams> = DyGridRegisteredComponentInput | string | boolean; export declare enum ComponentSource { DEFAULT = 0, REGISTERED_BY_NAME = 1, HARDCODED = 2 } export interface ComponentSelectorResult { component?: string; params?: any; } export interface ComponentClassDef & B, B, TParams> { component: { new (): A; } | { new (): B; } | null; componentFromFramework: boolean; source: ComponentSource; paramsFromSelector: TParams | null; } export declare class UserComponentFactory extends BeanStub { private readonly gridOptions; private readonly dyComponentUtils; private readonly componentMetadataProvider; private readonly userComponentRegistry; private readonly frameworkComponentWrapper; newDateComponent(params: IDateParams): DyPromise | null; newHeaderComponent(params: IHeaderParams): DyPromise | null; newHeaderGroupComponent(params: IHeaderGroupParams): DyPromise | null; newFullWidthGroupRowInnerCellRenderer(params: ICellRendererParams): DyPromise | null; newFullWidthCellRenderer(params: ICellRendererParams, cellRendererType: string, cellRendererName: string): DyPromise | null; newCellRenderer(target: ColDef | IRichCellEditorParams, params: ICellRendererParams, isPinned?: boolean): DyPromise | null; newCellEditor(colDef: ColDef, params: ICellEditorParams): DyPromise | null; newInnerCellRenderer(target: GroupCellRendererParams, params: ICellRendererParams): DyPromise | null; newLoadingOverlayComponent(params: ILoadingOverlayParams): DyPromise | null; newNoRowsOverlayComponent(params: INoRowsOverlayParams): DyPromise | null; newTooltipComponent(params: ITooltipParams): DyPromise | null; newFilterComponent(def: IFilterDef, params: IFilterParams, defaultFilter: string): DyPromise | null; newSetFilterCellRenderer(target: ISetFilterParams, params: ISetFilterCellRendererParams): DyPromise | null; newFloatingFilterComponent(def: IFilterDef, params: IFloatingFilterParams, defaultFloatingFilter: string | null): DyPromise | null; newToolPanelComponent(toolPanelDef: ToolPanelDef, params: IToolPanelParams): DyPromise | null; newStatusPanelComponent(def: StatusPanelDef, params: IStatusPanelParams): DyPromise | null; createAndInitUserComponent, TParams>(definitionObject: DefinitionObject | null, paramsFromGrid: TParams, componentType: ComponentType, defaultComponentName?: string | null, optional?: boolean): DyPromise | null; private addReactHacks; /** * This method creates a component given everything needed to guess what sort of component needs to be instantiated * It takes * @param clazz: The class to instantiate, * @param DyGridParams: Params to be passed to the component and passed by DYNA Grid. This will get merged with any params * specified by the user in the configuration * @param modifyParamsCallback: A chance to customise the params passed to the init method. It receives what the current * params are and the component that init is about to get called for */ createUserComponentFromConcreteClass, TParams>(clazz: { new (): A; }, dyGridParams: TParams): A; /** * This method returns the underlying representation of the component to be created. ie for Javascript the * underlying function where we should be calling new into. In case of the frameworks, the framework class * object that represents the component to be created. * * This method is handy for different reasons, for example if you want to check if a component has a particular * method implemented without having to create the component, just by inspecting the source component * * It takes * @param definitionObject: This is the context for which this component needs to be created, it can be gridOptions * (global) or columnDef mostly. * @param propertyName: The name of the property used in dyna-grid as a convention to refer to the component, it can be: * 'floatingFilter', 'cellRenderer', is used to find if the user is specifying a custom component * @param params: Params to be passed to the dynamic component function in case it needs to be * invoked * @param defaultComponentName: The name of the component to load if there is no component specified */ lookupComponentClassDef & B, B, TParams>(definitionObject: DefinitionObject, propertyName: string, params?: TParams | null, defaultComponentName?: string | null): ComponentClassDef | null; private lookupFromRegisteredComponents; /** * Useful to check what would be the resultant params for a given object * @param definitionObject: This is the context for which this component needs to be created, it can be gridOptions * (global) or columnDef mostly. * @param propertyName: The name of the property used in dyna-grid as a convention to refer to the component, it can be: * 'floatingFilter', 'cellRenderer', is used to find if the user is specifying a custom component * @param paramsFromGrid: Params to be passed to the component and passed by DYNA Grid. This will get merged with any params * specified by the user in the configuration * @returns {TParams} It merges the user dyGridParams with the actual params specified by the user. */ createFinalParams(definitionObject: DefinitionObject, propertyName: string, paramsFromGrid: TParams, paramsFromSelector?: any): TParams; private createComponentInstance; private initComponent; }