/** * Generic data manipulation utilities for working with datasets * These methods work with any array data, not just sample data */ export declare class DataHelpers { /** * Filter items by property value * @param dataset - Array to filter * @param key - Property key to filter by * @param value - Value to match * @returns Filtered array */ static filterBy(dataset: T[], key: keyof T, value: any): T[]; /** * Search across multiple string properties * @param dataset - Array to search * @param query - Search query * @param fields - Property keys to search within * @returns Items matching the search query */ static search>(dataset: T[], query: string, fields: (keyof T)[]): T[]; /** * Filter by custom predicate function * @param dataset - Array to filter * @param predicate - Filter function * @returns Filtered array */ static filterWhere(dataset: T[], predicate: (item: T) => boolean): T[]; /** * Group items by property value * @param dataset - Array to group * @param key - Property key to group by * @returns Object with groups */ static groupBy(dataset: T[], key: keyof T): Record; /** * Count items by property value * @param dataset - Array to count * @param key - Property key to count by * @returns Object with counts */ static countBy(dataset: T[], key: keyof T): Record; /** * Sort array by property * @param dataset - Array to sort * @param key - Property key to sort by * @param direction - Sort direction ('asc' or 'desc') * @returns New sorted array */ static sortBy(dataset: T[], key: keyof T, direction?: "asc" | "desc"): T[]; /** * Paginate array data * @param dataset - Array to paginate * @param page - Page number (1-based) * @param pageSize - Items per page * @returns Pagination result with metadata */ static paginate(dataset: T[], page: number, pageSize: number): { data: T[]; page: number; pageSize: number; total: number; totalPages: number; hasNext: boolean; hasPrev: boolean; }; /** * Get unique values for a property * @param dataset - Array to extract from * @param key - Property key to extract * @returns Array of unique values */ static unique(dataset: T[], key: keyof T): any[]; /** * Pluck specific properties from objects * @param dataset - Array to pluck from * @param keys - Property keys to extract * @returns Array of objects with only specified properties */ static pluck(dataset: T[], ...keys: K[]): Pick[]; }