File tree 2 files changed +26
-5
lines changed
2 files changed +26
-5
lines changed Original file line number Diff line number Diff line change
1
+ import { CodeGenOptions } from "../options/options" ;
2
+ import { ViewData } from "../getViewForSwagger2" ;
3
+
4
+ /**
5
+ * Abstraction over a code generator.
6
+ */
7
+ export interface CodeGenerator {
8
+ /**
9
+ * Returns the ViewData from the provided options.
10
+ *
11
+ * @param {CodeGenOptions } opts
12
+ *
13
+ * @returns {ViewData }
14
+ */
15
+ getViewData ( opts : CodeGenOptions ) : ViewData ;
16
+
17
+ /**
18
+ * Generate the code from the provided options.
19
+ *
20
+ * @param {CodeGenOptions } opts
21
+ *
22
+ * @returns {string }
23
+ */
24
+ getCode ( opts : CodeGenOptions ) : string ;
25
+ }
Original file line number Diff line number Diff line change 1
1
import { CodeGenOptions } from "../options/options" ;
2
2
import { transformToCodeWithMustache } from "../transform/transformToCodeWithMustache" ;
3
3
import { getViewForSwagger2 , ViewData } from "../getViewForSwagger2" ;
4
-
5
- interface CodeGenerator {
6
- getViewData ( opts : CodeGenOptions ) : ViewData ;
7
- getCode ( opts : CodeGenOptions ) : string ;
8
- }
4
+ import { CodeGenerator } from "./codeGenerator" ;
9
5
10
6
function verifyThatWeAreGeneratingForSwagger2 ( opts : CodeGenOptions ) : void {
11
7
if ( opts . swagger . swagger !== "2.0" ) {
You can’t perform that action at this time.
0 commit comments