From f749d96a34302c807fec6d9fbdad25be4b956374 Mon Sep 17 00:00:00 2001 From: Michael Beckemeyer Date: Wed, 31 Jan 2024 11:50:35 +0100 Subject: [PATCH] Add hint in docs --- .changeset/neat-terms-teach.md | 5 +++++ src/packages/runtime/DeclaredService.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/neat-terms-teach.md diff --git a/.changeset/neat-terms-teach.md b/.changeset/neat-terms-teach.md new file mode 100644 index 00000000..5cff959f --- /dev/null +++ b/.changeset/neat-terms-teach.md @@ -0,0 +1,5 @@ +--- +"@open-pioneer/runtime": patch +--- + +Add a hint that `DECLARE_SERVICE_INTERFACE` should be imported via `import type`. diff --git a/src/packages/runtime/DeclaredService.ts b/src/packages/runtime/DeclaredService.ts index 99d7ec28..5613e0d2 100644 --- a/src/packages/runtime/DeclaredService.ts +++ b/src/packages/runtime/DeclaredService.ts @@ -41,10 +41,13 @@ export interface DeclaredService { * 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.