UNPKG

1.04 kBTypeScriptView Raw
1import { TableColumnProp } from '../types/table-column.type';
2export declare type ValueGetter = (obj: any, prop: TableColumnProp) => any;
3/**
4 * Always returns the empty string ''
5 */
6export declare function emptyStringGetter(): string;
7/**
8 * Returns the appropriate getter function for this kind of prop.
9 * If prop == null, returns the emptyStringGetter.
10 */
11export 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 */
18export 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 */
25export declare function shallowValueGetter(obj: any, fieldName: string): any;
26/**
27 * Returns a deep object given a string. zoo['animal.type']
28 */
29export declare function deepValueGetter(obj: any, path: string): any;