import type { OsmChange, OsmFeatureType, Tags } from "../../types"; import { type FetchOptions } from "../_osmFetch"; export interface UploadChunkInfo { /** the total number of features being uploaded (counting all chunks) */ featureCount: number; /** the index of this changeset (the first is 0) */ changesetIndex: number; /** the number of changesets required for this upload */ changesetTotal: number; } export type UploadPhase = "upload" | "merge_conflicts"; /** Can include multiple changeset IDs if the upload was chunked. */ export interface UploadResult { [changesetId: number]: { diffResult: { [Type in OsmFeatureType]?: { [oldId: number]: { newId: number; newVersion: number; }; }; }; }; } export interface UploadOptions { /** * Some changesets are too big to upload, so they have to be * split ("chunked") into multiple changesets. * When this happens, you can customize the changeset tags for * each chunk by returning {@link Tags}. */ onChunk?(info: UploadChunkInfo): Tags; /** * Optional, if you want status updates during the upload process, * this callback is invoked whenever the progress updates. */ onProgress?(progress: { phase: UploadPhase; step: number; total: number; }): void; /** by default, uploads are compressed with gzip. set to `false` to disable */ disableCompression?: boolean; } /** * uploads a changeset to the OSM API. * @returns the changeset number */ export declare function uploadChangeset(tags: Tags, diff: OsmChange, options?: FetchOptions & UploadOptions): Promise;