Options
All
  • Public
  • Public/Protected
  • All
Menu

A WebCollabClient should be integrated to your application to enable collaboration.

It provides methods to create/get/remove Collaboration and generate Invitation.

Hierarchy

  • WebCollabClient

Index

Constructors

  • Constructor that creates a web collaboration client with given options.

    Parameters

    • collabOptions: CollabOptions

      The options for creating a web collaboration client.

    Returns WebCollabClient

    A web collaboration client.

Methods

  • createCollaboration(doc: { docName: string; fileUrl: string; isDocPublic: boolean }): Promise<Collaboration>
  • Create a collaboration with the specified document information. When the collaboration is created, the current user will be the owner of the created collaboration, and the information of the user is provided by the UserProvider.

    see

    CollabOptions

    see

    Collaboration

    Parameters

    • doc: { docName: string; fileUrl: string; isDocPublic: boolean }
      • docName: string

        The document name of the collaboration.

      • fileUrl: string

        The URL of the PDF file to enable collaboration.

      • isDocPublic: boolean
        • true: Anyone can access this collaboration.
        • false: Only the specified members can access this collaboration.

    Returns Promise<Collaboration>

    • A collaboration object.
  • createInvitation(collaborationId: string, expiresInMilliSeconds?: number): Promise<Invitation>
  • Create an invitation with the specified expiration time in milliseconds.

    For example, if you want to generate a link to invite others to join the collaboration, the following steps are required:

    1. Create an invitation using this method, and get the returned invitation id;
    2. Generate an invitation link that contains the invitation id;
    3. When users click the invitation link, they will get the invitation id from the link and then use joinCollaborationWithInvitation to join the collaboration.
    see

    Invitation.

    Parameters

    • collaborationId: string

      Identifier of the collaboration.

    • Optional expiresInMilliSeconds: number
      • Expire in milliseconds if this option specified.
      • If this option omitted, the invitation will not expire.

    Returns Promise<Invitation>

    • A Invitation object.
  • getCollaboration(collaborationId: string): Promise<Collaboration>
  • Get a collaboration by id.

    throws

    If the collaborationId is invalid.

    see

    Collaboration

    Parameters

    • collaborationId: string

      The id of the collaboration.

    Returns Promise<Collaboration>

    • A collaboration object.
  • joinCollaborationWithInvitation(invitationId: string): Promise<Collaboration>
  • Join a collaboration by the specified invitation id.

    throws

    If the invitation expires.

    see

    Collaboration.

    Parameters

    • invitationId: string

      The id of invitation ( usually obtained from invitation link). It is returned by function createInvitation.

    Returns Promise<Collaboration>

    • A Collaboration object.
  • removeCollaboration(collaborationId: string): Promise<boolean>
  • Remove collaboration by the specified id. Only the owner of Collaboration ia allowed to remove it.

    Parameters

    • collaborationId: string

      The id of collaboration.

    Returns Promise<boolean>

    • true: Remove collaboration successfully.
    • false: Failed to remove the collaboration.

Generated using TypeDoc