import type { ConditionalConstraints, DataProviderPlugin, DataRelationship, RealisticDataOptions, ValidationOptions, WeightedSelectionOptions } from '../types'; /** * Advanced data generation utilities for conditional, validated, and weighted data */ /** * Validate data against validation rules */ export declare function validateData(value: T, options: ValidationOptions): { isValid: boolean, errors: string[] }; /** * Select a weighted random item from a list */ export declare function selectWeightedItem(random: { number: () => number }, options: WeightedSelectionOptions): T; /** * Apply conditional constraints to filter data */ export declare function applyConstraints>(data: T[], constraints: ConditionalConstraints): T[]; /** * Apply data relationships to generate realistic connected data */ export declare function applyRelationships>(data: T, relationships: DataRelationship[]): T; /** * Generate data with realistic relationships */ export declare function generateRealisticData>(generator: (options?: any) => T, options?: RealisticDataOptions): T; /** * Global data provider registry instance */ export declare const globalProviderRegistry: DataProviderRegistry; /** * Built-in validation rules * @defaultValue * ```ts * { * email: (value: string) => unknown, * phone: (value: string) => unknown, * name: (value: string) => unknown, * regex: (pattern: RegExp) => unknown, * length: (min: number, max: number) => unknown, * range: (min: number, max: number) => unknown * } * ``` */ export declare const ValidationRules: { /** * Email validation */ email: (value: string) => unknown; /** * Phone number validation (basic) */ phone: (value: string) => unknown; /** * Name validation (no numbers, reasonable length) */ name: (value: string) => unknown; /** * Custom regex validation */ regex: (pattern: RegExp) => unknown; /** * Length validation */ length: (min: number, max: number) => unknown; /** * Range validation */ range: (min: number, max: number) => unknown }; /** * Built-in data relationships for realistic data generation * @defaultValue * ```ts * { * phoneByCountry: { * field: 'phone', * dependsOn: 'country', * mapping: { * 'United States': '+1-###-###-####', * 'United Kingdom': '+44 #### ### ###', * 'Germany': '+49 ### ########', * 'France': '+33 # ## ## ## ##', * 'Spain': '+34 ### ## ## ##', * 'Italy': '+39 ### ### ###', * 'Japan': '+81 ##-####-####', * 'China': '+86 ### #### ####', * 'Australia': '+61 ### ### ###', * 'Canada': '+1-###-###-####' * } * }, * postalCodeByCountry: { * field: 'postalCode', * dependsOn: 'country', * mapping: { * 'United States': '#####', * 'United Kingdom': 'AA## #AA', * 'Germany': '#####', * 'France': '#####', * 'Spain': '#####', * 'Italy': '#####', * 'Japan': '###-####', * 'China': '######', * 'Australia': '####', * 'Canada': 'A#A #A#' * } * }, * firstNameByGender: { * field: 'firstName', * dependsOn: 'gender', * mapping: { * male: ['John', 'Michael', 'David', 'James', 'Robert', 'William', 'Richard', 'Thomas', 'Christopher', 'Daniel'] as string[], * female: ['Mary', 'Patricia', 'Jennifer', 'Linda', 'Elizabeth', 'Barbara', 'Susan', 'Jessica', 'Sarah', 'Karen'] as string[] * } * } * } * ``` */ export declare const DataRelationships: { /** * Phone number formats by country */ phoneByCountry: { /** @defaultValue 'phone' */ field: string; /** @defaultValue 'country' */ dependsOn: string; mapping: { /** @defaultValue '+1-###-###-####' */ 'United States': string; /** @defaultValue '+44 #### ### ###' */ 'United Kingdom': string; /** @defaultValue '+49 ### ########' */ 'Germany': string; /** @defaultValue '+33 # ## ## ## ##' */ 'France': string; /** @defaultValue '+34 ### ## ## ##' */ 'Spain': string; /** @defaultValue '+39 ### ### ###' */ 'Italy': string; /** @defaultValue '+81 ##-####-####' */ 'Japan': string; /** @defaultValue '+86 ### #### ####' */ 'China': string; /** @defaultValue '+61 ### ### ###' */ 'Australia': string; /** @defaultValue '+1-###-###-####' */ 'Canada': string } }; /** * Postal code formats by country */ postalCodeByCountry: { /** @defaultValue 'postalCode' */ field: string; /** @defaultValue 'country' */ dependsOn: string; mapping: { /** @defaultValue '#####' */ 'United States': string; /** @defaultValue 'AA## #AA' */ 'United Kingdom': string; /** @defaultValue '#####' */ 'Germany': string; /** @defaultValue '#####' */ 'France': string; /** @defaultValue '#####' */ 'Spain': string; /** @defaultValue '#####' */ 'Italy': string; /** @defaultValue '###-####' */ 'Japan': string; /** @defaultValue '######' */ 'China': string; /** @defaultValue '####' */ 'Australia': string; /** @defaultValue 'A#A #A#' */ 'Canada': string } }; /** * Common first names by gender */ firstNameByGender: { /** @defaultValue 'firstName' */ field: string; /** @defaultValue 'gender' */ dependsOn: string; mapping: { male: (string | unknown)[]; female: (string | unknown)[] } } }; /** * Common weighted selections for realistic data distribution * @defaultValue * ```ts * { * commonFirstNames: { * items: [ { item: 'John', weight: 100 }, { item: 'Michael', weight: 85 }, { item: 'David', weight: 80 }, { item: 'James', weight: 75 }, { item: 'Robert', weight: 70 }, { item: 'William', weight: 65 }, { item: 'Richard', weight: 60 }, { item: 'Thomas', weight: 55 }, { item: 'Christopher', weight: 50 }, { item: 'Daniel', weight: 45 }, ] as Array<{ item: string, weight: number }> * }, * ageDistribution: { * items: [ { item: 25, weight: 80 }, { item: 30, weight: 90 }, { item: 35, weight: 95 }, { item: 40, weight: 100 }, { item: 45, weight: 85 }, { item: 50, weight: 70 }, { item: 55, weight: 55 }, { item: 60, weight: 40 }, { item: 65, weight: 25 }, { item: 70, weight: 15 }, ] as { item: number, weight: number }[] * }, * countryDistribution: { * items: [ { item: 'United States', weight: 100 }, { item: 'China', weight: 95 }, { item: 'India', weight: 90 }, { item: 'Brazil', weight: 60 }, { item: 'Russia', weight: 55 }, { item: 'Japan', weight: 50 }, { item: 'Germany', weight: 45 }, { item: 'United Kingdom', weight: 40 }, { item: 'France', weight: 35 }, { item: 'Italy', weight: 30 }, ] as { item: string, weight: number }[] * } * } * ``` */ export declare const WeightedSelections: { /** * Common first names with realistic distribution */ commonFirstNames: { items: unknown }; /** * Age distribution (more people in middle age ranges) */ ageDistribution: { items: ({ /** @defaultValue 25 */ item: number; /** @defaultValue 80 */ weight: number } | { /** @defaultValue 30 */ item: number; /** @defaultValue 90 */ weight: number } | { /** @defaultValue 35 */ item: number; /** @defaultValue 95 */ weight: number } | { /** @defaultValue 40 */ item: number; /** @defaultValue 100 */ weight: number } | { /** @defaultValue 45 */ item: number; /** @defaultValue 85 */ weight: number } | { /** @defaultValue 50 */ item: number; /** @defaultValue 70 */ weight: number } | { /** @defaultValue 55 */ item: number; /** @defaultValue 55 */ weight: number } | { /** @defaultValue 60 */ item: number; /** @defaultValue 40 */ weight: number } | { /** @defaultValue 65 */ item: number; /** @defaultValue 25 */ weight: number } | { /** @defaultValue 70 */ item: number; /** @defaultValue 15 */ weight: number } | unknown)[] }; /** * Country population distribution */ countryDistribution: { items: ({ /** @defaultValue 'United States' */ item: string; /** @defaultValue 100 */ weight: number } | { /** @defaultValue 'China' */ item: string; /** @defaultValue 95 */ weight: number } | { /** @defaultValue 'India' */ item: string; /** @defaultValue 90 */ weight: number } | { /** @defaultValue 'Brazil' */ item: string; /** @defaultValue 60 */ weight: number } | { /** @defaultValue 'Russia' */ item: string; /** @defaultValue 55 */ weight: number } | { /** @defaultValue 'Japan' */ item: string; /** @defaultValue 50 */ weight: number } | { /** @defaultValue 'Germany' */ item: string; /** @defaultValue 45 */ weight: number } | { /** @defaultValue 'United Kingdom' */ item: string; /** @defaultValue 40 */ weight: number } | { /** @defaultValue 'France' */ item: string; /** @defaultValue 35 */ weight: number } | { /** @defaultValue 'Italy' */ item: string; /** @defaultValue 30 */ weight: number } | unknown)[] } }; /** * Custom data provider registry */ export declare class DataProviderRegistry { register(plugin: DataProviderPlugin): void; get(category: string, name: string): DataProviderPlugin | undefined; getProvidersInCategory(category: string): DataProviderPlugin[]; getCategories(): string[]; remove(category: string, name: string): boolean; clear(): void; }