Telegram-iOS/third-party/SwiftSVG/Sources/CommandRepresentable.swift
2026-04-24 23:19:15 +04:00

15 lines
519 B
Swift

/// Elements conforming to `CommandRepresentable` can be expressed in the form of `Path.Command`s.
public protocol CommandRepresentable {
func commands() throws -> [Path.Command]
}
public protocol DirectionalCommandRepresentable: CommandRepresentable {
func commands(clockwise: Bool) throws -> [Path.Command]
}
public extension DirectionalCommandRepresentable {
/// Defaults to anti/counter-clockwise commands.
func commands() throws -> [Path.Command] {
try commands(clockwise: false)
}
}