From def7d05971bbf356f5a3b7de075371006dcb74be Mon Sep 17 00:00:00 2001 From: Pierre-Yves Lapersonne Date: Wed, 18 Dec 2024 09:46:10 +0100 Subject: [PATCH] refactor: rename type aliases for tokens providers (#79) Signed-off-by: Pierre-Yves Lapersonne --- .../OUDS/Sources/OUDSTheme/OUDSTheme.swift | 56 +++++++++---------- ...MockTheme+AllElevationSemanticTokens.swift | 2 +- .../OUDSTheme/MockThemes/MockTheme.swift | 2 +- .../Themes/Orange/Sources/OrangeTheme.swift | 30 +++++----- .../OUDSBorderSemanticTokensProvider.swift | 2 +- .../OUDSColorSemanticTokensProvider.swift | 2 +- .../OUDSElevationSemanticTokensProvider.swift | 2 +- .../OUDSFontSemanticTokensProvider.swift | 2 +- .../OUDSGridSemanticTokensProvider.swift | 2 +- .../OUDSOpacitySemanticTokensProvider.swift | 2 +- .../OUDSSizeSemanticTokensProvider.swift | 2 +- .../SemanticTokensProviders+TypeAliases.swift | 16 +++--- .../OUDSTokensSemantic.md | 4 +- 13 files changed, 62 insertions(+), 62 deletions(-) diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift index 224b04bb60..b672c5374f 100644 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift +++ b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift @@ -30,31 +30,31 @@ open class OUDSTheme: @unchecked Sendable { // MARK: - Properties /// All color semantic tokens exposed in one object - public let colors: AllColorSemanticTokens + public let colors: AllColorSemanticTokensProvider /// All border semantic tokens exposed in one object - public let borders: AllBorderSemanticTokens + public let borders: AllBorderSemanticTokensProvider /// All elevation semantic tokens exposed in one object - public let elevations: AllElevationSemanticTokens + public let elevations: AllElevationSemanticTokensProvider /// A theme can have a custom font which is not the system font public let fontFamily: FontFamilySemanticToken? /// All font semantic tokens exposed in one object - public let fonts: AllFontSemanticTokens + public let fonts: AllFontSemanticTokensProvider /// All grid semantic tokens exposed in one object - public let grids: AllGridSemanticTokens + public let grids: AllGridSemanticTokensProvider /// All opacity semantic tokens exposed in one object - public let opacities: AllOpacitySemanticTokens + public let opacities: AllOpacitySemanticTokensProvider /// All size semantic tokens exposed in one object - public let sizes: AllSizeSemanticTokens + public let sizes: AllSizeSemanticTokensProvider /// All size semantic tokens exposed in one object - public let spaces: AllSpaceSemanticTokens + public let spaces: AllSpaceSemanticTokensProvider // TODO: Add components tokens @@ -71,14 +71,14 @@ open class OUDSTheme: @unchecked Sendable { /// - opacities: An object providing all the opacity semantic tokens, by default `OUDSOpacitySemanticTokensProvider` /// - sizes: An object providing all the size semantic tokens, by default `OUDSSizeSemanticTokensProvider` /// - spaces: An object providing all the space semantic tokens, by default `OUDSSpaceSemanticTokensProvider` - public init(colors: AllColorSemanticTokens = OUDSColorSemanticTokensProvider(), - borders: AllBorderSemanticTokens = OUDSBorderSemanticTokensProvider(), - elevations: AllElevationSemanticTokens = OUDSElevationSemanticTokensProvider(), - fonts: AllFontSemanticTokens = OUDSFontSemanticTokensProvider(), - grids: AllGridSemanticTokens = OUDSGridSemanticTokensProvider(), - opacities: AllOpacitySemanticTokens = OUDSOpacitySemanticTokensProvider(), - sizes: AllSizeSemanticTokens = OUDSSizeSemanticTokensProvider(), - spaces: AllSpaceSemanticTokens = OUDSSpaceSemanticTokensProvider()) { + public init(colors: AllColorSemanticTokensProvider = OUDSColorSemanticTokensProvider(), + borders: AllBorderSemanticTokensProvider = OUDSBorderSemanticTokensProvider(), + elevations: AllElevationSemanticTokensProvider = OUDSElevationSemanticTokensProvider(), + fonts: AllFontSemanticTokensProvider = OUDSFontSemanticTokensProvider(), + grids: AllGridSemanticTokensProvider = OUDSGridSemanticTokensProvider(), + opacities: AllOpacitySemanticTokensProvider = OUDSOpacitySemanticTokensProvider(), + sizes: AllSizeSemanticTokensProvider = OUDSSizeSemanticTokensProvider(), + spaces: AllSpaceSemanticTokensProvider = OUDSSpaceSemanticTokensProvider()) { self.colors = colors self.borders = borders self.elevations = elevations @@ -93,23 +93,23 @@ open class OUDSTheme: @unchecked Sendable { /// Defines a basic kind of abstract theme to subclass then. /// - Parameters: /// - colors: An object providing all the color semantic tokens, as `AllColorSemanticTokens` implementation - /// - borders: An object providing all the border semantic tokens, as `BorderSemanticTokens` implementation - /// - elevations: An object providing all the elevation semantic tokens, by default `AllElevationSemanticTokens` + /// - borders: An object providing all the border semantic tokens, as `AllBorderSemanticTokensProvider` implementation + /// - elevations: An object providing all the elevation semantic tokens, by default `AllElevationSemanticTokensProvider` /// - fontFamily: Set `nil` if system font to use, otherwise use the `FontFamilySemanticToken` you want to apply /// - fonts: An object providing all the font semantic tokens, by default `AllFontemanticTokens` /// - grids: An object providing all the grid semantic tokens, by default `AllGridSemanticTokens` - /// - opacities: An object providing all the opacity semantic tokens, as `AllOpacitySemanticTokens` implementation + /// - opacities: An object providing all the opacity semantic tokens, as `AllOpacitySemanticTokensProvider` implementation /// - sizes: An object providing all the size semantic tokens, as `AllSizeSemanticTokens` implementation - /// - spaces: An object providing all the space semantic tokens, as `AllSpaceSemanticTokens` implementation - public init(colors: AllColorSemanticTokens, - borders: AllBorderSemanticTokens, - elevations: AllElevationSemanticTokens, + /// - spaces: An object providing all the space semantic tokens, as `AllSpaceSemanticTokensProvider` implementation + public init(colors: AllColorSemanticTokensProvider, + borders: AllBorderSemanticTokensProvider, + elevations: AllElevationSemanticTokensProvider, fontFamily: FontFamilySemanticToken?, - fonts: AllFontSemanticTokens, - grids: AllGridSemanticTokens, - opacities: AllOpacitySemanticTokens, - sizes: AllSizeSemanticTokens, - spaces: AllSpaceSemanticTokens) { + fonts: AllFontSemanticTokensProvider, + grids: AllGridSemanticTokensProvider, + opacities: AllOpacitySemanticTokensProvider, + sizes: AllSizeSemanticTokensProvider, + spaces: AllSpaceSemanticTokensProvider) { self.colors = colors self.borders = borders self.elevations = elevations diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllElevationSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllElevationSemanticTokens.swift index fd923c6a96..3090bbb357 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllElevationSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+AllElevationSemanticTokens.swift @@ -21,7 +21,7 @@ import OUDSTokensSemantic /// Overrides **all** the elevation semantic tokens, both simple, multiple and composites (from its super class, i.e. `OUDSElevationSemanticTokensProvider` so as to test overriding of them (unit tests) /// and to act like smoke tests with crashing tests if some tokens disappeared. -/// This ``MockThemeElevationSemanticTokensProvider`` will be asigned in ``MockTheme`` as an ``AllElevationSemanticTokens`` implementation. +/// This ``MockThemeElevationSemanticTokensProvider`` will be asigned in ``MockTheme`` as an ``AllElevationSemanticTokensProvider`` implementation. final class MockThemeElevationSemanticTokensProvider: OUDSElevationSemanticTokensProvider { // MARK: Semantic token - Elevation - Box shadow (Composites) diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme.swift index e8e0cc323e..1bb73c4913 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme.swift @@ -35,7 +35,7 @@ open class MockTheme: OUDSTheme, @unchecked Sendable { } /// For ``OtherMockTheme`` - init(colors: AllColorSemanticTokens) { + init(colors: AllColorSemanticTokensProvider) { super.init(colors: colors, borders: MockThemeBorderSemanticTokensProvider(), elevations: MockThemeElevationSemanticTokensProvider(), diff --git a/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift b/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift index 6092e0be6c..41ed6dabae 100644 --- a/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift +++ b/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift @@ -58,7 +58,7 @@ open class OrangeTheme: OUDSTheme, @unchecked Sendable { /// This constructor is defined for `InverseTheme`. /// - Parameters: /// - colors: An object providing all the color semantic tokens, as `AllColorSemanticTokens` implementation - public init(colors: AllColorSemanticTokens) { + public init(colors: AllColorSemanticTokensProvider) { // Not init log here as constructor used for `InverseTheme` and not for `OrangeTheme` super.init(colors: colors) } @@ -66,21 +66,21 @@ open class OrangeTheme: OUDSTheme, @unchecked Sendable { /// Initializes the `OrangeTheme` and lets children classes to user their own tokens implementations /// - Parameters: /// - colors: An object providing all the color semantic tokens, as `AllColorSemanticTokens` implementation, default set to `OrangeThemeColorSemanticTokensProvider` - /// - borders: An object providing all the border semantic tokens, as `BorderSemanticTokens` implementation, default set to `OUDSBorderSemanticTokensProvider` - /// - elevations: An object providing all the elevation semantic tokens, by default `AllElevationSemanticTokens`, default set to `OUDSElevationSemanticTokensProvider` + /// - borders: An object providing all the border semantic tokens, as `AllBorderSemanticTokensProvider` implementation, default set to `OUDSBorderSemanticTokensProvider` + /// - elevations: An object providing all the elevation semantic tokens, by default `AllElevationSemanticTokensProvider`, default set to `OUDSElevationSemanticTokensProvider` /// - fonts: An object providing all the font semantic tokens, by default `AllFontemanticTokens`, default set to `OUDSFontSemanticTokensProvider` - /// - grids: An object providing all the grid semantic tokens, by default `AllGridSemanticTokens`, default set to `OUDSGridSemanticTokensProvider` - /// - opacities: An object providing all the opacity semantic tokens, as `OpacitySemanticTokens` implementation, default set to `OUDSOpacitySemanticTokensProvider` - /// - sizes: An object providing all the size semantic tokens, as `AllSizeSemanticTokens` implementation, default set to `OUDSSizeSemanticTokensProvider` - /// - spaces: An object providing all the space semantic tokens, as `AllSpaceSemanticTokens` implementation, default set to `OUDSSpaceSemanticTokensProvider` - override public init(colors: AllColorSemanticTokens = OrangeThemeColorSemanticTokensProvider(), - borders: AllBorderSemanticTokens = OUDSBorderSemanticTokensProvider(), - elevations: AllElevationSemanticTokens = OUDSElevationSemanticTokensProvider(), - fonts: AllFontSemanticTokens = OUDSFontSemanticTokensProvider(), - grids: AllGridSemanticTokens = OUDSGridSemanticTokensProvider(), - opacities: AllOpacitySemanticTokens = OUDSOpacitySemanticTokensProvider(), - sizes: AllSizeSemanticTokens = OUDSSizeSemanticTokensProvider(), - spaces: AllSpaceSemanticTokens = OUDSSpaceSemanticTokensProvider()) { + /// - grids: An object providing all the grid semantic tokens, by default `AllGridSemanticTokensProvider`, default set to `OUDSGridSemanticTokensProvider` + /// - opacities: An object providing all the opacity semantic tokens, as `AllOpacitySemanticTokensProvider` implementation, default set to `OUDSOpacitySemanticTokensProvider` + /// - sizes: An object providing all the size semantic tokens, as `AllSizeSemanticTokensProvider` implementation, default set to `OUDSSizeSemanticTokensProvider` + /// - spaces: An object providing all the space semantic tokens, as `AllSpaceSemanticTokensProvider` implementation, default set to `OUDSSpaceSemanticTokensProvider` + override public init(colors: AllColorSemanticTokensProvider = OrangeThemeColorSemanticTokensProvider(), + borders: AllBorderSemanticTokensProvider = OUDSBorderSemanticTokensProvider(), + elevations: AllElevationSemanticTokensProvider = OUDSElevationSemanticTokensProvider(), + fonts: AllFontSemanticTokensProvider = OUDSFontSemanticTokensProvider(), + grids: AllGridSemanticTokensProvider = OUDSGridSemanticTokensProvider(), + opacities: AllOpacitySemanticTokensProvider = OUDSOpacitySemanticTokensProvider(), + sizes: AllSizeSemanticTokensProvider = OUDSSizeSemanticTokensProvider(), + spaces: AllSpaceSemanticTokensProvider = OUDSSpaceSemanticTokensProvider()) { OUDSLogger.debug("Init of OrangeTheme") super.init(colors: colors, borders: borders, diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSBorderSemanticTokensProvider.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSBorderSemanticTokensProvider.swift index 09d1be6ea2..35cddacd03 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSBorderSemanticTokensProvider.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSBorderSemanticTokensProvider.swift @@ -14,7 +14,7 @@ import OUDSFoundations /// A class which wraps all **border semantic tokens** and expose them. -/// This provider should be integrated as a ``AllBorderSemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This provider should be integrated as a ``AllBorderSemanticTokensProvider`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. It helps users to override some of the tokens and assign them to an `OUDSTheme` implementation to use. /// /// ```swift diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSColorSemanticTokensProvider.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSColorSemanticTokensProvider.swift index 179430c861..66d08503a7 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSColorSemanticTokensProvider.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSColorSemanticTokensProvider.swift @@ -14,7 +14,7 @@ import OUDSFoundations /// A class which wraps all **color semantic tokens**, *multiple* or not, and expose them. -/// This provider should be integrated as a ``AllColorSemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This provider should be integrated as a ``AllColorSemanticTokensProvider`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. It helps users to override some of the tokens and assign them to an `OUDSTheme` implementation to use. /// /// ```swift diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSElevationSemanticTokensProvider.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSElevationSemanticTokensProvider.swift index 9e34fbd84f..fdff9c2da8 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSElevationSemanticTokensProvider.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSElevationSemanticTokensProvider.swift @@ -14,7 +14,7 @@ import OUDSFoundations /// A class which wraps all **elevation semantic tokens**, *multiple*, *composite* or not, and expose them. -/// This provider should be integrated as a ``AllElevationSemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This provider should be integrated as a ``AllElevationSemanticTokensProvider`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. It helps users to override some of the tokens and assign them to an `OUDSTheme` implementation to use. /// /// ```swift diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSFontSemanticTokensProvider.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSFontSemanticTokensProvider.swift index 42b9b3b604..393e97b955 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSFontSemanticTokensProvider.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSFontSemanticTokensProvider.swift @@ -14,7 +14,7 @@ import OUDSFoundations /// A class which wraps all **font semantic tokens**, *multiple*, *composite* or not, and expose them. -/// This provider should be integrated as a ``AllFontSemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This provider should be integrated as a ``AllFontSemanticTokensProvider`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. It helps users to override some of the tokens and assign them to an `OUDSTheme` implementation to use. /// /// ```swift diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSGridSemanticTokensProvider.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSGridSemanticTokensProvider.swift index 9862fe50a8..d3662bdf30 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSGridSemanticTokensProvider.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSGridSemanticTokensProvider.swift @@ -14,7 +14,7 @@ import OUDSFoundations /// A class which wraps all **grid semantic tokens** and expose them. -/// This provider should be integrated as a ``AllGridSemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This provider should be integrated as a ``AllGridSemanticTokensProvider`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. It helps users to override some of the tokens and assign them to an `OUDSTheme` implementation to use. /// /// ```swift diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSOpacitySemanticTokensProvider.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSOpacitySemanticTokensProvider.swift index 7caff77f94..6cdf97254c 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSOpacitySemanticTokensProvider.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSOpacitySemanticTokensProvider.swift @@ -14,7 +14,7 @@ import OUDSFoundations /// A class which wraps all **opacity semantic tokens** and expose them. -/// This provider should be integrated as a ``AllOpacitySemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This provider should be integrated as a ``AllOpacitySemanticTokensProvider`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. It helps users to override some of the tokens and assign them to an `OUDSTheme` implementation to use. /// /// ```swift diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSSizeSemanticTokensProvider.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSSizeSemanticTokensProvider.swift index 933e424f43..dd92fb0211 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSSizeSemanticTokensProvider.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/OUDSSizeSemanticTokensProvider.swift @@ -14,7 +14,7 @@ import OUDSFoundations /// A class which wraps all **size semantic tokens**, *multiple* or not, and expose them. -/// This provider should be integrated as a ``AllSizeSemanticTokens`` implementation inside `OUDSTheme` so as to provide +/// This provider should be integrated as a ``AllSizeSemanticTokensProvider`` implementation inside `OUDSTheme` so as to provide /// all tokens to the users. It helps users to override some of the tokens and assign them to an `OUDSTheme` implementation to use. /// /// ```swift diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/SemanticTokensProviders+TypeAliases.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/SemanticTokensProviders+TypeAliases.swift index 730812a039..61973a8a9f 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/SemanticTokensProviders+TypeAliases.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Providers/SemanticTokensProviders+TypeAliases.swift @@ -14,39 +14,39 @@ /// A type alias only for ``BorderSemanticTokens`` so as to keep consistency with other type aliases /// merging several protocols /// For example ``OUDSBorderSemanticTokensProvider`` matches this type alias. -public typealias AllBorderSemanticTokens = BorderSemanticTokens +public typealias AllBorderSemanticTokensProvider = BorderSemanticTokens /// A type alias only for ``OpacitySemanticTokens`` so as to keep consistency with other type aliases /// merging several protocols. /// For example ``OUDSOpacitySemanticTokensProvider`` matches this type alias. -public typealias AllOpacitySemanticTokens = OpacitySemanticTokens +public typealias AllOpacitySemanticTokensProvider = OpacitySemanticTokens /// A type alias only for ``GridSemanticTokens`` so as to keep consistency with other type aliases /// merging several protocols. /// For example ``OUDSGridSemanticTokensProvider`` matches this type alias. -public typealias AllGridSemanticTokens = GridSemanticTokens +public typealias AllGridSemanticTokensProvider = GridSemanticTokens /// A type alias which merges ``ColorSemanticTokens`` and ``ColorMultipleSemanticTokens``. /// It helps in the end to define a provider for all the semantic tokens of colors, multiple or not, generated or not. /// For example ``OUDSColorSemanticTokensProvider`` matches this type alias. -public typealias AllColorSemanticTokens = ColorSemanticTokens & ColorMultipleSemanticTokens +public typealias AllColorSemanticTokensProvider = ColorSemanticTokens & ColorMultipleSemanticTokens /// A type alias which merges ``ElevationSemanticTokens``, ``ElevationCompositeSemanticTokens`` and ``ElevationMultipleSemanticTokens``. /// It helps in the end to define a provider for all the semantic tokens of elevations, multiple or not, generated or not. /// For example ``OUDSElevationSemanticTokensProvider`` matches this type alias. -public typealias AllElevationSemanticTokens = ElevationSemanticTokens & ElevationCompositeSemanticTokens & ElevationMultipleSemanticTokens +public typealias AllElevationSemanticTokensProvider = ElevationSemanticTokens & ElevationCompositeSemanticTokens & ElevationMultipleSemanticTokens /// A type alias which merges ``FontSemanticTokens``, ``FontCompositeSemanticTokens`` and ``FontMultipleSemanticTokens``. /// It helps in the end to define a provider for all the semantic tokens of fonts, multiple, composite, or not, generated or not. /// For example ``OUDSFontSemanticTokensProvider`` matches this type alias. -public typealias AllFontSemanticTokens = FontSemanticTokens & FontCompositeSemanticTokens & FontMultipleSemanticTokens +public typealias AllFontSemanticTokensProvider = FontSemanticTokens & FontCompositeSemanticTokens & FontMultipleSemanticTokens /// A type alias which merges ``SizeSemanticTokens`` and ``SizeMultipleSemanticTokens``. /// It helps in the end to define a provider for all the semantic tokens of size, multiple or not, generated or not. /// For example ``OUDSSizeSemanticTokensProvider`` matches this type alias. -public typealias AllSizeSemanticTokens = SizeSemanticTokens & SizeMultipleSemanticTokens +public typealias AllSizeSemanticTokensProvider = SizeSemanticTokens & SizeMultipleSemanticTokens /// A type alias which merges ``SpaceSemanticTokens`` and ``SpaceMultipleSemanticTokens``. /// It helps in the end to define a provider for all the semantic tokens of space, multiple or not, generated or not. /// For example ``OUDSSpaceSemanticTokensProvider`` matches this type alias. -public typealias AllSpaceSemanticTokens = SpaceSemanticTokens & SpaceMultipleSemanticTokens +public typealias AllSpaceSemanticTokensProvider = SpaceSemanticTokens & SpaceMultipleSemanticTokens diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/_OUDSTokensSemantic.docc/OUDSTokensSemantic.md b/OUDS/Core/Tokens/SemanticTokens/Sources/_OUDSTokensSemantic.docc/OUDSTokensSemantic.md index ac55faa5ab..67e83f2fd6 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/_OUDSTokensSemantic.docc/OUDSTokensSemantic.md +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/_OUDSTokensSemantic.docc/OUDSTokensSemantic.md @@ -73,7 +73,7 @@ public protocol ColorSemanticToken { ... } public protocol ColorMultipleSemanticTokens { ... } // These protoocols are merged in type aliase -public typealias AllColorSemanticTokens = ColorSemanticTokens & ColorMultipleSemanticTokens +public typealias AllColorSemanticTokensprovider = ColorSemanticTokens & ColorMultipleSemanticTokens // For example, the provider for the colors basically is: open class OUDSColorSemanticTokensProvider { ... } @@ -89,7 +89,7 @@ extension OUDSColorSemanticTokensProvider: ColorMultipleSemanticTokens { // The "abstract" object of theme expose the provider through this subset of protocols open class OUDSTheme: @unchecked Sendable { - public let colors: AllColorSemanticTokens + public let colors: AllColorSemanticTokensProvider } // And finaly, the default theme, which can be subclassed, exposes the tokens through the provider