Skip to content

Commit 39bf2cd

Browse files
aiskleeyeh
authored andcommitted
feat: add AV.Conversation's type define file
1 parent 33c3907 commit 39bf2cd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

storage.d.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,31 @@ declare namespace AV {
548548
getRoles(options?: AuthOptions): Promise<Role>;
549549
}
550550

551+
/**
552+
* @class AV.Conversation
553+
* <p>An AV.Conversation is a local representation of a LeanCloud realtime's
554+
* conversation. This class is a subclass of AV.Object, and retains the
555+
* same functionality of an AV.Object, but also extends it with various
556+
* conversation specific methods, like get members, creators of this conversation.
557+
* </p>
558+
*
559+
* @param {String} name The name of the Role to create.
560+
* @param {Boolean} [options.isSystem] Set this conversation as system conversation.
561+
* @param {Boolean} [options.isTransient] Set this conversation as transient conversation.
562+
*/
563+
export class Conversation extends Object {
564+
constructor(name: string, options?: { isSytem?: boolean, isTransient?: boolean });
565+
getCreator(): string;
566+
getLastMessageAt(): Date;
567+
getMembers(): string[];
568+
addMember(member: string): Conversation;
569+
getMutedMembers(): string[];
570+
getName(): string;
571+
isTransient(): boolean;
572+
isSystem(): boolean;
573+
send(clintId: string, message: string|object, options?: { transient?: boolean, pushData?: object }, authOptions?: AuthOptions): Promise<void>;
574+
}
575+
551576
export class Error {
552577

553578
code: ErrorCode;

0 commit comments

Comments
 (0)