import { AxiosRequestConfig, AxiosResponse } from "axios"; import postRobot from "post-robot"; import AssetSidebarWidget from "./AssetSidebarWidget"; import ContentTypeSidebarWidget from "./ContentTypeSidebarWidget"; import { IRTEPluginInitializer } from "./RTE/types"; import Metadata from "./metadata"; import Modal from "./modal"; import Stack from "./stack"; import Store from "./store"; import { IAppConfigWidget, ICustomField, IDashboardWidget, IFieldModifierLocation, IFullPageLocation, ISidebarWidget, InitializationData, LocationType, IGlobalFullPageLocation, RegionType } from "./types"; import { GenericObjectType } from "./types/common.types"; import { User } from "./types/user.types"; import { ContentstackEndpoints } from "./types/api.type"; /** * Class representing an UI Location from Contentstack App SDK. * @hideconstructor */ declare class UiLocation { /** * This value represents the current app's unique ID. */ appUID: string; /** * This holds the app's installation ID. */ installationUID: string; /** * This object holds details of the current user. */ currentUser: User; /** * The type of UI Location being rendered. */ private type; /** * The configuration set for an app. */ private config; readonly endpoints: ContentstackEndpoints; /** * This holds the instance of Cross-domain communication library for posting messages between windows. */ postRobot: typeof postRobot; /** * This holds the stack instance that allows users to read and manipulate a range of objects in a stack. */ stack: Stack; /** * Store to persist data for the app. * Note: Data is stored in the browser's {@link external:localStorage} and will be lost if the {@link external:localStorage} is cleared in the browser. */ store: Store; /** * This holds the instance of the Metadata class used to manage metadata. */ metadata: Metadata; /** * This value represents the current UI location's unique ID. One App may contain multiple UI locations */ locationUID: string; /** * This holds the instance of a helper class used to manage modals in an App. */ modal: Modal; /** * The Contentstack Region on which the app is running. */ readonly region: RegionType; version: number | null; ids: { apiKey: string; appUID: string; installationUID: string; locationUID: string; orgUID: string; userUID: string; }; /** * This holds the information of the currently running UI location of an App. */ location: { DashboardWidget: IDashboardWidget | null; SidebarWidget: ISidebarWidget | null; CustomField: ICustomField | null; RTEPlugin: IRTEPluginInitializer | null; RTELocation: GenericObjectType | null; AppConfigWidget: IAppConfigWidget | null; AssetSidebarWidget: AssetSidebarWidget | null; FullPage: IFullPageLocation | null; FieldModifierLocation: IFieldModifierLocation | null; ContentTypeSidebarWidget: ContentTypeSidebarWidget | null; GlobalFullPageLocation: IGlobalFullPageLocation | null; }; constructor(initData: InitializationData); private handleEventRegistration; pulse: (eventName: string, metadata: GenericObjectType) => void; /** * Method used to retrieve the configuration set for an app. */ getConfig: () => Promise; /** * Method used to get the type of currently running UI location of the app. */ getCurrentLocation: () => LocationType; /** * Conditionally retrieves and returns the app version if not present already * @returns version of the app currently running. */ getAppVersion: () => Promise; /** * Method used to get the Contentstack Region on which the app is running. */ getCurrentRegion: () => RegionType; getEndpoints: () => ContentstackEndpoints; /** * Method used to make an API request to the Contentstack's CMA APIs. */ api: (url: string, option?: RequestInit) => Promise; /** * Method used to create an adapter for management sdk. */ createAdapter: () => (config: AxiosRequestConfig) => Promise; /** * Method used to initialize the App SDK. * @param version - Version of the app SDK in use. */ static initialize(version: string): Promise; setReady(): Promise; } export default UiLocation; //# sourceMappingURL=uiLocation.d.ts.map