From 7e3ab09ba3977bec5bda101eed30029c219d06b0 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 1 Mar 2023 11:02:01 +0100 Subject: [PATCH] add TYPE property to UmbContextToken to get the generic type --- .../libs/context-api/context-token.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/libs/context-api/context-token.ts b/src/Umbraco.Web.UI.Client/libs/context-api/context-token.ts index a1d7c0b2a5..7ad36b1b4e 100644 --- a/src/Umbraco.Web.UI.Client/libs/context-api/context-token.ts +++ b/src/Umbraco.Web.UI.Client/libs/context-api/context-token.ts @@ -1,4 +1,15 @@ export class UmbContextToken { + /** + * Get the type of the token + * + * @public + * @type {T} + * @memberOf UmbContextToken + * @example `typeof MyToken.TYPE` + * @returns undefined + */ + readonly TYPE: T = undefined as never; + /** * @param alias Unique identifier for the token, * @param _desc Description for the token, @@ -7,13 +18,6 @@ export class UmbContextToken { */ constructor(protected alias: string, protected _desc?: string) {} - /** - * @internal - */ - get multi(): UmbContextToken> { - return this as UmbContextToken>; - } - /** * This method must always return the unique alias of the token since that * will be used to look up the token in the injector.