dop-sdk
Version:
Mini App SDK for JavaScript by VTB
28 lines (27 loc) • 1.52 kB
TypeScript
import { MessageToContact } from '../types/message-to-contact';
/** @internal */
export declare class ChatService {
/**
* @param message The message to send to contact.
* @returns Promise resolves with the contact id received a message.
* Can also resolve with null response in the case that the message was not sent to a contact, such as if the user cancelled sending the message.
* Promise rejects in the case that there was an error.
* It returns error info if user had denied the custom permission for sending message.
*/
sendMessageToContact(message: MessageToContact): Promise<string | null>;
/**
* @param id The id of the contact receiving a message.
* @param message The message to send to contact.
* @returns Promise resolves with the contact id received a message.
* @see {sendMessageToContact}
*/
sendMessageToContactId(id: string, message: MessageToContact): Promise<string | null>;
/**
* @param message The message to send to contact.
* @returns Promise resolves with an array of contact id which were sent the message.
* Can also resolve with null array in the case that the message was not sent to any contacts, such as if the user cancelled sending the message.
* Promise rejects in the case that there was an error.
* It returns error info if user had denied the custom permission for sending message.
*/
sendMessageToMultipleContacts(message: MessageToContact): Promise<string[] | null>;
}