Skip to content

Commit

Permalink
Add build
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlurie committed Jul 17, 2023
1 parent bcf791f commit 6f62c50
Show file tree
Hide file tree
Showing 60 changed files with 204 additions and 167 deletions.
2 changes: 1 addition & 1 deletion dist/maptiler-client.cjs.map

Large diffs are not rendered by default.

73 changes: 64 additions & 9 deletions dist/maptiler-client.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BBox, Position, Feature, FeatureCollection } from 'geojson';
import { BBox, Position, Feature, Geometry, FeatureCollection } from 'geojson';
export { BBox, Position } from 'geojson';

type FetchFunction = (url: string, options: object) => Promise<any>;
Expand Down Expand Up @@ -121,7 +121,7 @@ type CommonForwardAndReverseGeocodingOptions = LanguageGeocodingOptions & {
/**
* Filter of feature types to return. If not specified, all available feature types are returned.
*/
types?: ("country" | "region" | "subregion" | "county" | "joint_municipality" | "joint_submunicipality" | "municipality" | "municipal_district" | "locality" | "neighbourhood" | "place" | "postal_code" | "address")[];
types?: ("country" | "region" | "subregion" | "county" | "joint_municipality" | "joint_submunicipality" | "municipality" | "municipal_district" | "locality" | "neighbourhood" | "place" | "postal_code" | "address" | "poi")[];
};
type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {
/**
Expand Down Expand Up @@ -149,7 +149,33 @@ type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {
type ReverseGeocodingOptions = CommonForwardAndReverseGeocodingOptions;
type ByIdGeocodingOptions = LanguageGeocodingOptions;
type Coordinates = Position;
type FeatureHierarchy = {
type FeatureProperties = {
/**
* External reference of the feature used for debugging purposes
*/
ref: string;
/**
* ISO 3166-1 alpha-2 country code of the feature
*/
country_code: string;
/**
* (experimental) Kind of the feature
*/
kind?: "road" | "road_relation" | "admin_area" | "place" | "street" | "virtual_street";
/**
* (experimental) Value of place=* tag from OpenStreetMap feature if kind=place
*/
"osm:place_type"?: string;
/**
* (experimental) Feature tags from OpenStreetMap. Only available for `poi` type.
*/
"osm:tags"?: Record<string, string>;
/**
* Array of POI categories. Only available for `poi` type.
*/
categories?: string[];
};
type FeatureBase = {
/**
* Unique feature ID
*/
Expand All @@ -158,8 +184,23 @@ type FeatureHierarchy = {
* Localized feature name
*/
text: string;
/**
* Query's primary ISO 639-1 language code
*/
language?: string;
/**
* A string analogous to the `text` field that matches the query in the requested language.
* This field is only returned when multiple languages are requested using the `language` parameter, and will be present for each requested language.
*/
[text: `text_${string}`]: string;
/**
* A ISO 639-1 query's fallback language code.
* This field is only returned when multiple languages are requested using the `language` parameter, and will be present for each requested language.
*/
[language: `language_${string}`]: string;
};
type GeocodingFeature = Feature & {
type FeatureHierarchy = FeatureProperties & FeatureBase;
type GeocodingFeature = Feature<Geometry, FeatureProperties> & FeatureBase & {
/**
* Bounding box of the original feature as [w, s, e, n] array
*/
Expand All @@ -173,9 +214,19 @@ type GeocodingFeature = Feature & {
*/
place_name: string;
/**
* Localized feature name
* A string analogous to the `place_name` field that matches the query in the requested language.
* This field is only returned when multiple languages are requested using the `language` parameter, and will be present for each requested language.
*/
text: string;
[key: `place_name_${string}`]: string;
/**
* An array of feature types describing the feature.
* Currently each feature has only single type but this may change in the future.
*/
place_type: string[];
/**
* Localized type of the place name, matches `place_type` property
*/
place_type_name: string[];
/**
* Feature hierarchy
*/
Expand All @@ -184,6 +235,12 @@ type GeocodingFeature = Feature & {
* Address number, if applicable
*/
address?: string;
/**
* Indicates how well the returned feature matches the user's query on a scale from 0 to 1.
* 0 means the result does not match the query text at all, while 1 means the result fully matches the query text.
* You can use the relevance property to remove results that don't fully match the query.
*/
relevance: number;
};
type GeocodingSearchResult = {
type: "FeatureCollection";
Expand Down Expand Up @@ -288,9 +345,7 @@ declare const geocoding: {
LUXEMBOURGISH: string;
MACEDONIAN: string;
MALTESE: string;
NORWEGIAN: string; /**
* Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.
*/
NORWEGIAN: string;
POLISH: string;
PORTUGUESE: string;
ROMANIAN: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/maptiler-client.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/maptiler-client.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/classes/config.ClientConfig.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">ClientConfig</span></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/config.ts#L19">config.ts:19</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/config.ts#L19">config.ts:19</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand Down Expand Up @@ -58,7 +58,7 @@ <h3 class="tsd-anchor-link"><span>api<wbr/>Key</span><a href="#apiKey" aria-labe
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/config.ts#L41">config.ts:41</a></li></ul></aside></li>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/config.ts#L41">config.ts:41</a></li></ul></aside></li>
<li class="tsd-signature" id="apiKey.apiKey-2"><span class="tsd-signature-symbol">set</span> apiKey<span class="tsd-signature-symbol">(</span>k<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Set the MapTiler Cloud API key</p>
Expand All @@ -70,7 +70,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
<h5>k: <span class="tsd-signature-type">string</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/config.ts#L34">config.ts:34</a></li></ul></aside></li></ul></section>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/config.ts#L34">config.ts:34</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"><a id="fetch" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>fetch</span><a href="#fetch" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<ul class="tsd-signatures tsd-kind-accessor tsd-parent-kind-class">
Expand All @@ -80,7 +80,7 @@ <h3 class="tsd-anchor-link"><span>fetch</span><a href="#fetch" aria-label="Perma
</div>
<h4 class="tsd-returns-title">Returns <a href="../types/config.FetchFunction.html" class="tsd-signature-type" data-tsd-kind="Type alias">FetchFunction</a></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/config.ts#L55">config.ts:55</a></li></ul></aside></li>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/config.ts#L55">config.ts:55</a></li></ul></aside></li>
<li class="tsd-signature" id="fetch.fetch-2"><span class="tsd-signature-symbol">set</span> fetch<span class="tsd-signature-symbol">(</span>f<span class="tsd-signature-symbol">: </span><a href="../types/config.FetchFunction.html" class="tsd-signature-type" data-tsd-kind="Type alias">FetchFunction</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Set a the custom fetch function to replace the default one</p>
Expand All @@ -92,7 +92,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
<h5>f: <a href="../types/config.FetchFunction.html" class="tsd-signature-type" data-tsd-kind="Type alias">FetchFunction</a></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/config.ts#L48">config.ts:48</a></li></ul></aside></li></ul></section></section></div>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/config.ts#L48">config.ts:48</a></li></ul></aside></li></ul></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
6 changes: 3 additions & 3 deletions docs/classes/services_ServiceError.ServiceError.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">ServiceError</span></li></ul></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/ServiceError.ts#L4">services/ServiceError.ts:4</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/ServiceError.ts#L4">services/ServiceError.ts:4</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand Down Expand Up @@ -57,14 +57,14 @@ <h5>customMessage: <span class="tsd-signature-type">string</span><span class="ts
<h4 class="tsd-returns-title">Returns <a href="services_ServiceError.ServiceError.html" class="tsd-signature-type" data-tsd-kind="Class">ServiceError</a></h4><aside class="tsd-sources">
<p>Overrides Error.constructor</p>
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/ServiceError.ts#L5">services/ServiceError.ts:5</a></li></ul></aside></li></ul></section></section>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/ServiceError.ts#L5">services/ServiceError.ts:5</a></li></ul></aside></li></ul></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="res" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>res</span><a href="#res" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">res<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Response</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/ServiceError.ts#L5">services/ServiceError.ts:5</a></li></ul></aside></section></section></div>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/ServiceError.ts#L5">services/ServiceError.ts:5</a></li></ul></aside></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/language.getAutoLanguageGeocoding.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>Function getAutoLanguageGeocoding</h1></div>
<li class="tsd-description">
<h4 class="tsd-returns-title">Returns <a href="../types/language.LanguageGeocodingString.html" class="tsd-signature-type" data-tsd-kind="Type alias">LanguageGeocodingString</a></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/language.ts#L71">language.ts:71</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/language.ts#L71">language.ts:71</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/services_simplify.default.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h5>points: <span class="tsd-signature-type">Position</span><span class="tsd-sig
<h5>tolerance: <span class="tsd-signature-type">number</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Position</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/simplify.ts#L76">services/simplify.ts:76</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/simplify.ts#L76">services/simplify.ts:76</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="config.html">config</a></li></ul>
<h1>Module config</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/config.ts#L1">config.ts:1</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/config.ts#L1">config.ts:1</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/language.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="language.html">language</a></li></ul>
<h1>Module language</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/language.ts#L4">language.ts:4</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/language.ts#L4">language.ts:4</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/services_ServiceError.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="services_ServiceError.html">services/ServiceError</a></li></ul>
<h1>Module services/ServiceError</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/ServiceError.ts#L4">services/ServiceError.ts:4</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/ServiceError.ts#L4">services/ServiceError.ts:4</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/services_coordinates.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="services_coordinates.html">services/coordinates</a></li></ul>
<h1>Module services/coordinates</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/coordinates.ts#L1">services/coordinates.ts:1</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/coordinates.ts#L1">services/coordinates.ts:1</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/services_data.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="services_data.html">services/data</a></li></ul>
<h1>Module services/data</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/data.ts#L1">services/data.ts:1</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/data.ts#L1">services/data.ts:1</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/services_geocoding.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="services_geocoding.html">services/geocoding</a></li></ul>
<h1>Module services/geocoding</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/geocoding.ts#L1">services/geocoding.ts:1</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/geocoding.ts#L1">services/geocoding.ts:1</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/services_geolocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="services_geolocation.html">services/geolocation</a></li></ul>
<h1>Module services/geolocation</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/geolocation.ts#L1">services/geolocation.ts:1</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/geolocation.ts#L1">services/geolocation.ts:1</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/services_simplify.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="services_simplify.html">services/simplify</a></li></ul>
<h1>Module services/simplify</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/simplify.ts#L5">services/simplify.ts:5</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/simplify.ts#L5">services/simplify.ts:5</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/services_staticMaps.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li><a href="services_staticMaps.html">services/staticMaps</a></li></ul>
<h1>Module services/staticMaps</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/8bd7bfc/src/services/staticMaps.ts#L1">services/staticMaps.ts:1</a></li></ul></aside>
<li>Defined in <a href="https://github.com/maptiler/maptiler-client-js/blob/bcf791f/src/services/staticMaps.ts#L1">services/staticMaps.ts:1</a></li></ul></aside>
<section class="tsd-panel-group">
<section class="tsd-panel tsd-typography"></section></section>
<section class="tsd-panel-group tsd-index-group">
Expand Down
Loading

0 comments on commit 6f62c50

Please sign in to comment.