osm-api
Version:
πΊοΈπ Javascript/Typescript wrapper around the OpenStreetMap API
24 lines (23 loc) β’ 899 B
TypeScript
import type { OsmChange, 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;
}
/**
* uploads a changeset to the OSM API.
* @returns the changeset number
*/
export declare function uploadChangeset(tags: Tags, diff: OsmChange, options?: FetchOptions & {
/**
* 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;
}): Promise<number>;