An open source design system that's fully customizable and agent ready
TypeScript
// Generated by @astryxdesign/native. Do not edit.
public enum HeadingLevel: Int, CaseIterable, Codable, Sendable {
case v1 = 1
case v2 = 2
case v3 = 3
case v4 = 4
case v5 = 5
case v6 = 6
}
public enum HeadingType: String, CaseIterable, Codable, Sendable {
case display1 = "display-1"
case display2 = "display-2"
case display3 = "display-3"
}
public enum HeadingWeight: String, CaseIterable, Codable, Sendable {
case normal = "normal"
case medium = "medium"
case semibold = "semibold"
case bold = "bold"
}
public enum HeadingAccessibilityLevel: Int, CaseIterable, Codable, Sendable {
case v1 = 1
case v2 = 2
case v3 = 3
case v4 = 4
case v5 = 5
case v6 = 6
}
public enum HeadingColor: String, CaseIterable, Codable, Sendable {
case primary = "primary"
case secondary = "secondary"
case disabled = "disabled"
case placeholder = "placeholder"
case accent = "accent"
case inherit = "inherit"
}
public enum HeadingJustify: String, CaseIterable, Codable, Sendable {
case start = "start"
case center = "center"
case end = "end"
}
#if os(iOS)
public struct HeadingProps {
/// Base props attach to this part on every platform.
public static let baseTarget: AstryxBaseTarget = .root
public var base: AstryxBaseProps
public var level: HeadingLevel
public var type: HeadingType?
public var weight: HeadingWeight?
public var children: String
public var accessibilityLevel: HeadingAccessibilityLevel?
public var color: HeadingColor?
public var maxLines: Double?
public var justify: HeadingJustify?
public var hasStrikethrough: Bool?
public init(level: HeadingLevel, type: HeadingType? = nil, weight: HeadingWeight? = nil, children: String, accessibilityLevel: HeadingAccessibilityLevel? = nil, color: HeadingColor? = nil, maxLines: Double? = nil, justify: HeadingJustify? = nil, hasStrikethrough: Bool? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
self.level = level
self.type = type
self.weight = weight
self.children = children
self.accessibilityLevel = accessibilityLevel
self.color = color
self.maxLines = maxLines
self.justify = justify
self.hasStrikethrough = hasStrikethrough
self.base = base
}
}
public struct HeadingNode: Decodable, Equatable, Sendable {
public struct Props: Decodable, Equatable, Sendable {
public var level: HeadingLevel
public var type: HeadingType?
public var weight: HeadingWeight?
public var children: String
public var accessibilityLevel: HeadingAccessibilityLevel?
public var color: HeadingColor?
public var maxLines: Double?
public var justify: HeadingJustify?
public var hasStrikethrough: Bool?
}
public let key: String
public let base: AstryxBaseProps?
public let props: Props
/// The callbacks the core listens to, by prop name.
public let events: [String]?
public func listens(_ event: String) -> Bool { events?.contains(event) ?? false }
/// The contract a Heading view takes; its callbacks send actions to the core.
public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> HeadingProps {
return HeadingProps(
level: props.level,
type: props.type,
weight: props.weight,
children: props.children,
accessibilityLevel: props.accessibilityLevel,
color: props.color,
maxLines: props.maxLines,
justify: props.justify,
hasStrikethrough: props.hasStrikethrough,
base: base ?? AstryxBaseProps()
)
}
}
#endif
#if os(macOS)
public struct HeadingProps {
/// Base props attach to this part on every platform.
public static let baseTarget: AstryxBaseTarget = .root
public var base: AstryxBaseProps
public var level: HeadingLevel
public var type: HeadingType?
public var weight: HeadingWeight?
public var children: String
public var accessibilityLevel: HeadingAccessibilityLevel?
public var color: HeadingColor?
public var maxLines: Double?
public var justify: HeadingJustify?
public var hasStrikethrough: Bool?
public init(level: HeadingLevel, type: HeadingType? = nil, weight: HeadingWeight? = nil, children: String, accessibilityLevel: HeadingAccessibilityLevel? = nil, color: HeadingColor? = nil, maxLines: Double? = nil, justify: HeadingJustify? = nil, hasStrikethrough: Bool? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
self.level = level
self.type = type
self.weight = weight
self.children = children
self.accessibilityLevel = accessibilityLevel
self.color = color
self.maxLines = maxLines
self.justify = justify
self.hasStrikethrough = hasStrikethrough
self.base = base
}
}
public struct HeadingNode: Decodable, Equatable, Sendable {
public struct Props: Decodable, Equatable, Sendable {
public var level: HeadingLevel
public var type: HeadingType?
public var weight: HeadingWeight?
public var children: String
public var accessibilityLevel: HeadingAccessibilityLevel?
public var color: HeadingColor?
public var maxLines: Double?
public var justify: HeadingJustify?
public var hasStrikethrough: Bool?
}
public let key: String
public let base: AstryxBaseProps?
public let props: Props
/// The callbacks the core listens to, by prop name.
public let events: [String]?
public func listens(_ event: String) -> Bool { events?.contains(event) ?? false }
/// The contract a Heading view takes; its callbacks send actions to the core.
public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> HeadingProps {
return HeadingProps(
level: props.level,
type: props.type,
weight: props.weight,
children: props.children,
accessibilityLevel: props.accessibilityLevel,
color: props.color,
maxLines: props.maxLines,
justify: props.justify,
hasStrikethrough: props.hasStrikethrough,
base: base ?? AstryxBaseProps()
)
}
}
#endif