index.d.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. import { Feature, Point, Position, LineString, MultiLineString, Polygon, MultiPolygon, FeatureCollection, Geometry, GeometryCollection, GeometryObject, GeoJsonProperties, BBox, MultiPoint } from 'geojson';
  2. /**
  3. * Id
  4. *
  5. * https://tools.ietf.org/html/rfc7946#section-3.2
  6. * If a Feature has a commonly used identifier, that identifier SHOULD be included as a member of
  7. * the Feature object with the name "id", and the value of this member is either a JSON string or number.
  8. *
  9. * Should be contributed to @types/geojson
  10. */
  11. type Id = string | number;
  12. /**
  13. * @module helpers
  14. */
  15. type Coord = Feature<Point> | Point | Position;
  16. /**
  17. * Linear measurement units.
  18. *
  19. * ⚠️ Warning. Be aware of the implications of using radian or degree units to
  20. * measure distance. The distance represented by a degree of longitude *varies*
  21. * depending on latitude.
  22. *
  23. * See https://www.thoughtco.com/degree-of-latitude-and-longitude-distance-4070616
  24. * for an illustration of this behaviour.
  25. *
  26. * @typedef
  27. */
  28. type Units = "meters" | "metres" | "millimeters" | "millimetres" | "centimeters" | "centimetres" | "kilometers" | "kilometres" | "miles" | "nauticalmiles" | "inches" | "yards" | "feet" | "radians" | "degrees";
  29. /**
  30. * Area measurement units.
  31. *
  32. * @typedef
  33. */
  34. type AreaUnits = Exclude<Units, "radians" | "degrees"> | "acres" | "hectares";
  35. /**
  36. * Grid types.
  37. *
  38. * @typedef
  39. */
  40. type Grid = "point" | "square" | "hex" | "triangle";
  41. /**
  42. * Shorthand corner identifiers.
  43. *
  44. * @typedef
  45. */
  46. type Corners = "sw" | "se" | "nw" | "ne" | "center" | "centroid";
  47. /**
  48. * Geometries made up of lines i.e. lines and polygons.
  49. *
  50. * @typedef
  51. */
  52. type Lines = LineString | MultiLineString | Polygon | MultiPolygon;
  53. /**
  54. * Convenience type for all possible GeoJSON.
  55. *
  56. * @typedef
  57. */
  58. type AllGeoJSON = Feature | FeatureCollection | Geometry | GeometryCollection;
  59. /**
  60. * The Earth radius in kilometers. Used by Turf modules that model the Earth as a sphere. The {@link https://en.wikipedia.org/wiki/Earth_radius#Arithmetic_mean_radius mean radius} was selected because it is {@link https://rosettacode.org/wiki/Haversine_formula#:~:text=This%20value%20is%20recommended recommended } by the Haversine formula (used by turf/distance) to reduce error.
  61. *
  62. * @constant
  63. */
  64. declare const earthRadius = 6371008.8;
  65. /**
  66. * Unit of measurement factors based on earthRadius.
  67. *
  68. * Keys are the name of the unit, values are the number of that unit in a single radian
  69. *
  70. * @constant
  71. */
  72. declare const factors: Record<Units, number>;
  73. /**
  74. * Area of measurement factors based on 1 square meter.
  75. *
  76. * @constant
  77. */
  78. declare const areaFactors: Record<AreaUnits, number>;
  79. /**
  80. * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.
  81. *
  82. * @function
  83. * @param {GeometryObject} geometry input geometry
  84. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  85. * @param {Object} [options={}] Optional Parameters
  86. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  87. * @param {Id} [options.id] Identifier associated with the Feature
  88. * @returns {Feature<GeometryObject, GeoJsonProperties>} a GeoJSON Feature
  89. * @example
  90. * var geometry = {
  91. * "type": "Point",
  92. * "coordinates": [110, 50]
  93. * };
  94. *
  95. * var feature = turf.feature(geometry);
  96. *
  97. * //=feature
  98. */
  99. declare function feature<G extends GeometryObject = Geometry, P extends GeoJsonProperties = GeoJsonProperties>(geom: G | null, properties?: P, options?: {
  100. bbox?: BBox;
  101. id?: Id;
  102. }): Feature<G, P>;
  103. /**
  104. * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates.
  105. * For GeometryCollection type use `helpers.geometryCollection`
  106. *
  107. * @function
  108. * @param {("Point" | "LineString" | "Polygon" | "MultiPoint" | "MultiLineString" | "MultiPolygon")} type Geometry Type
  109. * @param {Array<any>} coordinates Coordinates
  110. * @param {Object} [options={}] Optional Parameters
  111. * @returns {Geometry} a GeoJSON Geometry
  112. * @example
  113. * var type = "Point";
  114. * var coordinates = [110, 50];
  115. * var geometry = turf.geometry(type, coordinates);
  116. * // => geometry
  117. */
  118. declare function geometry(type: "Point" | "LineString" | "Polygon" | "MultiPoint" | "MultiLineString" | "MultiPolygon", coordinates: any[], _options?: Record<string, never>): Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon;
  119. /**
  120. * Creates a {@link Point} {@link Feature} from a Position.
  121. *
  122. * @function
  123. * @param {Position} coordinates longitude, latitude position (each in decimal degrees)
  124. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  125. * @param {Object} [options={}] Optional Parameters
  126. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  127. * @param {Id} [options.id] Identifier associated with the Feature
  128. * @returns {Feature<Point, GeoJsonProperties>} a Point feature
  129. * @example
  130. * var point = turf.point([-75.343, 39.984]);
  131. *
  132. * //=point
  133. */
  134. declare function point<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position, properties?: P, options?: {
  135. bbox?: BBox;
  136. id?: Id;
  137. }): Feature<Point, P>;
  138. /**
  139. * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates.
  140. *
  141. * @function
  142. * @param {Position[]} coordinates an array of Points
  143. * @param {GeoJsonProperties} [properties={}] Translate these properties to each Feature
  144. * @param {Object} [options={}] Optional Parameters
  145. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north]
  146. * associated with the FeatureCollection
  147. * @param {Id} [options.id] Identifier associated with the FeatureCollection
  148. * @returns {FeatureCollection<Point>} Point Feature
  149. * @example
  150. * var points = turf.points([
  151. * [-75, 39],
  152. * [-80, 45],
  153. * [-78, 50]
  154. * ]);
  155. *
  156. * //=points
  157. */
  158. declare function points<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[], properties?: P, options?: {
  159. bbox?: BBox;
  160. id?: Id;
  161. }): FeatureCollection<Point, P>;
  162. /**
  163. * Creates a {@link Polygon} {@link Feature} from an Array of LinearRings.
  164. *
  165. * @function
  166. * @param {Position[][]} coordinates an array of LinearRings
  167. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  168. * @param {Object} [options={}] Optional Parameters
  169. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  170. * @param {Id} [options.id] Identifier associated with the Feature
  171. * @returns {Feature<Polygon, GeoJsonProperties>} Polygon Feature
  172. * @example
  173. * var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });
  174. *
  175. * //=polygon
  176. */
  177. declare function polygon<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][], properties?: P, options?: {
  178. bbox?: BBox;
  179. id?: Id;
  180. }): Feature<Polygon, P>;
  181. /**
  182. * Creates a {@link Polygon} {@link FeatureCollection} from an Array of Polygon coordinates.
  183. *
  184. * @function
  185. * @param {Position[][][]} coordinates an array of Polygon coordinates
  186. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  187. * @param {Object} [options={}] Optional Parameters
  188. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  189. * @param {Id} [options.id] Identifier associated with the FeatureCollection
  190. * @returns {FeatureCollection<Polygon, GeoJsonProperties>} Polygon FeatureCollection
  191. * @example
  192. * var polygons = turf.polygons([
  193. * [[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]],
  194. * [[[-15, 42], [-14, 46], [-12, 41], [-17, 44], [-15, 42]]],
  195. * ]);
  196. *
  197. * //=polygons
  198. */
  199. declare function polygons<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][][], properties?: P, options?: {
  200. bbox?: BBox;
  201. id?: Id;
  202. }): FeatureCollection<Polygon, P>;
  203. /**
  204. * Creates a {@link LineString} {@link Feature} from an Array of Positions.
  205. *
  206. * @function
  207. * @param {Position[]} coordinates an array of Positions
  208. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  209. * @param {Object} [options={}] Optional Parameters
  210. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  211. * @param {Id} [options.id] Identifier associated with the Feature
  212. * @returns {Feature<LineString, GeoJsonProperties>} LineString Feature
  213. * @example
  214. * var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});
  215. * var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], {name: 'line 2'});
  216. *
  217. * //=linestring1
  218. * //=linestring2
  219. */
  220. declare function lineString<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[], properties?: P, options?: {
  221. bbox?: BBox;
  222. id?: Id;
  223. }): Feature<LineString, P>;
  224. /**
  225. * Creates a {@link LineString} {@link FeatureCollection} from an Array of LineString coordinates.
  226. *
  227. * @function
  228. * @param {Position[][]} coordinates an array of LinearRings
  229. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  230. * @param {Object} [options={}] Optional Parameters
  231. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north]
  232. * associated with the FeatureCollection
  233. * @param {Id} [options.id] Identifier associated with the FeatureCollection
  234. * @returns {FeatureCollection<LineString, GeoJsonProperties>} LineString FeatureCollection
  235. * @example
  236. * var linestrings = turf.lineStrings([
  237. * [[-24, 63], [-23, 60], [-25, 65], [-20, 69]],
  238. * [[-14, 43], [-13, 40], [-15, 45], [-10, 49]]
  239. * ]);
  240. *
  241. * //=linestrings
  242. */
  243. declare function lineStrings<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][], properties?: P, options?: {
  244. bbox?: BBox;
  245. id?: Id;
  246. }): FeatureCollection<LineString, P>;
  247. /**
  248. * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.
  249. *
  250. * @function
  251. * @param {Array<Feature<GeometryObject, GeoJsonProperties>>} features input features
  252. * @param {Object} [options={}] Optional Parameters
  253. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  254. * @param {Id} [options.id] Identifier associated with the Feature
  255. * @returns {FeatureCollection<GeometryObject, GeoJsonProperties>} FeatureCollection of Features
  256. * @example
  257. * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});
  258. * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});
  259. * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});
  260. *
  261. * var collection = turf.featureCollection([
  262. * locationA,
  263. * locationB,
  264. * locationC
  265. * ]);
  266. *
  267. * //=collection
  268. */
  269. declare function featureCollection<G extends GeometryObject = Geometry, P extends GeoJsonProperties = GeoJsonProperties>(features: Array<Feature<G, P>>, options?: {
  270. bbox?: BBox;
  271. id?: Id;
  272. }): FeatureCollection<G, P>;
  273. /**
  274. * Creates a {@link Feature}<{@link MultiLineString}> based on a
  275. * coordinate array. Properties can be added optionally.
  276. *
  277. * @function
  278. * @param {Position[][]} coordinates an array of LineStrings
  279. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  280. * @param {Object} [options={}] Optional Parameters
  281. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  282. * @param {Id} [options.id] Identifier associated with the Feature
  283. * @returns {Feature<MultiLineString, GeoJsonProperties>} a MultiLineString feature
  284. * @throws {Error} if no coordinates are passed
  285. * @example
  286. * var multiLine = turf.multiLineString([[[0,0],[10,10]]]);
  287. *
  288. * //=multiLine
  289. */
  290. declare function multiLineString<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][], properties?: P, options?: {
  291. bbox?: BBox;
  292. id?: Id;
  293. }): Feature<MultiLineString, P>;
  294. /**
  295. * Creates a {@link Feature}<{@link MultiPoint}> based on a
  296. * coordinate array. Properties can be added optionally.
  297. *
  298. * @function
  299. * @param {Position[]} coordinates an array of Positions
  300. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  301. * @param {Object} [options={}] Optional Parameters
  302. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  303. * @param {Id} [options.id] Identifier associated with the Feature
  304. * @returns {Feature<MultiPoint, GeoJsonProperties>} a MultiPoint feature
  305. * @throws {Error} if no coordinates are passed
  306. * @example
  307. * var multiPt = turf.multiPoint([[0,0],[10,10]]);
  308. *
  309. * //=multiPt
  310. */
  311. declare function multiPoint<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[], properties?: P, options?: {
  312. bbox?: BBox;
  313. id?: Id;
  314. }): Feature<MultiPoint, P>;
  315. /**
  316. * Creates a {@link Feature}<{@link MultiPolygon}> based on a
  317. * coordinate array. Properties can be added optionally.
  318. *
  319. * @function
  320. * @param {Position[][][]} coordinates an array of Polygons
  321. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  322. * @param {Object} [options={}] Optional Parameters
  323. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  324. * @param {Id} [options.id] Identifier associated with the Feature
  325. * @returns {Feature<MultiPolygon, GeoJsonProperties>} a multipolygon feature
  326. * @throws {Error} if no coordinates are passed
  327. * @example
  328. * var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);
  329. *
  330. * //=multiPoly
  331. *
  332. */
  333. declare function multiPolygon<P extends GeoJsonProperties = GeoJsonProperties>(coordinates: Position[][][], properties?: P, options?: {
  334. bbox?: BBox;
  335. id?: Id;
  336. }): Feature<MultiPolygon, P>;
  337. /**
  338. * Creates a Feature<GeometryCollection> based on a
  339. * coordinate array. Properties can be added optionally.
  340. *
  341. * @function
  342. * @param {Array<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon>} geometries an array of GeoJSON Geometries
  343. * @param {GeoJsonProperties} [properties={}] an Object of key-value pairs to add as properties
  344. * @param {Object} [options={}] Optional Parameters
  345. * @param {BBox} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
  346. * @param {Id} [options.id] Identifier associated with the Feature
  347. * @returns {Feature<GeometryCollection, GeoJsonProperties>} a GeoJSON GeometryCollection Feature
  348. * @example
  349. * var pt = turf.geometry("Point", [100, 0]);
  350. * var line = turf.geometry("LineString", [[101, 0], [102, 1]]);
  351. * var collection = turf.geometryCollection([pt, line]);
  352. *
  353. * // => collection
  354. */
  355. declare function geometryCollection<P extends GeoJsonProperties = GeoJsonProperties>(geometries: Array<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon>, properties?: P, options?: {
  356. bbox?: BBox;
  357. id?: Id;
  358. }): Feature<GeometryCollection, P>;
  359. /**
  360. * Round number to precision
  361. *
  362. * @function
  363. * @param {number} num Number
  364. * @param {number} [precision=0] Precision
  365. * @returns {number} rounded number
  366. * @example
  367. * turf.round(120.4321)
  368. * //=120
  369. *
  370. * turf.round(120.4321, 2)
  371. * //=120.43
  372. */
  373. declare function round(num: number, precision?: number): number;
  374. /**
  375. * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.
  376. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
  377. *
  378. * @function
  379. * @param {number} radians in radians across the sphere
  380. * @param {Units} [units="kilometers"] can be degrees, radians, miles, inches, yards, metres,
  381. * meters, kilometres, kilometers.
  382. * @returns {number} distance
  383. */
  384. declare function radiansToLength(radians: number, units?: Units): number;
  385. /**
  386. * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians
  387. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
  388. *
  389. * @function
  390. * @param {number} distance in real units
  391. * @param {Units} [units="kilometers"] can be degrees, radians, miles, inches, yards, metres,
  392. * meters, kilometres, kilometers.
  393. * @returns {number} radians
  394. */
  395. declare function lengthToRadians(distance: number, units?: Units): number;
  396. /**
  397. * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees
  398. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet
  399. *
  400. * @function
  401. * @param {number} distance in real units
  402. * @param {Units} [units="kilometers"] can be degrees, radians, miles, inches, yards, metres,
  403. * meters, kilometres, kilometers.
  404. * @returns {number} degrees
  405. */
  406. declare function lengthToDegrees(distance: number, units?: Units): number;
  407. /**
  408. * Converts any bearing angle from the north line direction (positive clockwise)
  409. * and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line
  410. *
  411. * @function
  412. * @param {number} bearing angle, between -180 and +180 degrees
  413. * @returns {number} angle between 0 and 360 degrees
  414. */
  415. declare function bearingToAzimuth(bearing: number): number;
  416. /**
  417. * Converts any azimuth angle from the north line direction (positive clockwise)
  418. * and returns an angle between -180 and +180 degrees (positive clockwise), 0 being the north line
  419. *
  420. * @function
  421. * @param {number} angle between 0 and 360 degrees
  422. * @returns {number} bearing between -180 and +180 degrees
  423. */
  424. declare function azimuthToBearing(angle: number): number;
  425. /**
  426. * Converts an angle in radians to degrees
  427. *
  428. * @function
  429. * @param {number} radians angle in radians
  430. * @returns {number} degrees between 0 and 360 degrees
  431. */
  432. declare function radiansToDegrees(radians: number): number;
  433. /**
  434. * Converts an angle in degrees to radians
  435. *
  436. * @function
  437. * @param {number} degrees angle between 0 and 360 degrees
  438. * @returns {number} angle in radians
  439. */
  440. declare function degreesToRadians(degrees: number): number;
  441. /**
  442. * Converts a length from one unit to another.
  443. *
  444. * @function
  445. * @param {number} length Length to be converted
  446. * @param {Units} [originalUnit="kilometers"] Input length unit
  447. * @param {Units} [finalUnit="kilometers"] Returned length unit
  448. * @returns {number} The converted length
  449. */
  450. declare function convertLength(length: number, originalUnit?: Units, finalUnit?: Units): number;
  451. /**
  452. * Converts an area from one unit to another.
  453. *
  454. * @function
  455. * @param {number} area Area to be converted
  456. * @param {AreaUnits} [originalUnit="meters"] Input area unit
  457. * @param {AreaUnits} [finalUnit="kilometers"] Returned area unit
  458. * @returns {number} The converted length
  459. */
  460. declare function convertArea(area: number, originalUnit?: AreaUnits, finalUnit?: AreaUnits): number;
  461. /**
  462. * isNumber
  463. *
  464. * @function
  465. * @param {any} num Number to validate
  466. * @returns {boolean} true/false
  467. * @example
  468. * turf.isNumber(123)
  469. * //=true
  470. * turf.isNumber('foo')
  471. * //=false
  472. */
  473. declare function isNumber(num: any): boolean;
  474. /**
  475. * isObject
  476. *
  477. * @function
  478. * @param {any} input variable to validate
  479. * @returns {boolean} true/false, including false for Arrays and Functions
  480. * @example
  481. * turf.isObject({elevation: 10})
  482. * //=true
  483. * turf.isObject('foo')
  484. * //=false
  485. */
  486. declare function isObject(input: any): boolean;
  487. /**
  488. * Validate BBox
  489. *
  490. * @private
  491. * @param {any} bbox BBox to validate
  492. * @returns {void}
  493. * @throws {Error} if BBox is not valid
  494. * @example
  495. * validateBBox([-180, -40, 110, 50])
  496. * //=OK
  497. * validateBBox([-180, -40])
  498. * //=Error
  499. * validateBBox('Foo')
  500. * //=Error
  501. * validateBBox(5)
  502. * //=Error
  503. * validateBBox(null)
  504. * //=Error
  505. * validateBBox(undefined)
  506. * //=Error
  507. */
  508. declare function validateBBox(bbox: any): void;
  509. /**
  510. * Validate Id
  511. *
  512. * @private
  513. * @param {any} id Id to validate
  514. * @returns {void}
  515. * @throws {Error} if Id is not valid
  516. * @example
  517. * validateId([-180, -40, 110, 50])
  518. * //=Error
  519. * validateId([-180, -40])
  520. * //=Error
  521. * validateId('Foo')
  522. * //=OK
  523. * validateId(5)
  524. * //=OK
  525. * validateId(null)
  526. * //=Error
  527. * validateId(undefined)
  528. * //=Error
  529. */
  530. declare function validateId(id: any): void;
  531. export { type AllGeoJSON, type AreaUnits, type Coord, type Corners, type Grid, type Id, type Lines, type Units, areaFactors, azimuthToBearing, bearingToAzimuth, convertArea, convertLength, degreesToRadians, earthRadius, factors, feature, featureCollection, geometry, geometryCollection, isNumber, isObject, lengthToDegrees, lengthToRadians, lineString, lineStrings, multiLineString, multiPoint, multiPolygon, point, points, polygon, polygons, radiansToDegrees, radiansToLength, round, validateBBox, validateId };