column-prop-getters.d.ts 1.0 KB

1234567891011121314151617181920212223242526272829
  1. import { TableColumnProp } from '../types/table-column.type';
  2. export declare type ValueGetter = (obj: any, prop: TableColumnProp) => any;
  3. /**
  4. * Always returns the empty string ''
  5. */
  6. export declare function emptyStringGetter(): string;
  7. /**
  8. * Returns the appropriate getter function for this kind of prop.
  9. * If prop == null, returns the emptyStringGetter.
  10. */
  11. export declare function getterForProp(prop: TableColumnProp): ValueGetter;
  12. /**
  13. * Returns the value at this numeric index.
  14. * @param row array of values
  15. * @param index numeric index
  16. * @returns any or '' if invalid index
  17. */
  18. export declare function numericIndexGetter(row: any[], index: number): any;
  19. /**
  20. * Returns the value of a field.
  21. * (more efficient than deepValueGetter)
  22. * @param obj object containing the field
  23. * @param fieldName field name string
  24. */
  25. export declare function shallowValueGetter(obj: any, fieldName: string): any;
  26. /**
  27. * Returns a deep object given a string. zoo['animal.type']
  28. */
  29. export declare function deepValueGetter(obj: any, path: string): any;