import type { DataRecord } from '@overture-stack/lectern-dictionary'; import type { SchemaValidationRecordErrorUniqueKey } from '../../SchemaValidationError'; import { type TestResult } from '../../../types'; /** * Check if this record is unique in a data set based on the fields defined in the Schema's uniqueKey restriction. * * A uniqueKey restriction is like a compound primary-key constraint. It is defined by a list of fieldNames. For * each record in a data set, we find the uniqueKey value for each record by combining the record's values for the * fields listed in the uniqueKey restriction and generate a hash based on these fields and values. Each record in the * data set must have a unique value for this uniqueKey hash. * * To perform this check, the function needs to be provided a map object where the keys are the uniqueKey hash strings, * and the values are arrays of numbers where each number represents the indicies of records in the data set with that * uniqueKey hash. If there are no uniqueKey errors, then every entry in this map will have exactly one item in it. * * This function returns a SchemaValidationRecordErrorUniqueKey which is the SchemaValidationRecordError with information * about the uniqueKey error. * @param record * @param uniqueKeyRule * @param uniqueKeyMap * @returns */ export declare const testUniqueKey: (record: DataRecord, uniqueKeyRule: string[], uniqueKeyMap: Map) => TestResult;