1 | import doctrine from 'doctrine'
|
2 | import * as TS from 'ts-morph'
|
3 | import * as TJS from 'typescript-json-schema'
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export interface Definition {
|
10 |
|
11 | title: string
|
12 |
|
13 |
|
14 | description?: string
|
15 |
|
16 |
|
17 | config: Config
|
18 |
|
19 |
|
20 | version: string
|
21 |
|
22 | params: {
|
23 |
|
24 | schema: TJS.Definition
|
25 |
|
26 |
|
27 | order: string[]
|
28 |
|
29 |
|
30 | context: boolean
|
31 | }
|
32 |
|
33 | returns: {
|
34 |
|
35 | schema: TJS.Definition
|
36 |
|
37 |
|
38 | async: boolean
|
39 |
|
40 |
|
41 | http: boolean
|
42 | }
|
43 | }
|
44 |
|
45 | export interface Config {
|
46 | language: string
|
47 | defaultExport: boolean
|
48 | namedExport?: string
|
49 | }
|
50 |
|
51 | export interface DefinitionOptions {
|
52 | emit?: boolean
|
53 | emitOptions?: TS.EmitOptions
|
54 | compilerOptions?: TS.CompilerOptions
|
55 | jsonSchemaOptions?: TJS.PartialArgs
|
56 | }
|
57 |
|
58 | export type PartialDefinitionOptions = Partial<DefinitionOptions>
|
59 |
|
60 | export interface DefinitionBuilder {
|
61 | sourceFile: TS.SourceFile
|
62 | main: TS.FunctionDeclaration
|
63 | docs?: doctrine.Annotation
|
64 | title: string
|
65 | definition: Partial<Definition>
|
66 | }
|