1 | import * as reflect from 'jsii-reflect';
|
2 | import { TargetLanguage } from 'jsii-rosetta';
|
3 | import { Json } from '../render/json';
|
4 | import { MarkdownDocument } from '../render/markdown-doc';
|
5 | import { MarkdownFormattingOptions } from '../render/markdown-render';
|
6 | import { Schema } from '../schema';
|
7 | import { CSharpTranspile } from '../transpile/csharp';
|
8 | import { GoTranspile } from '../transpile/go';
|
9 | import { JavaTranspile } from '../transpile/java';
|
10 | import { PythonTranspile } from '../transpile/python';
|
11 | import { Language } from '../transpile/transpile';
|
12 | import { TypeScriptTranspile } from '../transpile/typescript';
|
13 |
|
14 |
|
15 |
|
16 | export interface RenderOptions extends TransliterationOptions {
|
17 | |
18 |
|
19 |
|
20 | readonly language: Language;
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 | readonly apiReference?: boolean;
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 | readonly readme?: boolean;
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 | readonly submodule?: string;
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | readonly allSubmodules?: boolean;
|
48 | }
|
49 | export interface TransliterationOptions {
|
50 | |
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | readonly loose?: boolean;
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | readonly validate?: boolean;
|
64 | }
|
65 | export interface MarkdownRenderOptions extends RenderOptions, MarkdownFormattingOptions {
|
66 | }
|
67 |
|
68 |
|
69 |
|
70 | export interface ForLocalPackageDocumentationOptions {
|
71 | |
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 | readonly assembliesDir?: string;
|
78 | }
|
79 | export interface ForPackageDocumentationOptions {
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 | readonly verbose?: boolean;
|
86 | }
|
87 |
|
88 |
|
89 |
|
90 | export declare class Documentation {
|
91 | private readonly assemblyName;
|
92 | private readonly assembliesDir;
|
93 | |
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 | static forPackage(target: string, options?: ForPackageDocumentationOptions): Promise<Documentation>;
|
106 | |
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 | static forProject(root: string, options?: ForLocalPackageDocumentationOptions): Promise<Documentation>;
|
113 | |
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 | static forAssembly(assemblyName: string, assembliesDir: string): Promise<Documentation>;
|
120 | private readonly cleanupDirectories;
|
121 | private readonly assembliesCache;
|
122 | private assemblyFqn;
|
123 | private constructor();
|
124 | /**
|
125 | * List all submodules in the assembly.
|
126 | */
|
127 | listSubmodules(): Promise<readonly reflect.Submodule[]>;
|
128 | toIndexMarkdown(fileSuffix: string, options: RenderOptions): Promise<MarkdownDocument>;
|
129 | /**
|
130 | * Generate markdown.
|
131 | */
|
132 | toJson(options: RenderOptions): Promise<Json<Schema>>;
|
133 | toMarkdown(options: MarkdownRenderOptions): Promise<MarkdownDocument>;
|
134 | private addCleanupDirectory;
|
135 | /**
|
136 | * Removes any internal working directories.
|
137 | */
|
138 | cleanup(): Promise<void>;
|
139 | private languageSpecific;
|
140 | /**
|
141 | * Lookup a submodule by a submodule name.
|
142 | *
|
143 | * The contract of this function is historically quite confused: the submodule
|
144 | * name can be either an FQN (`asm.sub1.sub2`) or just a submodule name
|
145 | * (`sub1` or `sub1.sub2`).
|
146 | *
|
147 | * This is sligthly complicated by ambiguity: `asm.asm.package` and
|
148 | * `asm.package` can both exist, and which one do you mean when you say
|
149 | * `asm.package`?
|
150 | *
|
151 | * We prefer an FQN match if possible (`asm.sub1.sub2`), but will accept a
|
152 | * root-relative submodule name as well (`sub1.sub2`).
|
153 | */
|
154 | private findSubmodule;
|
155 | private createAssembly;
|
156 | }
|
157 | export declare const LANGUAGE_SPECIFIC: {
|
158 | [x: string]: {
|
159 | transpile: PythonTranspile;
|
160 | rosettaTarget: TargetLanguage;
|
161 | } | {
|
162 | transpile: TypeScriptTranspile;
|
163 | rosettaTarget: undefined;
|
164 | } | {
|
165 | transpile: JavaTranspile;
|
166 | rosettaTarget: TargetLanguage;
|
167 | } | {
|
168 | transpile: CSharpTranspile;
|
169 | rosettaTarget: TargetLanguage;
|
170 | } | {
|
171 | transpile: GoTranspile;
|
172 | rosettaTarget: TargetLanguage;
|
173 | };
|
174 | };
|
175 | export declare function extractPackageName(spec: string): string;
|