import Guid from './Guid'; /** * Interface for properties neccesary for building a Session object. * @internal */ export interface ISessionData { /** {@inheritDoc Session.applicationId} */ applicationId: string; /** {@inheritDoc Session.pageId} */ pageId?: string; /** {@inheritDoc Session.clientSideApplicationId} */ clientSideApplicationId: string; } /** * Provides access to the application's browser session and active page. * * @public */ export default class Session { private static _applicationId; private static _pageId; private static _clientSideApplicationId; /** * This is called once by the system during startup to initialize the Session object. * @internal */ static _initialize(data: ISessionData): void; /** * This is called by the framework to indicate that the current page has changed. * @internal */ static _changePage(): void; /** * A unique identifier for the current instance of the client-side application. * * @remarks * A unique identifier used to correlate logging and other diagnostic information. Its lifetime * persists for the duration of the client-side application instance, i.e. it begins with the * server request that renders the page, and ends e.g. when the browser tab is closed or F5 is * pressed to reload the page. Note that if the application's router supports in-place navigation * (via the history.pushState() API), the application session persists across these transitions. */ static get applicationId(): Guid; /** * The id of the currently running application */ static get clientSideApplicationId(): string; /** * This is called by the framework to set the current application if it may have changed. * @internal */ static _setClientSideApplicationId(clientSideApplicationId: string): void; /** * A unique identifier for the current page within the client-side application. * * @remarks * A unique identifier used to correlate logging and other diagnostic information. Whereas the * {@link Session.applicationId} tracks the entire lifetime of the client-side application instance, * the pageId tracks an individual "page" that is rendered. * * For example, suppose that the application initially loads PageA, then the user does in-place * navigation (via the history.pushState() API) to PageB, then navigates back to PageA, and finally * they close the browser tab. During this sequence, the applicationId will remain the same, however * the pageId will change on each navigation. The 3 different pageId values are used by the diagnostics * e.g. to track success/failure statistics for PageA independently of PageB. * * The concept of a page is subjective and defined by the router for a particular application. */ static get pageId(): Guid; } //# sourceMappingURL=Session.d.ts.map