import type Database from 'better-sqlite3';
import type { BrokenReference, ChangedBy, Dto, DtoCreateInput, DtoDeleteResult, DtoListQuery, DtoUpdateInput } from '../../../shared/entities.js';
import type { TagsService } from '../../services/tags.js';
import type { VersionService } from '../../services/versions.js';
export declare class DtoService {
    private db;
    private tags;
    private versions;
    constructor(db: Database.Database, tags: TagsService, versions: VersionService);
    create(input: DtoCreateInput, actor: ChangedBy): Dto;
    list(query?: DtoListQuery): Dto[];
    getBySlug(slug: string): Dto | null;
    getIdBySlug(slug: string): number | null;
    update(slug: string, input: DtoUpdateInput, actor: ChangedBy): {
        dto: Dto;
        previousSlug: string;
    };
    /**
     * Idempotent UPSERT for M17 restore. CREATE if slug missing, UPDATE
     * otherwise; preserves slug.
     */
    upsert(slug: string, input: DtoCreateInput, actor: ChangedBy): {
        dto: Dto;
        op: 'created' | 'updated';
    };
    remove(slug: string, actor: ChangedBy, brokenReferences?: BrokenReference[]): DtoDeleteResult;
    private getByIdInternal;
    private hydrate;
    private getLinkedEndpoints;
}
