/** * Module to open a share dialog for web content. * For more info, see [Share to Teams from personal app or tab](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/share-to-teams-from-personal-app-or-tab) * @module */ import { SdkError } from '../interfaces'; import * as history from './history'; /** shareWebContent callback function type */ export type shareWebContentCallbackFunctionType = (err?: SdkError) => void; /** Type of message that can be sent or received by the sharing APIs */ export declare const SharingAPIMessages: { /** * Share web content message. * @internal */ shareWebContent: string; }; type ContentType = 'URL' | 'FILE'; /** Represents parameters for base shared content. */ interface IBaseSharedContent { /** Shared content type */ type: ContentType; } /** IShareRequestContentType defines share request type. */ export type IShareRequestContentType = IURLContent | IFileContent; /** Represents IShareRequest parameters interface. * @typeparam T - The identity type */ export interface IShareRequest { /** Content of the share request. */ content: T[]; } /** Represents IFileContent parameters. */ export interface IFileContent extends IBaseSharedContent { /** Type */ type: 'FILE'; /** * Required URL of the file to share */ url: string; /** * Default initial message text */ message?: string; /** * Show file preview, defaults to true */ preview?: boolean; } /** Represents IURLContent parameters. */ export interface IURLContent extends IBaseSharedContent { /** Type */ type: 'URL'; /** * Required URL */ url: string; /** * Default initial message text */ message?: string; /** * Show URL preview, defaults to true */ preview?: boolean; } /** * Feature is under development * Opens a share dialog for web content * * @param shareWebContentRequest - web content info * @returns Promise that will be fulfilled when the operation has completed */ export declare function shareWebContent(shareWebContentRequest: IShareRequest): Promise; /** * @deprecated * As of TeamsJS v2.0.0, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\): Promise\} instead. * * Feature is under development * Opens a share dialog for web content * * @param shareWebContentRequest - web content info * @param callback - optional callback */ export declare function shareWebContent(shareWebContentRequest: IShareRequest, callback: shareWebContentCallbackFunctionType): void; /** * Checks if the sharing capability is supported by the host * @returns boolean to represent whether the sharing capability is supported * * @throws Error if {@linkcode app.initialize} has not successfully completed */ export declare function isSupported(): boolean; export { history };