import type { FlattenedSchemaV4_0_0, LayerSchemaV4_0_0, ObjectSchemaV4_0_0, ProjectSchemaJSONV4_0_0, PropertySchemaV4_0_0, QueryJSONV4_0_0, ShapeMapV4_0_0 } from '../project-schema/index.ts';
import { type RefItemWithPath } from './refs.ts';
export type GetLayer = (layerId: string) => LayerSchemaV4_0_0 | undefined;
export declare function isObjectSchemaV4_0_0(maybeObjectSchema: PropertySchemaV4_0_0): maybeObjectSchema is ObjectSchemaV4_0_0;
export type RefPredicate = (ref: RefItemWithPath) => boolean;
/**
 * Walk through a `ProjectSchema` and collect all the `ref`s.
 */
export declare function getAllRefsInShapes(shapes: ShapeMapV4_0_0, predicate?: RefPredicate): RefItemWithPath[];
/**
 * Get all refs
 */
export declare function getAllRefsInQuery(shapes: ShapeMapV4_0_0, queryPath: string[], query: QueryJSONV4_0_0, predicate?: (ref: RefItemWithPath) => boolean): RefItemWithPath[];
type SchemaContext = Pick<FlattenedSchemaV4_0_0, 'shapes' | 'queries' | 'mutations'>;
/**
 * Collect refs from `queries` or `mutations`.
 */
export declare function getAllRefsInQueries(context: SchemaContext, rootPropertyName: 'queries' | 'mutations', predicate?: RefPredicate): RefItemWithPath[];
/**
 * Get all refs in a ProjectSchema
 * @param predicate return true to include the ref in
 */
export declare function getAllRefs(projectSchema: SchemaContext, predicate?: RefPredicate): RefItemWithPath[];
export declare function collectReferencedShapeNames(layerId: string, refSet: Set<string>): (schema: PropertySchemaV4_0_0) => void;
export declare function flattenSchema(projectSchema: ProjectSchemaJSONV4_0_0, getLayer: GetLayer): FlattenedSchemaV4_0_0;
export {};
