2018-12-27 22:24:20 +00:00
|
|
|
//
|
|
|
|
// AppLibrary.swift
|
|
|
|
// MasKit
|
|
|
|
//
|
|
|
|
// Created by Ben Chatelain on 12/27/18.
|
|
|
|
// Copyright © 2018 mas-cli. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
/// Utility for managing installed apps.
|
|
|
|
public protocol AppLibrary {
|
|
|
|
/// Finds an app by ID from the set of installed apps
|
|
|
|
///
|
|
|
|
/// - Parameter appId: MAS ID for app.
|
|
|
|
/// - Returns: Software Product of app if found; nil otherwise.
|
|
|
|
func installedApp(appId: UInt64) -> SoftwareProduct?
|
2018-12-27 23:07:35 +00:00
|
|
|
|
|
|
|
/// Uninstalls an app.
|
|
|
|
///
|
|
|
|
/// - Parameter app: App to be removed.
|
|
|
|
/// - Throws: Error if there is a problem.
|
|
|
|
func uninstallApp(app: SoftwareProduct) throws
|
2018-12-27 22:24:20 +00:00
|
|
|
}
|