From 33b4b5e41fd28df179872ef18bb680f46b36bfc1 Mon Sep 17 00:00:00 2001 From: Marat Al Date: Tue, 10 Dec 2024 00:32:36 +0100 Subject: [PATCH] Removed links unresolved by docc compiler + fixed some linting issues. --- Sources/AblyChat/Connection.swift | 4 +- Sources/AblyChat/EmitsDiscontinuities.swift | 2 +- Sources/AblyChat/Message.swift | 14 +++---- Sources/AblyChat/Messages.swift | 6 +-- Sources/AblyChat/Occupancy.swift | 8 ++-- Sources/AblyChat/Presence.swift | 42 ++++++++++----------- Sources/AblyChat/Room.swift | 13 ++++--- Sources/AblyChat/RoomOptions.swift | 4 +- Sources/AblyChat/RoomReactions.swift | 6 +-- Sources/AblyChat/Rooms.swift | 2 +- Sources/AblyChat/Typing.swift | 10 ++--- 11 files changed, 56 insertions(+), 55 deletions(-) diff --git a/Sources/AblyChat/Connection.swift b/Sources/AblyChat/Connection.swift index 764950c..e05579d 100644 --- a/Sources/AblyChat/Connection.swift +++ b/Sources/AblyChat/Connection.swift @@ -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 - /// 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 diff --git a/Sources/AblyChat/EmitsDiscontinuities.swift b/Sources/AblyChat/EmitsDiscontinuities.swift index 380b0df..d893e93 100644 --- a/Sources/AblyChat/EmitsDiscontinuities.swift +++ b/Sources/AblyChat/EmitsDiscontinuities.swift @@ -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 diff --git a/Sources/AblyChat/Message.swift b/Sources/AblyChat/Message.swift index 71d94c5..067726c 100644 --- a/Sources/AblyChat/Message.swift +++ b/Sources/AblyChat/Message.swift @@ -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 @@ -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 diff --git a/Sources/AblyChat/Messages.swift b/Sources/AblyChat/Messages.swift index 70b98a7..1ec6d74 100644 --- a/Sources/AblyChat/Messages.swift +++ b/Sources/AblyChat/Messages.swift @@ -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. * @@ -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? diff --git a/Sources/AblyChat/Occupancy.swift b/Sources/AblyChat/Occupancy.swift index 85142a2..3779fd4 100644 --- a/Sources/AblyChat/Occupancy.swift +++ b/Sources/AblyChat/Occupancy.swift @@ -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 - /// 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 @@ -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. * @@ -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. */ diff --git a/Sources/AblyChat/Presence.swift b/Sources/AblyChat/Presence.swift index 3271342..3032872 100644 --- a/Sources/AblyChat/Presence.swift +++ b/Sources/AblyChat/Presence.swift @@ -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] @@ -98,7 +98,7 @@ 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] @@ -106,11 +106,11 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities { * 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 - /// 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 @@ -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. */ @@ -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. */ @@ -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. */ diff --git a/Sources/AblyChat/Room.swift b/Sources/AblyChat/Room.swift index d8b3a97..80e168b 100644 --- a/Sources/AblyChat/Room.swift +++ b/Sources/AblyChat/Room.swift @@ -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 } @@ -66,11 +67,11 @@ 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 - /// 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 @@ -78,21 +79,21 @@ public protocol Room: AnyObject, Sendable { /** * 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 diff --git a/Sources/AblyChat/RoomOptions.swift b/Sources/AblyChat/RoomOptions.swift index c940689..0392186 100644 --- a/Sources/AblyChat/RoomOptions.swift +++ b/Sources/AblyChat/RoomOptions.swift @@ -54,7 +54,7 @@ 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. */ @@ -62,7 +62,7 @@ public struct PresenceOptions: Sendable, Equatable { /** * 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. */ diff --git a/Sources/AblyChat/RoomReactions.swift b/Sources/AblyChat/RoomReactions.swift index 2a0036f..2a33d01 100644 --- a/Sources/AblyChat/RoomReactions.swift +++ b/Sources/AblyChat/RoomReactions.swift @@ -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. */ @@ -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 - /// 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 diff --git a/Sources/AblyChat/Rooms.swift b/Sources/AblyChat/Rooms.swift index bcf705e..9745ab3 100644 --- a/Sources/AblyChat/Rooms.swift +++ b/Sources/AblyChat/Rooms.swift @@ -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 } diff --git a/Sources/AblyChat/Typing.swift b/Sources/AblyChat/Typing.swift index 8f3bc7f..07d29d9 100644 --- a/Sources/AblyChat/Typing.swift +++ b/Sources/AblyChat/Typing.swift @@ -13,11 +13,11 @@ public protocol Typing: AnyObject, Sendable, EmitsDiscontinuities { * - Parameters: * - bufferingPolicy: The ``BufferingPolicy`` for the created subscription. * - * - Returns: A subscription ``AsyncSequence`` that can be used to iterate through ``TypingEvent`` events. + * - Returns: A subscription `AsyncSequence` that can be used to iterate through ``TypingEvent`` events. */ func subscribe(bufferingPolicy: BufferingPolicy) async -> Subscription - /// Same as calling ``subscribe(bufferingPolicy:)`` with ``BufferingPolicy.unbounded``. + /// Same as calling ``subscribe(bufferingPolicy:)`` with ``BufferingPolicy/unbounded``. /// /// The `Typing` protocol provides a default implementation of this method. func subscribe() async -> Subscription @@ -33,11 +33,11 @@ public protocol Typing: AnyObject, Sendable, EmitsDiscontinuities { * Start indicates that the current user is typing. This will emit a ``TypingEvent`` event to inform listening clients and begin a timer, * once the timer expires, another ``TypingEvent`` event will be emitted. In both cases ``TypingEvent/currentlyTyping`` * contains a list of userIds who are currently typing. - * + * * The timeout is configurable through the ``TypingOptions/timeout`` parameter. * If the current user is already typing, it will reset the timer and being counting down again without emitting a new event. * - * - Throws: An ``ARTErrorInfo``. + * - Throws: An `ARTErrorInfo`. */ func start() async throws @@ -45,7 +45,7 @@ public protocol Typing: AnyObject, Sendable, EmitsDiscontinuities { * Stop indicates that the current user has stopped typing. This will emit a ``TypingEvent`` event to inform listening clients, * and immediately clear the typing timeout timer. * - * - Throws: An ``ARTErrorInfo``. + * - Throws: An `ARTErrorInfo`. */ func stop() async throws