import { type DataRecord, type DataRecordValue, type Dictionary } from '@overture-stack/lectern-dictionary'; /** * This type alias is for a structure used to collect then lookup values from schemas. It is helpful * to check if a value exists in a schema's records. Each set is a collection of all values from the * data set for a field from the schema. */ export type SchemaDataReference = Map>; /** * Create the reference data needed to efficiently check foreign key restrictions. * * For every field that is referenced by a foreign key restriction, this creates a set of all values for that * field from the records provided for that schema. This will be used when testing foreign key restrictions as * as quick way to look up if the local field's value is present in the foreign schema's field (since lookups * in a Set are much quicker than iterating through all items in an array). Additionally, this reference allows * us to perform the foreign key test without providing all record data to the test, instead passing only this * reference data. * * The output of this function is a Map of schema names to a Map of Field names, to a Set of field values. * It may be convenient to think of the output like this: * * ``` * { * "schemaA": { * "fieldName1": [... set of all values ...], * "fieldName2": [... set of all values ...] * } * "schemaB": { * "fieldName3": [... set of all values ...] * } * } * ``` * @param data Record that maps schema names to the list of records to be validated for that schema * @param dictionary * @returns */ export declare const collectSchemaReferenceData: (data: Record, dictionary: Dictionary) => Map;