Skip to content

Commit 3cea1ff

Browse files
committed
Merge branch 'master' of github.com:leancloud/javascript-sdk
2 parents 37d1620 + c1078b8 commit 3cea1ff

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/query.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,9 +1066,9 @@ module.exports = function(AV) {
10661066
);
10671067

10681068
AV.FriendShipQuery = AV.Query._extend({
1069-
_objectClass: AV.User,
10701069
_newObject: function() {
1071-
return new AV.User();
1070+
const UserClass = AV.Object._getSubclass('_User');
1071+
return new UserClass();
10721072
},
10731073
_processResult: function(json) {
10741074
if (json && json[this._friendshipTag]) {

storage.d.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,6 @@ declare interface LiveQueryEvent<T> {
576576
delete: (target?: T) => any;
577577
}
578578

579-
declare class FriendShipQuery extends Query<User> {}
580-
581579
export class SearchQuery<T extends Queriable> extends BaseQuery<T> {
582580
sid(sid: string): this;
583581
queryString(q: string): this;
@@ -732,8 +730,8 @@ export class User extends Object {
732730
): Promise<User>;
733731
static verifyMobilePhone(code: string, options?: AuthOptions): Promise<User>;
734732

735-
static followerQuery(userObjectId: string): FriendShipQuery;
736-
static followeeQuery(userObjectId: string): FriendShipQuery;
733+
static followerQuery<T extends User>(userObjectId: string): Query<T>;
734+
static followeeQuery<T extends User>(userObjectId: string): Query<T>;
737735

738736
loginWithWeapp(options?: WeappLoginOptions): Promise<User>;
739737
loginWithWeappWithUnionId(
@@ -799,8 +797,8 @@ export class User extends Object {
799797
options: { user: User | string },
800798
authOptions?: AuthOptions
801799
): Promise<void>;
802-
followerQuery(): FriendShipQuery;
803-
followeeQuery(): FriendShipQuery;
800+
followerQuery(): Query<this>;
801+
followeeQuery(): Query<this>;
804802
}
805803

806804
export class Captcha {

0 commit comments

Comments
 (0)