@open-pioneer/integration 0.1.1 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @open-pioneer/integration
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 234b3be: Fix registrations in ServiceRegistry
8
+ - 49ba4e1: Use build-package CLI to build.
9
+ - Updated dependencies [234b3be]
10
+ - Updated dependencies [49ba4e1]
11
+ - @open-pioneer/runtime@0.1.4
12
+
13
+ ## 0.1.2
14
+
15
+ ### Patch Changes
16
+
17
+ - a40f12d: Update build-package tool. TypeScript declaration files should now be available.
18
+
3
19
  ## 0.1.1
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1,12 @@
1
+ import { ApplicationContext, Service, ServiceOptions } from "@open-pioneer/runtime";
2
+ import { ExternalEventService } from "./api";
3
+ interface References {
4
+ ctx: ApplicationContext;
5
+ }
6
+ export declare class ExternalEventServiceImpl implements Service<ExternalEventService> {
7
+ #private;
8
+ constructor({ references }: ServiceOptions<References>);
9
+ emitEvent(name: string, detail?: unknown): void;
10
+ emitEvent(event: Event): void;
11
+ }
12
+ export {};
package/README.md CHANGED
@@ -134,3 +134,7 @@ app.addEventListener("extent-selected", (event) => {
134
134
  console.log("Selected extent:", event.detail.extent);
135
135
  });
136
136
  ```
137
+
138
+ ## License
139
+
140
+ [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
package/api.d.ts ADDED
@@ -0,0 +1,51 @@
1
+ import { type ApiExtension, type ApiMethods, type ApiMethod } from "@open-pioneer/runtime";
2
+ /**
3
+ * Emits events to users of the current web component.
4
+ *
5
+ * Use the interface `"integration.ExternalEventService"` to obtain an instance of this service.
6
+ */
7
+ export interface ExternalEventService {
8
+ /**
9
+ * Emits an event to the host site as a [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent).
10
+ *
11
+ * The `detail` value (if any) will be used as the custom event's `detail`.
12
+ *
13
+ * @example
14
+ *
15
+ * ```js
16
+ * // In the application, e.g. in a service
17
+ * eventService.emitEvent("my-event", { message: "Hello World" });
18
+ *
19
+ * // In the host site (node is the application's web component node)
20
+ * node.addEventLister("my-event", (event) => {
21
+ * console.log(event.detail);
22
+ * })
23
+ * ```
24
+ */
25
+ emitEvent(name: string, detail?: unknown): void;
26
+ /**
27
+ * Emits a prepared [DOM event](https://developer.mozilla.org/en-US/docs/Web/API/Event) to the host site.
28
+ *
29
+ * The event will be dispatched on the web component's dom node without being altered by this service.
30
+ *
31
+ * You must take care to set the appropriate event options for your use case if you're using this overload (e.g. `bubbles`).
32
+ *
33
+ * @example
34
+ *
35
+ * ```js
36
+ * // You can use the CustomEvent class or your own subclass of Event
37
+ * eventService.emitEvent(new CustomEvent("my-event", {
38
+ * detail: "detail-value"
39
+ * }));
40
+ * ```
41
+ */
42
+ emitEvent(event: Event): void;
43
+ }
44
+ export { ApiExtension, ApiMethod, ApiMethods };
45
+ import "@open-pioneer/runtime";
46
+ declare module "@open-pioneer/runtime" {
47
+ interface ServiceRegistry {
48
+ "integration.ApiExtension": ApiExtension;
49
+ "integration.ExternalEventService": ExternalEventService;
50
+ }
51
+ }
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export default undefined;
package/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import '@open-pioneer/runtime';
2
+
1
3
  var index = void 0;
2
4
 
3
5
  export { index as default };
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: con terra GmbH and contributors\n// SPDX-License-Identifier: Apache-2.0\nexport * from \"./api\";\n\n// Get rid of empty chunk warning\nexport default undefined;\n"],"names":[],"mappings":"AAKA,YAAe,KAAA,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: con terra GmbH and contributors\n// SPDX-License-Identifier: Apache-2.0\nexport * from \"./api\";\n\n// Get rid of empty chunk warning\nexport default undefined;\n"],"names":[],"mappings":";;AAKA,YAAe,KAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,15 +1,20 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/integration",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "license": "Apache-2.0",
6
+ "dependencies": {
7
+ "@open-pioneer/runtime": "^0.1.4"
8
+ },
6
9
  "exports": {
7
10
  "./package.json": "./package.json",
8
11
  ".": {
9
- "import": "./index.js"
12
+ "import": "./index.js",
13
+ "types": "./index.d.ts"
10
14
  },
11
15
  "./services": {
12
- "import": "./services.js"
16
+ "import": "./services.js",
17
+ "types": "./services.d.ts"
13
18
  }
14
19
  },
15
20
  "openPioneerFramework": {
package/services.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { ExternalEventServiceImpl } from "./ExternalEventServiceImpl";