import { Repository, RecordInput } from '../interfaces.js'; export declare const repository: Repository; /** * This will migrate a fields value to a new field name * * @example * * const obj = { hello: 'world' }; * const config = { from: 'hello', to: 'goodbye' }; * const results = RecordTransform.renameField(cloneDeep(obj), cloneDeep(obj), config); * results === { goodbye: 'world' }; * * @param {*} record * @param {{ from: string; to: string }} args * @returns object */ export declare function renameField(input: RecordInput, _parentContext: RecordInput, args: { from: string; to: string; }): Record | null; /** * Sets a field on a record with the given value * * @example * * const obj = { hello: 'world' }; * const config = { field: 'other', value: 'stuff' }; * const results = RecordTransform.setField(cloneDeep(obj), cloneDeep(obj), config); * results === { hello: 'world', other: 'stuff' }; * * @param {*} record * @param {{ field: string; value: any }} args * @returns object */ export declare function setField(input: RecordInput, _parentContext: RecordInput, args: { field: string; value: any; }): Record | null; /** * removes fields from a record * * @example * * const obj = { hello: 'world', other: 'stuff', last: 'thing' }; * const config = { fields: ['other', 'last']} ; * const results = RecordTransform.dropFields(cloneDeep(obj), cloneDeep(obj), config); * results; // { hello: 'world' }; * * @param {*} record * @param {{ fields: string[] }} args * @returns object */ export declare function dropFields(input: RecordInput, _parentContext: RecordInput, args: { fields: string[]; }): Record | null; /** * Will copy a field to another field * * @example * const obj = { hello: 'world', other: 'stuff' }; * const config = { from: 'other', to: 'myCopy' }; * const results = RecordTransform.copyField(cloneDeep(obj), cloneDeep(obj), config); * results; // { hello: 'world', other: 'stuff', myCopy: 'stuff' }; * * @param {*} record * @param {{ from: string; to: string }} args * @returns object */ export declare function copyField(input: RecordInput, _parentContext: RecordInput, args: { from: string; to: string; }): Record | null; /** * Will execute a jexl expression. Can use data-mate functions inside the jexl expression. * You do not need to specify the parent context argument as that is automatically * the document used as to call it. * * @example * * const obj = { hello: 'world', other: 'stuff' }; * const config = { query: '[hello]', field: 'final' }; * const results = RecordTransform.transformRecord(clone, clone, config) * results === { hello: 'world', other: 'stuff', final: ['world'] }); * * const obj = { foo: 'bar' }; * const config = { * jexlExp: 'foo|extract({ jexlExp: "foo|toUpperCase" })', field: 'final' * }; * * const mixedData = [obj, undefined, null]; * * const results = RecordTransform.transformRecord( * mixedData, mixedData, config * ) * * results === [{ foo: 'bar', final: 'BAR' }]; * * @param {*} record * @param {{ field: string; query: string }} args * @returns object */ export declare function transformRecord(_input: RecordInput, _parentContext: RecordInput, _args: any): Record | null; /** * returns an array with only unique values * * @example * * const results = FieldTransform.dedupe([1, 2, 2, 3, 3, 3, undefined, 4]) * results === [1, 2, 3, 4] * * * const results = RecordTransform.dedupe([ * { hello: 'world' }, * { hello: 'world' }, * { other: 'obj' }, * ]) * results === [{ hello: 'world' }, { other: 'obj' }]; * @param {any[]} input * @returns {any[] | null } returns null if input is null/undefined */ export declare function dedupe(input: any[], _parentContext?: unknown[]): T[] | null; //# sourceMappingURL=record-transform.d.ts.map