jmapcloud-ng-types 1.1.0 → 1.1.2

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.ts CHANGED
@@ -276,6 +276,7 @@ export interface JApplicationUIService {
276
276
  export interface JAppEventService {
277
277
  Main: JAppAppEventModule
278
278
  Layer: JAppLayerEventModule
279
+ Measure: JAppMeasureEventModule
279
280
  UI: JAppUIEventModule
280
281
  Extension: JAppExtensionEventModule
281
282
  MapContext: JAppMapContextEventModule
@@ -432,6 +433,12 @@ export interface JAppLayerEventModule extends JEventModule {
432
433
  }
433
434
  }
434
435
 
436
+ export interface JAppMeasureEventModule extends JEventModule {
437
+ on: {
438
+ creation(listenerId: string, fn: (params: JAppMeasureCreationEventParams) => void): void
439
+ }
440
+ }
441
+
435
442
  export interface JAppExtensionEventModule extends JEventModule {
436
443
  on: {
437
444
  registration(listenerId: string, fn: (params: JAppExtensionEventParams) => void): void
package/package.json CHANGED
@@ -1,15 +1,12 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-types",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG types and interfaces",
5
5
  "main": "src/app.ts",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "pub": "export NODE_ENV='production'; node build/buildfile.js publish;",
9
- "copy": "export NODE_ENV='production'; node build/buildfile.js copy;",
10
- "commit-doc": "export NODE_ENV='production'; node build/buildfile.js commit-doc;",
11
- "doc-test": "export DOC_DIR='./docs/latest'; node build/buildfile.js doc-test;",
12
- "copy-latest": "node build/buildfile.js copy-latest;"
8
+ "pub-github": "node build/buildfile.js publish-github;",
9
+ "doc-test": "node build/buildfile.js doc-test;"
13
10
  },
14
11
  "repository": {
15
12
  "type": "git",
package/public/app.d.ts CHANGED
@@ -2812,6 +2812,92 @@ declare namespace JMap {
2812
2812
  function remove(listenerId: string): void
2813
2813
  }
2814
2814
 
2815
+ /**
2816
+ * ***JMap.Application.Event.Measure***
2817
+ *
2818
+ * Here you can manage all JMap Cloud NG measure event listeners.
2819
+ *
2820
+ * Click to see all events available: ***{@link JMap.Application.Event.Measure.on}***.
2821
+ */
2822
+ namespace Measure {
2823
+ /**
2824
+ * ***JMap.Application.Event.Measure.on***
2825
+ *
2826
+ * Here you have all JMap Cloud NG available measure events on which you can attach a listener.
2827
+ */
2828
+ namespace on {
2829
+ /**
2830
+ * **JMap.Application.Measure.on.creation**
2831
+ *
2832
+ * This event is triggered when a measure is created
2833
+ *
2834
+ * @example
2835
+ * ```ts
2836
+ * // log a message in the console when a measure is created
2837
+ * JMap.Application.Event.Measure.on.creation(
2838
+ * "custom-measure-created",
2839
+ * params => console.log(`The measure id "${params.measure.id}" has been created`)
2840
+ * )
2841
+ * ```
2842
+ */
2843
+ function creation(listenerId: string, fn: (params: JAppMeasureCreationEventParams) => void): void
2844
+ }
2845
+
2846
+ /**
2847
+ * ***JMap.Application.Event.Measure.activate***
2848
+ *
2849
+ * Activates the listener.
2850
+ *
2851
+ * If the listener is already active, does nothing.
2852
+ *
2853
+ * If the listener is inactive, it will be reactivated and will be called again ...
2854
+ *
2855
+ * @param listenerId The listener id
2856
+ * @example
2857
+ * ```ts
2858
+ * // activate the listener "my-measure-listener"
2859
+ * JMap.Application.Event.Measure.activate("my-measure-listener")
2860
+ * ```
2861
+ */
2862
+ function activate(listenerId: string): void
2863
+
2864
+ /**
2865
+ * ***JMap.Application.Event.Measure.deactivate***
2866
+ *
2867
+ * Deactivates the listener.
2868
+ *
2869
+ * If the listener id doesn't exist or if the listener is already inactive, does nothing.
2870
+ *
2871
+ * If the listener is active, it will be deactivated and will be ignored ...
2872
+ *
2873
+ * @param listenerId The listener id
2874
+ * @example
2875
+ * ```ts
2876
+ * // deactivate the listener "my-measure-listener"
2877
+ * JMap.Application.Event.Measure.deactivate("my-measure-listener")
2878
+ * ```
2879
+ */
2880
+ function deactivate(listenerId: string): void
2881
+
2882
+ /**
2883
+ * ***JMap.Application.Event.Measure.remove***
2884
+ *
2885
+ * Removes the listener.
2886
+ *
2887
+ * If the listener doesn't exist, does nothing.
2888
+ *
2889
+ * Removes the listener from JMap Cloud NG. The listener is deleted and never called again after that.
2890
+ *
2891
+ * @param listenerId The listener id
2892
+ * @example
2893
+ * ```ts
2894
+ * // remove the listener "my-measure-listener"
2895
+ * JMap.Application.Event.Measure.remove("my-measure-listener")
2896
+ * ```
2897
+ */
2898
+ function remove(listenerId: string): void
2899
+ }
2900
+
2815
2901
  /**
2816
2902
  * ***JMap.Application.Event.UI***
2817
2903
  *
@@ -23,3 +23,7 @@ declare interface JAppMeasure {
23
23
  area: number
24
24
  radius: number
25
25
  }
26
+
27
+ declare interface JAppMeasureCreationEventParams {
28
+ measure: JAppMeasure
29
+ }