Skip to content

Commit

Permalink
Add hint in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Jan 31, 2024
1 parent 8b7c973 commit f749d96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-terms-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@open-pioneer/runtime": patch
---

Add a hint that `DECLARE_SERVICE_INTERFACE` should be imported via `import type`.
3 changes: 3 additions & 0 deletions src/packages/runtime/DeclaredService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ export interface DeclaredService<InterfaceName extends string> {
* Helper symbol to declare a service's interface name when not using a separate interface.
*
* > NOTE: This symbol does not exist at runtime. Declaring a service interface is compile time only!
* > It should therefore be imported via `import type` (see example below).
*
* @example
*
* ```ts
* import { type DECLARE_SERVICE_INTERFACE} from "@open-pioneer/runtime";
*
* class MyServiceImpl {
* // Add this line to your class.
* // It declares (at compile time) that the service class must be used via the given interface name.
Expand Down

0 comments on commit f749d96

Please sign in to comment.