Skip to content

Commit 5ca2fae

Browse files
committed
change protected to jsdoc (#155)
1 parent 2f14bdd commit 5ca2fae

File tree

5 files changed

+127
-20
lines changed

5 files changed

+127
-20
lines changed

src/mixins/contact-mixin.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,19 @@ const contactMixin = <TBase extends CacheMixin>(Base: TBase) => {
4747

4848
abstract contactList () : Promise<string[]>
4949

50-
protected abstract contactRawPayload (contactId: string) : Promise<any>
51-
protected abstract contactRawPayloadParser (rawPayload: any) : Promise<ContactPayload>
50+
/**
51+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
52+
*
53+
* @protected
54+
*/
55+
abstract contactRawPayload (contactId: string) : Promise<any>
56+
57+
/**
58+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
59+
*
60+
* @protected
61+
*/
62+
abstract contactRawPayloadParser (rawPayload: any) : Promise<ContactPayload>
5263

5364
// async contactRoomList (
5465
// contactId: string,
@@ -158,7 +169,12 @@ const contactMixin = <TBase extends CacheMixin>(Base: TBase) => {
158169
this.cache.contact.delete(contactId)
159170
}
160171

161-
protected contactQueryFilterFactory (
172+
/**
173+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
174+
*
175+
* @protected
176+
*/
177+
contactQueryFilterFactory (
162178
query: ContactQueryFilter,
163179
): ContactPayloadFilterFunction {
164180
log.verbose('Puppet', 'contactQueryFilterFactory(%s)',
@@ -221,7 +237,12 @@ const contactMixin = <TBase extends CacheMixin>(Base: TBase) => {
221237
return true
222238
}
223239

224-
protected contactPayloadCache (contactId: string): undefined | ContactPayload {
240+
/**
241+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
242+
*
243+
* @protected
244+
*/
245+
contactPayloadCache (contactId: string): undefined | ContactPayload {
225246
// log.silly('Puppet', 'contactPayloadCache(id=%s) @ %s', contactId, this)
226247
if (!contactId) {
227248
throw new Error('no id')

src/mixins/friendship-mixin.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,19 @@ const friendshipMixin = <TBase extends CacheMixin>(Base: TBase) => {
2828
abstract friendshipSearchPhone (phone: string) : Promise<null | string>
2929
abstract friendshipSearchWeixin (weixin: string) : Promise<null | string>
3030

31-
protected abstract friendshipRawPayload (friendshipId: string) : Promise<any>
32-
protected abstract friendshipRawPayloadParser (rawPayload: any) : Promise<FriendshipPayload>
31+
/**
32+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
33+
*
34+
* @protected
35+
*/
36+
abstract friendshipRawPayload (friendshipId: string) : Promise<any>
37+
38+
/**
39+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
40+
*
41+
* @protected
42+
*/
43+
abstract friendshipRawPayloadParser (rawPayload: any) : Promise<FriendshipPayload>
3344

3445
async friendshipSearch (
3546
searchQueryFilter: FriendshipSearchQueryFilter,
@@ -49,7 +60,12 @@ const friendshipMixin = <TBase extends CacheMixin>(Base: TBase) => {
4960
throw new Error(`unknown key from searchQueryFilter: ${Object.keys(searchQueryFilter).join('')}`)
5061
}
5162

52-
protected friendshipPayloadCache (friendshipId: string): undefined | FriendshipPayload {
63+
/**
64+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
65+
*
66+
* @protected
67+
*/
68+
friendshipPayloadCache (friendshipId: string): undefined | FriendshipPayload {
5369
log.silly('Puppet', 'friendshipPayloadCache(id=%s) @ %s', friendshipId, this)
5470

5571
if (!friendshipId) {

src/mixins/message-mixin.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,26 @@ const messageMixin = <TBase extends CacheMixin>(Base: TBase) => {
6161

6262
abstract messageRecall (messageId: string) : Promise<boolean>
6363

64-
protected abstract messageRawPayload (messageId: string) : Promise<any>
65-
protected abstract messageRawPayloadParser (rawPayload: any) : Promise<MessagePayload>
64+
/**
65+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
66+
*
67+
* @protected
68+
*/
69+
abstract messageRawPayload (messageId: string) : Promise<any>
70+
71+
/**
72+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
73+
*
74+
* @protected
75+
*/
76+
abstract messageRawPayloadParser (rawPayload: any) : Promise<MessagePayload>
6677

67-
protected messagePayloadCache (messageId: string): undefined | MessagePayload {
78+
/**
79+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
80+
*
81+
* @protected
82+
*/
83+
messagePayloadCache (messageId: string): undefined | MessagePayload {
6884
// log.silly('Puppet', 'messagePayloadCache(id=%s) @ %s', messageId, this)
6985
if (!messageId) {
7086
throw new Error('no id')
@@ -142,7 +158,12 @@ const messageMixin = <TBase extends CacheMixin>(Base: TBase) => {
142158
return messageIdList
143159
}
144160

145-
protected messageQueryFilterFactory (
161+
/**
162+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
163+
*
164+
* @protected
165+
*/
166+
messageQueryFilterFactory (
146167
query: MessageQueryFilter,
147168
): MessagePayloadFilterFunction {
148169
log.verbose('Puppet', 'messageQueryFilterFactory(%s)',

src/mixins/room-invitation-mixin.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ const roomInvitationMixin = <TBase extends CacheMixin>(Base: TBase) => {
2121
* Room Invitation
2222
*
2323
*/
24-
protected roomInvitationPayloadCache (
24+
25+
/**
26+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
27+
*
28+
* @protected
29+
*/
30+
roomInvitationPayloadCache (
2531
roomInvitationId: string,
2632
): undefined | RoomInvitationPayload {
2733
// log.silly('Puppet', 'roomInvitationPayloadCache(id=%s) @ %s', friendshipId, this)
@@ -41,8 +47,19 @@ const roomInvitationMixin = <TBase extends CacheMixin>(Base: TBase) => {
4147

4248
abstract roomInvitationAccept (roomInvitationId: string): Promise<void>
4349

44-
protected abstract roomInvitationRawPayload (roomInvitationId: string) : Promise<any>
45-
protected abstract roomInvitationRawPayloadParser (rawPayload: any) : Promise<RoomInvitationPayload>
50+
/**
51+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
52+
*
53+
* @protected
54+
*/
55+
abstract roomInvitationRawPayload (roomInvitationId: string) : Promise<any>
56+
57+
/**
58+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
59+
*
60+
* @protected
61+
*/
62+
abstract roomInvitationRawPayloadParser (rawPayload: any) : Promise<RoomInvitationPayload>
4663

4764
/**
4865
* Get & Set

src/mixins/room-mixin.ts

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,19 @@ const roomMixin = <TBase extends RoomMixinDependency>(Base: TBase) => {
5050
abstract roomTopic (roomId: string) : Promise<string>
5151
abstract roomTopic (roomId: string, topic: string) : Promise<void>
5252

53-
protected abstract roomRawPayload (roomId: string) : Promise<any>
54-
protected abstract roomRawPayloadParser (rawPayload: any) : Promise<RoomPayload>
53+
/**
54+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
55+
*
56+
* @protected
57+
*/
58+
abstract roomRawPayload (roomId: string) : Promise<any>
59+
60+
/**
61+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
62+
*
63+
* @protected
64+
*/
65+
abstract roomRawPayloadParser (rawPayload: any) : Promise<RoomPayload>
5566

5667
/**
5768
*
@@ -62,8 +73,19 @@ const roomMixin = <TBase extends RoomMixinDependency>(Base: TBase) => {
6273
abstract roomAnnounce (roomId: string, text: string) : Promise<void>
6374
abstract roomMemberList (roomId: string) : Promise<string[]>
6475

65-
protected abstract roomMemberRawPayload (roomId: string, contactId: string) : Promise<any>
66-
protected abstract roomMemberRawPayloadParser (rawPayload: any) : Promise<RoomMemberPayload>
76+
/**
77+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
78+
*
79+
* @protected
80+
*/
81+
abstract roomMemberRawPayload (roomId: string, contactId: string) : Promise<any>
82+
83+
/**
84+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
85+
*
86+
* @protected
87+
*/
88+
abstract roomMemberRawPayloadParser (rawPayload: any) : Promise<RoomMemberPayload>
6789

6890
async roomMemberSearch (
6991
roomId : string,
@@ -200,7 +222,12 @@ const roomMixin = <TBase extends RoomMixinDependency>(Base: TBase) => {
200222
return roomIdList
201223
}
202224

203-
protected roomQueryFilterFactory (
225+
/**
226+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
227+
*
228+
* @protected
229+
*/
230+
roomQueryFilterFactory (
204231
query: RoomQueryFilter,
205232
): RoomPayloadFilterFunction {
206233
log.verbose('Puppet', 'roomQueryFilterFactory(%s)',
@@ -250,7 +277,12 @@ const roomMixin = <TBase extends RoomMixinDependency>(Base: TBase) => {
250277
return true
251278
}
252279

253-
protected roomPayloadCache (roomId: string): undefined | RoomPayload {
280+
/**
281+
* Issue #155 - https://github.com/wechaty/puppet/issues/155
282+
*
283+
* @protected
284+
*/
285+
roomPayloadCache (roomId: string): undefined | RoomPayload {
254286
// log.silly('Puppet', 'roomPayloadCache(id=%s) @ %s', roomId, this)
255287
if (!roomId) {
256288
throw new Error('no id')

0 commit comments

Comments
 (0)