Skip to content

Commit

Permalink
starting work on docc
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Apr 24, 2024
1 parent bdd3d5f commit 5c237c9
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,7 @@ fastlane/test_output
iOSInjectionProject/

.mint
Output
Output

# Due to support for 5.10 and below
Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@
## Typealiases

- [EnumSet.RawValue](typealiases/EnumSet.RawValue.md)

This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs)
2 changes: 1 addition & 1 deletion Sources/Options/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// swiftlint:disable:next line_length
@available(*, deprecated, renamed: "MappedValueGenericRepresented", message: "Use MappedValueGenericRepresented instead.")
public protocol MappedValueCollectionRepresented: MappedValueGenericRepresented
public protocol MappedValueCollectionRepresented: MappedValueRepresented
where MappedValueType: Sequence {}

extension Array: MappedValues where Element: Equatable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Options/Dictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// swiftlint:disable:next line_length
@available(*, deprecated, renamed: "MappedValueGenericRepresented", message: "Use MappedValueGenericRepresented instead.")
public protocol MappedValueDictionaryRepresented: MappedValueGenericRepresented
public protocol MappedValueDictionaryRepresented: MappedValueRepresented
where MappedValueType == [Int: MappedType] {}

extension Dictionary: MappedValues where Key == Int, Value: Equatable {
Expand Down
30 changes: 30 additions & 0 deletions Sources/Options/Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ``Options``

Summary

## Overview

Text

## Topics

### Options conformance

- ``Options()``
- ``MappedValueRepresentable``
- ``MappedValueRepresented``
- ``EnumSet``

### Advanced customization

- ``MappedEnum``
- ``MappedValues``

### Errors

- ``MappedValueRepresentableError-2k4ki``

### Deprecated

- ``MappedValueCollectionRepresented``
- ``MappedValueDictionaryRepresented``
2 changes: 1 addition & 1 deletion Sources/Options/Macro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Foundation
#if swift(>=5.10)
@attached(
extension,
conformances: MappedValueRepresentable, MappedValueGenericRepresented,
conformances: MappedValueRepresentable, MappedValueRepresented,
names: named(MappedType), named(mappedValues)
)
@attached(peer, names: suffixed(Set))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// MappedValueGenericRepresented.swift
// MappedValueRepresented.swift
// SimulatorServices
//
// Created by Leo Dion.
Expand Down Expand Up @@ -28,14 +28,14 @@
//

/// Protocol which simplifies ``MappedValueRepresentable``by using a ``MappedValues``.
public protocol MappedValueGenericRepresented: MappedValueRepresentable
public protocol MappedValueRepresented: MappedValueRepresentable
where RawValue == Int, MappedType: Equatable {
associatedtype MappedValueType: MappedValues<MappedType>
/// An array of the mapped values which lines up with each case.
static var mappedValues: MappedValueType { get }
}

extension MappedValueGenericRepresented {
extension MappedValueRepresented {
/// Gets the raw value based on the MappedType by finding the index of the mapped value.
/// - Parameter value: MappedType value.
/// - Throws: `MappedValueCollectionRepresentedError.valueNotFound`
Expand Down

0 comments on commit 5c237c9

Please sign in to comment.