From 9b5594b28bbbfe0161480adf528a937b99e39be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Fri, 17 Nov 2023 08:51:38 +0100 Subject: [PATCH] JSDocs --- .../libs/extension-api/types/base.types.ts | 48 +++++++++---------- .../types/manifest-kind.interface.ts | 13 ++++- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/libs/extension-api/types/base.types.ts b/src/Umbraco.Web.UI.Client/src/libs/extension-api/types/base.types.ts index 154c8d7ef8..e17bc203fc 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/extension-api/types/base.types.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/extension-api/types/base.types.ts @@ -1,9 +1,12 @@ -import type { UmbApi } from "../models/index.js"; -import type { ManifestBase } from "./manifest-base.interface.js"; -import type { ApiLoaderProperty, CssLoaderProperty, ElementAndApiLoaderProperty, ElementLoaderProperty, JsLoaderProperty } from "./utils.js"; - - - +import type { UmbApi } from '../models/index.js'; +import type { ManifestBase } from './manifest-base.interface.js'; +import type { + ApiLoaderProperty, + CssLoaderProperty, + ElementAndApiLoaderProperty, + ElementLoaderProperty, + JsLoaderProperty, +} from './utils.js'; export interface ManifestWithView extends ManifestElement { meta: MetaManifestWithView; @@ -23,22 +26,18 @@ export interface ManifestElementWithElementName extends ManifestElement { elementName: string; } - - - export interface ManifestPlainCss extends ManifestBase { /** * The file location of the stylesheet file to load - * @TJS-type string + * @TJS-type string */ - css?: CssLoaderProperty + css?: CssLoaderProperty; } - export interface ManifestPlainJs extends ManifestBase { /** * The file location of the javascript file to load - * @TJS-type string + * @TJS-type string */ js?: JsLoaderProperty; } @@ -54,18 +53,16 @@ export interface ManifestApi extends ManifestBa /** * The file location of the javascript file to load - * @TJS-type string + * @TJS-type string */ js?: ApiLoaderProperty; /** - * @TJS-ignore + * @TJS-type string */ api?: ApiLoaderProperty; - } - export interface ManifestElement extends ManifestBase { /** * @TJS-ignore @@ -74,13 +71,13 @@ export interface ManifestElement /** * The file location of the javascript file to load - * @TJS-type string + * @TJS-type string */ js?: ElementLoaderProperty; /** * The file location of the element javascript file to load - * @TJS-type string + * @TJS-type string */ element?: ElementLoaderProperty; @@ -96,7 +93,8 @@ export interface ManifestElement meta?: unknown; } -export interface ManifestElementAndApi extends ManifestBase { +export interface ManifestElementAndApi + extends ManifestBase { /** * @TJS-ignore */ @@ -106,23 +104,21 @@ export interface ManifestElementAndApi; /** * The file location of the api javascript file to load - * @TJS-type string + * @TJS-type string */ api?: ApiLoaderProperty; /** * The file location of the element javascript file to load - * @TJS-type string + * @TJS-type string */ element?: ElementLoaderProperty; @@ -131,4 +127,4 @@ export interface ManifestElementAndApi, just the element name. */ elementName?: string; -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI.Client/src/libs/extension-api/types/manifest-kind.interface.ts b/src/Umbraco.Web.UI.Client/src/libs/extension-api/types/manifest-kind.interface.ts index 532e1dea2e..17b1b1fd50 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/extension-api/types/manifest-kind.interface.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/extension-api/types/manifest-kind.interface.ts @@ -1,8 +1,17 @@ - export interface ManifestKind { type: 'kind'; alias: string; matchType: string; matchKind: string; + /** + * Provide pre defined properties for the extension manifest. + * Define the `type`-property and other properties you like to preset for implementations of this kind. + * + * @examples { + * type: 'section', + * weight: 123, + * }, + * @TJS-type object + */ manifest: Partial; -} \ No newline at end of file +}