forked from lyraproj/servicesdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(lyraproj/lyra#42) Add generation of TypeScript types from TypeSet
This commit adds a TypeSet generator for TypeScript. It takes a TypeSet as input and generates a namespace hierachy of TypeScript classes that matches the types in the TypeSet.
- Loading branch information
Showing
6 changed files
with
2,747 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package lang | ||
|
||
import ( | ||
"bytes" | ||
"github.com/lyraproj/puppet-evaluator/eval" | ||
) | ||
|
||
// The Generator interface is implemented by generators that can transform Pcore types | ||
// to types in some specific language. | ||
type Generator interface { | ||
// GenerateTypes produces types in some language for all types in the given TypeSet and | ||
// appends them to the given buffer. | ||
GenerateTypes(ts eval.TypeSet, ns []string, indent int, bld *bytes.Buffer) | ||
|
||
// GenerateType produces a type in some language for the given Type and appends it to | ||
// the given buffer. | ||
GenerateType(t eval.Type, ns []string, indent int, bld *bytes.Buffer) | ||
} |
Oops, something went wrong.