import type { OsmPbfHeaderBlock } from "@osmix/pbf"; import type { GeoBbox2D } from "@osmix/types"; import { Nodes, type NodesTransferables } from "./nodes.ts"; import { Relations, type RelationsTransferables } from "./relations.ts"; import StringTable, { type StringTableTransferables } from "./stringtable.ts"; import type { BufferType } from "./typed-arrays.ts"; import { Ways, type WaysTransferables } from "./ways.ts"; export interface OsmTransferables { id: string; header: OsmPbfHeaderBlock; contentHash: string; stringTable: StringTableTransferables; nodes: NodesTransferables; ways: WaysTransferables; relations: RelationsTransferables; } export interface OsmInfo { id: string; bbox: GeoBbox2D; header: OsmPbfHeaderBlock; stats: { nodes: number; ways: number; relations: number; }; } export interface OsmOptions { id: string; header: OsmPbfHeaderBlock; } /** * OSM Entity Index. */ export declare class Osm { readonly id: string; readonly header: OsmPbfHeaderBlock; readonly stringTable: StringTable; readonly nodes: Nodes; readonly ways: Ways; readonly relations: Relations; private indexBuilt; private _contentHash; /** * Create a new OSM Entity index. */ constructor(opts?: Partial | OsmTransferables | Osm); /** * Build the internal indexes for all entities. * Also computes the content hash after indexes are built. */ buildIndexes(): void; /** * Check if the index is built and ready for use. */ isReady(): boolean; /** * Build spatial indexes for all entities. */ buildSpatialIndexes(): void; /** * Check if spatial indexes have been built for all entity types. */ hasSpatialIndexes(): boolean; /** * Get the bounding box of all entities in the OSM index. */ bbox(): GeoBbox2D; /** * Get information about the OSM index. */ info(): OsmInfo; /** * Get transferable objects for passing to another thread. */ transferables(): OsmTransferables; /** * Get the content hash of this OSM dataset. * The hash is computed when indexes are built. * * @returns A hex string hash uniquely identifying the content. */ contentHash(): string; /** * Check if this OSM dataset has identical content to another. * Uses the pre-computed content hash for fast comparison. * * @param other - The other Osm instance to compare with. * @returns True if both datasets have identical content. */ isEqual(other: Osm | null | undefined): boolean; /** * Compute a content hash of all underlying data. * This hash uniquely identifies the dataset content regardless of metadata. * * @returns A hex string hash of the content. */ private computeContentHash; } //# sourceMappingURL=osm.d.ts.map