userComponentRegistry.d.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { IComponent } from "../../interfaces/iComponent";
  2. import { BeanStub } from "../../context/beanStub";
  3. export declare enum RegisteredComponentSource {
  4. DEFAULT = 0,
  5. REGISTERED = 1
  6. }
  7. /**
  8. * B the business interface (ie IHeader)
  9. * A the agGridComponent interface (ie IHeaderComp). The final object acceptable by ag-grid
  10. */
  11. export interface RegisteredComponent<A extends IComponent<any> & B, B> {
  12. component: RegisteredComponentInput<A, B>;
  13. componentFromFramework: boolean;
  14. source: RegisteredComponentSource;
  15. }
  16. export declare type RegisteredComponentInput<A extends IComponent<any> & B, B> = AgGridRegisteredComponentInput<A> | {
  17. new (): B;
  18. };
  19. export declare type AgGridRegisteredComponentInput<A extends IComponent<any>> = AgGridComponentFunctionInput | {
  20. new (): A;
  21. };
  22. export declare type AgGridComponentFunctionInput = (params: any) => string | HTMLElement;
  23. export interface DeprecatedComponentName {
  24. propertyHolder: string;
  25. newComponentName: string;
  26. }
  27. export declare class UserComponentRegistry extends BeanStub {
  28. private gridOptions;
  29. private agGridDefaults;
  30. private agDeprecatedNames;
  31. private jsComponents;
  32. private frameworkComponents;
  33. private init;
  34. registerDefaultComponent<A extends IComponent<any>>(rawName: string, component: AgGridRegisteredComponentInput<A>): void;
  35. registerComponent<A extends IComponent<any>>(rawName: string, component: AgGridRegisteredComponentInput<A>): void;
  36. /**
  37. * B the business interface (ie IHeader)
  38. * A the agGridComponent interface (ie IHeaderComp). The final object acceptable by ag-grid
  39. */
  40. registerFwComponent<A extends IComponent<any> & B, B>(rawName: string, component: {
  41. new (): IComponent<B>;
  42. }): void;
  43. /**
  44. * B the business interface (ie IHeader)
  45. * A the agGridComponent interface (ie IHeaderComp). The final object acceptable by ag-grid
  46. */
  47. retrieve<A extends IComponent<any> & B, B>(rawName: string): RegisteredComponent<A, B>;
  48. private translateIfDeprecated;
  49. }