Skip to content

Commit 9f4a25f

Browse files
Added a canonical listing of types DynamicCodable uses
1 parent 802f752 commit 9f4a25f

File tree

1 file changed

+76
-2
lines changed

1 file changed

+76
-2
lines changed

Sources/DynamicCodable/DynamicCodable.swift

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
public enum DynamicCodable: Equatable, Hashable {
1212
/// A value coded using a keyed container such as a dictionary.
1313
/// - Tag: DynamicCodable.keyed
14-
case keyed([Key : Self])
14+
case keyed(Keyed)
1515

1616
/// A value coded using a keyed container such as an array.
1717
/// - Tag: DynamicCodable.unkeyed
18-
case unkeyed([Self])
18+
case unkeyed(Unkeyed)
1919

2020
/// A value coding nil as a single value container.
2121
/// - Tag: DynamicCodable.nil
@@ -80,6 +80,80 @@ public enum DynamicCodable: Equatable, Hashable {
8080
/// A (rare) value coding an empty single value container. Only certain decoders may even support this.
8181
/// - Tag: DynamicCodable.empty
8282
case empty
83+
84+
// MARK: - DynamicCodableTypes
85+
86+
/// The underlying type for [.keyed](x-source-tag://DynamicCodable.keyed) values.
87+
/// - Tag: DynamicCodable.Keyed
88+
public typealias Keyed = [DynamicCodable.Key : DynamicCodable]
89+
90+
/// The underlying type for [.unkeyed](x-source-tag://DynamicCodable.unkeyed) values.
91+
/// - Tag: DynamicCodable.Unkeyed
92+
public typealias Unkeyed = [DynamicCodable]
93+
94+
/// The underlying type for [.nil](x-source-tag://DynamicCodable.nil) values.
95+
/// - Tag: DynamicCodable.Nil
96+
public typealias Nil = Optional<Any>
97+
98+
/// The underlying type for [.bool](x-source-tag://DynamicCodable.bool) values.
99+
/// - Tag: DynamicCodable.Bool
100+
public typealias Bool = Swift.Bool
101+
102+
/// The underlying type for [.string](x-source-tag://DynamicCodable.string) values.
103+
/// - Tag: DynamicCodable.String
104+
public typealias String = Swift.String
105+
106+
/// The underlying type for [.float64](x-source-tag://DynamicCodable.float64) values.
107+
/// - Tag: DynamicCodable.Float64
108+
public typealias Float64 = Swift.Float64
109+
110+
/// The underlying type for [.float32](x-source-tag://DynamicCodable.float32) values.
111+
/// - Tag: DynamicCodable.Float32
112+
public typealias Float32 = Swift.Float32
113+
114+
/// The underlying type for [.int](x-source-tag://DynamicCodable.int) values.
115+
/// - Tag: DynamicCodable.Int
116+
public typealias Int = Swift.Int
117+
118+
/// The underlying type for [.int8](x-source-tag://DynamicCodable.int8) values.
119+
/// - Tag: DynamicCodable.Int8
120+
public typealias Int8 = Swift.Int8
121+
122+
/// The underlying type for [.int16](x-source-tag://DynamicCodable.int16) values.
123+
/// - Tag: DynamicCodable.Int16
124+
public typealias Int16 = Swift.Int16
125+
126+
/// The underlying type for [.int32](x-source-tag://DynamicCodable.int32) values.
127+
/// - Tag: DynamicCodable.Int32
128+
public typealias Int32 = Swift.Int32
129+
130+
/// The underlying type for [.int64](x-source-tag://DynamicCodable.int64) values.
131+
/// - Tag: DynamicCodable.Int64
132+
public typealias Int64 = Swift.Int64
133+
134+
/// The underlying type for [.uint](x-source-tag://DynamicCodable.uint) values.
135+
/// - Tag: DynamicCodable.UInt
136+
public typealias UInt = Swift.UInt
137+
138+
/// The underlying type for [.uint8](x-source-tag://DynamicCodable.uint8) values.
139+
/// - Tag: DynamicCodable.UInt8
140+
public typealias UInt8 = Swift.UInt8
141+
142+
/// The underlying type for [.uint16](x-source-tag://DynamicCodable.uint16) values.
143+
/// - Tag: DynamicCodable.UInt16
144+
public typealias UInt16 = Swift.UInt16
145+
146+
/// The underlying type for [.uint32](x-source-tag://DynamicCodable.uint32) values.
147+
/// - Tag: DynamicCodable.UInt32
148+
public typealias UInt32 = Swift.UInt32
149+
150+
/// The underlying type for [.uint64](x-source-tag://DynamicCodable.uint64) values.
151+
/// - Tag: DynamicCodable.UInt64
152+
public typealias UInt64 = Swift.UInt64
153+
154+
/// The underlying type for [.empty](x-source-tag://DynamicCodable.empty) values.
155+
/// - Tag: DynamicCodable.Empty
156+
public typealias Empty = Swift.Void
83157
}
84158

85159
extension DynamicCodable {

0 commit comments

Comments
 (0)