@types/microsoftteams
Version:
TypeScript definitions for microsoftteams
1,334 lines • 111 kB
TypeScript
interface MessageEvent {
originalEvent: MessageEvent;
}
/**
* This is the root namespace for the JavaScript SDK.
*/
declare namespace microsoftTeams {
// tslint:disable-next-line:no-unnecessary-class
class Communication {
static currentWindow: Window;
static parentOrigin: string;
static parentWindow: Window;
static childWindow: Window;
}
function initializeCommunication(callback: () => void, validMessageOrigins: string[] | undefined): void;
function uninitializeCommunication(): void;
/**
* Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
*/
function sendMessageToParent(actionName: string, callback?: () => void): void;
/**
* Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
*/
function sendMessageToParent(actionName: string, args: any[], callback?: () => void): void;
function waitForMessageQueue(targetWindow: Window, callback: () => void): void;
/**
* Send a custom message object that can be sent to child window,
* instead of a response message to a child
*/
function sendMessageEventToChild(actionName: string, args?: any[]): void;
const version = "1.10.0";
/**
* This is the SDK version when all SDK APIs started to check platform compatibility for the APIs.
*/
const defaultSDKVersionForCompatCheck = "1.6.0";
/**
* Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}
*/
const getUserJoinedTeamsSupportedAndroidClientVersion = "2.0.1";
/**
* This is the SDK version when location APIs (getLocation and showLocation) are supported.
*/
const locationAPIsRequiredVersion = "1.9.0";
/**
* This is the SDK version when people picker API is supported on mobile.
*/
const peoplePickerRequiredVersion = "2.0.0";
/**
* This is the SDK version when captureImage API is supported on mobile.
*/
const captureImageMobileSupportVersion = "1.7.0";
/**
* This is the SDK version when media APIs are supported on all three platforms ios, android and web.
*/
const mediaAPISupportVersion = "1.8.0";
/**
* This is the SDK version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
*/
const getMediaCallbackSupportVersion = "2.0.0";
/**
* This is the SDK version when scanBarCode API is supported on mobile.
*/
const scanBarCodeAPIMobileSupportVersion = "1.9.0";
/**
* List of supported Host origins
*/
const validOrigins: string[];
const validOriginRegExp: RegExp;
/**
* USer specified message origins should satisfy this test
*/
const userOriginUrlValidationRegExp: RegExp;
// tslint:disable-next-line:no-unnecessary-class
class GlobalVars {
static initializeCalled: boolean;
static initializeCompleted: boolean;
static additionalValidOrigins: string[];
static additionalValidOriginsRegexp: RegExp;
static initializeCallbacks: Array<{
(): void;
}>;
static isFramelessWindow: boolean;
static frameContext: FrameContexts;
static hostClientType: string;
static clientSupportedSDKVersion: string;
static printCapabilityEnabled: boolean;
}
function initializeHandlers(): void;
function callHandler(name: string, args?: any[]): [true, any] | [false, undefined];
function registerHandler(name: string, handler: () => void, sendMessage?: boolean, args?: any[]): void;
function removeHandler(name: string): void;
function registerOnThemeChangeHandler(handler: (theme: string) => void): void;
function handleThemeChange(theme: string): void;
function registerBackButtonHandler(handler: () => boolean): void;
function registerOnLoadHandler(handler: (context: LoadContext) => void): void;
function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void;
/**
* Hide from docs
* Shim in definitions used for browser-compat
*/
interface DOMMessageEvent {
origin?: any;
source?: any;
data?: any;
originalEvent: DOMMessageEvent;
}
/**
* Hide from docs
*/
interface TeamsNativeClient {
framelessPostMessage(msg: string): void;
}
/**
* Hide from docs
*/
interface ExtendedWindow extends Window {
nativeInterface: TeamsNativeClient;
onNativeMessage(evt: DOMMessageEvent): void;
}
interface MessageRequest {
id?: number | undefined;
func: string;
timestamp?: number | undefined;
args?: any[] | undefined;
}
interface MessageResponse {
id: number;
args?: any[] | undefined;
isPartialResponse?: boolean | undefined;
}
/**
* Meant for Message objects that are sent to children without id
*/
interface DOMMessageEvent {
func: string;
args?: any[] | undefined;
}
function ensureInitialized(...expectedFrameContexts: string[]): void;
/**
* Checks whether the platform has knowledge of this API by doing a comparison
* on API required version and platform supported version of the SDK
* @param requiredVersion SDK version required by the API
*/
function isAPISupportedByPlatform(requiredVersion?: string): boolean;
/**
* Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp
* which is used later for message source/origin validation
*/
function processAdditionalValidOrigins(validMessageOrigins: string[]): void;
/**
* Helper function to create a blob from media chunks based on their sequence
*/
function createFile(assembleAttachment: media.AssembleAttachment[], mimeType: string): Blob;
/**
* Helper function to convert Media chunks into another object type which can be later assemebled
* Converts base 64 encoded string to byte array and then into an array of blobs
*/
function decodeAttachment(attachment: media.MediaChunk, mimeType: string): media.AssembleAttachment;
/**
* Returns true if the mediaInput params are valid and false otherwise
*/
function validateSelectMediaInputs(mediaInputs: media.MediaInputs): boolean;
/**
* Returns true if the get Media params are valid and false otherwise
*/
function validateGetMediaInputs(mimeType: string, format: media.FileFormat, content: string): boolean;
/**
* Returns true if the view images param is valid and false otherwise
*/
function validateViewImagesInput(uriList: media.ImageUri[]): boolean;
/**
* Returns true if the scan barcode param is valid and false otherwise
*/
function validateScanBarCodeInput(barCodeConfig: media.BarCodeConfig): boolean;
/**
* Returns true if the people picker params are valid and false otherwise
*/
function validatePeoplePickerInput(peoplePickerInputs: people.PeoplePickerInputs): boolean;
function generateRegExpFromUrls(urls: string[]): RegExp;
function getGenericOnCompleteHandler(errorMessage?: string): (success: boolean, reason?: string) => void;
/**
* Compares SDK versions.
* @param v1 first version
* @param v2 second version
* returns NaN in case inputs are not in right format
* -1 if v1 < v2
* 1 if v1 > v2
* 0 otherwise
* For example,
* compareSDKVersions('1.2', '1.2.0') returns 0
* compareSDKVersions('1.2a', '1.2b') returns NaN
* compareSDKVersions('1.2', '1.3') returns -1
* compareSDKVersions('2.0', '1.3.2') returns 1
* compareSDKVersions('2.0', 2.0) returns NaN
*/
function compareSDKVersions(v1: string, v2: string): number;
/**
* Generates a GUID
*/
function generateGUID(): string;
/**
* Namespace to interact with the application entities specific part of the SDK.
*
* Hide from docs
*/
namespace appEntity {
/**
* Hide from docs
* --------
* Information on an app entity
*/
interface AppEntity {
/**
* App ID of the application
*/
appId: string;
/**
* URL for the application's icon
*/
appIconUrl: string;
/**
* Content URL for the app entity
*/
contentUrl: string;
/**
* The display name for the app entity
*/
displayName: string;
/**
* Website URL for the app entity. It is meant to be opened by the user in a browser.
*/
websiteUrl: string;
}
/**
* Hide from docs
*
* Open the Tab Gallery and retrieve the app entity
* @param threadId ID of the thread where the app entity will be created
* @param categories A list of app categories that will be displayed in the open tab gallery
* @param callback Callback that will be triggered once the app entity information is available.
* The callback takes two arguments: the app entity configuration, if available and
* an optional SdkError in case something happened (i.e. the window was closed)
*/
function selectAppEntity(
threadId: string,
categories: string[],
callback: (appEntity: AppEntity, sdkError?: SdkError) => void,
): void;
}
/**
* Namespace to interact with bots using the SDK.
*/
namespace bot {
/**
* Hide from docs until release.
* ------
* Sends query to bot in order to retrieve data.
* @param botRequest query to send to bot.
* @param onSuccess callback to invoke when data is retrieved from bot
* @param onError callback to invoke should an error occur
*/
function sendQuery(
botRequest: QueryRequest,
onSuccess?: (data: QueryResponse) => void,
onError?: (error: string) => void,
): void;
/**
* Hide from docs until release.
* -----
* Retrieves list of support commands from bot
* @param onSuccess callback to invoke when data is retrieved from bot
* @param onError callback to invoke should an error occur
*/
function getSupportedCommands(
onSuccess?: (response: Command[]) => void,
onError?: (error: string) => void,
): void;
/**
* Hide from docs until release.
* -----
* Authenticates a user for json tab
* @param authRequest callback to invoke when data is retrieved from bot
* @param onSuccess callback to invoke when user is authenticated
* @param onError callback to invoke should an error occur
*/
function authenticate(
authRequest: AuthQueryRequest,
onSuccess?: (results: Results) => void,
onError?: (error: string) => void,
): void;
interface QueryRequest {
/**
* Query to search for
*/
query: string;
commandId?: string | undefined;
option?: {
skip: number;
count: number;
} | undefined;
}
interface QueryResponse {
data: Results | Auth;
type: ResponseType;
}
interface Results {
attachments: Attachment[];
layout: any;
botId: string;
}
interface Auth {
url: string;
title: string;
}
interface AuthQueryRequest extends QueryRequest {
url: string;
}
interface Attachment {
card: any;
previewCard: any;
previewRawPayload: any;
rawPayload: any;
}
interface Command {
title: string;
id: string;
initialRun: boolean;
}
enum ResponseType {
Results = "Results",
Auth = "Auth",
}
}
/**
* Namespace to interact with the conversational subEntities inside the tab
*/
namespace conversations {
/**
* Hide from docs
* --------------
* Allows the user to start or continue a conversation with each subentity inside the tab
*/
function openConversation(openConversationRequest: OpenConversationRequest): void;
/**
* Hide from docs
* --------------
* Allows the user to close the conversation in the right pane
*/
function closeConversation(): void;
}
/**
* Namespace to interact with the files specific part of the SDK.
*
* Hide from docs
*/
namespace files {
/**
* Hide from docs
*
* Cloud storage providers registered with Microsoft Teams
*/
enum CloudStorageProvider {
Dropbox = "DROPBOX",
Box = "BOX",
Sharefile = "SHAREFILE",
GoogleDrive = "GOOGLEDRIVE",
Egnyte = "EGNYTE",
}
/**
* Hide from docs
*
* Cloud storage provider integration type
*/
enum CloudStorageProviderType {
Sharepoint = 0,
WopiIntegration = 1,
Google = 2,
}
/**
* Hide from docs
*
* Cloud storage folder interface
*/
interface CloudStorageFolder {
/**
* ID of the cloud storage folder
*/
id: string;
/**
* Display Name/Title of the cloud storage folder
*/
title: string;
/**
* ID of the cloud storage folder in the provider
*/
folderId: string;
/**
* Type of the cloud storage folder provider integration
*/
providerType: CloudStorageProviderType;
/**
* Code of the supported cloud storage folder provider
*/
providerCode: CloudStorageProvider;
/**
* Display name of the owner of the cloud storage folder provider
*/
ownerDisplayName: string;
/**
* Sharepoint specific siteURL of the folder
*/
siteUrl?: string | undefined;
/**
* Sharepoint specific serverRelativeUrl of the folder
*/
serverRelativeUrl?: string | undefined;
/**
* Sharepoint specific libraryType of the folder
*/
libraryType?: string | undefined;
/**
* Sharepoint specific accessType of the folder
*/
accessType?: string | undefined;
}
/**
* Hide from docs
*
* Cloud storage item interface
*/
interface CloudStorageFolderItem {
/**
* ID of the item in the provider
*/
id: string;
/**
* Display name/title
*/
title: string;
/**
* Key to differentiate files and subdirectory
*/
isSubdirectory: boolean;
/**
* File extension
*/
type: string;
/**
* Last modifed time of the item
*/
lastModifiedTime: string;
/**
* Display size of the items in bytes
*/
size: number;
/**
* URL of the file
*/
objectUrl: string;
/**
* Temporary access token for the item
*/
accessToken?: string | undefined;
}
/**
* Hide from docs
*
* Gets a list of cloud storage folders added to the channel
* @param channelId ID of the channel whose cloud storage folders should be retrieved
* @param callback Callback that will be triggered post folders load
*/
function getCloudStorageFolders(
channelId: string,
callback: (error: SdkError, folders: CloudStorageFolder[]) => void,
): void;
/**
* Hide from docs
*
* Initiates the add cloud storage folder flow
* @param channelId ID of the channel to add cloud storage folder
* @param callback Callback that will be triggered post add folder flow is compelete
*/
function addCloudStorageFolder(
channelId: string,
callback: (error: SdkError, isFolderAdded: boolean, folders: CloudStorageFolder[]) => void,
): void;
/**
* Hide from docs
*
* Deletes a cloud storage folder from channel
* @param channelId ID of the channel where folder is to be deleted
* @param folderToDelete cloud storage folder to be deleted
* @param callback Callback that will be triggered post delete
*/
function deleteCloudStorageFolder(
channelId: string,
folderToDelete: CloudStorageFolder,
callback: (error: SdkError, isFolderDeleted: boolean) => void,
): void;
/**
* Hide from docs
*
* Fetches the contents of a Cloud storage folder (CloudStorageFolder) / sub directory
* @param folder Cloud storage folder (CloudStorageFolder) / sub directory (CloudStorageFolderItem)
* @param providerCode Code of the cloud storage folder provider
* @param callback Callback that will be triggered post contents are loaded
*/
function getCloudStorageFolderContents(
folder: CloudStorageFolder | CloudStorageFolderItem,
providerCode: CloudStorageProvider,
callback: (error: SdkError, items: CloudStorageFolderItem[]) => void,
): void;
/**
* Hide from docs
*
* Open a cloud storage file in teams
* @param file cloud storage file that should be opened
* @param providerCode Code of the cloud storage folder provider
* @param fileOpenPreference Whether file should be opened in web/inline
*/
function openCloudStorageFile(
file: CloudStorageFolderItem,
providerCode: CloudStorageProvider,
fileOpenPreference?: FileOpenPreference.Web | FileOpenPreference.Inline,
): void;
}
/**
* Hide from docs
* --------
* Information about all members in a chat
*/
interface ChatMembersInformation {
members: ThreadMember[];
}
/**
* Hide from docs
* --------
* Information about a chat member
*/
interface ThreadMember {
/**
* The member's user principal name in the current tenant.
*/
upn: string;
}
enum NotificationTypes {
fileDownloadStart = "fileDownloadStart",
fileDownloadComplete = "fileDownloadComplete",
}
interface ShowNotificationParameters {
message: string;
notificationType: NotificationTypes;
}
/**
* Hide from docs.
* ------
*/
enum ViewerActionTypes {
view = "view",
edit = "edit",
editNew = "editNew",
}
/**
* Hide from docs.
* ------
* User setting changes that can be subscribed to,
*/
enum UserSettingTypes {
/**
* Use this key to subscribe to changes in user's file open preference
*/
fileOpenPreference = "fileOpenPreference",
/**
* Use this key to subscribe to theme changes
*/
theme = "theme",
}
/**
* Hide from docs.
* ------
*/
interface FilePreviewParameters {
/**
* The developer-defined unique ID for the file.
*/
entityId: string;
/**
* The display name of the file.
*/
title: string;
/**
* An optional description of the file.
*/
description?: string | undefined;
/**
* The file extension; e.g. pptx, docx, etc.
*/
type: string;
/**
* A url to the source of the file, used to open the content in the user's default browser
*/
objectUrl: string;
/**
* Optional; an alternate self-authenticating url used to preview the file in Mobile clients and offer it for download by the user
*/
downloadUrl?: string | undefined;
/**
* Optional; an alternate url optimized for previewing the file in Teams web and desktop clients
*/
webPreviewUrl?: string | undefined;
/**
* Optional; an alternate url that allows editing of the file in Teams web and desktop clients
*/
webEditUrl?: string | undefined;
/**
* Optional; the base url of the site where the file is hosted
*/
baseUrl?: string | undefined;
/**
* Deprecated; prefer using viewerAction instead
* Optional; indicates whether the file should be opened in edit mode
*/
editFile?: boolean | undefined;
/**
* Optional; the developer-defined unique ID for the sub-entity to return to when the file stage closes.
* This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.
*/
subEntityId?: string | undefined;
/**
* Optional; indicates the mode in which file should be opened. Takes precedence over edit mode.
*/
viewerAction?: ViewerActionTypes | undefined;
/**
* Optional; indicates how user prefers to open the file
*/
fileOpenPreference?: FileOpenPreference | undefined;
}
/**
* Hide from docs
* --------
* Query parameters used when fetching team information
*/
interface TeamInstanceParameters {
/**
* Flag allowing to select favorite teams only
*/
favoriteTeamsOnly?: boolean | undefined;
}
/**
* Hide from docs
* --------
* Information on userJoined Teams
*/
interface UserJoinedTeamsInformation {
/**
* List of team information
*/
userJoinedTeams: TeamInformation[];
}
/**
* Namespace to interact with the logging part of the SDK.
* This object is used to send the app logs on demand to the host client
*
* Hide from docs
*/
namespace logs {
/**
* Hide from docs
* ------
* Registers a handler for getting app log
* @param handler The handler to invoke to get the app log
*/
function registerGetLogHandler(handler: () => string): void;
}
namespace meetingRoom {
/**
* Hide from docs
*
* Data structure to represent a meeting room.
*/
interface MeetingRoomInfo {
/**
* Endpoint id of the meeting room.
*/
endpointId: string;
/**
* Device name of the meeting room.
*/
deviceName: string;
/**
* Client type of the meeting room.
*/
clientType: string;
/**
* Client version of the meeting room.
*/
clientVersion: string;
}
/**
* Hide from docs
*
* Enum used to indicate meeting room capabilities.
*/
enum Capability {
/**
* Media control capability: toggle mute.
*/
toggleMute = "toggleMute",
/**
* Media control capability: toggle camera.
*/
toggleCamera = "toggleCamera",
/**
* Media control capability: toggle captions.
*/
toggleCaptions = "toggleCaptions",
/**
* Media control capability: volume ajustion.
*/
volume = "volume",
/**
* Stage layout control capability: show gallery mode.
*/
showVideoGallery = "showVideoGallery",
/**
* Stage layout control capability: show content mode.
*/
showContent = "showContent",
/**
* Stage layout control capability: show content + gallery mode.
*/
showVideoGalleryAndContent = "showVideoGalleryAndContent",
/**
* Stage layout control capability: show laryge gallery mode.
*/
showLargeGallery = "showLargeGallery",
/**
* Stage layout control capability: show together mode.
*/
showTogether = "showTogether",
/**
* Meeting control capability: leave meeting.
*/
leaveMeeting = "leaveMeeting",
}
/**
* Hide from docs
*
* Data structure to represent capabilities of a meeting room.
*/
interface MeetingRoomCapability {
/**
* Media control capabilities, value can be "toggleMute", "toggleCamera", "toggleCaptions", "volume".
*/
mediaControls: string[];
/**
* Main stage layout control capabilities, value can be "showVideoGallery", "showContent", "showVideoGalleryAndContent", "showLargeGallery", "showTogether".
*/
stageLayoutControls: string[];
/**
* Meeting control capabilities, value can be "leaveMeeting".
*/
meetingControls: string[];
}
/**
* Hide from docs
*
* Data structure to represent states of a meeting room.
*/
interface MeetingRoomState {
/**
* Current mute state, true: mute, false: unmute.
*/
toggleMute: boolean;
/**
* Current camera state, true: camera on, false: camera off.
*/
toggleCamera: boolean;
/**
* Current captions state, true: captions on, false: captions off.
*/
toggleCaptions: boolean;
/**
* Current main stage layout state, value can be one of "Gallery", "Content + gallery", "Content", "Large gallery" and "Together mode".
*/
stageLayout: string;
/**
* Current leaveMeeting state, true: leave, false: no-op.
*/
leaveMeeting: boolean;
}
/**
* Hide from docs
*
* Fetch the meeting room info that paired with current client.
* @param callback Callback to invoke when the meeting room info is fetched.
*/
function getPairedMeetingRoomInfo(
callback: (sdkError: SdkError, meetingRoomInfo: MeetingRoomInfo) => void,
): void;
/**
* Hide from docs
*
* Send a command to paired meeting room.
* @param commandName The command name.
* @param callback Callback to invoke when the command response returns.
*/
function sendCommandToPairedMeetingRoom(commandName: string, callback: (sdkError: SdkError) => void): void;
/**
* Hide from docs
*
* Registers a handler for meeting room capabilities update.
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
* @param handler The handler to invoke when the capabilities of meeting room update.
*/
function registerMeetingRoomCapabilitiesUpdateHandler(
handler: (capabilities: MeetingRoomCapability) => void,
): void;
/**
* Hide from docs
* Registers a handler for meeting room states update.
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
* @param handler The handler to invoke when the states of meeting room update.
*/
function registerMeetingRoomStatesUpdateHandler(handler: (states: MeetingRoomState) => void): void;
}
/**
* Namespace to interact with the menu-specific part of the SDK.
* This object is used to show View Configuration, Action Menu and Navigation Bar Menu.
*
* Hide from docs until feature is complete
*/
namespace menus {
/**
* Represents information about item in View Configuration.
*/
interface ViewConfiguration {
/**
* Unique identifier of view.
*/
id: string;
/**
* Display title of the view.
*/
title: string;
/**
* Additional information for accessibility.
*/
contentDescription?: string | undefined;
}
/**
* Represents information about menu item for Action Menu and Navigation Bar Menu.
*/
class MenuItem {
/**
* Unique identifier for the menu item.
*/
id: string;
/**
* Display title of the menu item.
*/
title: string;
/**
* Display icon of the menu item. The icon value must be a string having SVG icon content.
*/
icon: string;
/**
* Selected state display icon of the menu item. The icon value must be a string having SVG icon content.
*/
iconSelected?: string | undefined;
/**
* Additional information for accessibility.
*/
contentDescription?: string | undefined;
/**
* State of the menu item
*/
enabled: boolean;
/**
* Interface to show list of items on selection of menu item.
*/
viewData: ViewData;
/**
* Whether the menu item is selected or not
*/
selected: boolean;
}
/**
* Represents information about view to show on Navigation Bar Menu item selection
*/
interface ViewData {
/**
* Display header title of the item list.
*/
listTitle?: string | undefined;
/**
* Type of the menu item.
*/
listType: MenuListType;
/**
* Array of MenuItem. Icon value will be required for all items in the list.
*/
listItems: MenuItem[];
}
/**
* Represents information about type of list to display in Navigation Bar Menu.
*/
enum MenuListType {
dropDown = "dropDown",
popOver = "popOver",
}
function initialize(): void;
/**
* Registers list of view configurations and it's handler.
* Handler is responsible for listening selection of View Configuration.
* @param viewConfig List of view configurations. Minimum 1 value is required.
* @param handler The handler to invoke when the user selects view configuration.
*/
function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean): void;
/**
* Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.
* @param items List of MenuItems for Navigation Bar Menu.
* @param handler The handler to invoke when the user selects menu item.
*/
function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean): void;
interface ActionMenuParameters {
/**
* Display title for Action Menu
*/
title: string;
/**
* List of MenuItems for Action Menu
*/
items: MenuItem[];
}
/**
* Used to show Action Menu.
* @param params Parameters for Menu Parameters
* @param handler The handler to invoke when the user selects menu item.
*/
function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean): void;
}
function initializePrivateApis(): void;
/**
* Hide from docs
* ------
* Allows an app to retrieve information of all user joined teams
* @param callback The callback to invoke when the {@link TeamInstanceParameters} object is retrieved.
* @param teamInstanceParameters OPTIONAL Flags that specify whether to scope call to favorite teams
*/
function getUserJoinedTeams(
callback: (userJoinedTeamsInformation: UserJoinedTeamsInformation) => void,
teamInstanceParameters?: TeamInstanceParameters,
): void;
/**
* Hide from docs
* ------
* Place the tab into full-screen mode.
*/
function enterFullscreen(): void;
/**
* Hide from docs
* ------
* Reverts the tab into normal-screen mode.
*/
function exitFullscreen(): void;
/**
* Hide from docs.
* ------
* Opens a client-friendly preview of the specified file.
* @param file The file to preview.
*/
function openFilePreview(filePreviewParameters: FilePreviewParameters): void;
/**
* Hide from docs.
* ------
* display notification API.
* @param message Notification message.
* @param notificationType Notification type
*/
function showNotification(showNotificationParameters: ShowNotificationParameters): void;
/**
* Hide from docs.
* ------
* Upload a custom App manifest directly to both team and personal scopes.
* This method works just for the first party Apps.
*/
function uploadCustomApp(manifestBlob: Blob, onComplete?: (status: boolean, reason?: string) => void): void;
/**
* Internal use only
* Sends a custom action MessageRequest to Teams or parent window
* @param actionName Specifies name of the custom action to be sent
* @param args Specifies additional arguments passed to the action
* @param callback Optionally specify a callback to receive response parameters from the parent
* @returns id of sent message
*/
function sendCustomMessage(actionName: string, args?: any[], callback?: (...args: any[]) => void): void;
/**
* Internal use only
* Sends a custom action MessageEvent to a child iframe/window, only if you are not using auth popup.
* Otherwise it will go to the auth popup (which becomes the child)
* @param actionName Specifies name of the custom action to be sent
* @param args Specifies additional arguments passed to the action
* @returns id of sent message
*/
function sendCustomEvent(actionName: string, args?: any[]): void;
/**
* Internal use only
* Adds a handler for an action sent by a child window or parent window
* @param actionName Specifies name of the action message to handle
* @param customHandler The callback to invoke when the action message is received. The return value is sent to the child
*/
function registerCustomHandler(actionName: string, customHandler: (...args: any[]) => any[]): void;
/**
* Hide from docs
* ------
* Allows an app to retrieve information of all chat members
* Because a malicious party run your content in a browser, this value should
* be used only as a hint as to who the members are and never as proof of membership.
* @param callback The callback to invoke when the {@link ChatMembersInformation} object is retrieved.
*/
function getChatMembers(callback: (chatMembersInformation: ChatMembersInformation) => void): void;
/**
* Hide from docs
* ------
* Allows an app to get the configuration setting value
* @param callback The callback to invoke when the value is retrieved.
* @param key The key for the config setting
*/
function getConfigSetting(callback: (value: string) => void, key: string): void;
/**
* register a handler to be called when a user setting changes. The changed setting type & value is provided in the callback.
* @param settingTypes List of user setting changes to subscribe
* @param handler When a subscribed setting is updated this handler is called
*/
function registerUserSettingsChangeHandler(
settingTypes: UserSettingTypes[],
handler: (settingType: UserSettingTypes, value: any) => void,
): void;
namespace remoteCamera {
/**
* Hide from docs
*
* Data structure to represent patricipant details needed to request control of camera.
*/
interface Participant {
/**
* Id of participant.
*/
id: string;
/**
* Display name of participant.
*/
displayName?: string | undefined;
/**
* Active indicates whether the participant's device is actively being controlled.
*/
active?: boolean | undefined;
}
/**
* Hide from docs
*
* Enum used to indicate possible camera control commands.
*/
enum ControlCommand {
Reset = "Reset",
ZoomIn = "ZoomIn",
ZoomOut = "ZoomOut",
PanLeft = "PanLeft",
PanRight = "PanRight",
TiltUp = "TiltUp",
TiltDown = "TiltDown",
}
/**
* Hide from docs
*
* Data structure to indicate the current state of the device.
*/
interface DeviceState {
/**
* All operation are available to apply.
*/
available: boolean;
/**
* Either camera doesnt support to get state or It unable to apply command.
*/
error: boolean;
/**
* Reset max out or already applied. Client Disable Reset.
*/
reset: boolean;
/**
* ZoomIn maxed out.
*/
zoomIn: boolean;
/**
* ZoomOut maxed out.
*/
zoomOut: boolean;
/**
* PanLeft reached max left.
*/
panLeft: boolean;
/**
* PanRight reached max right.
*/
panRight: boolean;
/**
* TiltUp reached top.
*/
tiltUp: boolean;
/**
* TiltDown reached bottom.
*/
tiltDown: boolean;
}
/**
* Hide from docs
*
* Enum used to indicate the reason for the error.
*/
enum ErrorReason {
CommandResetError = 0,
CommandZoomInError = 1,
CommandZoomOutError = 2,
CommandPanLeftError = 3,
CommandPanRightError = 4,
CommandTiltUpError = 5,
CommandTiltDownError = 6,
SendDataError = 7,
}
/**
* Hide from docs
*
* Data structure to indicate the status of the current session.
*/
interface SessionStatus {
/**
* Whether the far-end user is controlling a device.
*/
inControl: boolean;
/**
* Reason the control session was terminated.
*/
terminatedReason?: SessionTerminatedReason | undefined;
}
/**
* Hide from docs
*
* Enum used to indicate the reason the session was terminated.
*/
enum SessionTerminatedReason {
None = 0,
ControlDenied = 1,
ControlNoResponse = 2,
ControlBusy = 3,
AckTimeout = 4,
ControlTerminated = 5,
ControllerTerminated = 6,
DataChannelError = 7,
ControllerCancelled = 8,
ControlDisabled = 9,
ControlTerminatedToAllowOtherController = 10,
}
/**
* Hide from docs
*
* Fetch a list of the participants with controllable-cameras in a meeting.
* @param callback Callback contains 2 parameters, error and participants.
* error can either contain an error of type SdkError, incase of an error, or null when fetch is successful
* participants can either contain an array of Participant objects, incase of a successful fetch or null when it fails
* participants: object that contains an array of participants with controllable-cameras
*/
function getCapableParticipants(
callback: (error: SdkError | null, participants: Participant[] | null) => void,
): void;
/**
* Hide from docs
*
* Request control of a participant's camera.
* @param participant Participant specifies the participant to send the request for camera control.
* @param callback Callback contains 2 parameters, error and requestResponse.
* error can either contain an error of type SdkError, incase of an error, or null when fetch is successful
* requestResponse can either contain the true/false value, incase of a successful request or null when it fails
* requestResponse: True means request was accepted and false means request was denied
*/
function requestControl(
participant: Participant,
callback: (error: SdkError | null, requestResponse: boolean | null) => void,
): void;
/**
* Hide from docs
*
* Send control command to the participant's camera.
* @param ControlCommand ControlCommand specifies the command for controling the camera.
* @param callback Callback to invoke when the command response returns.
*/
function sendControlCommand(ControlCommand: ControlCommand, callback: (error: SdkError | null) => void): void;
/**
* Hide from docs
*
* Terminate the remote session
* @param callback Callback to invoke when the command response returns.
*/
function terminateSession(callback: (error: SdkError | null) => void): void;
/**
* Registers a handler for change in participants with controllable-cameras.
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
* @param handler The handler to invoke when the list of participants with controllable-cameras changes.
*/
function registerOnCapableParticipantsChangeHandler(handler: (participantChange: Participant[]) => void): void;
/**
* Registers a handler for error.
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
* @param handler The handler to invoke when there is an error from the camera handler.
*/
function registerOnErrorHandler(handler: (error: ErrorReason) => void): void;
/**
* Registers a handler for device state change.
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
* @param handler The handler to invoke when the controlled device changes state.
*/
function registerOnDeviceStateChangeHandler(handler: (deviceStateChange: DeviceState) => void): void;
/**
* Registers a handler for session status change.
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
* @param handler The handler to invoke when the current session status changes.
*/
function registerOnSessionStatusChangeHandler(handler: (sessionStatusChange: SessionStatus) => void): void;
}
namespace appInitialization {
const Messages: {
AppLoaded: string;
Success: string;
Failure: string;
ExpectedFailure: string;
};
enum FailedReason {
AuthFailed = "AuthFailed",
Timeout = "Timeout",
Other = "Other",
}
enum ExpectedFailureReason {
PermissionError = "PermissionError",
NotFound = "NotFound",
Throttling = "Throttling",
Offline = "Offline",
Other = "Other",
}
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IFailedRequest {
reason: FailedReason;
message?: string | undefined;
}
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IExpectedFailureRequest {
reason: ExpectedFailureReason;
message?: string | undefined;
}
/**
* Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
*/
function notifyAppLoaded(): void;
/**
* Notifies the frame that app initialization is successful and is ready for user interaction.
*/
function notifySuccess(): void;
/**
* Notifies the frame that app initialization has failed and to show an error page in its place.
*/
function notifyFailure(appInitializationFailedRequest: IFailedRequest): void;
/**
* Notifies the frame that app initialized with some expected errors.
*/
function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
}
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IAppWindow {
postMessage(message: any): void;
addEventListener(type: string, listener: () => void): void;
}
class ChildAppWindow implements IAppWindow {
postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
addEventListener(type: string, listener: (message: any) => void): void;
}
class ParentAppWindow implements IAppWindow {
private static _instance;
static readonly Instance: IAppWindow;
postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
addEventListener(type: string, listener: (message: any) => void): void;
}
/**
* Namespace to interact with the authentication-specific part of the SDK.
* This object is used for starting or completing authentication flows.
*/
namespace authentication {
function initialize(): void;
/**
* Registers the authentication Communication.handlers
* @param authenticateParameters A set of values that configure the authentication pop-up.
*/
function registerAuthenticationHandlers(authenticateParameters: AuthenticateParameters): void;
/**
* Initiates an authentication request, which opens a new window with the specified settings.
*/
function authenticate(authenticateParameters?: AuthenticateParameters): void;
/**
* Requests an Azure AD token to be issued on behalf of the app. The token is acquired from the cache
* if it is not expired. Otherwise a request is sent to Azure AD to obtain a new token.
* @param authTokenRequest A set of values that configure the token request.
*/
function getAuthToken(authTokenRequest: AuthTokenRequest): void;
/**
* Hide from docs.
* ------
* Requests the decoded Azure AD user identity on behalf of the app.
*/
function getUser(userRequest: UserRequest): void;
/**
* Notifies the frame that initiated this authentication request that the request was successful.
* This function is usable only on the authentication window.
* This call causes the authentication window to be closed.
* @param result Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives this value in its callback.
* @param callbackUrl Specifies the url to redirect back to if the client is Win32 Outlook.
*/
function notifySuccess(result?: string, callbackUrl?: string): void;
/**
* Notifies the frame that initiated this authentication request that the request failed.
* This function is usable only on the authentication window.
* This call causes the authentication window to be closed.
* @param result Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives this value in its callback.
* @param callbackUrl Specifies the url to redirect back to if the client is Win32 Outlook.
*/
function not