term-kit-backend/Sources/TermKitBackend/Model/TermKitApp.swift

42 lines
1.0 KiB
Swift
Raw Normal View History

2024-07-10 14:41:11 +02:00
//
// TermKitSceneElement.swift
// TermKitBackend
//
// Created by david-swift on 01.07.2024.
//
@_exported import Meta
import TermKit
/// The Meta app storage for the TermKit backend.
public class TermKitApp: AppStorage {
/// The scene element type of the TermKit backend.
public typealias SceneElementType = TermKitSceneElement
/// The widget type of the TermKit backend.
public typealias WidgetType = TermKitWidget
/// The wrapper type of the TermKit backend.
public typealias WrapperType = VStack
/// The app storage.
public var storage: StandardAppStorage = .init()
/// Initialize the app storage.
2024-07-19 23:41:19 +02:00
/// - Parameter id: The identifier.
2024-07-18 16:07:37 +02:00
public required init(id: String) { }
2024-07-10 14:41:11 +02:00
/// Execute the app.
/// - Parameter setup: Set the scene elements up.
public func run(setup: @escaping () -> Void) {
Application.prepare()
setup()
Application.run()
}
/// Quit the app.
public func quit() {
Application.shutdown()
}
}