Skip to content

Commit 0c4e0fe

Browse files
authored
Fix Swift inline docs (#25)
1 parent 511a639 commit 0c4e0fe

13 files changed

+52
-51
lines changed

Sources/Chat+AsyncAwait.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public extension Chat {
137137
/// - custom: Any custom properties or metadata associated with the user in the form of a `[String: JSONCodableScalar]`
138138
/// - status: Tag that lets you categorize your app users by their current state. The tag choice is entirely up to you and depends on your use case
139139
/// - type: Tag that lets you categorize your app users by their functional roles. The tag choice is entirely up to you and depends on your use case
140-
/// - Returns: Updated user
140+
/// - Returns: The updated ``User`` instance
141141
func updateUser(
142142
id: String,
143143
name: String? = nil,
@@ -287,7 +287,7 @@ public extension Chat {
287287
/// - description: Channel description
288288
/// - status: Tag that lets you categorize your app users by their current state. The tag choice is entirely up to you and depends on your use case
289289
/// - type: Tag that lets you categorize your app users by their functional roles. The tag choice is entirely up to you and depends on your use case
290-
/// - Returns: A value containing an updated channel and its metadata
290+
/// - Returns: A value containing an updated ``Channel`` and its metadata
291291
func updateChannel(
292292
id: String,
293293
name: String? = nil,
@@ -378,10 +378,12 @@ public extension Chat {
378378

379379
/// Creates a public channel that let users engage in open conversations with many people. Unlike group chats, anyone can join public channels.
380380
///
381+
/// If you don't provide the name, the channel will get the same name as id (value of `channelId`)
382+
///
381383
/// - Parameters:
382384
/// - channelId: ID of the public channel. The channel ID is created automatically using the UUID generator. You can override it by providing your own ID
383385
/// - channelName: Display name for the channel
384-
/// - channelDescription: If you don't provide the name, the channel will get the same name as id (value of `channelId`)
386+
/// - channelDescription: Additional details about the channel
385387
/// - channelCustom: Any custom properties or metadata associated with the channel in the form of a map of key-value pairs
386388
/// - channelStatus: Current status of the channel, like online, offline, or archived
387389
/// - Returns: A value containing details about created ``Channel``

Sources/Chat.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public protocol Chat: AnyObject {
4444

4545
/// An object for manipulating the list of muted users.
4646
///
47-
/// The list is local to this instance of Chat (it is not persisted anywhere) unless ``ChatConfiguration/syncMutedUsers`` is enabled, in which case it will be synced
47+
/// The list is local to this instance of ``Chat`` (it is not persisted anywhere) unless ``ChatConfiguration/syncMutedUsers`` is enabled, in which case it will be synced
4848
/// using App Context for the current user.
4949
///
5050
/// Please note that this is not a server-side moderation mechanism, but rather a way to ignore messages from certain users on the client.
@@ -75,7 +75,7 @@ public protocol Chat: AnyObject {
7575
/// - status: Tag that lets you categorize your app users by their current state. The tag choice is entirely up to you and depends on your use case
7676
/// - type: Tag that lets you categorize your app users by their functional roles. The tag choice is entirely up to you and depends on your use case
7777
/// - completion: The async `Result` of the method call
78-
/// - **Success**: The user was successfully created and returns the created user
78+
/// - **Success**: The ``User`` was successfully created and returns the created user
7979
/// - **Failure**: An `Error` describing the failure
8080
func createUser(
8181
id: String,
@@ -94,7 +94,7 @@ public protocol Chat: AnyObject {
9494
/// - Parameters:
9595
/// - userId: Unique user identifier (up to 92 UTF-8 characters).
9696
/// - completion: The async `Result` of the method call
97-
/// - **Success**: The user was successfully returned
97+
/// - **Success**: The ``User`` was successfully returned
9898
/// - **Failure**: An `Error` describing the failure
9999
func getUser(
100100
userId: String,
@@ -190,7 +190,7 @@ public protocol Chat: AnyObject {
190190
/// - Parameters:
191191
/// - channelId: Unique channel identifier (up to 92 UTF-8 byte sequences)
192192
/// - completion: The async `Result` of the method call
193-
/// - **Success**: A value containing a channel object with its metadata
193+
/// - **Success**: A value containing a ``Channel`` object with its metadata
194194
/// - **Failure**: An `Error` describing the failure
195195
func getChannel(
196196
channelId: String,
@@ -225,7 +225,7 @@ public protocol Chat: AnyObject {
225225
/// - status: Tag that lets you categorize your app users by their current state. The tag choice is entirely up to you and depends on your use case
226226
/// - type: Tag that lets you categorize your app users by their functional roles. The tag choice is entirely up to you and depends on your use case
227227
/// - completion: The async `Result` of the method call
228-
/// - **Success**: A value containing an updated channel and its metadata
228+
/// - **Success**: A value containing an updated ``Channel`` and its metadata
229229
/// - **Failure**: An `Error` describing the failure
230230
func updateChannel(
231231
id: String,
@@ -281,10 +281,12 @@ public protocol Chat: AnyObject {
281281

282282
/// Creates a public channel that let users engage in open conversations with many people. Unlike group chats, anyone can join public channels.
283283
///
284+
/// If you don't provide the name, the channel will get the same name as id (value of `channelId`)
285+
///
284286
/// - Parameters:
285287
/// - channelId: ID of the public channel. The channel ID is created automatically using the UUID generator. You can override it by providing your own ID
286288
/// - channelName: Display name for the channel
287-
/// - channelDescription: If you don't provide the name, the channel will get the same name as id (value of `channelId`)
289+
/// - channelDescription: Additional details about the channel
288290
/// - channelCustom: Any custom properties or metadata associated with the channel in the form of a map of key-value pairs
289291
/// - channelStatus: Current status of the channel, like online, offline, or archived
290292
/// - completion: The async `Result` of the method call
@@ -360,7 +362,7 @@ public protocol Chat: AnyObject {
360362
/// - channelId: Channel to listen for new events
361363
/// - customMethod: An optional custom method for emitting events
362364
/// - callback: A function that is called with an ``EventWrapper`` as its parameter. It defines the custom behavior to be executed whenever an event is detected on the specified channel
363-
/// - Returns: ``AutoCloseable`` interface you can call to stop listening for new events and clean up resources when they re no longer needed by invoking the `close()` method
365+
/// - Returns: ``AutoCloseable`` interface you can call to stop listening for new events and clean up resources when they re no longer needed by invoking the ``AutoCloseable/close()`` method
364366
func listenForEvents<T: EventContent>(
365367
type: T.Type,
366368
channelId: String,

Sources/Entities/Channel+AsyncAwait.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public extension Channel {
3838
/// - description: Additional details about the channel
3939
/// - status: Current status of the channel, like online, offline, or archived
4040
/// - type: Represents the type of channel
41-
/// - Returns: The updated channel object with its metadata
41+
/// - Returns: The updated ``Channel`` object with its metadata
4242
func update(
4343
name: String? = nil,
4444
custom: [String: JSONCodableScalar]? = nil,
@@ -103,7 +103,7 @@ public extension Channel {
103103
/// Activates a typing indicator on a given channel.
104104
///
105105
/// The method sets a flag (typingSent) to indicate that a typing signal is in progress and adds a timer to reset
106-
/// the flag after a specified timeout. You can change the default typing timeout and set your own value during the Chat SDK configuration (init() method)
106+
/// the flag after a specified timeout. You can change the default typing timeout and set your own value during the Chat SDK configuration initialization
107107
/// using the `typingTimeout` parameter
108108
///
109109
/// - Returns: A `Timetoken` indicating the action timestamp
@@ -277,7 +277,7 @@ public extension Channel {
277277
///
278278
/// - Parameters:
279279
/// - users: List of users you want to invite to the ``Channel``. You can invite up to 100 users in one call
280-
/// - completion: List of ``Membership`` of invited users
280+
/// - Returns: List of ``Membership`` of invited users
281281
@discardableResult
282282
func inviteMultiple(users: [ChatType.ChatUserType]) async throws -> [ChatType.ChatMembershipType] {
283283
try await withCheckedThrowingContinuation { continuation in
@@ -299,7 +299,7 @@ public extension Channel {
299299
/// - page: Object used for pagination to define which previous or next result page you want to fetch
300300
/// - filter: Expression used to filter the results. Returns only these members whose properties satisfy the given expression
301301
/// - sort: A collection to specify the sort order. Available options are id, name, and updated
302-
/// - completion: A `Tuple` containing an array of the members of the channel, and the next pagination `PubNubHashedPage` (if one exists)
302+
/// - Returns: A `Tuple` containing an array of the members of the channel, and the next pagination `PubNubHashedPage` (if one exists)
303303
func getMembers(
304304
limit: Int? = nil,
305305
page: PubNubHashedPage? = nil,
@@ -320,7 +320,6 @@ public extension Channel {
320320

321321
/// Watch the ``Channel`` content without a need to join the ``Channel``.
322322
///
323-
/// - Parameter callback: Defines the custom behavior to be executed whenever a message is received on the ``Channel``
324323
/// - Returns: An asynchronous stream that produces a new value every time a new message is published on the current channel
325324
func connect() -> AsyncStream<ChatType.ChatMessageType> {
326325
AsyncStream { continuation in
@@ -474,7 +473,7 @@ public extension Channel {
474473

475474
/// Receives updates on a single ``Channel`` object.
476475
///
477-
/// - Returns: An asynchronous stream that produces updates when the current Channel is edited or removed.
476+
/// - Returns: An asynchronous stream that produces updates when the current ``Channel`` is edited or removed.
478477
func streamUpdates() -> AsyncStream<ChatType.ChatChannelType?> {
479478
AsyncStream { continuation in
480479
let autoCloseable = streamUpdates {
@@ -581,9 +580,7 @@ public extension Channel {
581580
/// - startTimetoken: The start timetoken for fetching the history of reported messages, which allows specifying the point in time where the history retrieval should begin
582581
/// - endTimetoken: The end time token for fetching the history of reported messages, which allows specifying the point in time where the history retrieval should end
583582
/// - count: The number of reported message events to fetch from the history
584-
/// - completion: The async `Result` of the method call
585-
/// - **Success**: A `Tuple` containing an array of `EventWrapper<EventContent>`, and a boolean indicating whether there are more messages available beyond the current result set
586-
/// - **Failure**: An `Error` describing the failure
583+
/// - Returns: A `Tuple` containing an array of `EventWrapper<EventContent>`, and a boolean indicating whether there are more messages available beyond the current result set
587584
func getMessageReportsHistory(
588585
startTimetoken: Timetoken? = nil,
589586
endTimetoken: Timetoken? = nil,

Sources/Entities/Channel.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public protocol Channel: CustomStringConvertible {
4242
/// - Parameters:
4343
/// - channels: Collection containing the channels to watch for updates
4444
/// - callback: Defines the custom behavior to be executed when detecting channels changes
45-
/// - Returns: An ``AutoCloseable`` that you can use to stop receiving objects events by invoking its `close()` method
45+
/// - Returns: An ``AutoCloseable`` that you can use to stop receiving objects events by invoking its ``AutoCloseable/close()`` method
4646
static func streamUpdatesOn(
4747
channels: [Self],
4848
callback: @escaping (([Self]) -> Void)
@@ -57,7 +57,7 @@ public protocol Channel: CustomStringConvertible {
5757
/// - status: Current status of the channel, like online, offline, or archived
5858
/// - type: Represents the type of channel
5959
/// - completion: The async `Result` of the method call
60-
/// - **Success**: The updated channel object with its metadata
60+
/// - **Success**: The updated ``Channel`` object with its metadata
6161
/// - **Failure**: An `Error` describing the failure
6262
func update(
6363
name: String?,
@@ -95,7 +95,7 @@ public protocol Channel: CustomStringConvertible {
9595
/// Activates a typing indicator on a given channel.
9696
///
9797
/// The method sets a flag (typingSent) to indicate that a typing signal is in progress and adds a timer to reset
98-
/// the flag after a specified timeout. You can change the default typing timeout and set your own value during the Chat SDK configuration (init() method)
98+
/// the flag after a specified timeout. You can change the default typing timeout and set your own value during the Chat SDK configuration initialization
9999
/// using the `typingTimeout` parameter
100100
///
101101
/// - Parameters:
@@ -183,6 +183,7 @@ public protocol Channel: CustomStringConvertible {
183183
/// - textLinks: Returned list of text links that are shown as text in the message
184184
/// - quotedMessage: Object added to a message when you quote another message
185185
/// - files: One or multiple files attached to the text message
186+
/// - customPushData: Additional key-value pairs that will be added to the FCM and/or APNS push messages for the message itself and any user mentions
186187
/// - completion: The async `Result` of the method callnel
187188
/// - **Success**: The timetoken of the sent message
188189
/// - **Failure**: An `Error` describing the failure
@@ -330,7 +331,7 @@ public protocol Channel: CustomStringConvertible {
330331
/// - Parameters:
331332
/// - timetoken: Timetoken of the message you want to retrieve from Message Persistence
332333
/// - completion: The async `Result` of the method call
333-
/// - **Success**: A message object (if any)
334+
/// - **Success**: A ``Message`` object (if any)
334335
/// - **Failure**: An `Error` describing the failure
335336
func getMessage(
336337
timetoken: Timetoken,
@@ -375,7 +376,7 @@ public protocol Channel: CustomStringConvertible {
375376
///
376377
/// - Parameters:
377378
/// - completion: The async `Result` of the method call
378-
/// - **Success**: A channel with updated `custom` field
379+
/// - **Success**: A ``Channel`` with updated ``Channel/custom`` field
379380
/// - **Failure**: An `Error` describing the failure
380381
func unpinMessage(
381382
completion: ((Swift.Result<Self, Error>) -> Void)?

Sources/Entities/Membership+AsyncAwait.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public extension Membership {
9999

100100
/// You can receive updates when specific user-channel Membership object(s) are added, edited, or removed.
101101
///
102-
/// - Returns: An asynchronous stream that produces updates when the current Membership is edited or removed.
102+
/// - Returns: An asynchronous stream that produces updates when the current ``Membership`` is edited or removed.
103103
func streamUpdates() -> AsyncStream<ChatType.ChatMembershipType?> {
104104
AsyncStream { continuation in
105105
let autoCloseable = streamUpdates {

Sources/Entities/Membership.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public protocol Membership: CustomStringConvertible {
4242
/// - Parameters:
4343
/// - memberships: Collection containing the ``Membership`` to watch for updates
4444
/// - callback: Defines the custom behavior to be executed when detecting membership changes
45-
/// - Returns: An ``AutoCloseable`` that you can use to stop receiving objects events by invoking its `close()` method
45+
/// - Returns: An ``AutoCloseable`` that you can use to stop receiving objects events by invoking its ``AutoCloseable/close()`` method
4646
static func streamUpdatesOn(
4747
memberships: [Self],
4848
callback: @escaping (([Self]) -> Void)
@@ -100,7 +100,7 @@ public protocol Membership: CustomStringConvertible {
100100
/// the stream will be canceled, and no further items will be produced. You can also stop receiving updates manually by calling ``AutoCloseable/close()``.
101101
///
102102
/// - Parameter callback: Defines the custom behavior to be executed when detecting membership changes
103-
/// - Returns: An ``AutoCloseable`` that you can use to stop receiving objects events by invoking its `close()` method
103+
/// - Returns: An ``AutoCloseable`` that you can use to stop receiving objects events by invoking its ``AutoCloseable/close()`` method
104104
func streamUpdates(
105105
callback: @escaping ((ChatType.ChatMembershipType?) -> Void)
106106
) -> AutoCloseable

Sources/Entities/Message+AsyncAwait.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public extension Message {
106106

107107
/// Attach this message to its channel.
108108
///
109-
/// - Returns: The updated Channel metadata
109+
/// - Returns: The updated ``Channel`` metadata
110110
@discardableResult
111111
func pin() async throws -> ChatType.ChatChannelType {
112112
try await withCheckedThrowingContinuation { continuation in
@@ -205,7 +205,7 @@ public extension Message {
205205

206206
/// Removes a thread (channel) for a selected message.
207207
///
208-
/// - Returns: The updated channel object after the removal of the thread
208+
/// - Returns: The updated ``Channel`` object after the removal of the thread
209209
func removeThread() async throws -> ChatType.ChatChannelType? {
210210
try await withCheckedThrowingContinuation { continuation in
211211
removeThread {
@@ -241,8 +241,7 @@ public extension Message {
241241

242242
/// You can receive updates when this message and related message reactions are added, edited, or removed.
243243
///
244-
/// - Parameter completion: Function that takes a single Message object. It defines the custom behavior to be executed when detecting message or message reaction changes
245-
/// - Returns: An asynchronous stream that produces updates when the current Message is edited or removed.
244+
/// - Returns: An asynchronous stream that produces updates when the current ``Message`` is edited.
246245
func streamUpdates() -> AsyncStream<Self> {
247246
AsyncStream { continuation in
248247
let autoCloseable = streamUpdates {
@@ -254,7 +253,7 @@ public extension Message {
254253
}
255254
}
256255

257-
/// If you delete a message, you can restore its content together with the attached files using the `restore()` method.
256+
/// If you delete a message, you can restore its content together with the attached files using the ``restore()`` method.
258257
///
259258
/// This is possible, however, only if the message you want to restore was soft deleted (the soft parameter was set to true when deleting it). Hard deleted messages cannot be restored as their data
260259
/// is no longer available in Message Persistence. This method also requires Message Persistence configuration. To manage messages, you must enable Message Persistence for your app's keyset

0 commit comments

Comments
 (0)