mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 22:50:18 +00:00
parent
73f46c6897
commit
3c7d81ba17
@ -5,7 +5,7 @@ import aqua.backend.ts.TypeScriptCommon.fnDef
|
||||
import aqua.model.transform.res.ServiceRes
|
||||
|
||||
case class TSServiceTypes(srv: ServiceRes) extends ServiceTypes {
|
||||
import TypeScriptTypes._
|
||||
import TypeScriptTypes.*
|
||||
|
||||
private val serviceTypeName = s"${srv.name}Def";
|
||||
|
||||
@ -49,18 +49,18 @@ case class TSServiceTypes(srv: ServiceRes) extends ServiceTypes {
|
||||
.mkString("\n")
|
||||
}
|
||||
|
||||
def exportInterface = {
|
||||
private def exportInterface = {
|
||||
val fnDefs = srv.members.map { case (name, arrow) =>
|
||||
s"${typed(name, fnDef(arrow))};"
|
||||
s" ${typed(name, fnDef(arrow))};"
|
||||
}
|
||||
.mkString("\n")
|
||||
|
||||
s"""export interface ${serviceTypeName} {
|
||||
| ${fnDefs}
|
||||
|${fnDefs}
|
||||
|}""".stripMargin
|
||||
}
|
||||
|
||||
def generate = {
|
||||
def generate: String = {
|
||||
s"""$exportInterface
|
||||
|$registerServiceArgs
|
||||
"""
|
||||
|
@ -114,6 +114,7 @@ object CompareTypes {
|
||||
case (x: ArrayType, y: ArrayType) => apply(x.element, y.element)
|
||||
case (x: ArrayType, y: StreamType) => apply(x.element, y.element)
|
||||
case (x: ArrayType, y: OptionType) => apply(x.element, y.element)
|
||||
case (x: OptionType, y: OptionType) => apply(x.element, y.element)
|
||||
case (x: OptionType, y: StreamType) => apply(x.element, y.element)
|
||||
case (x: OptionType, y: ArrayType) => apply(x.element, y.element)
|
||||
case (x: StreamType, y: StreamType) => apply(x.element, y.element)
|
||||
|
Loading…
Reference in New Issue
Block a user