UNPKG

textiot

Version:

A framework for building web and native (IoT) Dapps on the IPFS network

44 lines (43 loc) 1.29 kB
import { API } from '../core/api'; import { Block, ExternalInvite, InviteViewList } from '../models'; /** * Invites is an API module for managing thread invites * * @extends API */ export default class Invites extends API { /** * Accept an invite to a thread * * @param invite Invite ID * @param key Key for an external invite */ accept(invite: string, key?: string): Promise<Block>; /** * Adds a peer-to-peer invite to a thread * * @param thread Thread ID (can also use ‘default’) * @param address Account Address (omit to create an external invite) * @returns Whether the operation was successfull */ add(thread: string, address: string): Promise<boolean>; /** * Adds a external invite to a thread * * @param thread Thread ID (can also use ‘default’) * @returns An external invite object */ addExternal(thread: string): Promise<ExternalInvite>; /** * Lists all pending thread invites * @returns An array of invite views */ list(): Promise<InviteViewList>; /** * Ignore a direct invite to a thread * * @param id ID of the invite * @returns Whether the operation was successfull */ ignore(id: string): Promise<boolean>; }