UNPKG

@adobe/aem-spa-page-model-manager

Version:
86 lines 2.64 kB
import MetaProperty from './MetaProperty'; export declare class AuthoringUtils { private readonly _apiDomain; /** * Base path for editor clientlibs. */ static readonly EDITOR_CLIENTLIB_PATH = "/etc.clientlibs/cq/gui/components/authoring/editors/clientlibs/"; /** * Authoring libraries. */ static readonly AUTHORING_LIBRARIES: { JS: string[]; CSS: string[]; META: { "cq:datatype": string; }; }; /** * @private */ constructor(domain: string | null); /** * @private */ getApiDomain(): string | null; /** * Generates <script>, <link> and <meta> tags. * The document fragment needs to be added to the page to enable AEM Editing capabilities. * * Example: * ``` * import ModelManager, Constants, { AEM_MODE } from '@adobe/aem-spa-page-model-manager'; * * await ModelManager.initialize({modelClient: new ModelClient(<<REMOTE_AEM_HOST>>)}); * ``` * * @returns HTML markup including state specific libraries. */ getAemLibraries(): DocumentFragment; /** * Triggers callback when synchronous src tags in the document fragment have been loaded. * Resolves automatically when there are no scripts. * * @param docFragment HTMLElements aggregate * @param callback */ setOnLoadCallback(docFragment: DocumentFragment, callback: () => void): void; private generateMetaElements; private generateLinkElements; private generateScriptElements; private static isMode; /** * Checks if edit mode is on. * @returns `true` if application is in AEM `EDIT` mode. */ static isEditMode(): boolean; /** * Checks if preview mode is on. * @returns `true` if application is in AEM `PREVIEW` mode. */ static isPreviewMode(): boolean; /** * Checks if app is a remote application. * If the cq:wcmmode is provided as get parameter it is implied that the app is remote. * @returns `true` if the application is a remote app. */ static isRemoteApp(): boolean; /** * Checks AEM mode from URL. * @private * @returns AEM mode. */ private static getWCMModeFromURL; /** * Generates urls to authoring clientlibs. * @private * @returns Clientlib URLs. */ private prependDomain; /** * Is the app used in the context of the AEM Page editor or it is a remote application. * @returns 'true' if app is in Editor */ static isInEditor(): boolean; } //# sourceMappingURL=AuthoringUtils.d.ts.map