/**
 * @copyright Sister Software
 * @license AGPL-3.0
 * @author Teffen Ellis, et al.
 */
import { PathBuilder } from "path-ts";
import { PlacetypeDefinition, PlacetypeDefinitionInit, PlacetypeRole } from "./definition.js";
export declare const PLACETYPES_REPO_SOURCE: {
    readonly url: "https://github.com/whosonfirst/whosonfirst-placetypes.git";
    readonly owner: "whosonfirst";
    readonly name: "whosonfirst-placetypes";
};
interface PlacetypeServiceInit {
    batchSize: number;
    localRepoDirectory: PathBuilder;
}
export declare class Placetype implements Disposable {
    #private;
    [Symbol.dispose](): void;
    static prepare({ batchSize, localRepoDirectory }: PlacetypeServiceInit): Promise<void>;
    /**
     * Find a placetype by its name or ID.
     */
    static find: (idOrName: number | string) => Placetype | null;
    /**
     * Find a placetype by its name or ID.
     *
     * @throws {Error} If no placetype is found with the given name.
     */
    static findOrThrow: (idOrName: number | string) => Placetype;
    /**
     * Compare two placetypes, sorting less specific (i.e. bigger or higher) placetypes first.
     *
     * Note that the two placetype IDs have no affect on the comparison as they are not sequential,
     * only unique.
     */
    static comparatorAsc(a: Placetype, b: Placetype): number;
    /**
     * Compare two placetypes, sorting more specific (i.e. smaller or lower) placetypes first.
     *
     * Note that the two placetype IDs have no affect on the comparison as they are not sequential,
     * only unique.
     */
    static comparatorDesc(a: Placetype, b: Placetype): number;
    /**
     * The Brooklyn Integers ID of this placetype.
     *
     * This is effectively a unique identifier for the placetype, but any pattern of sequential
     * integers is coincidental.
     */
    get id(): number;
    /**
     * The name of this placetype, e.g. "country", "city", "neighborhood"
     */
    get name(): string;
    /**
     * The role of this placetype, indicating its level of requirement to represent a full hierarchy.
     *
     * Some placetypes only exist to provide a supplementary role and are not required for a full
     * hierarchy.
     */
    get role(): PlacetypeRole;
    /**
     * The parent names of this placetype, i.e. those that this Placetype is a child of.
     *
     * @example Continent is a parent of "country"
     */
    parentNames: Set<string>;
    /**
     * The parents of this Placetype, i.e. those with this Placetype as a child.
     */
    parents: Set<Placetype>;
    /**
     * Sibling Placetypes of this Placetype, i.e. those with the same parent.
     *
     * Note that this is **all** siblings across **all** parents.
     */
    siblings: Set<Placetype>;
    /**
     * Children of this Placetype, i.e. those with **this Placetype as a parent**.
     */
    children: Set<Placetype>;
    /**
     * Check if this placetype has a child matching the given name, ID, or Placetype instance.
     */
    hasChild(childLike: Placetype | string | number): boolean;
    /**
     * Find the ancestors of this placetype, optionally filtered by role.
     *
     * An ancestor is a parent, grandparent, great-grandparent, etc. of this placetype.
     */
    findAncestors(roles?: Iterable<PlacetypeRole> | null): Placetype[];
    /**
     * Find the children of this placetype, optionally filtered by role.
     *
     * @see {@linkcode children} for children as a Set.
     */
    findChildren(roles?: Iterable<PlacetypeRole> | null): Placetype[];
    /**
     * Find the parents of this placetype, optionally filtered by role.
     *
     * @see {@linkcode parents} for parents as a Set.
     */
    findParents(roles?: Iterable<PlacetypeRole> | null): Placetype[];
    /**
     * Find the siblings of this placetype, optionally filtered by role.
     */
    findSiblings(roles?: Iterable<PlacetypeRole> | null): Placetype[];
    /**
     * Find the descendants of this placetype, optionally filtered by role.
     *
     * A descendant is a child, grandchild, great-grandchild, etc. of this placetype.
     */
    findDescendants(roles?: Iterable<PlacetypeRole> | null): Placetype[];
    /**
     * Register a placetype specification, creating a new Placetype instance and indexing it by id.
     */
    static register(initLike: PlacetypeDefinition | PlacetypeDefinitionInit): Placetype;
    /**
     * Create a new Placetype instance from a PlacetypeDefinition
     *
     * @see {@linkcode Placetype.register}
     */
    protected constructor(definition: PlacetypeDefinition);
    toString(): string;
}
export {};
//# sourceMappingURL=Placetype.d.ts.map