import { LocationLike, MessageLocation } from '../validation'; import { ModelComponent, ValidationContext } from '../validation/validation-context'; import { Field } from './field'; import { ObjectType, Type } from './type'; export interface FieldPathConfig extends Partial { readonly path: string; readonly location?: LocationLike; readonly baseType: ObjectType; readonly canTraverseRootEntities?: boolean; readonly canFollowReferences?: boolean; readonly canUseCollectFields?: boolean; readonly canNavigateIntoLists?: boolean; } export interface FieldPathOptions { readonly canTraverseRootEntities: boolean; readonly canFollowReferences: boolean; readonly canUseCollectFields: boolean; readonly canNavigateIntoLists: boolean; } /** * A path to a single value * * Can be evaluated by calling createFieldNode for each segment */ export declare class FieldPath implements ModelComponent { private readonly config; readonly path: string; private readonly options; readonly location: LocationLike | undefined; constructor(config: FieldPathConfig); get fields(): ReadonlyArray | undefined; get lastField(): Field | undefined; get type(): Type | undefined; get isList(): boolean | undefined; validate(context: ValidationContext): void; /** * Gets the location for some fields within this path * * lastFieldIndex is exclusive (like with substring or slice) */ getSubLocation(firstFieldIndex: number, lastFieldIndex: number): MessageLocation | undefined; private traversePath; }