-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.hbs
93 lines (89 loc) · 1.56 KB
/
template.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* This file is auto-generated by @seasonjs/protobuf-gen
*/
/* eslint-disable @typescript-eslint/no-namespace */
{{#*inline "selector"}}
{{#each nested}}
{{#if fields}}
{{> type }}
{{else if methods}}
{{> service }}
{{else if values}}
{{> enum }}
{{else}}
{{> namespace }}
{{/if}}
{{/each}}
{{/inline}}
{{> selector }}
{{#*inline "namespace"}}
{{#if comment}}
{{comment}}
{{/if}}
/* package {{@key}} start */
export namespace {{@key}} {
{{> selector }}
}
/* package {{@key}} end */
{{/inline}}
{{#*inline "service"}}
{{#each methods}}
{{else}}
// tslint:disable-next-line:no-empty-interface
{{/each}}
{{#if comment}}
{{comment}}
{{/if}}
export interface {{@key}} {
{{#each methods}}
{{#if comment}}
{{comment}}
{{/if}}
{{uncapitalize @key}}{{{server-method-signature this.requestType this.responseType this.requestStream this.responseStream}}};
{{/each}}
}
{{> selector }}
{{/inline}}
{{#*inline "type"}}
{{#each fields}}
{{else}}
// tslint:disable-next-line:no-empty-interface
{{/each}}
{{#if comment}}
{{comment}}
{{/if}}
export interface {{@key}} {
{{#each fields}}
{{#if comment}}
{{comment}}
{{/if}}
{{@key}}?: {{type this}};
{{/each}}
}
{{#if nested}}
export namespace {{@key}} {
{{#if comment}}
{{comment}}
{{/if}}
{{> selector }}
}
{{/if}}
{{/inline}}
{{#*inline "enum"}}
{{#each values}}
{{else}}
// tslint:disable-next-line:no-empty-interface
{{/each}}
{{#if comment}}
{{comment}}
{{/if}}
{{var "comments" comments ~}}
export enum {{@key}} {
{{#each values}}
{{#if (enumComment @key)}}
{{enumComment @key}}
{{/if}}
{{@key}} = {{this}},
{{/each}}
}
{{/inline}}