Update RiotSwiftUI symbols to triple slash documentation style with function annotations.

This commit is contained in:
David Langley
2021-09-13 11:36:33 +01:00
parent 886bb98eb1
commit 3d65fbd48f
39 changed files with 184 additions and 240 deletions
@@ -17,14 +17,12 @@
import Foundation
import DesignKit
/**
Conformance of MXPushRule to the abstraction `NotificationPushRule` for use in `NotificationSettingsViewModel`.
*/
// Conformance of MXPushRule to the abstraction `NotificationPushRule` for use in `NotificationSettingsViewModel`.
extension MXPushRule: NotificationPushRuleType {
/*
Given a rule, check it match the actions in the static definition.
*/
/// Given a rule, check it match the actions in the static definition.
/// - Parameter standardActions: The standard actions to match against.
/// - Returns: Wether `this` rule matches the standard actions.
func matches(standardActions: NotificationStandardActions?) -> Bool {
guard let standardActions = standardActions else {
return false
@@ -16,9 +16,7 @@
import Foundation
/**
The actions defined on a push rule, used in the static push rule definitions.
*/
/// The actions defined on a push rule, used in the static push rule definitions.
struct NotificationActions {
let notify: Bool
let highlight: Bool
@@ -16,11 +16,10 @@
import Foundation
/**
Index that determines the state of the push setting.
Silent case is un-unsed on iOS but keeping in for consistency of
definition across the platforms.
*/
/// Index that determines the state of the push setting.
///
/// Silent case is un-used on iOS but keeping in for consistency of
/// definition across the platforms.
enum NotificationIndex {
case off
case silent
@@ -30,16 +29,14 @@ enum NotificationIndex {
extension NotificationIndex: CaseIterable { }
extension NotificationIndex {
/**
Used to map the on/off checkmarks to an index used in the static push rule definitions.
*/
/// Used to map the on/off checkmarks to an index used in the static push rule definitions.
/// - Parameter enabled: Enabled/Disabled state.
/// - Returns: The associated NotificationIndex
static func index(when enabled: Bool) -> NotificationIndex {
return enabled ? .noisy : .off
}
/**
Used to map from the checked state back to the index.
*/
/// Used to map from the checked state back to the index.
var enabled: Bool {
return self != .off
}
@@ -18,10 +18,11 @@ import Foundation
extension NotificationPushRuleId {
/**
A static definition of the push rule actions.
It is defined similarly across Web and Android.
*/
/// A static definition of the push rule actions.
///
/// It is defined similarly across Web and Android.
/// - Parameter index: The notification index for which to get the actions for.
/// - Returns: The associated `NotificationStandardActions`.
func standardActions(for index: NotificationIndex) -> NotificationStandardActions? {
switch self {
case .containDisplayName:
@@ -16,9 +16,7 @@
import Foundation
/**
The push rule ids used in notification settings and the static rule definitions.
*/
/// The push rule ids used in notification settings and the static rule definitions.
enum NotificationPushRuleId: String {
case suppressBots = ".m.rule.suppress_notices"
case inviteMe = ".m.rule.invite_for_me"
@@ -16,9 +16,7 @@
import Foundation
/**
The notification settings screen definitions, used when calling the coordinator.
*/
/// The notification settings screen definitions, used when calling the coordinator.
@objc enum NotificationSettingsScreen: Int {
case defaultNotifications
case mentionsAndKeywords
@@ -32,9 +30,7 @@ extension NotificationSettingsScreen: Identifiable {
}
extension NotificationSettingsScreen {
/**
Defines which rules are handled by each of the screens.
*/
/// Defines which rules are handled by each of the screens.
var pushRules: [NotificationPushRuleId] {
switch self {
case .defaultNotifications:
@@ -16,10 +16,9 @@
import Foundation
/**
A static definition of the different actions that can be defined on push rules.
It is defined similarly across Web and Android.
*/
/// A static definition of the different actions that can be defined on push rules.
///
/// It is defined similarly across Web and Android.
enum NotificationStandardActions {
case notify
case notifyDefaultSound