@proteinjs/reflection-build 1.0.3 → 1.0.5
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 +16 -0
- package/dist/modules/typescript-parser/.appveyor.yml +22 -0
- package/dist/modules/typescript-parser/DeclarationIndex.d.ts +217 -0
- package/dist/modules/typescript-parser/DeclarationIndex.js +441 -0
- package/dist/modules/typescript-parser/LICENSE +21 -0
- package/dist/modules/typescript-parser/Node.d.ts +23 -0
- package/dist/modules/typescript-parser/Node.js +2 -0
- package/dist/modules/typescript-parser/README.md +51 -0
- package/dist/modules/typescript-parser/SymbolSpecifier.d.ts +22 -0
- package/dist/modules/typescript-parser/SymbolSpecifier.js +28 -0
- package/dist/modules/typescript-parser/TypescriptParser.d.ts +68 -0
- package/dist/modules/typescript-parser/TypescriptParser.js +191 -0
- package/dist/modules/typescript-parser/clonable/Clonable.d.ts +17 -0
- package/dist/modules/typescript-parser/clonable/Clonable.js +2 -0
- package/dist/modules/typescript-parser/code-generators/TypescriptCodeGenerator.d.ts +39 -0
- package/dist/modules/typescript-parser/code-generators/TypescriptCodeGenerator.js +66 -0
- package/dist/modules/typescript-parser/code-generators/TypescriptGenerationOptions.d.ts +69 -0
- package/dist/modules/typescript-parser/code-generators/TypescriptGenerationOptions.js +9 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/accessorDeclaration.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/accessorDeclaration.js +34 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/externalModuleImport.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/externalModuleImport.js +15 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/methodDeclaration.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/methodDeclaration.js +23 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/namedImport.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/namedImport.js +94 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/namespaceImport.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/namespaceImport.js +15 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/parameterDeclaration.d.ts +9 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/parameterDeclaration.js +14 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/propertyDeclaration.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/propertyDeclaration.js +18 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/stringImport.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/stringImport.js +15 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/symbolSpecifier.d.ts +9 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/symbolSpecifier.js +14 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/variableDeclaration.d.ts +9 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/variableDeclaration.js +14 -0
- package/dist/modules/typescript-parser/declarations/AccessorDeclaration.d.ts +40 -0
- package/dist/modules/typescript-parser/declarations/AccessorDeclaration.js +45 -0
- package/dist/modules/typescript-parser/declarations/ClassDeclaration.d.ts +34 -0
- package/dist/modules/typescript-parser/declarations/ClassDeclaration.js +26 -0
- package/dist/modules/typescript-parser/declarations/ConstructorDeclaration.d.ts +18 -0
- package/dist/modules/typescript-parser/declarations/ConstructorDeclaration.js +20 -0
- package/dist/modules/typescript-parser/declarations/Declaration.d.ts +215 -0
- package/dist/modules/typescript-parser/declarations/Declaration.js +2 -0
- package/dist/modules/typescript-parser/declarations/DeclarationInfo.d.ts +13 -0
- package/dist/modules/typescript-parser/declarations/DeclarationInfo.js +17 -0
- package/dist/modules/typescript-parser/declarations/DeclarationVisibility.d.ts +18 -0
- package/dist/modules/typescript-parser/declarations/DeclarationVisibility.js +22 -0
- package/dist/modules/typescript-parser/declarations/DefaultDeclaration.d.ts +21 -0
- package/dist/modules/typescript-parser/declarations/DefaultDeclaration.js +28 -0
- package/dist/modules/typescript-parser/declarations/EnumDeclaration.d.ts +16 -0
- package/dist/modules/typescript-parser/declarations/EnumDeclaration.js +20 -0
- package/dist/modules/typescript-parser/declarations/FunctionDeclaration.d.ts +23 -0
- package/dist/modules/typescript-parser/declarations/FunctionDeclaration.js +25 -0
- package/dist/modules/typescript-parser/declarations/InterfaceDeclaration.d.ts +27 -0
- package/dist/modules/typescript-parser/declarations/InterfaceDeclaration.js +24 -0
- package/dist/modules/typescript-parser/declarations/MethodDeclaration.d.ts +28 -0
- package/dist/modules/typescript-parser/declarations/MethodDeclaration.js +29 -0
- package/dist/modules/typescript-parser/declarations/ModuleDeclaration.d.ts +15 -0
- package/dist/modules/typescript-parser/declarations/ModuleDeclaration.js +19 -0
- package/dist/modules/typescript-parser/declarations/ParameterDeclaration.d.ts +33 -0
- package/dist/modules/typescript-parser/declarations/ParameterDeclaration.js +54 -0
- package/dist/modules/typescript-parser/declarations/PropertyDeclaration.d.ts +20 -0
- package/dist/modules/typescript-parser/declarations/PropertyDeclaration.js +23 -0
- package/dist/modules/typescript-parser/declarations/TypeAliasDeclaration.d.ts +19 -0
- package/dist/modules/typescript-parser/declarations/TypeAliasDeclaration.js +22 -0
- package/dist/modules/typescript-parser/declarations/VariableDeclaration.d.ts +19 -0
- package/dist/modules/typescript-parser/declarations/VariableDeclaration.js +22 -0
- package/dist/modules/typescript-parser/declarations/index.d.ts +16 -0
- package/dist/modules/typescript-parser/declarations/index.js +19 -0
- package/dist/modules/typescript-parser/errors/NotGeneratableYetError.d.ts +11 -0
- package/dist/modules/typescript-parser/errors/NotGeneratableYetError.js +17 -0
- package/dist/modules/typescript-parser/exports/AllExport.d.ts +14 -0
- package/dist/modules/typescript-parser/exports/AllExport.js +18 -0
- package/dist/modules/typescript-parser/exports/AssignedExport.d.ts +26 -0
- package/dist/modules/typescript-parser/exports/AssignedExport.js +38 -0
- package/dist/modules/typescript-parser/exports/Export.d.ts +10 -0
- package/dist/modules/typescript-parser/exports/Export.js +2 -0
- package/dist/modules/typescript-parser/exports/NamedExport.d.ts +16 -0
- package/dist/modules/typescript-parser/exports/NamedExport.js +18 -0
- package/dist/modules/typescript-parser/exports/index.d.ts +4 -0
- package/dist/modules/typescript-parser/exports/index.js +7 -0
- package/dist/modules/typescript-parser/imports/ExternalModuleImport.d.ts +25 -0
- package/dist/modules/typescript-parser/imports/ExternalModuleImport.js +33 -0
- package/dist/modules/typescript-parser/imports/Import.d.ts +43 -0
- package/dist/modules/typescript-parser/imports/Import.js +2 -0
- package/dist/modules/typescript-parser/imports/NamedImport.d.ts +29 -0
- package/dist/modules/typescript-parser/imports/NamedImport.js +38 -0
- package/dist/modules/typescript-parser/imports/NamespaceImport.d.ts +24 -0
- package/dist/modules/typescript-parser/imports/NamespaceImport.js +32 -0
- package/dist/modules/typescript-parser/imports/StringImport.d.ts +23 -0
- package/dist/modules/typescript-parser/imports/StringImport.js +31 -0
- package/dist/modules/typescript-parser/imports/index.d.ts +5 -0
- package/dist/modules/typescript-parser/imports/index.js +8 -0
- package/dist/modules/typescript-parser/index.d.ts +12 -0
- package/dist/modules/typescript-parser/index.js +14 -0
- package/dist/modules/typescript-parser/node-parser/changes/parseType.d.ts +14 -0
- package/dist/modules/typescript-parser/node-parser/changes/parseType.js +35 -0
- package/dist/modules/typescript-parser/node-parser/class-parser.d.ts +30 -0
- package/dist/modules/typescript-parser/node-parser/class-parser.js +143 -0
- package/dist/modules/typescript-parser/node-parser/enum-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/enum-parser.js +18 -0
- package/dist/modules/typescript-parser/node-parser/export-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/export-parser.js +58 -0
- package/dist/modules/typescript-parser/node-parser/function-parser.d.ts +33 -0
- package/dist/modules/typescript-parser/node-parser/function-parser.js +101 -0
- package/dist/modules/typescript-parser/node-parser/identifier-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/identifier-parser.js +81 -0
- package/dist/modules/typescript-parser/node-parser/import-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/import-parser.js +54 -0
- package/dist/modules/typescript-parser/node-parser/index.d.ts +0 -0
- package/dist/modules/typescript-parser/node-parser/index.js +11 -0
- package/dist/modules/typescript-parser/node-parser/interface-parser.d.ts +11 -0
- package/dist/modules/typescript-parser/node-parser/interface-parser.js +57 -0
- package/dist/modules/typescript-parser/node-parser/module-parser.d.ts +12 -0
- package/dist/modules/typescript-parser/node-parser/module-parser.js +23 -0
- package/dist/modules/typescript-parser/node-parser/parse-utilities.d.ts +55 -0
- package/dist/modules/typescript-parser/node-parser/parse-utilities.js +96 -0
- package/dist/modules/typescript-parser/node-parser/traverse-ast.d.ts +1 -0
- package/dist/modules/typescript-parser/node-parser/traverse-ast.js +14 -0
- package/dist/modules/typescript-parser/node-parser/type-alias-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/type-alias-parser.js +20 -0
- package/dist/modules/typescript-parser/node-parser/variable-parser.d.ts +11 -0
- package/dist/modules/typescript-parser/node-parser/variable-parser.js +30 -0
- package/dist/modules/typescript-parser/package-lock.json +16793 -0
- package/dist/modules/typescript-parser/package.json +55 -0
- package/dist/modules/typescript-parser/resources/File.d.ts +45 -0
- package/dist/modules/typescript-parser/resources/File.js +58 -0
- package/dist/modules/typescript-parser/resources/Module.d.ts +35 -0
- package/dist/modules/typescript-parser/resources/Module.js +50 -0
- package/dist/modules/typescript-parser/resources/Namespace.d.ts +35 -0
- package/dist/modules/typescript-parser/resources/Namespace.js +50 -0
- package/dist/modules/typescript-parser/resources/Resource.d.ts +64 -0
- package/dist/modules/typescript-parser/resources/Resource.js +2 -0
- package/dist/modules/typescript-parser/resources/index.d.ts +4 -0
- package/dist/modules/typescript-parser/resources/index.js +7 -0
- package/dist/modules/typescript-parser/type-guards/TypescriptGuards.d.ts +153 -0
- package/dist/modules/typescript-parser/type-guards/TypescriptGuards.js +213 -0
- package/dist/modules/typescript-parser/type-guards/TypescriptHeroGuards.d.ts +26 -0
- package/dist/modules/typescript-parser/type-guards/TypescriptHeroGuards.js +36 -0
- package/dist/modules/typescript-parser/utilities/PathHelpers.d.ts +22 -0
- package/dist/modules/typescript-parser/utilities/PathHelpers.js +42 -0
- package/dist/modules/typescript-parser/utilities/StringTemplate.d.ts +9 -0
- package/dist/modules/typescript-parser/utilities/StringTemplate.js +21 -0
- package/dist/src/runBuild.js +0 -0
- package/dist/src/runWatch.js +0 -0
- package/package.json +3 -3
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { Node } from '../Node';
|
|
2
|
+
import { AccessorDeclaration } from './AccessorDeclaration';
|
|
3
|
+
import { DeclarationVisibility } from './DeclarationVisibility';
|
|
4
|
+
import { MethodDeclaration } from './MethodDeclaration';
|
|
5
|
+
import { ParameterDeclaration } from './ParameterDeclaration';
|
|
6
|
+
import { PropertyDeclaration } from './PropertyDeclaration';
|
|
7
|
+
import { VariableDeclaration } from './VariableDeclaration';
|
|
8
|
+
import { Type } from '../node-parser/changes/parseType';
|
|
9
|
+
/**
|
|
10
|
+
* Basic interface for all declarations. Defines the basic needed information for a typescript declaration.
|
|
11
|
+
*
|
|
12
|
+
* @export
|
|
13
|
+
* @interface Declaration
|
|
14
|
+
* @extends {Node}
|
|
15
|
+
*/
|
|
16
|
+
export interface Declaration extends Node {
|
|
17
|
+
/**
|
|
18
|
+
* The name of the declaration.
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof Declaration
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Interface for all typed declarations. Those declarations contain a type that must be taken care of.
|
|
27
|
+
* (e.g. 'string' or 'number')
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
* @interface TypedDeclaration
|
|
31
|
+
* @extends {Declaration}
|
|
32
|
+
*/
|
|
33
|
+
export interface TypedDeclaration extends Declaration {
|
|
34
|
+
/**
|
|
35
|
+
* The type of the declaration.
|
|
36
|
+
*
|
|
37
|
+
* @type {(string | undefined)}
|
|
38
|
+
* @example "string"
|
|
39
|
+
* @example "Declaration[]"
|
|
40
|
+
* @memberof TypedDeclaration
|
|
41
|
+
*/
|
|
42
|
+
type: Type | string | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Interface for generic type declarations. Those declarations are able to be used in a generic way.
|
|
46
|
+
* Examples are: classes, interfaces, methods and such.
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
* @interface GenericDeclaration
|
|
50
|
+
* @extends {Declaration}
|
|
51
|
+
*/
|
|
52
|
+
export interface GenericDeclaration extends Declaration {
|
|
53
|
+
/**
|
|
54
|
+
* List of type parameters
|
|
55
|
+
*
|
|
56
|
+
* @type {(string[] | undefined)}
|
|
57
|
+
* @memberof GenericDeclaration
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ['T', 'TResult', 'TError']
|
|
61
|
+
*/
|
|
62
|
+
typeParameters: string[] | undefined;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Interface for exportable declarations. Does contain information about the export status of a declaration.
|
|
66
|
+
*
|
|
67
|
+
* @export
|
|
68
|
+
* @interface ExportableDeclaration
|
|
69
|
+
* @extends {Declaration}
|
|
70
|
+
*/
|
|
71
|
+
export interface ExportableDeclaration extends Declaration {
|
|
72
|
+
/**
|
|
73
|
+
* Indicates if the declaration is exported (i.e. export function ...) or not.
|
|
74
|
+
*
|
|
75
|
+
* @type {boolean}
|
|
76
|
+
* @memberof ExportableDeclaration
|
|
77
|
+
*/
|
|
78
|
+
isExported: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Interface for visible declarations. Does contain information about the visibility of the declaration.
|
|
82
|
+
*
|
|
83
|
+
* @export
|
|
84
|
+
* @interface ScopedDeclaration
|
|
85
|
+
* @extends {Declaration}
|
|
86
|
+
*/
|
|
87
|
+
export interface ScopedDeclaration extends Declaration {
|
|
88
|
+
/**
|
|
89
|
+
* Defines the visibility scope of the declaration. Can be undefined, in which case there
|
|
90
|
+
* is no visibility given (e.g. methods in interfaces).
|
|
91
|
+
*
|
|
92
|
+
* @type {(DeclarationVisibility | undefined)}
|
|
93
|
+
* @memberof ScopedDeclaration
|
|
94
|
+
*/
|
|
95
|
+
visibility: DeclarationVisibility | undefined;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Interface for class like constructs. Contain properties and methods that are contained.
|
|
99
|
+
* Examples are classes, interfaces, abstract classes, etc.
|
|
100
|
+
*
|
|
101
|
+
* @export
|
|
102
|
+
* @interface ClassLikeDeclaration
|
|
103
|
+
* @extends {Declaration}
|
|
104
|
+
*/
|
|
105
|
+
export interface ClassLikeDeclaration extends Declaration {
|
|
106
|
+
/**
|
|
107
|
+
* Accessors of this class.
|
|
108
|
+
*
|
|
109
|
+
* @type {AccessorDeclaration[]}
|
|
110
|
+
* @memberof ClassLikeDeclaration
|
|
111
|
+
*/
|
|
112
|
+
accessors: AccessorDeclaration[];
|
|
113
|
+
/**
|
|
114
|
+
* The properties of the declaration.
|
|
115
|
+
*
|
|
116
|
+
* @type {PropertyDeclaration[]}
|
|
117
|
+
* @memberof ClassLikeDeclaration
|
|
118
|
+
*/
|
|
119
|
+
properties: PropertyDeclaration[];
|
|
120
|
+
/**
|
|
121
|
+
* The methods of the declaration.
|
|
122
|
+
*
|
|
123
|
+
* @type {MethodDeclaration[]}
|
|
124
|
+
* @memberof ClassLikeDeclaration
|
|
125
|
+
*/
|
|
126
|
+
methods: MethodDeclaration[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Interface for callable declarations. Contains lists for parameters and used variables in the callable
|
|
130
|
+
* definitions.
|
|
131
|
+
*
|
|
132
|
+
* @export
|
|
133
|
+
* @interface CallableDeclaration
|
|
134
|
+
* @extends {Declaration}
|
|
135
|
+
*/
|
|
136
|
+
export interface CallableDeclaration extends Declaration {
|
|
137
|
+
/**
|
|
138
|
+
* List of used parameters in the callable node.
|
|
139
|
+
*
|
|
140
|
+
* @type {ParameterDeclaration[]}
|
|
141
|
+
* @memberof CallableDeclaration
|
|
142
|
+
*/
|
|
143
|
+
parameters: ParameterDeclaration[];
|
|
144
|
+
/**
|
|
145
|
+
* List of used variables in the callable node.
|
|
146
|
+
*
|
|
147
|
+
* @type {VariableDeclaration[]}
|
|
148
|
+
* @memberof CallableDeclaration
|
|
149
|
+
*/
|
|
150
|
+
variables: VariableDeclaration[];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Interface for possible abstract declarations. Contains information if the element is abstract or not.
|
|
154
|
+
*
|
|
155
|
+
* @export
|
|
156
|
+
* @interface AbstractDeclaration
|
|
157
|
+
* @extends {Declaration}
|
|
158
|
+
*/
|
|
159
|
+
export interface AbstractDeclaration extends Declaration {
|
|
160
|
+
/**
|
|
161
|
+
* Defines if the declaration is abstract or not.
|
|
162
|
+
*
|
|
163
|
+
* @type {boolean}
|
|
164
|
+
* @memberof AbstractDeclaration
|
|
165
|
+
*/
|
|
166
|
+
isAbstract: boolean;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Interface for possible optional declarations. Contains information if the element is optional or not.
|
|
170
|
+
*
|
|
171
|
+
* @export
|
|
172
|
+
* @interface OptionalDeclaration
|
|
173
|
+
* @extends {Declaration}
|
|
174
|
+
*/
|
|
175
|
+
export interface OptionalDeclaration extends Declaration {
|
|
176
|
+
/**
|
|
177
|
+
* Defines if the declaration is optional or not.
|
|
178
|
+
*
|
|
179
|
+
* @type {boolean}
|
|
180
|
+
* @memberof OptionalDeclaration
|
|
181
|
+
*/
|
|
182
|
+
isOptional: boolean;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Interface for possible static declarations.
|
|
186
|
+
*
|
|
187
|
+
* @export
|
|
188
|
+
* @interface StaticDeclaration
|
|
189
|
+
* @extends {Declaration}
|
|
190
|
+
*/
|
|
191
|
+
export interface StaticDeclaration extends Declaration {
|
|
192
|
+
/**
|
|
193
|
+
* Defines if the declaration is static or not.
|
|
194
|
+
*
|
|
195
|
+
* @type {boolean}
|
|
196
|
+
* @memberof StaticDeclaration
|
|
197
|
+
*/
|
|
198
|
+
isStatic: boolean;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Interface for possible async declarations.
|
|
202
|
+
*
|
|
203
|
+
* @export
|
|
204
|
+
* @interface AsyncDeclaration
|
|
205
|
+
* @extends {Declaration}
|
|
206
|
+
*/
|
|
207
|
+
export interface AsyncDeclaration extends Declaration {
|
|
208
|
+
/**
|
|
209
|
+
* Defines if the declaration is async or not.
|
|
210
|
+
*
|
|
211
|
+
* @type {boolean}
|
|
212
|
+
* @memberof AsyncDeclaration
|
|
213
|
+
*/
|
|
214
|
+
isAsync: boolean;
|
|
215
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Declaration } from './Declaration';
|
|
2
|
+
/**
|
|
3
|
+
* Class that defines information about a declaration.
|
|
4
|
+
* Contains the declaration and the origin of the declaration.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class DeclarationInfo
|
|
8
|
+
*/
|
|
9
|
+
export declare class DeclarationInfo {
|
|
10
|
+
declaration: Declaration;
|
|
11
|
+
from: string;
|
|
12
|
+
constructor(declaration: Declaration, from: string);
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeclarationInfo = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Class that defines information about a declaration.
|
|
6
|
+
* Contains the declaration and the origin of the declaration.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class DeclarationInfo
|
|
10
|
+
*/
|
|
11
|
+
class DeclarationInfo {
|
|
12
|
+
constructor(declaration, from) {
|
|
13
|
+
this.declaration = declaration;
|
|
14
|
+
this.from = from;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DeclarationInfo = DeclarationInfo;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the visibility string for a given enum value.
|
|
3
|
+
*
|
|
4
|
+
* @param {DeclarationVisibility} [visibility]
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export declare function getVisibilityText(visibility?: DeclarationVisibility): string;
|
|
8
|
+
/**
|
|
9
|
+
* Visibility of a class or interface property, as well as a method.
|
|
10
|
+
*
|
|
11
|
+
* @export
|
|
12
|
+
* @enum {number}
|
|
13
|
+
*/
|
|
14
|
+
export declare const enum DeclarationVisibility {
|
|
15
|
+
Private = 0,
|
|
16
|
+
Protected = 1,
|
|
17
|
+
Public = 2
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVisibilityText = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Returns the visibility string for a given enum value.
|
|
6
|
+
*
|
|
7
|
+
* @param {DeclarationVisibility} [visibility]
|
|
8
|
+
* @returns {string}
|
|
9
|
+
*/
|
|
10
|
+
function getVisibilityText(visibility) {
|
|
11
|
+
switch (visibility) {
|
|
12
|
+
case 0 /* Private */:
|
|
13
|
+
return 'private';
|
|
14
|
+
case 2 /* Public */:
|
|
15
|
+
return 'public';
|
|
16
|
+
case 1 /* Protected */:
|
|
17
|
+
return 'protected';
|
|
18
|
+
default:
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.getVisibilityText = getVisibilityText;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Resource } from '../resources/Resource';
|
|
2
|
+
import { Declaration, ExportableDeclaration } from './Declaration';
|
|
3
|
+
/**
|
|
4
|
+
* Default declaration. Is used when a file exports something as its default.
|
|
5
|
+
* Primary use is to ask the user about a name for the default export.
|
|
6
|
+
* Is kind of an abstract declaration since there is no real declaration.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class DefaultDeclaration
|
|
10
|
+
* @implements {ExportableDeclaration}
|
|
11
|
+
*/
|
|
12
|
+
export declare class DefaultDeclaration implements ExportableDeclaration {
|
|
13
|
+
name: string;
|
|
14
|
+
private resource;
|
|
15
|
+
start?: number | undefined;
|
|
16
|
+
end?: number | undefined;
|
|
17
|
+
readonly isExported: boolean;
|
|
18
|
+
private exported;
|
|
19
|
+
get exportedDeclaration(): Declaration;
|
|
20
|
+
constructor(name: string, resource: Resource, start?: number | undefined, end?: number | undefined);
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultDeclaration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Default declaration. Is used when a file exports something as its default.
|
|
6
|
+
* Primary use is to ask the user about a name for the default export.
|
|
7
|
+
* Is kind of an abstract declaration since there is no real declaration.
|
|
8
|
+
*
|
|
9
|
+
* @export
|
|
10
|
+
* @class DefaultDeclaration
|
|
11
|
+
* @implements {ExportableDeclaration}
|
|
12
|
+
*/
|
|
13
|
+
class DefaultDeclaration {
|
|
14
|
+
constructor(name, resource, start, end) {
|
|
15
|
+
this.name = name;
|
|
16
|
+
this.resource = resource;
|
|
17
|
+
this.start = start;
|
|
18
|
+
this.end = end;
|
|
19
|
+
this.isExported = true;
|
|
20
|
+
}
|
|
21
|
+
get exportedDeclaration() {
|
|
22
|
+
if (!this.exported) {
|
|
23
|
+
this.exported = this.resource.declarations.find(o => o.name === this.name);
|
|
24
|
+
}
|
|
25
|
+
return this.exported;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.DefaultDeclaration = DefaultDeclaration;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExportableDeclaration } from './Declaration';
|
|
2
|
+
/**
|
|
3
|
+
* Enum declaration.
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @class EnumDeclaration
|
|
7
|
+
* @implements {ExportableDeclaration}
|
|
8
|
+
*/
|
|
9
|
+
export declare class EnumDeclaration implements ExportableDeclaration {
|
|
10
|
+
name: string;
|
|
11
|
+
isExported: boolean;
|
|
12
|
+
start?: number | undefined;
|
|
13
|
+
end?: number | undefined;
|
|
14
|
+
members: string[];
|
|
15
|
+
constructor(name: string, isExported: boolean, start?: number | undefined, end?: number | undefined);
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnumDeclaration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enum declaration.
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @class EnumDeclaration
|
|
9
|
+
* @implements {ExportableDeclaration}
|
|
10
|
+
*/
|
|
11
|
+
class EnumDeclaration {
|
|
12
|
+
constructor(name, isExported, start, end) {
|
|
13
|
+
this.name = name;
|
|
14
|
+
this.isExported = isExported;
|
|
15
|
+
this.start = start;
|
|
16
|
+
this.end = end;
|
|
17
|
+
this.members = [];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.EnumDeclaration = EnumDeclaration;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AsyncDeclaration, CallableDeclaration, ExportableDeclaration } from './Declaration';
|
|
2
|
+
import { ParameterDeclaration } from './ParameterDeclaration';
|
|
3
|
+
import { VariableDeclaration } from './VariableDeclaration';
|
|
4
|
+
/**
|
|
5
|
+
* Function declaration. Like the MethodDeclaration it contains the base info about the function
|
|
6
|
+
* and additional stuff.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class FunctionDeclaration
|
|
10
|
+
* @implements {CallableDeclaration}
|
|
11
|
+
* @implements {ExportableDeclaration}
|
|
12
|
+
*/
|
|
13
|
+
export declare class FunctionDeclaration implements AsyncDeclaration, CallableDeclaration, ExportableDeclaration {
|
|
14
|
+
name: string;
|
|
15
|
+
isExported: boolean;
|
|
16
|
+
isAsync: boolean;
|
|
17
|
+
type?: string | undefined;
|
|
18
|
+
start?: number | undefined;
|
|
19
|
+
end?: number | undefined;
|
|
20
|
+
parameters: ParameterDeclaration[];
|
|
21
|
+
variables: VariableDeclaration[];
|
|
22
|
+
constructor(name: string, isExported: boolean, isAsync: boolean, type?: string | undefined, start?: number | undefined, end?: number | undefined);
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FunctionDeclaration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Function declaration. Like the MethodDeclaration it contains the base info about the function
|
|
6
|
+
* and additional stuff.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class FunctionDeclaration
|
|
10
|
+
* @implements {CallableDeclaration}
|
|
11
|
+
* @implements {ExportableDeclaration}
|
|
12
|
+
*/
|
|
13
|
+
class FunctionDeclaration {
|
|
14
|
+
constructor(name, isExported, isAsync, type, start, end) {
|
|
15
|
+
this.name = name;
|
|
16
|
+
this.isExported = isExported;
|
|
17
|
+
this.isAsync = isAsync;
|
|
18
|
+
this.type = type;
|
|
19
|
+
this.start = start;
|
|
20
|
+
this.end = end;
|
|
21
|
+
this.parameters = [];
|
|
22
|
+
this.variables = [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.FunctionDeclaration = FunctionDeclaration;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AccessorDeclaration } from './AccessorDeclaration';
|
|
2
|
+
import { ClassLikeDeclaration, ExportableDeclaration, GenericDeclaration } from './Declaration';
|
|
3
|
+
import { MethodDeclaration } from './MethodDeclaration';
|
|
4
|
+
import { PropertyDeclaration } from './PropertyDeclaration';
|
|
5
|
+
/**
|
|
6
|
+
* Interface declaration that contains defined properties and methods.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class InterfaceDeclaration
|
|
10
|
+
* @implements {ExportableDeclaration}
|
|
11
|
+
* @implements {GenericDeclaration}
|
|
12
|
+
*/
|
|
13
|
+
export declare class InterfaceDeclaration implements ClassLikeDeclaration, ExportableDeclaration, GenericDeclaration {
|
|
14
|
+
name: string;
|
|
15
|
+
isExported: boolean;
|
|
16
|
+
start?: number | undefined;
|
|
17
|
+
end?: number | undefined;
|
|
18
|
+
accessors: AccessorDeclaration[];
|
|
19
|
+
typeParameters: string[] | undefined;
|
|
20
|
+
properties: PropertyDeclaration[];
|
|
21
|
+
methods: MethodDeclaration[];
|
|
22
|
+
extends: {
|
|
23
|
+
name: string;
|
|
24
|
+
typeParameters: string[];
|
|
25
|
+
}[];
|
|
26
|
+
constructor(name: string, isExported: boolean, start?: number | undefined, end?: number | undefined);
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InterfaceDeclaration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Interface declaration that contains defined properties and methods.
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @class InterfaceDeclaration
|
|
9
|
+
* @implements {ExportableDeclaration}
|
|
10
|
+
* @implements {GenericDeclaration}
|
|
11
|
+
*/
|
|
12
|
+
class InterfaceDeclaration {
|
|
13
|
+
constructor(name, isExported, start, end) {
|
|
14
|
+
this.name = name;
|
|
15
|
+
this.isExported = isExported;
|
|
16
|
+
this.start = start;
|
|
17
|
+
this.end = end;
|
|
18
|
+
this.accessors = [];
|
|
19
|
+
this.properties = [];
|
|
20
|
+
this.methods = [];
|
|
21
|
+
this.extends = [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.InterfaceDeclaration = InterfaceDeclaration;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AbstractDeclaration, AsyncDeclaration, CallableDeclaration, OptionalDeclaration, ScopedDeclaration, StaticDeclaration, TypedDeclaration } from './Declaration';
|
|
2
|
+
import { DeclarationVisibility } from './DeclarationVisibility';
|
|
3
|
+
import { ParameterDeclaration } from './ParameterDeclaration';
|
|
4
|
+
import { VariableDeclaration } from './VariableDeclaration';
|
|
5
|
+
/**
|
|
6
|
+
* Method declaration. A method is contained in an interface or a class.
|
|
7
|
+
* Contains information abount the method itself.
|
|
8
|
+
*
|
|
9
|
+
* @export
|
|
10
|
+
* @class MethodDeclaration
|
|
11
|
+
* @implements {CallableDeclaration}
|
|
12
|
+
* @implements {ScopedDeclaration}
|
|
13
|
+
* @implements {TypedDeclaration}
|
|
14
|
+
*/
|
|
15
|
+
export declare class MethodDeclaration implements AbstractDeclaration, AsyncDeclaration, CallableDeclaration, OptionalDeclaration, ScopedDeclaration, StaticDeclaration, TypedDeclaration {
|
|
16
|
+
name: string;
|
|
17
|
+
isAbstract: boolean;
|
|
18
|
+
visibility: DeclarationVisibility | undefined;
|
|
19
|
+
type: string | undefined;
|
|
20
|
+
isOptional: boolean;
|
|
21
|
+
isStatic: boolean;
|
|
22
|
+
isAsync: boolean;
|
|
23
|
+
start?: number | undefined;
|
|
24
|
+
end?: number | undefined;
|
|
25
|
+
parameters: ParameterDeclaration[];
|
|
26
|
+
variables: VariableDeclaration[];
|
|
27
|
+
constructor(name: string, isAbstract: boolean, visibility: DeclarationVisibility | undefined, type: string | undefined, isOptional: boolean, isStatic: boolean, isAsync: boolean, start?: number | undefined, end?: number | undefined);
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MethodDeclaration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Method declaration. A method is contained in an interface or a class.
|
|
6
|
+
* Contains information abount the method itself.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class MethodDeclaration
|
|
10
|
+
* @implements {CallableDeclaration}
|
|
11
|
+
* @implements {ScopedDeclaration}
|
|
12
|
+
* @implements {TypedDeclaration}
|
|
13
|
+
*/
|
|
14
|
+
class MethodDeclaration {
|
|
15
|
+
constructor(name, isAbstract, visibility, type, isOptional, isStatic, isAsync, start, end) {
|
|
16
|
+
this.name = name;
|
|
17
|
+
this.isAbstract = isAbstract;
|
|
18
|
+
this.visibility = visibility;
|
|
19
|
+
this.type = type;
|
|
20
|
+
this.isOptional = isOptional;
|
|
21
|
+
this.isStatic = isStatic;
|
|
22
|
+
this.isAsync = isAsync;
|
|
23
|
+
this.start = start;
|
|
24
|
+
this.end = end;
|
|
25
|
+
this.parameters = [];
|
|
26
|
+
this.variables = [];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.MethodDeclaration = MethodDeclaration;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Declaration } from './Declaration';
|
|
2
|
+
/**
|
|
3
|
+
* Module (namespace) declaration. Does export a whole module or namespace that is mainly used by
|
|
4
|
+
* external declaration files.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class ModuleDeclaration
|
|
8
|
+
* @implements {Declaration}
|
|
9
|
+
*/
|
|
10
|
+
export declare class ModuleDeclaration implements Declaration {
|
|
11
|
+
name: string;
|
|
12
|
+
start?: number | undefined;
|
|
13
|
+
end?: number | undefined;
|
|
14
|
+
constructor(name: string, start?: number | undefined, end?: number | undefined);
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModuleDeclaration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Module (namespace) declaration. Does export a whole module or namespace that is mainly used by
|
|
6
|
+
* external declaration files.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class ModuleDeclaration
|
|
10
|
+
* @implements {Declaration}
|
|
11
|
+
*/
|
|
12
|
+
class ModuleDeclaration {
|
|
13
|
+
constructor(name, start, end) {
|
|
14
|
+
this.name = name;
|
|
15
|
+
this.start = start;
|
|
16
|
+
this.end = end;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ModuleDeclaration = ModuleDeclaration;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TypedDeclaration } from './Declaration';
|
|
2
|
+
/**
|
|
3
|
+
* Parameter declaration. Is contained in a method or function delaration since a parameter can not be exported
|
|
4
|
+
* by itself.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class ParameterDeclaration
|
|
8
|
+
* @implements {TypedDeclaration}
|
|
9
|
+
*/
|
|
10
|
+
export declare class ParameterDeclaration implements TypedDeclaration {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string | undefined;
|
|
13
|
+
start?: number | undefined;
|
|
14
|
+
end?: number | undefined;
|
|
15
|
+
constructor(name: string, type: string | undefined, start?: number | undefined, end?: number | undefined);
|
|
16
|
+
}
|
|
17
|
+
export declare class BoundParameterDeclaration extends ParameterDeclaration {
|
|
18
|
+
private startCharacter;
|
|
19
|
+
private endCharacter;
|
|
20
|
+
parameters: ParameterDeclaration[];
|
|
21
|
+
typeReference: string | undefined;
|
|
22
|
+
get name(): string;
|
|
23
|
+
set name(_: string);
|
|
24
|
+
get type(): string;
|
|
25
|
+
set type(_: string);
|
|
26
|
+
constructor(startCharacter: string, endCharacter: string, start?: number, end?: number);
|
|
27
|
+
}
|
|
28
|
+
export declare class ObjectBoundParameterDeclaration extends BoundParameterDeclaration {
|
|
29
|
+
constructor(start?: number, end?: number);
|
|
30
|
+
}
|
|
31
|
+
export declare class ArrayBoundParameterDeclaration extends BoundParameterDeclaration {
|
|
32
|
+
constructor(start?: number, end?: number);
|
|
33
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayBoundParameterDeclaration = exports.ObjectBoundParameterDeclaration = exports.BoundParameterDeclaration = exports.ParameterDeclaration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Parameter declaration. Is contained in a method or function delaration since a parameter can not be exported
|
|
6
|
+
* by itself.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class ParameterDeclaration
|
|
10
|
+
* @implements {TypedDeclaration}
|
|
11
|
+
*/
|
|
12
|
+
class ParameterDeclaration {
|
|
13
|
+
constructor(name, type, start, end) {
|
|
14
|
+
this.name = name;
|
|
15
|
+
this.type = type;
|
|
16
|
+
this.start = start;
|
|
17
|
+
this.end = end;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.ParameterDeclaration = ParameterDeclaration;
|
|
21
|
+
class BoundParameterDeclaration extends ParameterDeclaration {
|
|
22
|
+
constructor(startCharacter, endCharacter, start, end) {
|
|
23
|
+
super('', '', start, end);
|
|
24
|
+
this.startCharacter = startCharacter;
|
|
25
|
+
this.endCharacter = endCharacter;
|
|
26
|
+
this.parameters = [];
|
|
27
|
+
}
|
|
28
|
+
get name() {
|
|
29
|
+
return this.parameters.length ?
|
|
30
|
+
`${this.startCharacter} ${this.parameters.map(p => p.name).join(', ')} ${this.endCharacter}` :
|
|
31
|
+
this.startCharacter + this.endCharacter;
|
|
32
|
+
}
|
|
33
|
+
set name(_) { }
|
|
34
|
+
get type() {
|
|
35
|
+
return this.typeReference ||
|
|
36
|
+
this.parameters.length ?
|
|
37
|
+
`{ ${this.parameters.map(p => p.type).join(', ')} }` :
|
|
38
|
+
this.startCharacter + this.endCharacter;
|
|
39
|
+
}
|
|
40
|
+
set type(_) { }
|
|
41
|
+
}
|
|
42
|
+
exports.BoundParameterDeclaration = BoundParameterDeclaration;
|
|
43
|
+
class ObjectBoundParameterDeclaration extends BoundParameterDeclaration {
|
|
44
|
+
constructor(start, end) {
|
|
45
|
+
super('{', '}', start, end);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.ObjectBoundParameterDeclaration = ObjectBoundParameterDeclaration;
|
|
49
|
+
class ArrayBoundParameterDeclaration extends BoundParameterDeclaration {
|
|
50
|
+
constructor(start, end) {
|
|
51
|
+
super('[', ']', start, end);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.ArrayBoundParameterDeclaration = ArrayBoundParameterDeclaration;
|