import { FieldPath, FieldPaths, ViewModelConstructor } from './ViewModelFactory'; export declare const CACHE_KEY_FIELD_SEPARATOR = "\u205E"; /** * Stores the field paths for a model in a standardised form for use in caching. * * @extractdocs * @menugroup Utils */ export declare class ViewModelFieldPaths> { modelClass: T; /** * The flattened path - any nested fields are joined with '.' */ flattenedPath: string[]; /** * The expanded paths - any nested fields are represented as an array */ fieldPaths: FieldPath[]; /** * Names of fields that aren't relations */ nonRelationFieldNames: string[]; /** * Map of relation field name to the paths for that relation */ relations: Record[]>; /** * A key representation of this field path that can be used as a cache key */ key: string; constructor(modelClass: T, flattenedPath: string[]); /** * Is the specified `paths` a subset of this? */ isSubset(paths: ViewModelFieldPaths, ignoreNested?: boolean): boolean; } /** * Takes an array of field paths for a model class and returns a normalized version in the form of `ViewModelFieldPaths`. * * Note that `ViewModelFieldPaths` can be compared with normal equality operators - they are cached internally so a single * instance exists for each unique `fieldNames` * * Normalization means: * * Id fields are always included * * Expands a related field to include all it's subfields * * If a related field is referenced ensures the related field sourceFieldName is included * * Sorts field names consistently * * @param modelClass The ViewModel class the fields are from * @param fieldNames The array of field paths to normalize * * @extractdocs * @menugroup Utils */ export declare function normalizeFields>(modelClass: T, fieldNames: FieldPaths): ViewModelFieldPaths;