@microsoft/teams-js
Version:
Microsoft Client SDK for building app for Microsoft hosts
45 lines (44 loc) • 2.1 kB
TypeScript
/**
* Provides APIs for handling the user's navigational history.
* @module
*/
import { backButtonHandlerFunctionType } from './pages';
/**
* @hidden
* Register backButtonPress handler.
*
* @internal
* Limited to Microsoft-internal use.
*/
export declare function _initialize(): void;
/**
* Navigates back in the hosted application. See {@link pages.backStack.registerBackButtonHandler} for notes on usage.
* @returns Promise that resolves when the navigation has completed.
*/
export declare function navigateBack(): Promise<void>;
/**
* Registers a handler for user presses of the host client's back button. Experiences that maintain an internal
* navigation stack should use this handler to navigate the user back within their frame. If an application finds
* that after running its back button handler it cannot handle the event it should call the navigateBack
* method to ask the host client to handle it instead.
* @param handler - The handler to invoke when the user presses the host client's back button.
*/
export declare function registerBackButtonHandler(handler: backButtonHandlerFunctionType): void;
/**
* @hidden
* Undocumented helper function with shared code between deprecated version and current version of the registerBackButtonHandler API.
*
* @internal
* Limited to Microsoft-internal use
* @param apiVersionTag - The tag indicating API version number with name
* @param handler - The handler to invoke when the user presses the host client's back button.
* @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
*/
export declare function registerBackButtonHandlerHelper(apiVersionTag: string, handler: () => boolean, versionSpecificHelper?: () => void): void;
/**
* Checks if the pages.backStack capability is supported by the host
* @returns boolean to represent whether the pages.backStack capability is supported
*
* @throws Error if {@linkcode app.initialize} has not successfully completed
*/
export declare function isSupported(): boolean;