jmapcloud-ng-core-types 2.0.17-qa.3 → 2.0.17-qa.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +3 -10
- package/package.json +1 -1
- package/public/core.d.ts +19 -122
- package/public/global-aliases.d.ts +1 -2
- package/public/jmap/layer.d.ts +1 -0
- package/public/jmap/simple-search.d.ts +4 -8
- package/public/state.d.ts +5 -4
package/index.d.ts
CHANGED
|
@@ -89,9 +89,10 @@ export interface JUIService {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export interface JSimpleSearchService {
|
|
92
|
-
|
|
92
|
+
getSelectedLayerIds(): JId[]
|
|
93
|
+
setSelectedLayerIds(layerIds: JId[]): void
|
|
93
94
|
setQueryString(queryString: string): void
|
|
94
|
-
|
|
95
|
+
search(queryString: string, options?: JSimpleSearchOptions): Promise<JSimpleSearchResult[]>
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
export interface JLibraryService {
|
|
@@ -251,7 +252,6 @@ export interface JEventService {
|
|
|
251
252
|
Language: JLanguageEventModule
|
|
252
253
|
Map: JMapEventModule
|
|
253
254
|
Geocoding: JGeocodingEventModule
|
|
254
|
-
SimpleSearch: JSimpleSearchEventModule
|
|
255
255
|
Project: JProjectEventModule
|
|
256
256
|
User: JUserEventModule
|
|
257
257
|
Feature: JFeatureEventModule
|
|
@@ -330,13 +330,6 @@ export interface JGeocodingEventModule extends JEventModule {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
export interface JSimpleSearchEventModule extends JEventModule {
|
|
334
|
-
on: {
|
|
335
|
-
success(listenerId: string, fn: (params: JSimpleSearchSuccessEventParams) => void): void
|
|
336
|
-
error(listenerId: string, fn: (params: JSimpleSearchErrorEventParams) => void): void
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
333
|
export interface JLayerEventModule extends JEventModule {
|
|
341
334
|
on: {
|
|
342
335
|
layersChange(listenerId: string, fn: (params: JLayerEventChangeParams) => void): void
|
package/package.json
CHANGED
package/public/core.d.ts
CHANGED
|
@@ -113,7 +113,6 @@ import type { JMouseOverAfterEventParams, JMouseOverBeforeEventParams, JMouseOve
|
|
|
113
113
|
import type { JProject, JProjectAllEventParams, JProjectEventParams, JProjectLoadThumbnailsParams } from "./jmap/project.d.ts"
|
|
114
114
|
import type { JMapSelectionParams, JSelectionSetLayersSelectionParams } from "./jmap/selection.d.ts"
|
|
115
115
|
import type { JServerAnyIdentityProvider, JServerIdentityProviderById, JServerInfo, JServerInfoReadyEventParams, JServerVersion } from "./jmap/server.d.ts"
|
|
116
|
-
import type { JSimpleSearchErrorEventParams, JSimpleSearchSuccessEventParams } from "./jmap/simple-search.d.ts"
|
|
117
116
|
import type { JTable, JTableData, JTableDataParams } from "./jmap/table.d.ts"
|
|
118
117
|
import type { JIFramePopupParams } from "./jmap/ui.d.ts"
|
|
119
118
|
import type { JJMapPasswordPolicyCompliance, JOrganization, JSessionData, JUserEventSessionChangedParams, JUserInfo } from "./jmap/user.d.ts"
|
|
@@ -7003,14 +7002,23 @@ export namespace JMap {
|
|
|
7003
7002
|
*
|
|
7004
7003
|
*/
|
|
7005
7004
|
namespace SimpleSearch {
|
|
7005
|
+
/** Returns a copy of the selected layer IDs. Selection lasts until the project changes. */
|
|
7006
|
+
function getSelectedLayerIds(): JId[]
|
|
7007
|
+
/**
|
|
7008
|
+
* Selects indexed layers and all indexed siblings sharing their data sources.
|
|
7009
|
+
* Unknown IDs are ignored. An empty list disables search, including table searches.
|
|
7010
|
+
* The mounted NG search UI re-runs an active query immediately; indexed tables remain included when any layer is selected.
|
|
7011
|
+
* @throws if no project is active or layerIds is not an array.
|
|
7012
|
+
*/
|
|
7013
|
+
function setSelectedLayerIds(layerIds: JId[]): void
|
|
7006
7014
|
/**
|
|
7007
7015
|
* ***JMap.SimpleSearch.setQueryString***
|
|
7008
7016
|
*
|
|
7009
|
-
*
|
|
7017
|
+
* Updates the simple-search input. While the NG search UI is mounted, it debounces changes for 500ms and searches the selected indexed layers and indexed tables of the current project. See {@link https://opensearch.org/docs/latest/query-dsl/full-text/query-string/#query-string-syntax here} for details.
|
|
7010
7018
|
*
|
|
7011
7019
|
* All query_string reserved characters are escaped, and the following characters can't be used: "<>"
|
|
7012
7020
|
*
|
|
7013
|
-
* This method
|
|
7021
|
+
* This method only updates state. Requests require the NG search UI to be mounted; results and request status are managed by its React Query hook.
|
|
7014
7022
|
*
|
|
7015
7023
|
* @throws if no project is loaded, if the passed search string is not a string or if it contains invalid characters.
|
|
7016
7024
|
* @param queryString the search string to be used
|
|
@@ -7020,31 +7028,21 @@ export namespace JMap {
|
|
|
7020
7028
|
*/
|
|
7021
7029
|
function setQueryString(queryString: string): void
|
|
7022
7030
|
/**
|
|
7023
|
-
*
|
|
7031
|
+
* ***JMap.SimpleSearch.search***
|
|
7024
7032
|
*
|
|
7025
|
-
*
|
|
7033
|
+
* Runs one search and resolves with the results, one entry per data source. The input and the
|
|
7034
|
+
* layer selection are not touched.
|
|
7026
7035
|
*
|
|
7027
|
-
*
|
|
7028
|
-
*
|
|
7029
|
-
* // returns the minimum search string length
|
|
7030
|
-
* JMap.SimpleSearch.getMinimumQueryStringLength()
|
|
7031
|
-
* // 1
|
|
7032
|
-
* ```
|
|
7033
|
-
*/
|
|
7034
|
-
function getMinimumQueryStringLength(): number
|
|
7035
|
-
/**
|
|
7036
|
-
* **JMap.SimpleSearch.getInvalidQueryStringCharacters**
|
|
7037
|
-
*
|
|
7038
|
-
* Returns a string composed of all forbidden characters in simple search strings.
|
|
7036
|
+
* `options.layerIds` restricts the search to those indexed layers; indexed tables are always
|
|
7037
|
+
* included. Omit it to search the whole project. An empty list resolves with no results.
|
|
7039
7038
|
*
|
|
7039
|
+
* @throws if no project is loaded, if queryString is not a string or contains invalid characters, or if options.layerIds is not an array.
|
|
7040
7040
|
* @example
|
|
7041
7041
|
* ```ts
|
|
7042
|
-
*
|
|
7043
|
-
* JMap.SimpleSearch.getInvalidQueryStringCharacters()
|
|
7044
|
-
* // "<>"
|
|
7042
|
+
* JMap.SimpleSearch.search("montreal", { layerIds: JMap.SimpleSearch.getSelectedLayerIds() }).then(results => console.log(results))
|
|
7045
7043
|
* ```
|
|
7046
7044
|
*/
|
|
7047
|
-
function
|
|
7045
|
+
function search(queryString: string, options?: JSimpleSearchOptions): Promise<JSimpleSearchResult[]>
|
|
7048
7046
|
}
|
|
7049
7047
|
/**
|
|
7050
7048
|
* **JMap.Draw**
|
|
@@ -7823,107 +7821,6 @@ export namespace JMap {
|
|
|
7823
7821
|
*/
|
|
7824
7822
|
function remove(listenerId: string): void
|
|
7825
7823
|
}
|
|
7826
|
-
/**
|
|
7827
|
-
* ***JMap.Event.SimpleSearch***
|
|
7828
|
-
*
|
|
7829
|
-
* Here you can manage all simple search event listeners.
|
|
7830
|
-
*
|
|
7831
|
-
* Click to see all events available: ***{@link JMap.Event.SimpleSearch.on}***.
|
|
7832
|
-
*/
|
|
7833
|
-
namespace SimpleSearch {
|
|
7834
|
-
/**
|
|
7835
|
-
* ***JMap.Event.SimpleSearch.on***
|
|
7836
|
-
*
|
|
7837
|
-
* Here you have all JMap Cloud NG Core simple search events on which you can attach a listener.
|
|
7838
|
-
*/
|
|
7839
|
-
namespace on {
|
|
7840
|
-
/**
|
|
7841
|
-
* ***JMap.Event.SimpleSearch.on.success***
|
|
7842
|
-
*
|
|
7843
|
-
* This event is triggered when a simple search has been completed.
|
|
7844
|
-
*
|
|
7845
|
-
* @param listenerId Your listener id (must be unique)
|
|
7846
|
-
* @param fn Your listener function
|
|
7847
|
-
* @example
|
|
7848
|
-
* ```ts
|
|
7849
|
-
* // log a message in the console once the simple search has been completed
|
|
7850
|
-
* JMap.Event.SimpleSearch.on.success(
|
|
7851
|
-
* "custom-simple-search-success",
|
|
7852
|
-
* params => console.log("A simple search has been completed", params.results)
|
|
7853
|
-
* )
|
|
7854
|
-
* ```
|
|
7855
|
-
*/
|
|
7856
|
-
function success(listenerId: string, fn: (params: JSimpleSearchSuccessEventParams) => void): void
|
|
7857
|
-
/**
|
|
7858
|
-
* ***JMap.Event.SimpleSearch.on.error***
|
|
7859
|
-
*
|
|
7860
|
-
* This event is triggered when a simple search has been processed, but an error occured.
|
|
7861
|
-
*
|
|
7862
|
-
* @param listenerId Your listener id (must be unique)
|
|
7863
|
-
* @param fn Your listener function
|
|
7864
|
-
* @example
|
|
7865
|
-
* ```ts
|
|
7866
|
-
* // log a message in the console if a simple search error occured
|
|
7867
|
-
* JMap.Event.SimpleSearch.on.error(
|
|
7868
|
-
* "custom-simple-search-error",
|
|
7869
|
-
* params => console.log("A simple search has failed", params)
|
|
7870
|
-
* )
|
|
7871
|
-
* ```
|
|
7872
|
-
*/
|
|
7873
|
-
function error(listenerId: string, fn: (params: JSimpleSearchErrorEventParams) => void): void
|
|
7874
|
-
}
|
|
7875
|
-
/**
|
|
7876
|
-
* ***JMap.Event.SimpleSearch.activate***
|
|
7877
|
-
*
|
|
7878
|
-
* Activate the listener.
|
|
7879
|
-
*
|
|
7880
|
-
* If the listener is already active, do nothing.
|
|
7881
|
-
*
|
|
7882
|
-
* If the listener is inactive, it will be reactivated and will be called again ...
|
|
7883
|
-
*
|
|
7884
|
-
* @param listenerId The listener id
|
|
7885
|
-
* @example
|
|
7886
|
-
* ```ts
|
|
7887
|
-
* // activate the listener "my-simple-search-listener"
|
|
7888
|
-
* JMap.Event.SimpleSearch.activate("my-simple-search-listener")
|
|
7889
|
-
* ```
|
|
7890
|
-
*/
|
|
7891
|
-
function activate(listenerId: string): void
|
|
7892
|
-
/**
|
|
7893
|
-
* ***JMap.Event.SimpleSearch.deactivate***
|
|
7894
|
-
*
|
|
7895
|
-
* Deactivate the listener.
|
|
7896
|
-
*
|
|
7897
|
-
* If the listener id doesn't exists or if the listener is already inactive, do nothing.
|
|
7898
|
-
*
|
|
7899
|
-
* If the listener is active, it will be deactivated and will be ignored ...
|
|
7900
|
-
*
|
|
7901
|
-
* @param listenerId The listener id
|
|
7902
|
-
* @example
|
|
7903
|
-
* ```ts
|
|
7904
|
-
* // deactivate the listener "my-simple-search-listener"
|
|
7905
|
-
* JMap.Event.SimpleSearch.deactivate("my-simple-search-listener")
|
|
7906
|
-
* ```
|
|
7907
|
-
*/
|
|
7908
|
-
function deactivate(listenerId: string): void
|
|
7909
|
-
/**
|
|
7910
|
-
* ***JMap.Event.SimpleSearch.remove***
|
|
7911
|
-
*
|
|
7912
|
-
* Remove the listener.
|
|
7913
|
-
*
|
|
7914
|
-
* If the listener doesn't exist, do nothing.
|
|
7915
|
-
*
|
|
7916
|
-
* Remove the listener from JMap Cloud NG Core library. The listener is deleted and never called again after that.
|
|
7917
|
-
*
|
|
7918
|
-
* @param listenerId The listener id
|
|
7919
|
-
* @example
|
|
7920
|
-
* ```ts
|
|
7921
|
-
* // remove the listener "my-simple-search-listener"
|
|
7922
|
-
* JMap.Event.SimpleSearch.remove("my-simple-search-listener")
|
|
7923
|
-
* ```
|
|
7924
|
-
*/
|
|
7925
|
-
function remove(listenerId: string): void
|
|
7926
|
-
}
|
|
7927
7824
|
namespace Server {
|
|
7928
7825
|
/**
|
|
7929
7826
|
* ***JMap.Event.Server.on***
|
|
@@ -318,10 +318,9 @@ declare global {
|
|
|
318
318
|
/** @internal */ type JServerVersion = server.JServerVersion
|
|
319
319
|
/** @internal */ type JServerInfoReadyEventParams = server.JServerInfoReadyEventParams
|
|
320
320
|
/** @internal */ type JSimpleSearchQueryString = simplesearch.JSimpleSearchQueryString
|
|
321
|
+
/** @internal */ type JSimpleSearchOptions = simplesearch.JSimpleSearchOptions
|
|
321
322
|
/** @internal */ type JSimpleSearchResult = simplesearch.JSimpleSearchResult
|
|
322
323
|
/** @internal */ type JSimpleSearchResultHit = simplesearch.JSimpleSearchResultHit
|
|
323
|
-
/** @internal */ type JSimpleSearchSuccessEventParams = simplesearch.JSimpleSearchSuccessEventParams
|
|
324
|
-
/** @internal */ type JSimpleSearchErrorEventParams = simplesearch.JSimpleSearchErrorEventParams
|
|
325
324
|
/** @internal */ type JWindow = startupoptions.JWindow
|
|
326
325
|
/** @internal */ type JCoreOptions = startupoptions.JCoreOptions
|
|
327
326
|
/** @internal */ type JTABLE_ATTRIBUTE_TYPES = table.JTABLE_ATTRIBUTE_TYPES
|
package/public/jmap/layer.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export interface JSimpleSearchQueryString {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
export interface JSimpleSearchOptions {
|
|
12
|
+
layerIds?: JId[]
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
export interface JSimpleSearchResult {
|
|
12
16
|
took: number
|
|
13
17
|
timedOut: boolean
|
|
@@ -39,11 +43,3 @@ export interface JSimpleSearchResultHit {
|
|
|
39
43
|
[attributeName: string]: string[]
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
|
|
43
|
-
export interface JSimpleSearchSuccessEventParams {
|
|
44
|
-
result: JSimpleSearchResult[]
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface JSimpleSearchErrorEventParams {
|
|
48
|
-
error: any
|
|
49
|
-
}
|
package/public/state.d.ts
CHANGED
|
@@ -69,12 +69,13 @@ export interface JGeocodingState {
|
|
|
69
69
|
results: JGeocodingResult[]
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* User intent only. The mounted NG search UI manages request state and results with React Query.
|
|
74
|
+
*/
|
|
72
75
|
export interface JSimpleSearchState {
|
|
73
|
-
|
|
74
|
-
isLoading: boolean
|
|
75
|
-
hasLoadingError: boolean
|
|
76
|
+
/** The string as typed, updated on every call to `JMap.SimpleSearch.setQueryString`. */
|
|
76
77
|
queryString: string
|
|
77
|
-
|
|
78
|
+
selectedLayerIds: JId[]
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
export interface JGeolocationState {
|