import { FieldSet, Field, TypedField, FieldType } from './field.js'; /** * Creates an array of new objects containing only the specified fields from the provided object, * based on the given fieldsets. * * @param obj - The source object from which to select fields. * @param fieldsets - An array of fieldsets, each defining a group of fields to be selected from the object. * Each fieldset is represented as a tuple, where the first element is an optional name or label * for the fieldset, and the second element is an object containing the fields to be selected. * The fields to be selected are defined within the 'fields' property of the fieldset object. * @returns An array of new objects, each containing only the specified fields from the source object, * based on the provided fieldsets. */ declare const dataByFieldsets: (obj: T, fieldsets: FieldSet[]) => T[]; /** * Creates a new object containing only the specified fields from the provided object. * * @param object - The source object from which to select fields. * @param fields - An array of keys representing the fields to be selected from the object. * @returns A new object containing only the specified fields from the source object. * @template T - The type of the source object. */ declare const dataByFields: (object: T, fields: Array | TypedField>) => T; /** * Attempts to find `field`'s type based on its presence in a row in `objectList`. * @param field * @param objectList * @returns FieldTypes */ declare const typeByDataArray: (field: Field, objectList?: T[]) => FieldType; /** * Filters `objectList` by `data` * @param objectList * @param data */ declare const filterDataArray: (objectList: T[], data: T | object) => T[]; /** * Sorts `objectList` by `field` based on `direction`. * @param objectList * @param field * @param direction can be "ASC" or "DESC". */ declare const sortDataArray: (objectList: T[], field: keyof T | string, direction: "ASC" | "DESC") => T[]; export { dataByFields, dataByFieldsets, filterDataArray, sortDataArray, typeByDataArray };