diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/umbraco-package.ts b/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/umbraco-package.ts index cb865825b1..7663b53c2c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/umbraco-package.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/umbraco-package.ts @@ -38,19 +38,38 @@ export interface UmbracoPackage { * @description This is used to define the imports and the scopes for the package to be used in the browser. It will be combined with the global importmap. * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap */ - importmap?: { - /** - * @title The imports for the package - * @required - * @minProperties 1 - * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap#imports - */ - imports: Record; - - /** - * @title The scopes for the package - * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap#scopes - */ - scopes?: Record>; - }; + importmap?: UmbracoPackageImportmap; +} + +export interface UmbracoPackageImportmap { + /** + * @title A module specifier with a path for the importmap + * @description This is used to define the module specifiers and their respective paths for the package to be used in the browser. + * @examples [{ + * "library": "./path/to/library.js", + * "library/*": "./path/to/library/*" + * }] + * @required + * @minProperties 1 + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap#imports + */ + imports: UmbracoPackageImportmapValue; + + /** + * @title The importmap scopes for the package + * @description This is used to define the scopes for the package to be used in the browser. It has to specify a path and a value that is an object with module specifiers and their respective paths. + * @examples [{ + * "/path/to/library": { "library": "./path/to/some/other/library.js" } + * }] + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap#scopes + */ + scopes?: UmbracoPackageImportmapScopes; +} + +export interface UmbracoPackageImportmapScopes { + [key: string]: UmbracoPackageImportmapValue; +} + +export interface UmbracoPackageImportmapValue { + [key: string]: string; }