-
Notifications
You must be signed in to change notification settings - Fork 33
feature: Better exports #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| export { default as OgcApiEndpoint } from '../ogc-api/endpoint.js'; | ||
| export { DataQueryTypes, CollectionParameterTypes } from '../ogc-api/model.js'; | ||
| export type { | ||
| ConformanceClass, | ||
| OgcApiEndpointInfo, | ||
| DataQueryType, | ||
| CollectionParameterType, | ||
| CollectionParameter, | ||
| EdrParameterInfo, | ||
| OgcApiCollectionInfo, | ||
| OgcApiDocumentLink, | ||
| OgcApiDocument, | ||
| OgcApiRecordContact, | ||
| OgcApiRecordLanguage, | ||
| OgcApiRecordProperties, | ||
| OgcApiRecord, | ||
| OgcApiCollectionItem, | ||
| TileMatrixSet, | ||
| StyleItem, | ||
| OgcStyleFull, | ||
| OgcStyleBrief, | ||
| OgcApiStylesDocument, | ||
| OgcApiStyleRecord, | ||
| OgcApiStylesheet, | ||
| OgcApiStyleMetadata, | ||
| } from '../ogc-api/model.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { useCache, clearCache } from '../../shared/cache.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export { | ||
| check, | ||
| ServiceExceptionError, | ||
| EndpointError, | ||
| } from '../../shared/errors.js'; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export { | ||
| sharedFetch, | ||
| setFetchOptions, | ||
| setQueryParams, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not put this in the API, even though it's useful it's also specific to what we do inside the library and we need toe flexibility to change its behavior without notice
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other functions already exposed from Since re-using this function was my original motivation for this then it's a shame, but I understand your reasons for not wanting it to be part of the API: I guess I'll just have to copy and paste it into my local library instead.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well we might also leave it exported but mark it as not part of the official API; then we still have the freedom of changing it in the future! Could you describe a bit more your use case? maybe we can expose something a bit more high level in the API too.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to look what I'm actually doing with it! Looks like building up custom WFS queries in a scenario where I'm not wanting to first retrieve the capabilities (capabilities are retrieved once when the layer is added and the configuration saved - when the map is re-opened then no new capabilities request is made). I think I actually replaced a local function I had with this function since it is a nice implementation of all the special cases needed for dealing with OWS GET requests, particularly case-sensitive parameter names, and was better than what I previously had. For such nice general-purpose functions I always find it a shame when libraries don't expose them for re-use, although I can understand the argument of wanting to keep the API surface higher-level. |
||
| resetFetchOptions, | ||
| } from '../../shared/http-utils.js'; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| export type { | ||
| Address, | ||
| Contact, | ||
| Provider, | ||
| LayerStyle, | ||
| BoundingBox, | ||
| MetadataURL, | ||
| FetchOptions, | ||
| GenericEndpointInfo, | ||
| MimeType, | ||
| CrsCode, | ||
| } from '../../shared/models.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export { default as TmsEndpoint } from '../tms/endpoint.js'; | ||
| export type { | ||
| TileMapService, | ||
| TmsEndpointInfo, | ||
| TileMapInfo, | ||
| ContactInformation, | ||
| Metadata, | ||
| Attribution, | ||
| TileMapReference, | ||
| TileSet, | ||
| TileFormat, | ||
| Origin, | ||
| TmsProfile, | ||
| } from '../tms/model.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export { default as WfsEndpoint } from '../wfs/endpoint.js'; | ||
| export type { | ||
| WfsVersion, | ||
| WfsFeatureWithProps, | ||
| WfsFeatureTypeSummary, | ||
| WfsFeatureTypeBrief, | ||
| FeatureGeometryType, | ||
| FeaturePropertyType, | ||
| WfsFeatureTypeFull, | ||
| WfsFeatureTypePropDetails, | ||
| WfsFeatureTypePropsDetails, | ||
| WfsFeatureTypeUniqueValue, | ||
| WfsGetFeatureOptions, | ||
| } from '../wfs/model.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export { default as WmsEndpoint } from '../wms/endpoint.js'; | ||
| export type { | ||
| WmsLayerFull, | ||
| WmsVersion, | ||
| WmsLayerSummary, | ||
| WmsLayerAttribution, | ||
| } from '../wms/model.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| export { default as WmtsEndpoint } from '../wmts/endpoint.js'; | ||
| export type { | ||
| WmtsLayerDimensionValue, | ||
| WmtsLayerResourceLink, | ||
| WmtsEndpointInfo, | ||
| WmtsLayer, | ||
| WmtsMatrixSet, | ||
| } from '../wmts/model.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { enableFallbackWithoutWorker } from '../worker/index.js'; | ||
| import '../worker-fallback/index.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,60 +1,12 @@ | ||
| export { default as WfsEndpoint } from './wfs/endpoint.js'; | ||
| export type { | ||
| WfsVersion, | ||
| WfsFeatureWithProps, | ||
| WfsFeatureTypeSummary, | ||
| WfsFeatureTypeBrief, | ||
| FeatureGeometryType, | ||
| FeaturePropertyType, | ||
| WfsFeatureTypeFull, | ||
| WfsFeatureTypePropDetails, | ||
| WfsFeatureTypePropsDetails, | ||
| WfsFeatureTypeUniqueValue, | ||
| WfsGetFeatureOptions, | ||
| } from './wfs/model.js'; | ||
| export { default as WmsEndpoint } from './wms/endpoint.js'; | ||
| export type { | ||
| WmsLayerFull, | ||
| WmsVersion, | ||
| WmsLayerSummary, | ||
| WmsLayerAttribution, | ||
| } from './wms/model.js'; | ||
| export { default as WmtsEndpoint } from './wmts/endpoint.js'; | ||
| export type { | ||
| WmtsLayerDimensionValue, | ||
| WmtsLayerResourceLink, | ||
| WmtsEndpointInfo, | ||
| WmtsLayer, | ||
| WmtsMatrixSet, | ||
| } from './wmts/model.js'; | ||
| export type { | ||
| Address, | ||
| Contact, | ||
| Provider, | ||
| LayerStyle, | ||
| BoundingBox, | ||
| MetadataURL, | ||
| FetchOptions, | ||
| GenericEndpointInfo, | ||
| MimeType, | ||
| CrsCode, | ||
| } from './shared/models.js'; | ||
| export { default as OgcApiEndpoint } from './ogc-api/endpoint.js'; | ||
| export * from './ogc-api/model.js'; | ||
| export { default as TmsEndpoint } from './tms/endpoint.js'; | ||
| export * from './tms/model.js'; | ||
| export * from './api/ogc-api.js'; | ||
| export * from './api/tms.js'; | ||
| export * from './api/wfs.js'; | ||
| export * from './api/wms.js'; | ||
| export * from './api/wmts.js'; | ||
|
|
||
| export { useCache, clearCache } from './shared/cache.js'; | ||
| export { | ||
| sharedFetch, | ||
| setFetchOptions, | ||
| resetFetchOptions, | ||
| } from './shared/http-utils.js'; | ||
| export { | ||
| check, | ||
| ServiceExceptionError, | ||
| EndpointError, | ||
| } from './shared/errors.js'; | ||
| export * from './api/shared/cache.js'; | ||
| export * from './api/shared/errors.js'; | ||
| export * from './api/shared/http-utils.js'; | ||
| export type * from './api/shared/models.js'; | ||
|
|
||
| export { enableFallbackWithoutWorker } from './worker/index.js'; | ||
| import './worker-fallback/index.js'; | ||
| export * from './api/worker.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably drop this to be honest, I can't remember why it's part of the API in the first place; to be investigated more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess officially that would be an API break and a new major version since this function is already exposed?
Maybe in the first instance keep the export but mark it as
@deprecated?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be a major version yes, but I think we're heading that way because we dropped support for older versions of node