/**
 * @copyright Sister Software
 * @license AGPL-3.0
 * @author Teffen Ellis, et al.
 */
import { Options as SQLiteOptions } from "better-sqlite3";
import { Alpha2LanguageCode, Alpha3bLanguageCode } from "mailwoman/core/resources/languages";
import { PathBuilder, PathBuilderLike } from "path-ts";
import { WhosOnFirstPlacetype } from "./placetypes/definition.js";
export interface PlacetypeDataSourceOptions<P extends WhosOnFirstPlacetype = WhosOnFirstPlacetype, L extends Alpha3bLanguageCode | Alpha2LanguageCode = Alpha3bLanguageCode> {
    placetype: P;
    languageCode: L;
    dataDirectory: PathBuilderLike;
}
export interface PlacetypeRecord {
    /**
     * The WhosOnFirst ID of the record.
     */
    id: number;
    /**
     * The source of the record, e.g. "whosonfirst", "quattroshapes", etc.
     */
    src: string;
    /**
     * The parent ID of the record
     */
    parent_id: number;
    /**
     * The name of the record. This is the name of the record typically in English.
     */
    name: string;
    /**
     * The preferred name of the record.
     */
    preferred: string | null;
    /**
     * A common variant of the name.
     */
    variant: string | null;
    /**
     * A colloquial usage of the name.
     */
    colloquial: string | null;
    /**
     * An abbreviation of the name.
     */
    abbr: string | null;
    /**
     * A short form of the name.
     */
    short: string | null;
}
/**
 * A data source for WhosOnFirst placetype records.
 */
export declare class PlacetypeDataSource implements Disposable {
    #private;
    static createPath<P extends WhosOnFirstPlacetype, L extends Alpha3bLanguageCode | Alpha2LanguageCode>({ placetype, languageCode, dataDirectory, }: Pick<PlacetypeDataSourceOptions<P, L>, "placetype" | "languageCode" | "dataDirectory">): PathBuilder<`/${P}/${L}.db`>;
    prepareTables(): void;
    prepareIndexes(): void;
    constructor(databasePath: PathBuilderLike, dbOptions?: SQLiteOptions);
    [Symbol.dispose](): void;
    /**
     * Find a placetype record by at least one criteria.
     */
    find(criteria: Partial<PlacetypeRecord>): IteratorObject<PlacetypeRecord>;
    /**
     * Given a placetype record, insert or update into the database.
     *
     * @param record The placetype record to upsert.
     */
    upsert(record: PlacetypeRecord): Promise<void>;
}
//# sourceMappingURL=PlacetypeDataSource.d.ts.map