import type { LayerName, MetadataEntity, MetadataLayerRef, MetadataStore, PublicRequestOptions } from './types.js';
/** Resolved content for one referenced metadata layer file. */
export type LayerFileContent = {
    content: string;
    ref: MetadataLayerRef;
};
/** Matching configuration for user-input-to-entity lookup helpers. */
export type EntityLookupOptions<T> = {
    extraCandidates?: Array<string | undefined> | ((entity: MetadataEntity<T>) => Array<string | undefined>);
    prefix: string;
    prefixedCandidates?: (input: string) => string[];
};
/**
 * Normalize user-provided lookup values to the canonical comparison format.
 */
export declare const normalizeLookupValue: (value: string) => string;
/**
 * Match a user-provided name/id against a metadata entity using a shared normalization strategy.
 */
export declare const matchesEntityNameOrId: <T>(entity: MetadataEntity<T>, nameOrId: string, options: EntityLookupOptions<T>) => boolean;
/**
 * Return a new array sorted by `entity.id` in ascending order.
 */
export declare const sortByEntityId: <T>(entities: MetadataEntity<T>[]) => MetadataEntity<T>[];
/**
 * Return a paginated slice with safe `offset`/`limit` handling.
 */
export declare const paginate: <T>(items: T[], limit?: number, offset?: number) => T[];
/**
 * Collect layer file references from one or more entities.
 * When `layer` is provided, only references from that layer are returned.
 */
export declare const collectLayerReferences: <T>(entities: MetadataEntity<T>[], layer?: LayerName) => MetadataLayerRef[];
/**
 * Read content for all layer files referenced by a single entity.
 * This is a convenience helper built on top of `store.readLayerFile`.
 */
export declare const readLayerFilesForEntity: <T>(store: MetadataStore, entity: MetadataEntity<T>, layer?: LayerName) => Promise<LayerFileContent[]>;
/**
 * Check whether an entity has at least one reference for the requested layer.
 */
export declare const layerExistsForEntity: <T>(entity: MetadataEntity<T>, layer: LayerName) => boolean;
/**
 * Apply response visibility options to an entity.
 * - `includeLayerRefs=false` removes `layers` from the result
 * - `includeSources=true` includes source references, otherwise returns an empty `sources` array
 */
export declare const mapEntityForResponse: <T>(entity: MetadataEntity<T>, options: PublicRequestOptions) => MetadataEntity<T>;
