Share via


@microsoft/document-collaboration-sdk package

Interfaces

AnnotationData

Annotation event data for PowerPoint Live presentations. Used to synchronize annotation events across meeting participants.

BootDocumentParams

Defines the input type for the launch function.

BootInfo

Information returned by the Meeting and Document boot flows.

DocumentIdentifier

Information to uniquely identify a document.

DocumentInfo

Information about the document.

ErrorInfo

Error information returned by BootInfo.errorInfo.

HostInfo

Information about the external partner host.

JoinCollaborationParams

Defines the input type for the joinCollaboration function.

JoinPresentationParams

The input type for the joinPresentation function.

MediaEventData

Media event data for PowerPoint Live presentations. Used to synchronize media playback (video/audio) across meeting participants.

MeetingInfo

Information about the meeting.

OpticalZoomData

Optical zoom data for PowerPoint Live presentations. Used to synchronize zoom level and center point across meeting participants.

SessionInfo

Information about the session.

SlideChangeData

Slide change data for PowerPoint Live presentations. Used to synchronize slide navigation across meeting participants.

StartCollaborationParams

Defines the input type for the startCollaboration function.

StartPresentationParams

The input type for the startPresentation function.

UiHostEventHandlers

The callback for event handling.

UserInfo

Information about the user.

Enums

Action

Possible actions.

DocumentType

Possible document types.

ErrorType

Error types.

HostClientType

Host client types.

MediaEventType

Media event types for PowerPoint Live presentations.

MediaPlayerState

Media player states for PowerPoint Live presentations.

Functions

accessibilityLoopComplete(boolean)

Notify the Office for the Web experience whether to handle keyboard events related to focus change.

endSession()

Signals the end of the Office for the Web session.

initializeDocument(HostInfo)

Initializes the document. Must be invoked first in order to prepare the experience and perform the needed licensing checks.

initializeMeeting(HostInfo)

Initializes the meeting. Must be invoked first in order to prepare the experience and perform the needed licensing checks.

joinCollaboration(JoinCollaborationParams)

Allows a user to join an existing Collaborate session. Must have already called initializeMeeting and startCollaboration.

joinPresentation(JoinPresentationParams)

Allows an attendee to join an existing Present session. Must have already called initializeMeeting and startPresentation.

launch(BootDocumentParams)

Initiates a new Office for the Web session. Must have already called initializeDocument.

launchStartPage(BootStartPageParams)

Initiates a new Start Page session. Must have already called initializeDocument.

meetingAccessibilityLoopComplete(boolean)

Notify the Live or Collaborate experience how to handle keyboard events related to focus change.

startCollaboration(JoinCollaborationParams)

Initiates a Collaborate session. Must have already called initializeMeeting.

startPresentation(StartPresentationParams)

Initiates a new Present session. Must have already called initializeMeeting.

stopCollaboration()

Signals the end of the Collaborate session.

IMPORTANT: Not implemented yet.

trySilentAuth(string, string)

Does a silent sign in attempt using MSAL. If failure or interaction required, returns false. If successful, returns true.

Function Details

accessibilityLoopComplete(boolean)

Notify the Office for the Web experience whether to handle keyboard events related to focus change.

function accessibilityLoopComplete(navigateForward: boolean): boolean

Parameters

navigateForward

boolean

Indicates the keyboard focus direction when the user switches between the Office app iframe and the external partner host UI frame. true represents clockwise, otherwise false.

Returns

boolean

A boolean value indicating whether the loop has completed successfully.

endSession()

Note

This API is in Alpha and still in experimentation. Do not use this API in a production environment.

Signals the end of the Office for the Web session.

function endSession(): Promise<string>

Returns

Promise<string>

Pending...

initializeDocument(HostInfo)

Initializes the document. Must be invoked first in order to prepare the experience and perform the needed licensing checks.

function initializeDocument(hostInfo: HostInfo)

Parameters

hostInfo
HostInfo

Information about the external partner host. See definition of HostInfo for details.

initializeMeeting(HostInfo)

Initializes the meeting. Must be invoked first in order to prepare the experience and perform the needed licensing checks.

function initializeMeeting(hostInfo: HostInfo)

Parameters

hostInfo
HostInfo

Information about the external partner host. See definition of HostInfo for details.

joinCollaboration(JoinCollaborationParams)

Allows a user to join an existing Collaborate session. Must have already called initializeMeeting and startCollaboration.

function joinCollaboration(collabParams: JoinCollaborationParams): Promise<BootInfo>

Parameters

collabParams
JoinCollaborationParams

Information needed to join the Collaborate session. See definition of JoinCollaborationParams for details.

Returns

Promise<BootInfo>

Information about the session. See definition of BootInfo for details.

joinPresentation(JoinPresentationParams)

Allows an attendee to join an existing Present session. Must have already called initializeMeeting and startPresentation.

function joinPresentation(presParams: JoinPresentationParams): Promise<BootInfo>

Parameters

presParams
JoinPresentationParams

Information needed to join the existing Present session. See definition of JoinPresentationParams for details.

Returns

Promise<BootInfo>

Information about the session. See definition of BootInfo for details.

Remarks

Use the joinInfo property returned in the object returned by the startPresentation call that initialized the sharing session.

launch(BootDocumentParams)

Initiates a new Office for the Web session. Must have already called initializeDocument.

function launch(bootDocumentParams: BootDocumentParams): Promise<BootInfo>

Parameters

bootDocumentParams
BootDocumentParams

Information needed to boot the document. See definition of BootDocumentParams for details.

Returns

Promise<BootInfo>

Information about the session. See definition of BootInfo for details.

launchStartPage(BootStartPageParams)

Initiates a new Start Page session. Must have already called initializeDocument.

function launchStartPage(startPageParams: BootStartPageParams): Promise<BootInfo>

Parameters

startPageParams

BootStartPageParams

Information needed to boot the start page. See definition of BootStartPageParams for details.

Returns

Promise<BootInfo>

Information about the session. See definition of BootInfo for details.

meetingAccessibilityLoopComplete(boolean)

Notify the Live or Collaborate experience how to handle keyboard events related to focus change.

function meetingAccessibilityLoopComplete(navigateForward: boolean): boolean

Parameters

navigateForward

boolean

Indicates the keyboard focus direction when the user switches between the Office app iframe and the external partner host UI frame. true represents clockwise, otherwise false.

Returns

boolean

A boolean value indicating whether the loop has completed successfully.

startCollaboration(JoinCollaborationParams)

Initiates a Collaborate session. Must have already called initializeMeeting.

function startCollaboration(collabParams: JoinCollaborationParams): Promise<BootInfo>

Parameters

collabParams
JoinCollaborationParams

Information needed to start the Collaborate session. See definition of JoinCollaborationParams for details.

Returns

Promise<BootInfo>

Information about the session. See definition of BootInfo for details.

startPresentation(StartPresentationParams)

Initiates a new Present session. Must have already called initializeMeeting.

function startPresentation(presParams: StartPresentationParams): Promise<BootInfo>

Parameters

Returns

Promise<BootInfo>

Information about the session. See definition of BootInfo for details.

Remarks

Starts a new Present sharing session for a document and renders the presenter's view into the specified container element. If the presentation starts successfully, the response will contain a joinInfo parameter. This must be passed to the attendee for them to join the existing Present session. joinInfo contains secret info and must not be included in any telemetry or diagnostic logs.

stopCollaboration()

Note

This API is in Alpha and still in experimentation. Do not use this API in a production environment.

Signals the end of the Collaborate session.

IMPORTANT: Not implemented yet.

function stopCollaboration(): Promise<string>

Returns

Promise<string>

Pending...

trySilentAuth(string, string)

Note

This API is in Alpha and still in experimentation. Do not use this API in a production environment.

Does a silent sign in attempt using MSAL. If failure or interaction required, returns false. If successful, returns true.

function trySilentAuth(username: string, clientId: string): Promise<boolean>

Parameters

username

string

The username (email) of the user to authenticate.

clientId

string

App Id that is used to acquire the token silently.

Returns

Promise<boolean>

A boolean indicating whether the silent auth was successful.

Remarks

This function is used to check if the user is already signed in without prompting for credentials. It is useful for scenarios where you want to avoid user interaction.