diff --git a/Server---Build-level-API.md b/Server---Build-level-API.md index c7c42bf..e8ddb50 100644 --- a/Server---Build-level-API.md +++ b/Server---Build-level-API.md @@ -13,14 +13,16 @@ val uiContext = taskKey[sbt.UIContext]("All user interaction should be driven th ```scala package sbt -trait UIContext { - +sealed trait UIContext { /** Prompts the user for input, optionally with a mask for characters. */ - def readLine(prompt: String, mask: Option[Char] = None): Option[String] + def readLine(prompt: String, mask: Boolean): Option[String] + // TODO - Ask for input with autocomplete? /** Sends an event out to all registered event listeners. */ def sendEvent[T: Format](event: T): Unit + def sendGenericEvent(data: JsValue): Unit } +private[sbt] abstract class AbstractUIContext extends UIContext ``` # 3. Plugin API @@ -29,6 +31,11 @@ trait UIContext { trait Plugin { ... def serializers: Seq[(AttributeKey[_], Format[_])] = Nil + + // Example types for keys.... + // TaskKey[T] => AttributeKey[Task[T]] -> Format[T] + // SettingKey[T] => AttributeKey[T] -> Format[T] + // InputKey[T] => AttributeKey[InputTask[T]] -> Format[T] } ```