Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829public import Foundation
public enum SetupIPC { public static let queryName = "setups"
public static func listRequest(id: IPCRequestID = .string(UUID().uuidString)) -> IPCRequest { IPCRequest(id: id, command: "query", args: [queryName]) }
public enum Mutation: String, Sendable, CaseIterable { case save = "setup-save" case open = "setup-open" case delete = "setup-delete"
public func request( name: String, noHide: Bool = false, id: IPCRequestID = .string(UUID().uuidString) ) throws -> IPCRequest { guard !name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty, !noHide || self == .save else { throw IPCError( code: "invalid_arguments", message: String(localized: "The command arguments are missing or invalid.", bundle: .module)) } return IPCRequest(id: id, command: rawValue, args: [name] + (noHide ? ["no-hide"] : [])) } }}