umberto 6.1.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/scripts/filter/before-post-render/has-own-favicons.js +12 -0
- package/scripts/utils/has-own-favicons.js +48 -0
- package/src/api-builder/utils/findtargetdoclet.js +2 -2
- package/src/data-converter/converters/typedoc/abstractparser.js +54 -50
- package/src/data-converter/converters/typedoc/accessorparser.js +7 -5
- package/src/data-converter/converters/typedoc/classparser.js +5 -3
- package/src/data-converter/converters/typedoc/computedpropertyparser.js +4 -3
- package/src/data-converter/converters/typedoc/constantparser.js +5 -3
- package/src/data-converter/converters/typedoc/constructorparser.js +4 -3
- package/src/data-converter/converters/typedoc/errorparser.js +4 -10
- package/src/data-converter/converters/typedoc/eventparser.js +4 -10
- package/src/data-converter/converters/typedoc/functionparser.js +5 -3
- package/src/data-converter/converters/typedoc/interfaceparser.js +5 -3
- package/src/data-converter/converters/typedoc/methodparser.js +6 -4
- package/src/data-converter/converters/typedoc/moduleparser.js +9 -3
- package/src/data-converter/converters/typedoc/propertyparser.js +7 -28
- package/src/data-converter/converters/typedoc/referenceparser.js +41 -0
- package/src/data-converter/converters/typedoc/reflectionkind.js +34 -0
- package/src/data-converter/converters/typedoc/typedoc.ts +215 -214
- package/src/data-converter/converters/typedoc/typedocconverter.js +130 -99
- package/src/data-converter/converters/typedoc/typeparser.js +10 -6
- package/src/data-converter/converters/typedoc2umberto.js +9 -3
- package/themes/umberto/layout/gloria/_api-docs/_mixin/_type.pug +9 -0
- package/themes/umberto/layout/gloria/_partial/head.pug +7 -4
- package/themes/umberto/layout/umberto/_api-docs/_mixin/_type.pug +9 -0
- package/themes/umberto/layout/umberto/_partial/head.pug +7 -4
- package/themes/umberto/src/gloria/js/_codeswitcherbuttons.js +2 -2
- package/themes/umberto/src/umberto/js/_codeswitcherbuttons.js +2 -2
|
@@ -6,286 +6,287 @@
|
|
|
6
6
|
// This file contains several types and definitions used in the Typedoc converter mechanism.
|
|
7
7
|
// It is not loaded anywhere in Umberto, and should not cause any errors.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
* @typeParameter V Kind string.
|
|
11
|
-
*/
|
|
12
|
-
export type TypedocReflectionMeta<V extends string> = {
|
|
9
|
+
import type * as ReflectionKind from './reflectionkind.js';
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
kindString: V;
|
|
11
|
+
export type TypedocCommentItem = {
|
|
12
|
+
kind: 'text' | 'code' | 'inline-tag';
|
|
13
|
+
text: string;
|
|
18
14
|
|
|
19
15
|
/**
|
|
20
|
-
*
|
|
16
|
+
* Available when `kind === 'inline-tag'`.
|
|
21
17
|
*/
|
|
22
|
-
|
|
18
|
+
tag?: string;
|
|
23
19
|
|
|
24
20
|
/**
|
|
25
|
-
*
|
|
21
|
+
* Available if `tag === '@link'` and it points to an existing reflection.
|
|
26
22
|
*/
|
|
27
|
-
|
|
23
|
+
target?: number;
|
|
24
|
+
};
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
export type BaseReflection<T> = {
|
|
27
|
+
id: number;
|
|
28
|
+
kind: T;
|
|
32
29
|
name: string;
|
|
33
|
-
|
|
30
|
+
variant: 'declaration' | 'reference' | 'signature';
|
|
34
31
|
flags: Record<
|
|
35
32
|
'isReadonly' | 'isPrivate' | 'isProtected' | 'isPublic' | 'isStatic' | 'isOptional' | 'isRest' | 'isExternal',
|
|
36
33
|
true | undefined
|
|
37
34
|
>;
|
|
38
|
-
|
|
39
35
|
comment?: {
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* A description of the code. It contains all text found before processing annotations.
|
|
43
|
-
*/
|
|
44
36
|
summary: Array<TypedocCommentItem>;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Annotations that require additional description, e.g. `@param`.
|
|
48
|
-
*/
|
|
49
37
|
blockTags: Array<{
|
|
50
38
|
tag: `@${ string }`;
|
|
51
39
|
name: string;
|
|
52
40
|
content: Array<TypedocCommentItem>;
|
|
53
41
|
}>;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Annotation without descriptions, e.g. `@internal`.
|
|
57
|
-
*/
|
|
58
42
|
modifierTags: Array<`@${ string }`>;
|
|
59
43
|
};
|
|
44
|
+
sources?: Array<{
|
|
45
|
+
fileName: string;
|
|
46
|
+
line: number;
|
|
47
|
+
character: number;
|
|
48
|
+
url: string;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type ProjectReflection = BaseReflection<typeof ReflectionKind.Project> & {
|
|
53
|
+
children: Array<ModuleReflection>;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type ModuleReflection = BaseReflection<typeof ReflectionKind.Module> & {
|
|
57
|
+
children: Array<
|
|
58
|
+
VariableReflection |
|
|
59
|
+
FunctionReflection |
|
|
60
|
+
CKEditor5ErrorReflection |
|
|
61
|
+
ClassReflection |
|
|
62
|
+
InterfaceReflection |
|
|
63
|
+
ReferenceReflection |
|
|
64
|
+
LiteralObjectReflection
|
|
65
|
+
>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type VariableReflection = BaseReflection<typeof ReflectionKind.Variable> & {
|
|
69
|
+
type: AvailableTypes;
|
|
70
|
+
defaultValue: string;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type ReferenceReflection = BaseReflection<typeof ReflectionKind.Reference> & {
|
|
74
|
+
variant: 'reference';
|
|
75
|
+
target: number;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type LiteralObjectReflection = BaseReflection<typeof ReflectionKind.TypeLiteral> & {
|
|
79
|
+
type?: LiteralTypeReflection;
|
|
60
80
|
};
|
|
61
81
|
|
|
62
82
|
/**
|
|
63
|
-
*
|
|
83
|
+
* CKEditor 5 structures.
|
|
64
84
|
*/
|
|
65
|
-
export type TypedocReflection<T extends TypedocParsers> = TypedocReflectionMeta<T> & {
|
|
66
85
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
export type CKEditor5ErrorReflection = BaseReflection<typeof ReflectionKind.Document> & {
|
|
87
|
+
isCKEditor5Error: true;
|
|
88
|
+
parameters: Array<ParameterReflection>;
|
|
89
|
+
};
|
|
71
90
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
extendedTypes: T extends ClassOrInterface ? Array<TypedocReflectionMeta<TypedocParsers>> : undefined;
|
|
91
|
+
export type CKEditor5EventReflection = BaseReflection<typeof ReflectionKind.Document> & {
|
|
92
|
+
parameters: Array<ParameterReflection>;
|
|
93
|
+
};
|
|
76
94
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
implementedTypes: T extends 'Class' ? Array<TypedocReflectionMeta<TypedocParsers>> : undefined;
|
|
95
|
+
export type Eventable = {
|
|
96
|
+
ckeditor5Events: Array<CKEditor5EventReflection>;
|
|
97
|
+
};
|
|
81
98
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* Also, due to lack of knowledge how to create parameters for a custom structure, we keep event arguments here.
|
|
86
|
-
*/
|
|
87
|
-
typeParameters: T extends ClassOrInterface | 'Event' ? Array<TypedocReflectionTypeParameter> : undefined;
|
|
99
|
+
/**
|
|
100
|
+
* OOP.
|
|
101
|
+
*/
|
|
88
102
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
103
|
+
export type TypeParameterReflection = BaseReflection<typeof ReflectionKind.TypeParameter> & {
|
|
104
|
+
type?: AvailableTypes;
|
|
105
|
+
default?: LiteralOrIntrinsic | ReferenceType;
|
|
106
|
+
};
|
|
93
107
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
export type Inheritable = {
|
|
109
|
+
extendedTypes: Array<ReferenceType>;
|
|
110
|
+
implementedTypes: Array<ReferenceType>;
|
|
111
|
+
typeParameters: Array<TypeParameterReflection>;
|
|
112
|
+
inheritedFrom: ReferenceType;
|
|
113
|
+
};
|
|
98
114
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
signatures: T extends ConstructorOrMethod | 'Function' ? Array<TypedocCallSignature> : undefined;
|
|
115
|
+
export type ClassReflection = BaseReflection<typeof ReflectionKind.Class> & Inheritable & Eventable & {
|
|
116
|
+
children: Array<AccessorReflection | ConstructorReflection | MethodReflection | PropertyReflection>;
|
|
117
|
+
};
|
|
103
118
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
defaultValue: T extends 'Variable' ? TypedocReflectionType : undefined;
|
|
119
|
+
export type InterfaceReflection = BaseReflection<typeof ReflectionKind.Interface> & Inheritable & Eventable & {
|
|
120
|
+
children: Array<AccessorReflection | MethodReflection | PropertyReflection>;
|
|
121
|
+
};
|
|
108
122
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
123
|
+
export type AccessorReflection = BaseReflection<typeof ReflectionKind.Accessor> & {
|
|
124
|
+
getSignature: Omit<
|
|
125
|
+
CallSignatureReflection<typeof ReflectionKind.GetSignature>,
|
|
126
|
+
'typeParameters' | 'parameters'
|
|
127
|
+
>;
|
|
128
|
+
setSignature: Omit<
|
|
129
|
+
CallSignatureReflection<typeof ReflectionKind.SetSignature>,
|
|
130
|
+
'typeParameters'
|
|
131
|
+
>;
|
|
132
|
+
};
|
|
117
133
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
*/
|
|
121
|
-
sources?: Array<TypedocSource>;
|
|
122
|
-
originalName?: string;
|
|
134
|
+
export type PropertyReflection = BaseReflection<typeof ReflectionKind.Property> & {
|
|
135
|
+
type: AvailableTypes;
|
|
123
136
|
};
|
|
124
137
|
|
|
125
|
-
export type
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
defaultValue?: string;
|
|
138
|
+
export type ComputedPropertyReflection = BaseReflection<typeof ReflectionKind.IndexSignature>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Callables.
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
export type TypedocCallable<T> = {
|
|
145
|
+
signatures: Array<CallSignatureReflection<T>>;
|
|
134
146
|
};
|
|
135
147
|
|
|
136
|
-
export type
|
|
137
|
-
|
|
138
|
-
type?: TypedocReflectionType;
|
|
148
|
+
export type ParameterReflection = BaseReflection<typeof ReflectionKind.Parameter> & {
|
|
149
|
+
type: AvailableTypes;
|
|
139
150
|
};
|
|
140
151
|
|
|
141
|
-
export type
|
|
142
|
-
type:
|
|
143
|
-
parameters?: Array<
|
|
144
|
-
|
|
152
|
+
export type CallSignatureReflection<T> = BaseReflection<T> & {
|
|
153
|
+
type: AvailableTypes;
|
|
154
|
+
parameters?: Array<ParameterReflection>;
|
|
155
|
+
typeParameters?: Array<TypeParameterReflection>;
|
|
156
|
+
inheritedFrom?: ReferenceType;
|
|
157
|
+
children?: Array<PropertyReflection>;
|
|
158
|
+
indexSignatures?: Array<IndexSignatureType>;
|
|
145
159
|
};
|
|
146
160
|
|
|
147
|
-
export type
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
} |
|
|
185
|
-
{
|
|
186
|
-
type: 'mapped';
|
|
187
|
-
parameter: string;
|
|
188
|
-
parameterType?: TypeOperator | string;
|
|
189
|
-
templateType: LiteralOrIntrinsic;
|
|
190
|
-
optionalModifier?: string;
|
|
191
|
-
} |
|
|
192
|
-
{
|
|
193
|
-
type: 'conditional';
|
|
194
|
-
checkType: Reference;
|
|
195
|
-
extendsType: TypedocTypeDetails;
|
|
196
|
-
trueType: TypedocTypeDetails;
|
|
197
|
-
falseType: TypedocTypeDetails;
|
|
198
|
-
} |
|
|
199
|
-
{
|
|
200
|
-
type: 'template-literal';
|
|
201
|
-
tail: Array<{
|
|
202
|
-
type: TypedocTypeDetails;
|
|
203
|
-
suffix: string;
|
|
204
|
-
}>;
|
|
205
|
-
head: string;
|
|
206
|
-
} |
|
|
207
|
-
{
|
|
208
|
-
type: 'predicate';
|
|
209
|
-
targetType: TypedocTypeDetails;
|
|
161
|
+
export type ConstructorReflection =
|
|
162
|
+
BaseReflection<typeof ReflectionKind.Constructor> & TypedocCallable<typeof ReflectionKind.ConstructorSignature>;
|
|
163
|
+
|
|
164
|
+
export type MethodReflection =
|
|
165
|
+
BaseReflection<typeof ReflectionKind.Method> & TypedocCallable<typeof ReflectionKind.CallSignature>;
|
|
166
|
+
|
|
167
|
+
export type FunctionReflection =
|
|
168
|
+
BaseReflection<typeof ReflectionKind.Function> & TypedocCallable<typeof ReflectionKind.CallSignature>;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Types.
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
export type AvailableTypes = string |
|
|
175
|
+
LiteralOrIntrinsic |
|
|
176
|
+
ReferenceType |
|
|
177
|
+
TypeOperator |
|
|
178
|
+
LiteralTypeReflection |
|
|
179
|
+
UnionType |
|
|
180
|
+
ArrayType |
|
|
181
|
+
IndexAccessType |
|
|
182
|
+
TupleType |
|
|
183
|
+
NamedTupleMemberType |
|
|
184
|
+
IntersectionType |
|
|
185
|
+
QueryType |
|
|
186
|
+
MappedType |
|
|
187
|
+
ConditionalType |
|
|
188
|
+
TemplateLiteralType |
|
|
189
|
+
PredicateType;
|
|
190
|
+
|
|
191
|
+
export type LiteralTypeReflection = BaseReflection<typeof ReflectionKind.TypeLiteral> & {
|
|
192
|
+
type: 'reflection';
|
|
193
|
+
declaration?: {
|
|
194
|
+
name: '__type';
|
|
195
|
+
children?: Array<PropertyReflection>;
|
|
196
|
+
signatures?: TypedocCallable<typeof ReflectionKind.CallSignature>;
|
|
197
|
+
indexSignatures?: Array<IndexSignatureType>;
|
|
210
198
|
};
|
|
199
|
+
};
|
|
211
200
|
|
|
212
|
-
export type
|
|
213
|
-
|
|
214
|
-
|
|
201
|
+
export type IndexSignatureType = BaseReflection<typeof ReflectionKind.IndexSignature> & {
|
|
202
|
+
name: '__index';
|
|
203
|
+
variant: 'signature';
|
|
204
|
+
parameters: Array<ParameterReflection>;
|
|
205
|
+
type: AvailableTypes;
|
|
206
|
+
};
|
|
215
207
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
208
|
+
export type UnionType = {
|
|
209
|
+
type: 'union';
|
|
210
|
+
types: Array<LiteralTypeReflection>;
|
|
211
|
+
};
|
|
220
212
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
target?: number;
|
|
213
|
+
export type ArrayType = {
|
|
214
|
+
type: 'array';
|
|
215
|
+
elementType: AvailableTypes;
|
|
225
216
|
};
|
|
226
217
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
218
|
+
export type IndexAccessType = {
|
|
219
|
+
type: 'indexedAccess';
|
|
220
|
+
objectType: AvailableTypes;
|
|
221
|
+
indexType: AvailableTypes;
|
|
222
|
+
};
|
|
231
223
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
224
|
+
export type TupleType = {
|
|
225
|
+
type: 'tuple';
|
|
226
|
+
elements: Array<AvailableTypes>;
|
|
227
|
+
};
|
|
236
228
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
229
|
+
export type NamedTupleMemberType = {
|
|
230
|
+
type: 'namedTupleMember';
|
|
231
|
+
element: AvailableTypes;
|
|
232
|
+
};
|
|
241
233
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
// Root.
|
|
247
|
-
Module: TypedocReflection<ClassOrInterface | 'Function' | 'Type alias' | 'Error' | 'Variable'>;
|
|
234
|
+
export type IntersectionType = {
|
|
235
|
+
type: 'intersection';
|
|
236
|
+
types: Array<LiteralTypeReflection>;
|
|
237
|
+
};
|
|
248
238
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
Variable: null;
|
|
239
|
+
export type QueryType = {
|
|
240
|
+
type: 'query';
|
|
241
|
+
queryType: {
|
|
242
|
+
name: string;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
256
245
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
246
|
+
export type MappedType = {
|
|
247
|
+
type: 'mapped';
|
|
248
|
+
parameter: string;
|
|
249
|
+
parameterType?: TypeOperator | string;
|
|
250
|
+
templateType: LiteralOrIntrinsic;
|
|
251
|
+
optionalModifier?: string;
|
|
252
|
+
};
|
|
263
253
|
|
|
264
|
-
|
|
265
|
-
|
|
254
|
+
export type ConditionalType = {
|
|
255
|
+
type: 'conditional';
|
|
256
|
+
checkType: ReferenceType;
|
|
257
|
+
extendsType: AvailableTypes;
|
|
258
|
+
trueType: AvailableTypes;
|
|
259
|
+
falseType: AvailableTypes;
|
|
260
|
+
};
|
|
266
261
|
|
|
267
|
-
|
|
268
|
-
|
|
262
|
+
export type TemplateLiteralType = {
|
|
263
|
+
type: 'templateLiteral';
|
|
264
|
+
tail: Array<{
|
|
265
|
+
type: AvailableTypes;
|
|
266
|
+
suffix: string;
|
|
267
|
+
}>;
|
|
268
|
+
head: string;
|
|
269
269
|
};
|
|
270
270
|
|
|
271
|
-
type
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
character: number;
|
|
275
|
-
url: string;
|
|
271
|
+
export type PredicateType = {
|
|
272
|
+
type: 'predicate';
|
|
273
|
+
targetType: AvailableTypes;
|
|
276
274
|
};
|
|
277
275
|
|
|
278
|
-
type
|
|
276
|
+
export type ReferenceType = {
|
|
279
277
|
type: 'reference';
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
278
|
+
target: number | {
|
|
279
|
+
packageName: 'typescript';
|
|
280
|
+
packagePath: string;
|
|
281
|
+
qualifiedName: string;
|
|
282
|
+
};
|
|
283
|
+
typeArguments?: Array<TypeParameterReflection>;
|
|
283
284
|
};
|
|
284
285
|
|
|
285
|
-
type TypeOperator = {
|
|
286
|
+
export type TypeOperator = {
|
|
286
287
|
type: 'typeOperator';
|
|
287
288
|
operator: string;
|
|
288
|
-
target:
|
|
289
|
+
target: ReferenceType;
|
|
289
290
|
};
|
|
290
291
|
|
|
291
292
|
type LiteralOrIntrinsic =
|