@microsoft/teams-js
Version:
Microsoft Client SDK for building app for Microsoft hosts
47 lines (46 loc) • 1.74 kB
TypeScript
/**
* Provides functions for navigating within your own app
*
* @remarks
* If you are looking to navigate to a different app, use {@link pages.navigateToApp}.
* @module
*/
/**
* Parameters provided to the {@link navigateTo} function
*/
export interface NavigateWithinAppParams {
/**
* The developer-defined unique ID for the page defined in the manifest or when first configuring
* the page. (Known as {@linkcode Context.entityId} prior to TeamsJS v2.0.0)
*/
pageId: string;
/**
* Optional developer-defined unique ID describing the content to navigate to within the page. This
* can be retrieved from the Context object {@link app.PageInfo.subPageId | app.Context.page.subPageId}
*/
subPageId?: string;
}
/**
* Navigate within the currently running app
*
* @remarks
* If you are looking to navigate to a different app, use {@link pages.navigateToApp}.
*
* @param params Parameters for the navigation
* @returns `Promise` that will resolve if the navigation was successful and reject if not
*/
export declare function navigateTo(params: NavigateWithinAppParams): Promise<void>;
/**
* Navigate to the currently running app's first static page defined in the application
* manifest.
*
* @returns `Promise` that will resolve if the navigation was successful and reject if not
*/
export declare function navigateToDefaultPage(): Promise<void>;
/**
* Checks if pages.currentApp capability is supported by the host
* @returns boolean to represent whether the pages.currentApp capability is supported
*
* @throws Error if {@linkcode app.initialize} has not successfully completed
*/
export declare function isSupported(): boolean;