Skip to content

Commit

Permalink
Added a canonical listing of types DynamicCodable uses
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitribouniol committed Apr 18, 2021
1 parent a16e0db commit 96a2c19
Showing 1 changed file with 76 additions and 2 deletions.
78 changes: 76 additions & 2 deletions Sources/DynamicCodable/DynamicCodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
public enum DynamicCodable: Equatable, Hashable {
/// A value coded using a keyed container such as a dictionary.
/// - Tag: DynamicCodable.keyed
case keyed([Key : Self])
case keyed(Keyed)

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

/// A value coding nil as a single value container.
/// - Tag: DynamicCodable.nil
Expand Down Expand Up @@ -80,6 +80,80 @@ public enum DynamicCodable: Equatable, Hashable {
/// A (rare) value coding an empty single value container. Only certain decoders may even support this.
/// - Tag: DynamicCodable.empty
case empty

// MARK: - DynamicCodableTypes

/// The underlying type for [.keyed](x-source-tag://DynamicCodable.keyed) values.
/// - Tag: DynamicCodable.Keyed
public typealias Keyed = [DynamicCodable.Key : DynamicCodable]

/// The underlying type for [.unkeyed](x-source-tag://DynamicCodable.unkeyed) values.
/// - Tag: DynamicCodable.Unkeyed
public typealias Unkeyed = [DynamicCodable]

/// The underlying type for [.nil](x-source-tag://DynamicCodable.nil) values.
/// - Tag: DynamicCodable.Nil
public typealias Nil = Optional<Any>

/// The underlying type for [.bool](x-source-tag://DynamicCodable.bool) values.
/// - Tag: DynamicCodable.Bool
public typealias Bool = Swift.Bool

/// The underlying type for [.string](x-source-tag://DynamicCodable.string) values.
/// - Tag: DynamicCodable.String
public typealias String = Swift.String

/// The underlying type for [.float64](x-source-tag://DynamicCodable.float64) values.
/// - Tag: DynamicCodable.Float64
public typealias Float64 = Swift.Float64

/// The underlying type for [.float32](x-source-tag://DynamicCodable.float32) values.
/// - Tag: DynamicCodable.Float32
public typealias Float32 = Swift.Float32

/// The underlying type for [.int](x-source-tag://DynamicCodable.int) values.
/// - Tag: DynamicCodable.Int
public typealias Int = Swift.Int

/// The underlying type for [.int8](x-source-tag://DynamicCodable.int8) values.
/// - Tag: DynamicCodable.Int8
public typealias Int8 = Swift.Int8

/// The underlying type for [.int16](x-source-tag://DynamicCodable.int16) values.
/// - Tag: DynamicCodable.Int16
public typealias Int16 = Swift.Int16

/// The underlying type for [.int32](x-source-tag://DynamicCodable.int32) values.
/// - Tag: DynamicCodable.Int32
public typealias Int32 = Swift.Int32

/// The underlying type for [.int64](x-source-tag://DynamicCodable.int64) values.
/// - Tag: DynamicCodable.Int64
public typealias Int64 = Swift.Int64

/// The underlying type for [.uint](x-source-tag://DynamicCodable.uint) values.
/// - Tag: DynamicCodable.UInt
public typealias UInt = Swift.UInt

/// The underlying type for [.uint8](x-source-tag://DynamicCodable.uint8) values.
/// - Tag: DynamicCodable.UInt8
public typealias UInt8 = Swift.UInt8

/// The underlying type for [.uint16](x-source-tag://DynamicCodable.uint16) values.
/// - Tag: DynamicCodable.UInt16
public typealias UInt16 = Swift.UInt16

/// The underlying type for [.uint32](x-source-tag://DynamicCodable.uint32) values.
/// - Tag: DynamicCodable.UInt32
public typealias UInt32 = Swift.UInt32

/// The underlying type for [.uint64](x-source-tag://DynamicCodable.uint64) values.
/// - Tag: DynamicCodable.UInt64
public typealias UInt64 = Swift.UInt64

/// The underlying type for [.empty](x-source-tag://DynamicCodable.empty) values.
/// - Tag: DynamicCodable.Empty
public typealias Empty = Swift.Void
}

extension DynamicCodable {
Expand Down

0 comments on commit 96a2c19

Please sign in to comment.