1
1
/**
2
- * Type Definitions for Sendbird SDK v3.0.154
2
+ * Type Definitions for Sendbird SDK v3.0.155
3
3
* homepage: https://sendbird.com/
4
4
* git: https://github.com/sendbird/Sendbird-SDK-JavaScript
5
5
*/
@@ -26,6 +26,13 @@ declare namespace SendBird {
26
26
message : string ;
27
27
}
28
28
29
+ /**
30
+ * @deprecated
31
+ */
32
+ type voidErrorLastCallback = ( result : null , error : SendBirdError ) => void ;
33
+ type voidErrorFirstCallback = ( error : SendBirdError ) => void ;
34
+ type voidCallback = voidErrorFirstCallback | voidErrorLastCallback ;
35
+
29
36
type userCallback = ( user : User , error : SendBirdError ) => void ;
30
37
type pushSettingCallback = ( response : string , error : SendBirdError ) => void ;
31
38
@@ -75,6 +82,12 @@ declare namespace SendBird {
75
82
ADMIN : 'ADMM'
76
83
} ;
77
84
85
+ type PollStatus = {
86
+ OPEN : 'open' ,
87
+ CLOSED : 'closed' ,
88
+ REMOVED : 'removed'
89
+ } ;
90
+
78
91
interface DiscoveryObject {
79
92
friendDiscoveryKey : string ;
80
93
friendName ?: string ;
@@ -95,6 +108,12 @@ declare namespace SendBird {
95
108
FileMessage : FileMessageStatic ;
96
109
AdminMessage : AdminMessageStatic ;
97
110
111
+ MessageMetaArray : MessageMetaArray ;
112
+ Options : Options ;
113
+
114
+ Poll : PollStatic ;
115
+ PollOption : PollOptionStatic ;
116
+
98
117
SessionHandler : SessionHandlerStatic ;
99
118
UserEventHandler : UserEventHandlerStatic ;
100
119
ChannelHandler : ChannelHandlerStatic ;
@@ -112,8 +131,11 @@ declare namespace SendBird {
112
131
MessageListParams : MessageListParams ;
113
132
ThreadedMessageListParams : ThreadedMessageListParams ;
114
133
MessageChangeLogsParams : MessageChangeLogsParams ;
115
- MessageMetaArray : MessageMetaArray ;
116
- Options : Options ;
134
+ PollParams : PollParams ;
135
+ PollRetrievalParams : PollRetrievalParams ;
136
+
137
+ PollListQuery : PollListQuery ;
138
+ PollVoterListQuery : PollVoterListQuery ;
117
139
118
140
currentUser : User ;
119
141
appInfo : AppInfo ;
@@ -295,6 +317,7 @@ declare namespace SendBird {
295
317
useMemberAsMessageSender : boolean ;
296
318
typingIndicatorThrottle : number ;
297
319
websocketResponseTimeout : number ;
320
+ includePollDetails : boolean ;
298
321
}
299
322
interface AppInfo {
300
323
uploadSizeLimit : number ;
@@ -378,11 +401,13 @@ declare namespace SendBird {
378
401
onMetaCountersUpdated ( channel : OpenChannel | GroupChannel , metaCounter : Object ) : void ;
379
402
onMetaCountersDeleted ( channel : OpenChannel | GroupChannel , metaCounterKeys : Array < string > ) : void ;
380
403
onChannelHidden ( channel : GroupChannel ) : void ;
381
- onReactionUpdated ( channel : OpenChannel | GroupChannel , reactionEvent : ReactionEvent ) : void ;
404
+ onReactionUpdated ( channel : OpenChannel | GroupChannel , event : ReactionEvent ) : void ;
382
405
onMentionReceived ( channel : OpenChannel | GroupChannel , message : AdminMessage | UserMessage | FileMessage ) : void ;
383
- onThreadInfoUpdated ( channel : OpenChannel | GroupChannel , threadInfoUpdateEvent : ThreadInfoUpdateEvent ) : void ;
406
+ onThreadInfoUpdated ( channel : OpenChannel | GroupChannel , event : ThreadInfoUpdateEvent ) : void ;
384
407
onChannelMemberCountChanged ( channels : Array < GroupChannel > ) : void ;
385
408
onChannelParticipantCountChanged ( channels : Array < OpenChannel > ) : void ;
409
+ onPollUpdated ( event : PollUpdateEvent ) : void ;
410
+ onPollVoted ( event : PollVoteEvent ) : void ;
386
411
}
387
412
388
413
interface ConnectionHandlerStatic {
@@ -433,7 +458,7 @@ declare namespace SendBird {
433
458
params : ThreadedMessageListParams ,
434
459
callback ?: messageListCallback
435
460
) : Promise < Object > ;
436
- applyThreadInfoUpdateEvent ( threadInfoUpdateEvent : ThreadInfoUpdateEvent ) : boolean ;
461
+ applyThreadInfoUpdateEvent ( event : ThreadInfoUpdateEvent ) : boolean ;
437
462
438
463
/**
439
464
* @deprecated
@@ -478,19 +503,6 @@ declare namespace SendBird {
478
503
emojiCategories : Array < EmojiCategory > ;
479
504
}
480
505
481
- interface Plugin {
482
- type : string ;
483
- vendor : string ;
484
- detail : { } ;
485
- }
486
-
487
- interface AppleCriticalAlertOptions {
488
- name : string ;
489
- volume : number ;
490
-
491
- serialize ( ) : Object ;
492
- }
493
-
494
506
interface UserMessageParams {
495
507
new ( ) : UserMessageParams ;
496
508
message : string ;
@@ -528,6 +540,8 @@ declare namespace SendBird {
528
540
messageSurvivalSeconds : number ;
529
541
plugins : Array < Plugin > ;
530
542
isResendable ( ) : boolean ;
543
+ applyPollUpdateEvent ( event : PollUpdateEvent ) ;
544
+ applyPollVoteEvent ( event : PollVoteEvent ) ;
531
545
}
532
546
interface UserMessageStatic {
533
547
buildFromSerializedData ( serializedObject : Object ) : UserMessage ;
@@ -586,8 +600,10 @@ declare namespace SendBird {
586
600
channelType : string ;
587
601
messageId : number ;
588
602
includeMetaArray : boolean ;
603
+ includeReactions : boolean ;
589
604
includeParentMessageText : boolean ;
590
605
includeThreadInfo : boolean ;
606
+ includePollDetails : boolean ;
591
607
}
592
608
interface MessageListParams {
593
609
new ( ) : MessageListParams ;
@@ -612,6 +628,7 @@ declare namespace SendBird {
612
628
includeParentMessageText : boolean ;
613
629
includeThreadInfo : boolean ;
614
630
showSubchannelMessagesOnly : boolean ;
631
+ includePollDetails : boolean ;
615
632
}
616
633
interface ThreadedMessageListParams {
617
634
new ( ) : ThreadedMessageListParams ;
@@ -633,6 +650,7 @@ declare namespace SendBird {
633
650
includeReaction : boolean ;
634
651
includeReactions : boolean ;
635
652
includeParentMessageText : boolean ;
653
+ includePollDetails : boolean ;
636
654
}
637
655
interface MessageChangeLogsParams {
638
656
new ( ) : MessageChangeLogsParams ;
@@ -643,8 +661,9 @@ declare namespace SendBird {
643
661
includeReaction : boolean ;
644
662
includeReactions : boolean ;
645
663
includeReplies : boolean ;
646
- includeParentMessageText : string ;
664
+ includeParentMessageText : boolean ;
647
665
includeThreadInfo : boolean ;
666
+ includePollDetails : boolean ;
648
667
}
649
668
650
669
interface ThumbnailObject {
@@ -716,7 +735,7 @@ declare namespace SendBird {
716
735
complete : ( error : SendBirdError ) => void ;
717
736
} ;
718
737
type messageCallback = ( message : UserMessage | FileMessage | AdminMessage , error : SendBirdError ) => void ;
719
- type reactionEventCallback = ( reactionEvent : ReactionEvent , error : SendBirdError ) => void ;
738
+ type reactionEventCallback = ( event : ReactionEvent , error : SendBirdError ) => void ;
720
739
type cancelUploadingFileMessageCallback = ( isSuccess : boolean , error : SendBirdError ) => void ;
721
740
type fileUploadprogressHandler = ( event : ProgressEvent ) => void ;
722
741
type messageChangeLogs = {
@@ -807,6 +826,9 @@ declare namespace SendBird {
807
826
createMessageListQuery ( ) : MessageListQuery ;
808
827
createPreviousMessageListQuery ( ) : PreviousMessageListQuery ;
809
828
829
+ createPollListQuery ( ) : PollListQuery ;
830
+ createPollVoterListQuery ( pollId : number , optionId : number ) : PollVoterListQuery ;
831
+
810
832
/**
811
833
* @deprecated since version v3.0.123, please use {@link getMessagesByTimestamp()} instead
812
834
*/
@@ -1522,6 +1544,7 @@ declare namespace SendBird {
1522
1544
includeParentMessageText : boolean ;
1523
1545
includeThreadInfo : boolean ;
1524
1546
showSubchannelMessagesOnly : boolean ;
1547
+ includePollDetails : boolean ;
1525
1548
1526
1549
load ( limit : number , reverse : boolean , messageType ?: number | string , callback ?: messageListCallback ) : Array < UserMessage | FileMessage | AdminMessage > ;
1527
1550
load ( callback ?: messageListCallback ) : Array < UserMessage | FileMessage | AdminMessage > ;
@@ -1890,6 +1913,138 @@ declare namespace SendBird {
1890
1913
alt : string ;
1891
1914
}
1892
1915
1916
+ interface Plugin {
1917
+ type : string ;
1918
+ vendor : string ;
1919
+ detail : { } ;
1920
+ }
1921
+
1922
+ interface AppleCriticalAlertOptions {
1923
+ name : string ;
1924
+ volume : number ;
1925
+
1926
+ serialize ( ) : Object ;
1927
+ }
1928
+
1929
+ /**
1930
+ * @deprecated
1931
+ */
1932
+ type pollErrorLastCallback = ( poll : Poll , error : SendBirdError ) => void ;
1933
+ type pollErrorFirstCallback = ( error : SendBirdError , poll : Poll ) => void ;
1934
+ type pollCallback = pollErrorFirstCallback | pollErrorLastCallback ;
1935
+ /**
1936
+ * @deprecated
1937
+ */
1938
+ type pollOptionErrorLastCallback = ( option : PollOption , error : SendBirdError ) => void ;
1939
+ type pollOptionErrorFirstCallback = ( error : SendBirdError , option : PollOption ) => void ;
1940
+ type pollOptionCallback = pollOptionErrorFirstCallback | pollOptionErrorLastCallback ;
1941
+ /**
1942
+ * @deprecated
1943
+ */
1944
+ type pollListQueryErrorLastCallback = ( polls : Array < Poll > , error : SendBirdError ) => void ;
1945
+ type pollListQueryErrorFirstCallback = ( error : SendBirdError , polls : Array < Poll > ) => void ;
1946
+ type pollListQueryCallback = pollListQueryErrorFirstCallback | pollListQueryErrorLastCallback ;
1947
+
1948
+ interface PollStatic {
1949
+ Status : PollStatus ;
1950
+
1951
+ get ( params : PollRetrievalParams , callback ?: pollCallback ) : Promise < Poll > ;
1952
+ create ( pollParams : PollParams , callback ?: pollCallback ) : Promise < Poll > ;
1953
+ }
1954
+ interface Poll {
1955
+ id : number ;
1956
+ title : string ;
1957
+ details : PollDetails ;
1958
+
1959
+ update ( pollParams : PollParams , callback ?: pollCallback ) : Promise < Poll > ;
1960
+ delete ( callback ?: voidCallback ) : Promise < void > ;
1961
+ addOption ( channelUrl : string , text : string , callback ?: pollCallback ) : Promise < Poll > ;
1962
+ vote ( channelUrl : string , optionIds : Array < number > , callback ?: pollCallback ) : Promise < Poll > ;
1963
+ close ( callback ?: pollCallback ) : Promise < Poll > ;
1964
+ }
1965
+ interface PollDetails {
1966
+ options : Array < PollOption > ;
1967
+ data : object ;
1968
+ isAnonymous : boolean ;
1969
+ allowUserSuggestion : boolean ;
1970
+ allowMultipleVotes : boolean ;
1971
+ closeAt : number ;
1972
+ voterCount : number ;
1973
+ status : PollStatus [ keyof PollStatus ] ;
1974
+ createdBy : string ;
1975
+ createdAt : number ;
1976
+ updatedAt : number ;
1977
+ }
1978
+ interface PollOptionStatic {
1979
+ get ( channelUrl : string , pollId : number , optionId : number , callback ?: pollOptionCallback ) : Promise < PollOption > ;
1980
+ }
1981
+ interface PollOption {
1982
+ pollId : number ;
1983
+ id : number ;
1984
+ text : string ;
1985
+ voteCount : number ;
1986
+ partialVoters : User [ ] ;
1987
+ createdBy : string ;
1988
+ createdAt : number ;
1989
+ updatedAt : number ;
1990
+
1991
+ update ( text : string , callback ?: pollCallback ) : Promise < Poll > ;
1992
+ delete ( callback ?: voidCallback ) : Promise < void > ;
1993
+ }
1994
+
1995
+ interface PollParams {
1996
+ new ( ) : PollParams ;
1997
+
1998
+ title : string ;
1999
+ options : Array < string > ;
2000
+ data ?: string ;
2001
+ isAnonymous ?: boolean ;
2002
+ allowUserSuggestion ?: boolean ;
2003
+ allowMultipleVotes ?: boolean ;
2004
+ closeAt ?: number ;
2005
+ }
2006
+ interface PollRetrievalParams {
2007
+ new ( ) : PollRetrievalParams ;
2008
+
2009
+ channelUrl : string ;
2010
+ pollId : number ;
2011
+ showPartialVoters ?: boolean ;
2012
+ }
2013
+
2014
+ interface PollListQuery {
2015
+ token ?: string ;
2016
+ limit ?: number ;
2017
+ readonly hasNext : boolean ;
2018
+ readonly isLoading : boolean ;
2019
+ next ( callback ?: pollListQueryCallback ) : Promise < Array < Poll > > ;
2020
+ }
2021
+
2022
+ interface PollVoterListQuery {
2023
+ pollId : number ;
2024
+ optionId : number ;
2025
+ token ?: string ;
2026
+ limit ?: number ;
2027
+ readonly hasNext : boolean ;
2028
+ readonly isLoading : boolean ;
2029
+ next ( callback ?: userListQueryCallback ) : Promise < Array < User > > ;
2030
+ }
2031
+
2032
+ interface PollUpdateEvent {
2033
+ new ( ) : PollUpdateEvent ;
2034
+ poll : Poll ;
2035
+ status : PollStatus [ keyof PollStatus ] ;
2036
+ }
2037
+ interface PollUpdatedVoteCount {
2038
+ optionId : number ;
2039
+ voteCount : number ;
2040
+ }
2041
+ interface PollVoteEvent {
2042
+ new ( ) : PollVoteEvent ;
2043
+ pollId : number ;
2044
+ updatedVoteCounts : Array < PollUpdatedVoteCount > ;
2045
+ ts : number ;
2046
+ }
2047
+
1893
2048
type groupChannelCallback = ( groupChannel : GroupChannel , error : SendBirdError ) => void ;
1894
2049
type distinctGroupChannelCallback = ( response : DistinctGroupChannelResponse , error : SendBirdError ) => void ;
1895
2050
type getPushPreferenceCallback = ( isPushOn : boolean , error : SendBirdError ) => void ;
@@ -2193,7 +2348,7 @@ declare namespace SendBird {
2193
2348
customTypesFilter : Array < string > ;
2194
2349
customTypeStartsWithFilter : string ;
2195
2350
channelUrlsFilter : Array < string > ;
2196
- superChannelFilter : 'all' | 'super' | 'nonsuper' ;
2351
+ superChannelFilter : 'all' | 'super' | 'nonsuper' | 'broadcast_only' ;
2197
2352
publicChannelFilter : 'all' | 'public' | 'private' ;
2198
2353
metadataOrderKeyFilter : string ;
2199
2354
metadataKey : string ;
@@ -2219,7 +2374,7 @@ declare namespace SendBird {
2219
2374
channelUrlsFilter : Array < string > ;
2220
2375
customTypesFilter : Array < string > ;
2221
2376
customTypeStartsWithFilter : string ;
2222
- superChannelFilter : 'all' | 'super' | 'nonsuper' ;
2377
+ superChannelFilter : 'all' | 'super' | 'nonsuper' | 'broadcast_only' ;
2223
2378
membershipFilter : 'all' | 'joined' ;
2224
2379
metadataOrderKeyFilter : string ;
2225
2380
metadataKey : string ;
0 commit comments