add types for translation manifest
This commit is contained in:
@@ -100,6 +100,15 @@ export interface ManifestClassWithClassConstructor<T = unknown> extends Manifest
|
||||
class: ClassConstructor<T>;
|
||||
}
|
||||
|
||||
export interface ManifestDefaultExport<T = unknown> extends ManifestWithLoader<{ default: T }> {
|
||||
/**
|
||||
* The file location of the javascript file to load
|
||||
*
|
||||
* @TJS-require
|
||||
*/
|
||||
js?: string;
|
||||
}
|
||||
|
||||
export interface ManifestElement<ElementType extends HTMLElement = HTMLElement>
|
||||
extends ManifestWithLoader<{ default: ClassConstructor<ElementType> } | Omit<object, 'default'>> {
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ import type { ManifestSectionView } from './section-view.model.js';
|
||||
import type { ManifestStore, ManifestTreeStore, ManifestItemStore } from './store.model.js';
|
||||
import type { ManifestTheme } from './theme.model.js';
|
||||
import type { ManifestTinyMcePlugin } from './tinymce-plugin.model.js';
|
||||
import type { ManifestTranslations } from './translations.model.js';
|
||||
import type { ManifestTree } from './tree.model.js';
|
||||
import type { ManifestTreeItem } from './tree-item.model.js';
|
||||
import type { ManifestUserProfileApp } from './user-profile-app.model.js';
|
||||
@@ -89,6 +90,7 @@ export type ManifestTypes =
|
||||
| ManifestStore
|
||||
| ManifestTheme
|
||||
| ManifestTinyMcePlugin
|
||||
| ManifestTranslations
|
||||
| ManifestTree
|
||||
| ManifestTreeItem
|
||||
| ManifestTreeStore
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { ManifestDefaultExport } from '@umbraco-cms/backoffice/extension-api';
|
||||
|
||||
export interface ManifestTranslations extends ManifestDefaultExport<Record<string, Record<string, string>>> {
|
||||
type: 'translations';
|
||||
meta: MetaTranslations;
|
||||
}
|
||||
|
||||
export interface MetaTranslations {
|
||||
/**
|
||||
* The culture of the translations.
|
||||
* @example "en-US"
|
||||
*/
|
||||
culture: string;
|
||||
|
||||
/**
|
||||
* The translations.
|
||||
* @example
|
||||
* {
|
||||
* "general": {
|
||||
* "cancel": "Cancel",
|
||||
* "close": "Close"
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
translations?: Record<string, Record<string, string>>;
|
||||
}
|
||||
Reference in New Issue
Block a user