import type Database from 'better-sqlite3';
export type RawEntityType = 'endpoint' | 'dto' | 'database-table' | 'ui-view' | 'ac';
export interface RawEntity {
    type: RawEntityType;
    id: number;
    slug: string;
    data: Record<string, unknown>;
    tags: string[];
}
export interface RawSection {
    anchor: string;
    pagePath: string;
    headingPath: string;
    headingSlug: string;
    headingText: string;
    headingLevel: number;
    lineStart: number;
    lineEnd: number;
}
/** Per-entity-type counts. Keys are plugin types; absent type = 0. */
export type RawTagCounts = Record<string, number>;
export interface RawTag {
    slug: string;
    name: string;
    color: string | null;
    description: string | null;
    counts: RawTagCounts;
}
export interface FindByTagParams {
    type?: RawEntityType;
    tags: string[];
    filter: 'and' | 'or';
}
export interface SectionEntityRef {
    anchor: string;
    pagePath: string;
    headingText: string;
    relation: string;
}
export declare function isRawEntityType(value: string): value is RawEntityType;
export declare class RawEntityReader {
    private db;
    constructor(db: Database.Database);
    getEntity(type: RawEntityType, slug: string): RawEntity | null;
    getEntityById(type: RawEntityType, id: number): RawEntity | null;
    getEntities(type: RawEntityType, slugs: string[]): {
        items: RawEntity[];
        missing: string[];
    };
    findByTag(params: FindByTagParams): RawEntity[];
    private findByTagForType;
    getSection(anchor: string): RawSection | null;
    listTypes(): RawEntityType[];
    listSlugs(type: RawEntityType): string[];
    listTags(): RawTag[];
    /** Returns sections that referenced the given entity (populated by section-indexer). */
    findSectionReferences(type: RawEntityType, entityId: number): SectionEntityRef[];
    /** Endpoint-DTO links (denormalised). */
    findEndpointDtos(endpointId: number): Array<{
        dtoSlug: string;
        dtoName: string;
        relation: string;
        statusCode: number | null;
    }>;
    /** Reverse: endpoints linked to a DTO. */
    findDtoEndpoints(dtoId: number): Array<{
        endpointSlug: string;
        method: string;
        path: string;
        relation: string;
        statusCode: number | null;
    }>;
    private hydrate;
    private hydrateSection;
    private getEntityTagSlugs;
}
