david-swift 04c77831b5
Some checks are pending
Deploy Docs / publish (push) Waiting to run
SwiftLint / SwiftLint (push) Waiting to run
Remove Core library
2025-10-30 21:36:13 +01:00

36 lines
916 B
Swift

//
// Set.swift
// Adwaita
//
// Created by david-swift on 21.01.24.
//
extension Set where Element == Edge {
/// Horizontal and vertical edges.
public static var all: Self { vertical.union(horizontal) }
/// Top and bottom edges.
public static var vertical: Self { top.union(bottom) }
/// Leading and trailing edges.
public static var horizontal: Self { leading.union(trailing) }
/// Top edge.
public static var top: Self { [.top] }
/// Bottom edge.
public static var bottom: Self { [.bottom] }
/// Leading edge.
public static var leading: Self { [.leading] }
/// Trailing edge.
public static var trailing: Self { [.trailing] }
/// Add a collection of edges to a collection of edges.
/// - Parameter edges: The collection of edges.
/// - Returns: Both collections combined.
public func add(_ edges: Self) -> Self { union(edges) }
}