/** * @internal */ export declare const BROKER_IN_USE_KEY: string; /** * BrowserUtilities contains common utilities for browser related operations. * @internal */ export declare class BrowserUtilities { private static _isWebViewHosted; private static _isMobileBrowser; private static _isMobileWebView; private static _isSharePointiOSApp; private static _isTeamsVivaMobile; private static _isTeamsAndroid; private static _isTeamsIOS; private static _isEmbedded; private static _isEmbeddedInSite; private static __isEmbeddedInTeamsClient; private static _isSafari; private static _isMEEBridgeApplicationHosted; private static _isSharePointMobileHosted; private static _isVivaConnectionsMobileHosted; static isWebViewHosted(): boolean; static getTeamsAppType(): string | undefined; /** Returns the Product information for ASHA for Customer Promise implementations to consume. * We have SPO Sites and Connections (Viva) as 2 main identified products for many of our Customer Promise scenarios in WEX. * This method checks if a page is hosted within Teams and the hosted app is Viva1P to identify 'Connections', * else we return the default 'SPO Sites' as Product. * Edu scenario is categorized under SPO Sites product and will be further differentiated using endpoint value further. */ static getASHAProduct(): string; /** * Returns true if current page has flag for using teams authentication * @returns */ static isUseTeamsAuth(): boolean; /** * Returns true if current page is loaded as iFrame under secure broker app * App is responsible for calling setUsingSecureBroker() before isUsingSecureBroker if value is true. * @returns */ static isUsingSecureBroker(): boolean; /** * Returns true if current page is loaded as iFrame under secure broker app * @returns */ static isRequestComingFromSecureBroker(): boolean; /** * Set flags in session storage indicating current page is loaded as iFrame under secure broker app. * It is callers responsibility to ensure it is indeed loaded using secure broker app. * Also see isUsingSecureBroker() */ static setUsingSecureBroker(): void; static isInTeamsChannelApp(): boolean; static isViva1PHosted(): boolean; /** * Returns true if we are in the VivaTopics App. */ static isVivaTopicsHosted(): boolean; static isEduClassHosted(): boolean; static isTeamsAndroidHosted(): boolean; static isTeamsIOSHosted(): boolean; static isTeamsWebViewHostedDeprecated(): boolean; static isTeamsWebViewHosted(): boolean; static isTeams1PVivaDesktopHosted(): boolean; /** * When SharePoint is hosted in Teams, it can either be in : * 1. Teams Desktop Client: Electron Webview * 2. Teams in Browser: Iframe * Old Teams: * Desktop Client is identifiable via the user-agent. * However, for Teams in Browser, since we cannot leverage user-agent, * we'll be using window.name property to get the host iframe's name, * which when equal to "embedded-page-container" lets us know that * SharePoint is currently running in Teams in Browser. * * For Teams 2.1: * window.name property is equal to "embedded-page-container" for desktop * and browser. We rely on localStorage from Teams context to find the correct host. * If localStorage has not been set in the lifecycle, this api may not return the correct result in new Teams */ static isTeamsBrowserHostedDeprecated(): boolean; static isTeamsBrowserHosted(): boolean; static isTeamsBrowserOrDesktop(): boolean; /** * Returns true, if SharePoint is hosted in Viva Mobile L2 View (browser). * If SharePoint is hosted in bridge webview, returns false. * If required please add different API for bridge by checking 'VivaBridge' string. * * In Viva, application name is appended to default RN WebView user agent - * application name for L2 View WebView - 'Viva Connections for Mobile (MEE App)' * application name for bridge WebView - 'Viva Connections for Mobile (MEE App) VivaBridge' */ static isTeamsVivaMobile(): boolean; static isInPortalsApp(): boolean; static isTemplatesGallery(): boolean; /** * Returns true, if Mobile bridge is hosted in mobile Teams browser. */ static isMEEBridgeApplicationHosted(): boolean; /** * Returns true, if we are in the SharePoint Mobile app. */ static isSharePointMobileHosted(): boolean; /** * Returns true, if we are in the VCM app. */ static isVivaConnectionsMobileHosted(): boolean; /** * Return true, if SharePoint is hosted in Teams, either Webview or Browser */ static isTeamsHostedDeprecated(): boolean; static isTeamsHosted(): boolean; static isiOSWebView(): boolean; static isSharePointiOSApp(): boolean; static isMobileWebView(): boolean; static isMobileBrowser(): boolean; static isEmbedded(): boolean; /** * Returns true if SharePoint site is embedded within site and not hosted e.g. in Teams. */ static isEmbeddedInSite(): boolean; static supportsServiceWorker(): boolean; static supportsNavigationPreload(): boolean; static isOutlookWebViewHosted(): boolean; /** * Check if the current browser is Safari. We have this check because * cookie based scenarios do not work in Safari due to ITP. * * @returns true if the current browser is Safari. */ static isSafari(): boolean; /** * Returns true if we are on the VivaHome layouts page. */ static isVivaHome(): boolean; /** * Returns true if user is navigated from the VivaHome layouts page. */ static isFromVivaHome(): boolean; /** * Returns true if the workbench page is opened. */ static isWorkbenchHosted(): boolean; /** * A call to access localStorage will throw an error if called by a cross-domain iframe, * if the call localStorage throws an error, catch the error and return null instead * * @returns the item stored in localStorage at the given key or null if the item is not found. */ static safelyAccessLocalStorage(key: string): string | null; /** * A call to access sessionStorage will throw an error if called by a cross-domain iframe, * if the call sessionStorage throws an error, catch the error and return null instead * * @returns the item stored in sessionStorage at the given key or null if the item is not found. */ static safelyAccessSessionStorage(key: string): string | null; /** * Returns true if SharePoint site is embedded within SharePoint which is hosted in Teams client. * This check is not required for Teams browser because, this api needs to be used along with isTeamsHosted, * which will return false for browser anyway */ private static _isEmbeddedInTeamsClient; private static _isTestMobileWebView; private static _isMobileIntuneBrowser; private static _handleErrorForParentWindowCheck; } //# sourceMappingURL=BrowserUtilities.d.ts.map