import type { LocationLike, MessageLocation } from '../validation/location.js'; import type { ModelComponent, ValidationContext } from '../validation/validation-context.js'; import type { Field } from './field.js'; import type { ObjectType, Type } from './type.js'; 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; /** * If true, navigating into lists or references (if not allowed) is reported as a deprecation warning * instead of an error, and the path is still resolved. * * These checks were not effective previously, so some users need to treat them as deprecations. */ readonly reportInvalidNavigationAsDeprecation?: boolean; /** * If true, collect fields (if not allowed) are reported as a deprecation warning instead of an * error, and the path is still resolved. */ readonly reportCollectFieldsAsDeprecation?: boolean; /** * If true, parent fields are reported as a deprecation warning instead of an error, and the path is * still resolved. */ readonly reportParentFieldsAsDeprecation?: 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; }