Class InviteApi

Hierarchy

  • TypedEmitter
    • InviteApi

Constructors

Properties

Methods

Constructors

  • Parameters

    • options: {
          logger: undefined | Logger;
          queries: {
              addProject: ((projectDetails: Pick<ProjectJoinDetails, "projectKey" | "encryptionKeys"> & {
                  projectName: string;
              }) => Promise<string>);
              getProjectByInviteId: ((projectInviteId: Readonly<Buffer>) => undefined | {
                  projectPublicId: string;
              });
          };
          rpc: LocalPeers;
      }
      • logger: undefined | Logger
      • queries: {
            addProject: ((projectDetails: Pick<ProjectJoinDetails, "projectKey" | "encryptionKeys"> & {
                projectName: string;
            }) => Promise<string>);
            getProjectByInviteId: ((projectInviteId: Readonly<Buffer>) => undefined | {
                projectPublicId: string;
            });
        }
        • addProject: ((projectDetails: Pick<ProjectJoinDetails, "projectKey" | "encryptionKeys"> & {
              projectName: string;
          }) => Promise<string>)
            • (projectDetails): Promise<string>
            • Parameters

              • projectDetails: Pick<ProjectJoinDetails, "projectKey" | "encryptionKeys"> & {
                    projectName: string;
                }

              Returns Promise<string>

        • getProjectByInviteId: ((projectInviteId: Readonly<Buffer>) => undefined | {
              projectPublicId: string;
          })
            • (projectInviteId): undefined | {
                  projectPublicId: string;
              }
            • Parameters

              • projectInviteId: Readonly<Buffer>

              Returns undefined | {
                  projectPublicId: string;
              }

      • rpc: LocalPeers

    Returns InviteApi

Properties

Methods

  • Attempt to accept the invite.

    This can fail if the invitor has canceled the invite or if you cannot connect to the invitor's device.

    If the invite is accepted and you had other invites to the same project, those invites are removed, and the invitors are told that you're already part of this project.

    Parameters

    Returns Promise<string>