Skip to content

An open source design system that's fully customizable and agent ready

TypeScript
3.4 KB
Raw Blame
// Generated by @astryxdesign/native. Do not edit.
public enum DividerOrientation: String, CaseIterable, Codable, Sendable {
  case horizontal = "horizontal"
  case vertical = "vertical"
}
public enum DividerVariant: String, CaseIterable, Codable, Sendable {
  case subtle = "subtle"
  case strong = "strong"
}
#if os(iOS)
public struct DividerProps {
  /// Base props attach to this part on every platform.
  public static let baseTarget: AstryxBaseTarget = .root
  public var base: AstryxBaseProps
  public var orientation: DividerOrientation?
  public var label: String?
  public var variant: DividerVariant?
  public var isFullBleed: Bool?
  public init(orientation: DividerOrientation? = nil, label: String? = nil, variant: DividerVariant? = nil, isFullBleed: Bool? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
    self.orientation = orientation
    self.label = label
    self.variant = variant
    self.isFullBleed = isFullBleed
    self.base = base
  }
}
public struct DividerNode: Decodable, Equatable, Sendable {
  public struct Props: Decodable, Equatable, Sendable {
    public var orientation: DividerOrientation?
    public var label: String?
    public var variant: DividerVariant?
    public var isFullBleed: 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 Divider view takes; its callbacks send actions to the core.
  public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> DividerProps {
    return DividerProps(
      orientation: props.orientation,
      label: props.label,
      variant: props.variant,
      isFullBleed: props.isFullBleed,
      base: base ?? AstryxBaseProps()
    )
  }
}
#endif
#if os(macOS)
public struct DividerProps {
  /// Base props attach to this part on every platform.
  public static let baseTarget: AstryxBaseTarget = .root
  public var base: AstryxBaseProps
  public var orientation: DividerOrientation?
  public var label: String?
  public var variant: DividerVariant?
  public var isFullBleed: Bool?
  public init(orientation: DividerOrientation? = nil, label: String? = nil, variant: DividerVariant? = nil, isFullBleed: Bool? = nil, base: AstryxBaseProps = AstryxBaseProps()) {
    self.orientation = orientation
    self.label = label
    self.variant = variant
    self.isFullBleed = isFullBleed
    self.base = base
  }
}
public struct DividerNode: Decodable, Equatable, Sendable {
  public struct Props: Decodable, Equatable, Sendable {
    public var orientation: DividerOrientation?
    public var label: String?
    public var variant: DividerVariant?
    public var isFullBleed: 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 Divider view takes; its callbacks send actions to the core.
  public func viewProps(send: @escaping @Sendable (AstryxAction) -> Void) -> DividerProps {
    return DividerProps(
      orientation: props.orientation,
      label: props.label,
      variant: props.variant,
      isFullBleed: props.isFullBleed,
      base: base ?? AstryxBaseProps()
    )
  }
}
#endif