Skip to content

Commit

Permalink
Removed links unresolved by docc compiler + fixed some linting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
maratal committed Dec 9, 2024
1 parent b4a89f4 commit 33b4b5e
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 55 deletions.
4 changes: 2 additions & 2 deletions Sources/AblyChat/Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public protocol Connection: AnyObject, Sendable {
* - Parameters:
* - bufferingPolicy: The ``BufferingPolicy`` for the created subscription.
*
* - Returns: A subscription ``AsyncSequence`` that can be used to iterate through ``ConnectionStatusChange`` events.
* - Returns: A subscription `AsyncSequence` that can be used to iterate through ``ConnectionStatusChange`` events.
*/
func onStatusChange(bufferingPolicy: BufferingPolicy) -> Subscription<ConnectionStatusChange>

/// Same as calling ``onStatusChange(bufferingPolicy:)`` with ``BufferingPolicy.unbounded``.
/// Same as calling ``onStatusChange(bufferingPolicy:)`` with ``BufferingPolicy/unbounded``.
///
/// The `Connection` protocol provides a default implementation of this method.
func onStatusChange() -> Subscription<ConnectionStatusChange>
Expand Down
2 changes: 1 addition & 1 deletion Sources/AblyChat/EmitsDiscontinuities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public protocol EmitsDiscontinuities {
* - Parameters:
* - bufferingPolicy: The ``BufferingPolicy`` for the created subscription.
*
* - Returns: A subscription ``AsyncSequence`` that can be used to iterate through ``DiscontinuityEvent`` events.
* - Returns: A subscription `AsyncSequence` that can be used to iterate through ``DiscontinuityEvent`` events.
*/
func onDiscontinuity(bufferingPolicy: BufferingPolicy) async -> Subscription<DiscontinuityEvent>

Expand Down
14 changes: 7 additions & 7 deletions Sources/AblyChat/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@ public struct Message: Sendable, Codable, Identifiable, Equatable {
* The unique identifier of the message.
*/
public var serial: String

/**
* The action type of the message. This can be used to determine if the message was created, updated, or deleted.
*/
public var action: MessageAction

/**
* The clientId of the user who created the message.
*/
public var clientID: String

/**
* The roomId of the chat room to which the message belongs.
*/
public var roomID: String

/**
* The text of the message.
*/
public var text: String

/**
* The timestamp at which the message was created.
*/
public var createdAt: Date?

/**
* The metadata of a chat message. Allows for attaching extra info to a message,
* which can be used for various features such as animations, effects, or simply
Expand All @@ -60,7 +60,7 @@ public struct Message: Sendable, Codable, Identifiable, Equatable {
* validation. When reading the metadata treat it like user input.
*/
public var metadata: MessageMetadata

/**
* The headers of a chat message. Headers enable attaching extra info to a message,
* which can be used for various features such as linking to a relative point in
Expand Down
6 changes: 3 additions & 3 deletions Sources/AblyChat/Messages.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public protocol Messages: AnyObject, Sendable, EmitsDiscontinuities {
* This method uses the Ably Chat API endpoint for sending messages.
*
* - Parameters:
* - params: An object containing ``text``, ``headers`` and ``metadata`` for the message.
* - params: An object containing `text`, `headers` and `metadata` for the message.
*
* - Returns: The published message.
*
Expand Down Expand Up @@ -141,8 +141,8 @@ public struct QueryOptions: Sendable {

/**
* The direction to query messages in.
* If ``ResultOrder/oldestFirst``, the response will include messages from the start of the time window to the end.
* If ``ResultOrder/newestFirst``, the response will include messages from the end of the time window to the start.
* If ``OrderBy/oldestFirst``, the response will include messages from the start of the time window to the end.
* If ``OrderBy/newestFirst``, the response will include messages from the end of the time window to the start.
*/
public var orderBy: OrderBy?

Expand Down
8 changes: 4 additions & 4 deletions Sources/AblyChat/Occupancy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ public protocol Occupancy: AnyObject, Sendable, EmitsDiscontinuities {
* - Parameters:
* - bufferingPolicy: The ``BufferingPolicy`` for the created subscription.
*
* - Returns: A subscription ``AsyncSequence`` that can be used to iterate through ``OccupancyEvent`` events.
* - Returns: A subscription `AsyncSequence` that can be used to iterate through ``OccupancyEvent`` events.
*/
func subscribe(bufferingPolicy: BufferingPolicy) async -> Subscription<OccupancyEvent>

/// Same as calling ``subscribe(bufferingPolicy:)`` with ``BufferingPolicy.unbounded``.
/// Same as calling ``subscribe(bufferingPolicy:)`` with ``BufferingPolicy/unbounded``.
///
/// The `Occupancy` protocol provides a default implementation of this method.
func subscribe() async -> Subscription<OccupancyEvent>
Expand All @@ -28,7 +28,7 @@ public protocol Occupancy: AnyObject, Sendable, EmitsDiscontinuities {
* - Returns: A current occupancy of the chat room.
*/
func get() async throws -> OccupancyEvent

/**
* Get underlying Ably channel for occupancy events.
*
Expand All @@ -53,7 +53,7 @@ public struct OccupancyEvent: Sendable, Encodable, Decodable {
* The number of connections to the chat room.
*/
public var connections: Int

/**
* The number of presence members in the chat room - members who have entered presence.
*/
Expand Down
42 changes: 21 additions & 21 deletions Sources/AblyChat/Presence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ internal extension PresenceData {
*/
public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities {
/**
* Same as ``get(params: PresenceQuery)``, but with defaults params.
* Same as ``get(params:)``, but with defaults params.
*/
func get() async throws -> [PresenceMember]

Expand All @@ -98,19 +98,19 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities {
*
* - Returns: An array of ``PresenceMember``s.
*
* - Throws: An ``ARTErrorInfo``.
* - Throws: An `ARTErrorInfo`.
*/
func get(params: PresenceQuery) async throws -> [PresenceMember]

/**
* Method to check if user with supplied clientId is online.
*
* - Parameters:
* - clientId: The client ID to check if it is present in the room.
* - clientID: The client ID to check if it is present in the room.
*
* - Returns: A boolean value indicating whether the user is present in the room.
*
* - Throws: An ``ARTErrorInfo``.
* - Throws: An `ARTErrorInfo`.
*/
func isUserPresent(clientID: String) async throws -> Bool

Expand All @@ -120,7 +120,7 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities {
* - Parameters:
* - data: The users data, a JSON serializable object that will be sent to all subscribers.
*
* - Throws: An ``ARTErrorInfo``.
* - Throws: An `ARTErrorInfo`.
*/
func enter(data: PresenceData?) async throws

Expand All @@ -130,7 +130,7 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities {
* - Parameters:
* - data: The users data, a JSON serializable object that will be sent to all subscribers.
*
* - Throws: An ``ARTErrorInfo``.
* - Throws: An `ARTErrorInfo`.
*/
func update(data: PresenceData?) async throws

Expand All @@ -140,7 +140,7 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities {
* - Parameters:
* - data: The users data, a JSON serializable object that will be sent to all subscribers.
*
* - Throws: An ``ARTErrorInfo``.
* - Throws: An `ARTErrorInfo`.
*/
func leave(data: PresenceData?) async throws

Expand All @@ -151,7 +151,7 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities {
* - event: A single presense event type ``PresenceEventType`` to subscribe to.
* - bufferingPolicy: The ``BufferingPolicy`` for the created subscription.
*
* - Returns: A subscription ``AsyncSequence`` that can be used to iterate through ``PresenceEvent`` events.
* - Returns: A subscription `AsyncSequence` that can be used to iterate through ``PresenceEvent`` events.
*/
func subscribe(event: PresenceEventType, bufferingPolicy: BufferingPolicy) async -> Subscription<PresenceEvent>

Expand All @@ -162,7 +162,7 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities {
* - events: An array of presense event types ``PresenceEventType`` to subscribe to.
* - bufferingPolicy: The ``BufferingPolicy`` for the created subscription.
*
* - Returns: A subscription ``AsyncSequence`` that can be used to iterate through ``PresenceEvent`` events.
* - Returns: A subscription `AsyncSequence` that can be used to iterate through ``PresenceEvent`` events.
*/
func subscribe(events: [PresenceEventType], bufferingPolicy: BufferingPolicy) async -> Subscription<PresenceEvent>

Expand All @@ -181,12 +181,12 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities {
/// The `Presence` protocol provides a default implementation of this method.
func leave() async throws

/// Same as calling ``subscribe(event:bufferingPolicy:)`` with ``BufferingPolicy.unbounded``.
/// Same as calling ``subscribe(event:bufferingPolicy:)`` with ``BufferingPolicy/unbounded``.
///
/// The `Presence` protocol provides a default implementation of this method.
func subscribe(event: PresenceEventType) async -> Subscription<PresenceEvent>

/// Same as calling ``subscribe(events:bufferingPolicy:)`` with ``BufferingPolicy.unbounded``.
/// Same as calling ``subscribe(events:bufferingPolicy:)`` with ``BufferingPolicy/unbounded``.
///
/// The `Presence` protocol provides a default implementation of this method.
func subscribe(events: [PresenceEventType]) async -> Subscription<PresenceEvent>
Expand Down Expand Up @@ -259,19 +259,19 @@ public struct PresenceMember: Sendable {
* The clientId of the presence member.
*/
public var clientID: String

/**
* The data associated with the presence member.
*/
public var data: PresenceData?

/**
* The current state of the presence member.
*/
public var action: Action

// TODO: (https://github.com/ably-labs/ably-chat-swift/issues/13): try to improve this type

/**
* The extras associated with the presence member.
*/
Expand All @@ -287,17 +287,17 @@ public enum PresenceEventType: Sendable {
* Event triggered when a user enters.
*/
case enter

/**
* Event triggered when a user leaves.
*/
case leave

/**
* Event triggered when a user updates their presence data.
*/
case update

/**
* Event triggered when a user initially subscribes to presence.
*/
Expand Down Expand Up @@ -325,17 +325,17 @@ public struct PresenceEvent: Sendable {
* The type of the presence event.
*/
public var action: PresenceEventType

/**
* The clientId of the client that triggered the presence event.
*/
public var clientID: String

/**
* The timestamp of the presence event.
*/
public var timestamp: Date

/**
* The data associated with the presence event.
*/
Expand Down
13 changes: 7 additions & 6 deletions Sources/AblyChat/Room.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Ably
public protocol Room: AnyObject, Sendable {
/**
* The unique identifier of the room.
*
* - Returns: The room identifier.
*/
var roomID: String { get }
Expand Down Expand Up @@ -66,33 +67,33 @@ public protocol Room: AnyObject, Sendable {
* - Parameters:
* - bufferingPolicy: The ``BufferingPolicy`` for the created subscription.
*
* - Returns: A subscription ``AsyncSequence`` that can be used to iterate through ``RoomStatusChange`` events.
* - Returns: A subscription `AsyncSequence` that can be used to iterate through ``RoomStatusChange`` events.
*/
func onStatusChange(bufferingPolicy: BufferingPolicy) async -> Subscription<RoomStatusChange>

/// Same as calling ``onStatusChange(bufferingPolicy:)`` with ``BufferingPolicy.unbounded``.
/// Same as calling ``onStatusChange(bufferingPolicy:)`` with ``BufferingPolicy/unbounded``.
///
/// The `Room` protocol provides a default implementation of this method.
func onStatusChange() async -> Subscription<RoomStatusChange>

/**
* Attaches to the room to receive events in realtime.
*
* If a room fails to attach, it will enter either the {@link RoomStatus.Suspended} or {@link RoomStatus.Failed} state.
* If a room fails to attach, it will enter either the ``RoomStatus/suspended(error:)`` or ``RoomStatus/failed(error:)`` state.
*
* If the room enters the failed state, then it will not automatically retry attaching and intervention is required.
*
* If the room enters the suspended state, then the call to attach will reject with the {@link ErrorInfo} that caused the suspension. However,
* If the room enters the suspended state, then the call to attach will throw `ARTErrorInfo` with the cause of the suspension. However,
* the room will automatically retry attaching after a delay.
*
* - Returns: A promise that resolves when the room is attached.
* - Throws: An `ARTErrorInfo`.
*/
func attach() async throws

/**
* Detaches from the room to stop receiving events in realtime.
*
* - Returns: A promise that resolves when the room is detached.
* - Throws: An `ARTErrorInfo`.
*/
func detach() async throws

Expand Down
4 changes: 2 additions & 2 deletions Sources/AblyChat/RoomOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public struct RoomOptions: Sendable, Equatable {
public struct PresenceOptions: Sendable, Equatable {
/**
* Whether the underlying Realtime channel should use the presence enter mode, allowing entry into presence.
* This property does not affect the presence lifecycle, and users must still call ``Presence/enter``
* This property does not affect the presence lifecycle, and users must still call ``Presence/enter()``
* in order to enter presence.
* Defaults to true.
*/
public var enter = true

/**
* Whether the underlying Realtime channel should use the presence subscribe mode, allowing subscription to presence.
* This property does not affect the presence lifecycle, and users must still call ``Presence/subscribe``
* This property does not affect the presence lifecycle, and users must still call ``Presence/subscribe(events:)``
* in order to subscribe to presence.
* Defaults to true.
*/
Expand Down
6 changes: 3 additions & 3 deletions Sources/AblyChat/RoomReactions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public protocol RoomReactions: AnyObject, Sendable, EmitsDiscontinuities {
* Send a reaction to the room including some metadata.
*
* - Parameters:
* - params: An object containing ``type`` and optional ``headers`` with ``metadata``.
* - params: An object containing `type` and optional `headers` with `metadata`.
*
* - Note: It is possible to receive your own reaction via the reactions subscription before this method returns.
*/
Expand All @@ -30,11 +30,11 @@ public protocol RoomReactions: AnyObject, Sendable, EmitsDiscontinuities {
* - Parameters:
* - bufferingPolicy: The ``BufferingPolicy`` for the created subscription.
*
* - Returns: A subscription ``AsyncSequence`` that can be used to iterate through ``Reaction`` events.
* - Returns: A subscription `AsyncSequence` that can be used to iterate through ``Reaction`` events.
*/
func subscribe(bufferingPolicy: BufferingPolicy) async -> Subscription<Reaction>

/// Same as calling ``subscribe(bufferingPolicy:)`` with ``BufferingPolicy.unbounded``.
/// Same as calling ``subscribe(bufferingPolicy:)`` with ``BufferingPolicy/unbounded``.
///
/// The `RoomReactions` protocol provides a default implementation of this method.
func subscribe() async -> Subscription<Reaction>
Expand Down
2 changes: 1 addition & 1 deletion Sources/AblyChat/Rooms.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public protocol Rooms: AnyObject, Sendable {

/**
* Get the client options used to create the chat instance.
*
*
* - Returns: ``ClientOptions`` object.
*/
var clientOptions: ClientOptions { get }
Expand Down
Loading

0 comments on commit 33b4b5e

Please sign in to comment.