Structure
Typealias
public struct Typealias: Declaration, Hashable, Codable
A type alias declaration.
Relationships
Conforms To
Declaration
A Swift declaration.
ExpressibleBySyntax
A type that can be initialized with a Swift syntax node.
Codable
CustomStringConvertible
Hashable
Initializers
init(_:)
public init(_ node: TypealiasDeclSyntax)
Creates an instance initialized with the given syntax node.
Properties
keyword
let keyword: String
The declaration keyword ("typealias"
).
name
let name: String
The type alias name.
initializedType
let initializedType: String?
The initialized type, if any.
genericParameters
let genericParameters: [GenericParameter]
The generic parameters for the declaration.
For example,
the following typealias declaration
has a single generic parameter
whose name
is "T"
and type
is "Comparable"
:
typealias SortableArray<T: Comparable> = Array<T>
genericRequirements
let genericRequirements: [GenericRequirement]
The generic parameter requirements for the declaration.
For example,
the following typealias declaration
has a single requirement
that its generic parameter identified as "T"
conforms to the type identified as "Numeric"
:
typealias ArrayOfNumbers<T> = Array<T> where T: Numeric
description
var description: String