1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export function parse(content: string, options?: Options): Annotation;
|
10 |
|
11 |
|
12 |
|
13 | export function unwrapComment(doc: string): string;
|
14 |
|
15 | interface Options {
|
16 | |
17 |
|
18 |
|
19 |
|
20 | unwrap?: boolean | undefined;
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 | tags?: string[] | undefined;
|
27 | |
28 |
|
29 |
|
30 |
|
31 | recoverable?: boolean | undefined;
|
32 | |
33 |
|
34 |
|
35 |
|
36 | sloppy?: boolean | undefined;
|
37 | |
38 |
|
39 |
|
40 |
|
41 | strict?: boolean | undefined;
|
42 | |
43 |
|
44 |
|
45 |
|
46 | preserveWhitespace?: boolean | undefined;
|
47 | |
48 |
|
49 |
|
50 |
|
51 | lineNumbers?: boolean | undefined;
|
52 | }
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | interface Annotation {
|
58 |
|
59 | description: string;
|
60 | tags: Tag[];
|
61 | }
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | export interface Tag {
|
79 |
|
80 | title: string;
|
81 |
|
82 | name?: string | undefined;
|
83 |
|
84 | description: string | null;
|
85 |
|
86 | type?: Type | null | undefined;
|
87 | kind?: string | undefined;
|
88 |
|
89 | errors?: string[] | undefined;
|
90 | }
|
91 |
|
92 | export type Type =
|
93 | | type.AllLiteral
|
94 | | type.ArrayType
|
95 | | type.FieldType
|
96 | | type.FunctionType
|
97 | | type.NameExpression
|
98 | | type.NonNullableType
|
99 | | type.NullableLiteral
|
100 | | type.NullableType
|
101 | | type.NullLiteral
|
102 | | type.OptionalType
|
103 | | type.ParameterType
|
104 | | type.RecordType
|
105 | | type.RestType
|
106 | | type.TypeApplication
|
107 | | type.UndefinedLiteral
|
108 | | type.UnionType
|
109 | | type.VoidLiteral;
|
110 |
|
111 | export namespace type {
|
112 | export interface AllLiteral {
|
113 | type: "AllLiteral";
|
114 | }
|
115 | export interface ArrayType {
|
116 | type: "ArrayType";
|
117 | elements: Type[];
|
118 | }
|
119 | export interface FieldType {
|
120 | type: "FieldType";
|
121 | key: string;
|
122 | value?: Type | undefined;
|
123 | }
|
124 | export interface FunctionType {
|
125 | type: "FunctionType";
|
126 | "this": Type;
|
127 | "new": Type;
|
128 | params: Type[];
|
129 | result: Type;
|
130 | }
|
131 | export interface NameExpression {
|
132 | type: "NameExpression";
|
133 | name: string;
|
134 | }
|
135 | export interface NonNullableType {
|
136 | type: "NonNullableType";
|
137 | prefix: boolean;
|
138 | expression: Type;
|
139 | }
|
140 | export interface NullableLiteral {
|
141 | type: "NullableLiteral";
|
142 | }
|
143 | export interface NullableType {
|
144 | type: "NullableType";
|
145 | prefix: boolean;
|
146 | expression: Type;
|
147 | }
|
148 | export interface NullLiteral {
|
149 | type: "NullLiteral";
|
150 | }
|
151 | export interface OptionalType {
|
152 | type: "OptionalType";
|
153 | expression: Type;
|
154 | }
|
155 | export interface ParameterType {
|
156 | type: "ParameterType";
|
157 | name: string;
|
158 | expression: Type;
|
159 | }
|
160 | export interface RecordType {
|
161 | type: "RecordType";
|
162 | fields: Type[];
|
163 | }
|
164 | export interface RestType {
|
165 | type: "RestType";
|
166 | expression?: Type | undefined;
|
167 | }
|
168 | export interface TypeApplication {
|
169 | type: "TypeApplication";
|
170 | expression: Type;
|
171 | applications: Type[];
|
172 | }
|
173 | export interface UndefinedLiteral {
|
174 | type: "UndefinedLiteral";
|
175 | }
|
176 | export interface UnionType {
|
177 | type: "UnionType";
|
178 | elements: Type[];
|
179 | }
|
180 | export interface VoidLiteral {
|
181 | type: "VoidLiteral";
|
182 | }
|
183 |
|
184 | export function stringify(type: Type): string;
|
185 | export function parseType(src: string, options?: { midstream: boolean }): Type;
|
186 | export function parseParamType(
|
187 | src: string,
|
188 | options?: { midstream: boolean },
|
189 | ): Type;
|
190 |
|
191 | export const Syntax: {
|
192 | NullableLiteral: "NullableLiteral";
|
193 | AllLiteral: "AllLiteral";
|
194 | NullLiteral: "NullLiteral";
|
195 | UndefinedLiteral: "UndefinedLiteral";
|
196 | VoidLiteral: "VoidLiteral";
|
197 | UnionType: "UnionType";
|
198 | ArrayType: "ArrayType";
|
199 | RecordType: "RecordType";
|
200 | FieldType: "FieldType";
|
201 | FunctionType: "FunctionType";
|
202 | ParameterType: "ParameterType";
|
203 | RestType: "RestType";
|
204 | NonNullableType: "NonNullableType";
|
205 | OptionalType: "OptionalType";
|
206 | NullableType: "NullableType";
|
207 | NameExpression: "NameExpression";
|
208 | TypeApplication: "TypeApplication";
|
209 | };
|
210 | }
|
211 |
|
212 | export const version: string;
|
213 | export const parseType: typeof type.parseType;
|
214 | export const parseParamType: typeof type.parseParamType;
|
215 | export const Syntax: typeof type.Syntax;
|