@proteinjs/reflection-build 1.0.2 → 1.0.4

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.
Files changed (149) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/modules/typescript-parser/.appveyor.yml +22 -0
  3. package/dist/modules/typescript-parser/DeclarationIndex.d.ts +217 -0
  4. package/dist/modules/typescript-parser/DeclarationIndex.js +441 -0
  5. package/dist/modules/typescript-parser/LICENSE +21 -0
  6. package/dist/modules/typescript-parser/Node.d.ts +23 -0
  7. package/dist/modules/typescript-parser/Node.js +2 -0
  8. package/dist/modules/typescript-parser/README.md +51 -0
  9. package/dist/modules/typescript-parser/SymbolSpecifier.d.ts +22 -0
  10. package/dist/modules/typescript-parser/SymbolSpecifier.js +28 -0
  11. package/dist/modules/typescript-parser/TypescriptParser.d.ts +68 -0
  12. package/dist/modules/typescript-parser/TypescriptParser.js +191 -0
  13. package/dist/modules/typescript-parser/clonable/Clonable.d.ts +17 -0
  14. package/dist/modules/typescript-parser/clonable/Clonable.js +2 -0
  15. package/dist/modules/typescript-parser/code-generators/TypescriptCodeGenerator.d.ts +39 -0
  16. package/dist/modules/typescript-parser/code-generators/TypescriptCodeGenerator.js +66 -0
  17. package/dist/modules/typescript-parser/code-generators/TypescriptGenerationOptions.d.ts +69 -0
  18. package/dist/modules/typescript-parser/code-generators/TypescriptGenerationOptions.js +9 -0
  19. package/dist/modules/typescript-parser/code-generators/typescript-generators/accessorDeclaration.d.ts +11 -0
  20. package/dist/modules/typescript-parser/code-generators/typescript-generators/accessorDeclaration.js +34 -0
  21. package/dist/modules/typescript-parser/code-generators/typescript-generators/externalModuleImport.d.ts +11 -0
  22. package/dist/modules/typescript-parser/code-generators/typescript-generators/externalModuleImport.js +15 -0
  23. package/dist/modules/typescript-parser/code-generators/typescript-generators/methodDeclaration.d.ts +11 -0
  24. package/dist/modules/typescript-parser/code-generators/typescript-generators/methodDeclaration.js +23 -0
  25. package/dist/modules/typescript-parser/code-generators/typescript-generators/namedImport.d.ts +11 -0
  26. package/dist/modules/typescript-parser/code-generators/typescript-generators/namedImport.js +94 -0
  27. package/dist/modules/typescript-parser/code-generators/typescript-generators/namespaceImport.d.ts +11 -0
  28. package/dist/modules/typescript-parser/code-generators/typescript-generators/namespaceImport.js +15 -0
  29. package/dist/modules/typescript-parser/code-generators/typescript-generators/parameterDeclaration.d.ts +9 -0
  30. package/dist/modules/typescript-parser/code-generators/typescript-generators/parameterDeclaration.js +14 -0
  31. package/dist/modules/typescript-parser/code-generators/typescript-generators/propertyDeclaration.d.ts +11 -0
  32. package/dist/modules/typescript-parser/code-generators/typescript-generators/propertyDeclaration.js +18 -0
  33. package/dist/modules/typescript-parser/code-generators/typescript-generators/stringImport.d.ts +11 -0
  34. package/dist/modules/typescript-parser/code-generators/typescript-generators/stringImport.js +15 -0
  35. package/dist/modules/typescript-parser/code-generators/typescript-generators/symbolSpecifier.d.ts +9 -0
  36. package/dist/modules/typescript-parser/code-generators/typescript-generators/symbolSpecifier.js +14 -0
  37. package/dist/modules/typescript-parser/code-generators/typescript-generators/variableDeclaration.d.ts +9 -0
  38. package/dist/modules/typescript-parser/code-generators/typescript-generators/variableDeclaration.js +14 -0
  39. package/dist/modules/typescript-parser/declarations/AccessorDeclaration.d.ts +40 -0
  40. package/dist/modules/typescript-parser/declarations/AccessorDeclaration.js +45 -0
  41. package/dist/modules/typescript-parser/declarations/ClassDeclaration.d.ts +34 -0
  42. package/dist/modules/typescript-parser/declarations/ClassDeclaration.js +26 -0
  43. package/dist/modules/typescript-parser/declarations/ConstructorDeclaration.d.ts +18 -0
  44. package/dist/modules/typescript-parser/declarations/ConstructorDeclaration.js +20 -0
  45. package/dist/modules/typescript-parser/declarations/Declaration.d.ts +215 -0
  46. package/dist/modules/typescript-parser/declarations/Declaration.js +2 -0
  47. package/dist/modules/typescript-parser/declarations/DeclarationInfo.d.ts +13 -0
  48. package/dist/modules/typescript-parser/declarations/DeclarationInfo.js +17 -0
  49. package/dist/modules/typescript-parser/declarations/DeclarationVisibility.d.ts +18 -0
  50. package/dist/modules/typescript-parser/declarations/DeclarationVisibility.js +22 -0
  51. package/dist/modules/typescript-parser/declarations/DefaultDeclaration.d.ts +21 -0
  52. package/dist/modules/typescript-parser/declarations/DefaultDeclaration.js +28 -0
  53. package/dist/modules/typescript-parser/declarations/EnumDeclaration.d.ts +16 -0
  54. package/dist/modules/typescript-parser/declarations/EnumDeclaration.js +20 -0
  55. package/dist/modules/typescript-parser/declarations/FunctionDeclaration.d.ts +23 -0
  56. package/dist/modules/typescript-parser/declarations/FunctionDeclaration.js +25 -0
  57. package/dist/modules/typescript-parser/declarations/InterfaceDeclaration.d.ts +27 -0
  58. package/dist/modules/typescript-parser/declarations/InterfaceDeclaration.js +24 -0
  59. package/dist/modules/typescript-parser/declarations/MethodDeclaration.d.ts +28 -0
  60. package/dist/modules/typescript-parser/declarations/MethodDeclaration.js +29 -0
  61. package/dist/modules/typescript-parser/declarations/ModuleDeclaration.d.ts +15 -0
  62. package/dist/modules/typescript-parser/declarations/ModuleDeclaration.js +19 -0
  63. package/dist/modules/typescript-parser/declarations/ParameterDeclaration.d.ts +33 -0
  64. package/dist/modules/typescript-parser/declarations/ParameterDeclaration.js +54 -0
  65. package/dist/modules/typescript-parser/declarations/PropertyDeclaration.d.ts +20 -0
  66. package/dist/modules/typescript-parser/declarations/PropertyDeclaration.js +23 -0
  67. package/dist/modules/typescript-parser/declarations/TypeAliasDeclaration.d.ts +19 -0
  68. package/dist/modules/typescript-parser/declarations/TypeAliasDeclaration.js +22 -0
  69. package/dist/modules/typescript-parser/declarations/VariableDeclaration.d.ts +19 -0
  70. package/dist/modules/typescript-parser/declarations/VariableDeclaration.js +22 -0
  71. package/dist/modules/typescript-parser/declarations/index.d.ts +16 -0
  72. package/dist/modules/typescript-parser/declarations/index.js +19 -0
  73. package/dist/modules/typescript-parser/errors/NotGeneratableYetError.d.ts +11 -0
  74. package/dist/modules/typescript-parser/errors/NotGeneratableYetError.js +17 -0
  75. package/dist/modules/typescript-parser/exports/AllExport.d.ts +14 -0
  76. package/dist/modules/typescript-parser/exports/AllExport.js +18 -0
  77. package/dist/modules/typescript-parser/exports/AssignedExport.d.ts +26 -0
  78. package/dist/modules/typescript-parser/exports/AssignedExport.js +38 -0
  79. package/dist/modules/typescript-parser/exports/Export.d.ts +10 -0
  80. package/dist/modules/typescript-parser/exports/Export.js +2 -0
  81. package/dist/modules/typescript-parser/exports/NamedExport.d.ts +16 -0
  82. package/dist/modules/typescript-parser/exports/NamedExport.js +18 -0
  83. package/dist/modules/typescript-parser/exports/index.d.ts +4 -0
  84. package/dist/modules/typescript-parser/exports/index.js +7 -0
  85. package/dist/modules/typescript-parser/imports/ExternalModuleImport.d.ts +25 -0
  86. package/dist/modules/typescript-parser/imports/ExternalModuleImport.js +33 -0
  87. package/dist/modules/typescript-parser/imports/Import.d.ts +43 -0
  88. package/dist/modules/typescript-parser/imports/Import.js +2 -0
  89. package/dist/modules/typescript-parser/imports/NamedImport.d.ts +29 -0
  90. package/dist/modules/typescript-parser/imports/NamedImport.js +38 -0
  91. package/dist/modules/typescript-parser/imports/NamespaceImport.d.ts +24 -0
  92. package/dist/modules/typescript-parser/imports/NamespaceImport.js +32 -0
  93. package/dist/modules/typescript-parser/imports/StringImport.d.ts +23 -0
  94. package/dist/modules/typescript-parser/imports/StringImport.js +31 -0
  95. package/dist/modules/typescript-parser/imports/index.d.ts +5 -0
  96. package/dist/modules/typescript-parser/imports/index.js +8 -0
  97. package/dist/modules/typescript-parser/index.d.ts +12 -0
  98. package/dist/modules/typescript-parser/index.js +14 -0
  99. package/dist/modules/typescript-parser/node-parser/changes/parseType.d.ts +14 -0
  100. package/dist/modules/typescript-parser/node-parser/changes/parseType.js +35 -0
  101. package/dist/modules/typescript-parser/node-parser/class-parser.d.ts +30 -0
  102. package/dist/modules/typescript-parser/node-parser/class-parser.js +143 -0
  103. package/dist/modules/typescript-parser/node-parser/enum-parser.d.ts +10 -0
  104. package/dist/modules/typescript-parser/node-parser/enum-parser.js +18 -0
  105. package/dist/modules/typescript-parser/node-parser/export-parser.d.ts +10 -0
  106. package/dist/modules/typescript-parser/node-parser/export-parser.js +58 -0
  107. package/dist/modules/typescript-parser/node-parser/function-parser.d.ts +33 -0
  108. package/dist/modules/typescript-parser/node-parser/function-parser.js +101 -0
  109. package/dist/modules/typescript-parser/node-parser/identifier-parser.d.ts +10 -0
  110. package/dist/modules/typescript-parser/node-parser/identifier-parser.js +81 -0
  111. package/dist/modules/typescript-parser/node-parser/import-parser.d.ts +10 -0
  112. package/dist/modules/typescript-parser/node-parser/import-parser.js +54 -0
  113. package/dist/modules/typescript-parser/node-parser/index.d.ts +0 -0
  114. package/dist/modules/typescript-parser/node-parser/index.js +11 -0
  115. package/dist/modules/typescript-parser/node-parser/interface-parser.d.ts +11 -0
  116. package/dist/modules/typescript-parser/node-parser/interface-parser.js +57 -0
  117. package/dist/modules/typescript-parser/node-parser/module-parser.d.ts +12 -0
  118. package/dist/modules/typescript-parser/node-parser/module-parser.js +23 -0
  119. package/dist/modules/typescript-parser/node-parser/parse-utilities.d.ts +55 -0
  120. package/dist/modules/typescript-parser/node-parser/parse-utilities.js +96 -0
  121. package/dist/modules/typescript-parser/node-parser/traverse-ast.d.ts +1 -0
  122. package/dist/modules/typescript-parser/node-parser/traverse-ast.js +14 -0
  123. package/dist/modules/typescript-parser/node-parser/type-alias-parser.d.ts +10 -0
  124. package/dist/modules/typescript-parser/node-parser/type-alias-parser.js +20 -0
  125. package/dist/modules/typescript-parser/node-parser/variable-parser.d.ts +11 -0
  126. package/dist/modules/typescript-parser/node-parser/variable-parser.js +30 -0
  127. package/dist/modules/typescript-parser/package-lock.json +16793 -0
  128. package/dist/modules/typescript-parser/package.json +55 -0
  129. package/dist/modules/typescript-parser/resources/File.d.ts +45 -0
  130. package/dist/modules/typescript-parser/resources/File.js +58 -0
  131. package/dist/modules/typescript-parser/resources/Module.d.ts +35 -0
  132. package/dist/modules/typescript-parser/resources/Module.js +50 -0
  133. package/dist/modules/typescript-parser/resources/Namespace.d.ts +35 -0
  134. package/dist/modules/typescript-parser/resources/Namespace.js +50 -0
  135. package/dist/modules/typescript-parser/resources/Resource.d.ts +64 -0
  136. package/dist/modules/typescript-parser/resources/Resource.js +2 -0
  137. package/dist/modules/typescript-parser/resources/index.d.ts +4 -0
  138. package/dist/modules/typescript-parser/resources/index.js +7 -0
  139. package/dist/modules/typescript-parser/type-guards/TypescriptGuards.d.ts +153 -0
  140. package/dist/modules/typescript-parser/type-guards/TypescriptGuards.js +213 -0
  141. package/dist/modules/typescript-parser/type-guards/TypescriptHeroGuards.d.ts +26 -0
  142. package/dist/modules/typescript-parser/type-guards/TypescriptHeroGuards.js +36 -0
  143. package/dist/modules/typescript-parser/utilities/PathHelpers.d.ts +22 -0
  144. package/dist/modules/typescript-parser/utilities/PathHelpers.js +42 -0
  145. package/dist/modules/typescript-parser/utilities/StringTemplate.d.ts +9 -0
  146. package/dist/modules/typescript-parser/utilities/StringTemplate.js +21 -0
  147. package/dist/src/tsconfigTemplate.json +18 -0
  148. package/package.json +3 -3
  149. package/tsconfig.json +1 -0
@@ -0,0 +1,20 @@
1
+ import { OptionalDeclaration, ScopedDeclaration, StaticDeclaration, TypedDeclaration } from './Declaration';
2
+ import { DeclarationVisibility } from './DeclarationVisibility';
3
+ /**
4
+ * Property declaration that contains its visibility.
5
+ *
6
+ * @export
7
+ * @class PropertyDeclaration
8
+ * @implements {ScopedDeclaration}
9
+ * @implements {TypedDeclaration}
10
+ */
11
+ export declare class PropertyDeclaration implements OptionalDeclaration, ScopedDeclaration, StaticDeclaration, TypedDeclaration {
12
+ name: string;
13
+ visibility: DeclarationVisibility | undefined;
14
+ type: string | undefined;
15
+ isOptional: boolean;
16
+ isStatic: boolean;
17
+ start?: number | undefined;
18
+ end?: number | undefined;
19
+ constructor(name: string, visibility: DeclarationVisibility | undefined, type: string | undefined, isOptional: boolean, isStatic: boolean, start?: number | undefined, end?: number | undefined);
20
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PropertyDeclaration = void 0;
4
+ /**
5
+ * Property declaration that contains its visibility.
6
+ *
7
+ * @export
8
+ * @class PropertyDeclaration
9
+ * @implements {ScopedDeclaration}
10
+ * @implements {TypedDeclaration}
11
+ */
12
+ class PropertyDeclaration {
13
+ constructor(name, visibility, type, isOptional, isStatic, start, end) {
14
+ this.name = name;
15
+ this.visibility = visibility;
16
+ this.type = type;
17
+ this.isOptional = isOptional;
18
+ this.isStatic = isStatic;
19
+ this.start = start;
20
+ this.end = end;
21
+ }
22
+ }
23
+ exports.PropertyDeclaration = PropertyDeclaration;
@@ -0,0 +1,19 @@
1
+ import { ExportableDeclaration } from './Declaration';
2
+ import { Type } from '../node-parser/changes/parseType';
3
+ /**
4
+ * Alias declaration that can be exported. Is used to defined types.
5
+ * (e.g. type Foobar = { name: string };)
6
+ *
7
+ * @export
8
+ * @class TypeAliasDeclaration
9
+ * @implements {ExportableDeclaration}
10
+ */
11
+ export declare class TypeAliasDeclaration implements ExportableDeclaration {
12
+ name: string;
13
+ isExported: boolean;
14
+ typeParameters: string[];
15
+ type: Type;
16
+ start?: number | undefined;
17
+ end?: number | undefined;
18
+ constructor(name: string, isExported: boolean, typeParameters: string[], type: Type, start?: number | undefined, end?: number | undefined);
19
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeAliasDeclaration = void 0;
4
+ /**
5
+ * Alias declaration that can be exported. Is used to defined types.
6
+ * (e.g. type Foobar = { name: string };)
7
+ *
8
+ * @export
9
+ * @class TypeAliasDeclaration
10
+ * @implements {ExportableDeclaration}
11
+ */
12
+ class TypeAliasDeclaration {
13
+ constructor(name, isExported, typeParameters, type, start, end) {
14
+ this.name = name;
15
+ this.isExported = isExported;
16
+ this.typeParameters = typeParameters;
17
+ this.type = type;
18
+ this.start = start;
19
+ this.end = end;
20
+ }
21
+ }
22
+ exports.TypeAliasDeclaration = TypeAliasDeclaration;
@@ -0,0 +1,19 @@
1
+ import { ExportableDeclaration, TypedDeclaration } from './Declaration';
2
+ import { Type } from '../node-parser/changes/parseType';
3
+ /**
4
+ * Variable declaration. Is contained in a method or function, or can be exported.
5
+ *
6
+ * @export
7
+ * @class VariableDeclaration
8
+ * @implements {ExportableDeclaration}
9
+ * @implements {TypedDeclaration}
10
+ */
11
+ export declare class VariableDeclaration implements ExportableDeclaration, TypedDeclaration {
12
+ name: string;
13
+ isConst: boolean;
14
+ isExported: boolean;
15
+ type: Type;
16
+ start?: number | undefined;
17
+ end?: number | undefined;
18
+ constructor(name: string, isConst: boolean, isExported: boolean, type: Type, start?: number | undefined, end?: number | undefined);
19
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VariableDeclaration = void 0;
4
+ /**
5
+ * Variable declaration. Is contained in a method or function, or can be exported.
6
+ *
7
+ * @export
8
+ * @class VariableDeclaration
9
+ * @implements {ExportableDeclaration}
10
+ * @implements {TypedDeclaration}
11
+ */
12
+ class VariableDeclaration {
13
+ constructor(name, isConst, isExported, type, start, end) {
14
+ this.name = name;
15
+ this.isConst = isConst;
16
+ this.isExported = isExported;
17
+ this.type = type;
18
+ this.start = start;
19
+ this.end = end;
20
+ }
21
+ }
22
+ exports.VariableDeclaration = VariableDeclaration;
@@ -0,0 +1,16 @@
1
+ export * from './AccessorDeclaration';
2
+ export * from './ClassDeclaration';
3
+ export * from './ConstructorDeclaration';
4
+ export * from './Declaration';
5
+ export * from './DeclarationInfo';
6
+ export * from './DeclarationVisibility';
7
+ export * from './DefaultDeclaration';
8
+ export * from './EnumDeclaration';
9
+ export * from './FunctionDeclaration';
10
+ export * from './InterfaceDeclaration';
11
+ export * from './MethodDeclaration';
12
+ export * from './ModuleDeclaration';
13
+ export * from './ParameterDeclaration';
14
+ export * from './PropertyDeclaration';
15
+ export * from './TypeAliasDeclaration';
16
+ export * from './VariableDeclaration';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./AccessorDeclaration"), exports);
5
+ tslib_1.__exportStar(require("./ClassDeclaration"), exports);
6
+ tslib_1.__exportStar(require("./ConstructorDeclaration"), exports);
7
+ tslib_1.__exportStar(require("./Declaration"), exports);
8
+ tslib_1.__exportStar(require("./DeclarationInfo"), exports);
9
+ tslib_1.__exportStar(require("./DeclarationVisibility"), exports);
10
+ tslib_1.__exportStar(require("./DefaultDeclaration"), exports);
11
+ tslib_1.__exportStar(require("./EnumDeclaration"), exports);
12
+ tslib_1.__exportStar(require("./FunctionDeclaration"), exports);
13
+ tslib_1.__exportStar(require("./InterfaceDeclaration"), exports);
14
+ tslib_1.__exportStar(require("./MethodDeclaration"), exports);
15
+ tslib_1.__exportStar(require("./ModuleDeclaration"), exports);
16
+ tslib_1.__exportStar(require("./ParameterDeclaration"), exports);
17
+ tslib_1.__exportStar(require("./PropertyDeclaration"), exports);
18
+ tslib_1.__exportStar(require("./TypeAliasDeclaration"), exports);
19
+ tslib_1.__exportStar(require("./VariableDeclaration"), exports);
@@ -0,0 +1,11 @@
1
+ import { Generatable } from '../code-generators/TypescriptCodeGenerator';
2
+ /**
3
+ * Error that should be thrown, when a generatable is not yet able to be generated.
4
+ *
5
+ * @export
6
+ * @class NotGeneratableYetError
7
+ * @extends {Error}
8
+ */
9
+ export declare class NotGeneratableYetError extends Error {
10
+ constructor(generatable: Generatable);
11
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotGeneratableYetError = void 0;
4
+ /**
5
+ * Error that should be thrown, when a generatable is not yet able to be generated.
6
+ *
7
+ * @export
8
+ * @class NotGeneratableYetError
9
+ * @extends {Error}
10
+ */
11
+ class NotGeneratableYetError extends Error {
12
+ constructor(generatable) {
13
+ super();
14
+ this.message = `The element "${generatable.constructor.name}" is not yet generatable.`;
15
+ }
16
+ }
17
+ exports.NotGeneratableYetError = NotGeneratableYetError;
@@ -0,0 +1,14 @@
1
+ import { Export } from './Export';
2
+ /**
3
+ * Declares an all export (i.e. export * from ...).
4
+ *
5
+ * @export
6
+ * @class AllExport
7
+ * @implements {Export}
8
+ */
9
+ export declare class AllExport implements Export {
10
+ start: number;
11
+ end: number;
12
+ from: string;
13
+ constructor(start: number, end: number, from: string);
14
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AllExport = void 0;
4
+ /**
5
+ * Declares an all export (i.e. export * from ...).
6
+ *
7
+ * @export
8
+ * @class AllExport
9
+ * @implements {Export}
10
+ */
11
+ class AllExport {
12
+ constructor(start, end, from) {
13
+ this.start = start;
14
+ this.end = end;
15
+ this.from = from;
16
+ }
17
+ }
18
+ exports.AllExport = AllExport;
@@ -0,0 +1,26 @@
1
+ import { ExportableDeclaration } from '../declarations/Declaration';
2
+ import { Resource } from '../resources/Resource';
3
+ import { Export } from './Export';
4
+ /**
5
+ * Declares an all export (i.e. export * from ...).
6
+ *
7
+ * @export
8
+ * @class AssignedExport
9
+ * @implements {Export}
10
+ */
11
+ export declare class AssignedExport implements Export {
12
+ start: number;
13
+ end: number;
14
+ declarationIdentifier: string;
15
+ private resource;
16
+ /**
17
+ * Returns a list of exported objects of this export.
18
+ * This returns a list of possible exportable declarations or further exported resources.
19
+ *
20
+ * @readonly
21
+ * @type {((ExportableDeclaration | Resource)[])}
22
+ * @memberof AssignedExport
23
+ */
24
+ get exported(): (ExportableDeclaration | Resource)[];
25
+ constructor(start: number, end: number, declarationIdentifier: string, resource: Resource);
26
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssignedExport = void 0;
4
+ const Module_1 = require("../resources/Module");
5
+ const Namespace_1 = require("../resources/Namespace");
6
+ const TypescriptHeroGuards_1 = require("../type-guards/TypescriptHeroGuards");
7
+ /**
8
+ * Declares an all export (i.e. export * from ...).
9
+ *
10
+ * @export
11
+ * @class AssignedExport
12
+ * @implements {Export}
13
+ */
14
+ class AssignedExport {
15
+ constructor(start, end, declarationIdentifier, resource) {
16
+ this.start = start;
17
+ this.end = end;
18
+ this.declarationIdentifier = declarationIdentifier;
19
+ this.resource = resource;
20
+ }
21
+ /**
22
+ * Returns a list of exported objects of this export.
23
+ * This returns a list of possible exportable declarations or further exported resources.
24
+ *
25
+ * @readonly
26
+ * @type {((ExportableDeclaration | Resource)[])}
27
+ * @memberof AssignedExport
28
+ */
29
+ get exported() {
30
+ return [
31
+ ...this.resource.declarations
32
+ .filter(o => TypescriptHeroGuards_1.isExportableDeclaration(o) && o.isExported && o.name === this.declarationIdentifier),
33
+ ...this.resource.resources
34
+ .filter(o => (o instanceof Namespace_1.Namespace || o instanceof Module_1.Module) && o.name === this.declarationIdentifier),
35
+ ];
36
+ }
37
+ }
38
+ exports.AssignedExport = AssignedExport;
@@ -0,0 +1,10 @@
1
+ import { Node } from '../Node';
2
+ /**
3
+ * Basic export interface. Defines an export in a document.
4
+ *
5
+ * @export
6
+ * @interface Export
7
+ * @extends {Node}
8
+ */
9
+ export interface Export extends Node {
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import { SymbolSpecifier } from '../SymbolSpecifier';
2
+ import { Export } from './Export';
3
+ /**
4
+ * Declares a named export (i.e. export { Foobar } from ...).
5
+ *
6
+ * @export
7
+ * @class NamedExport
8
+ * @implements {Export}
9
+ */
10
+ export declare class NamedExport implements Export {
11
+ start: number;
12
+ end: number;
13
+ from: string;
14
+ specifiers: SymbolSpecifier[] | undefined;
15
+ constructor(start: number, end: number, from: string);
16
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NamedExport = void 0;
4
+ /**
5
+ * Declares a named export (i.e. export { Foobar } from ...).
6
+ *
7
+ * @export
8
+ * @class NamedExport
9
+ * @implements {Export}
10
+ */
11
+ class NamedExport {
12
+ constructor(start, end, from) {
13
+ this.start = start;
14
+ this.end = end;
15
+ this.from = from;
16
+ }
17
+ }
18
+ exports.NamedExport = NamedExport;
@@ -0,0 +1,4 @@
1
+ export * from './AllExport';
2
+ export * from './AssignedExport';
3
+ export * from './Export';
4
+ export * from './NamedExport';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./AllExport"), exports);
5
+ tslib_1.__exportStar(require("./AssignedExport"), exports);
6
+ tslib_1.__exportStar(require("./Export"), exports);
7
+ tslib_1.__exportStar(require("./NamedExport"), exports);
@@ -0,0 +1,25 @@
1
+ import { AliasedImport } from './Import';
2
+ /**
3
+ * Alternative to the namespace import. Can be used by various libraries.
4
+ * (i.e. import foobar = require('foobar')).
5
+ *
6
+ * @export
7
+ * @class ExternalModuleImport
8
+ * @implements {AliasedImport}
9
+ */
10
+ export declare class ExternalModuleImport implements AliasedImport {
11
+ libraryName: string;
12
+ alias: string;
13
+ start?: number | undefined;
14
+ end?: number | undefined;
15
+ get isNew(): boolean;
16
+ constructor(libraryName: string, alias: string, start?: number | undefined, end?: number | undefined);
17
+ /**
18
+ * Clone the current import object.
19
+ *
20
+ * @returns {ExternalModuleImport}
21
+ *
22
+ * @memberof ExternalModuleImport
23
+ */
24
+ clone(): ExternalModuleImport;
25
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExternalModuleImport = void 0;
4
+ /**
5
+ * Alternative to the namespace import. Can be used by various libraries.
6
+ * (i.e. import foobar = require('foobar')).
7
+ *
8
+ * @export
9
+ * @class ExternalModuleImport
10
+ * @implements {AliasedImport}
11
+ */
12
+ class ExternalModuleImport {
13
+ constructor(libraryName, alias, start, end) {
14
+ this.libraryName = libraryName;
15
+ this.alias = alias;
16
+ this.start = start;
17
+ this.end = end;
18
+ }
19
+ get isNew() {
20
+ return this.start === undefined || this.end === undefined;
21
+ }
22
+ /**
23
+ * Clone the current import object.
24
+ *
25
+ * @returns {ExternalModuleImport}
26
+ *
27
+ * @memberof ExternalModuleImport
28
+ */
29
+ clone() {
30
+ return new ExternalModuleImport(this.libraryName, this.alias, this.start, this.end);
31
+ }
32
+ }
33
+ exports.ExternalModuleImport = ExternalModuleImport;
@@ -0,0 +1,43 @@
1
+ import { Clonable } from '../clonable/Clonable';
2
+ import { Node } from '../Node';
3
+ /**
4
+ * Basic import interface. Defines an import in a document.
5
+ * If no start and end points are given, the import is considered "new".
6
+ *
7
+ * @export
8
+ * @interface Import
9
+ */
10
+ export interface Import extends Clonable<Import>, Node {
11
+ /**
12
+ * Indicates if the given import is "new" or a parsed one.
13
+ *
14
+ * @type {boolean}
15
+ * @memberof Import
16
+ */
17
+ readonly isNew: boolean;
18
+ /**
19
+ * The library name of the given import (This actually is the part after the import statement).
20
+ *
21
+ * @example "express"
22
+ *
23
+ * @type {string}
24
+ * @memberof Import
25
+ */
26
+ libraryName: string;
27
+ }
28
+ /**
29
+ * Basic interface for aliased imports. Defines an alias for namespace imports and other aliased imports.
30
+ *
31
+ * @export
32
+ * @interface AliasedImport
33
+ * @extends {Import}
34
+ */
35
+ export interface AliasedImport extends Import {
36
+ /**
37
+ * Alias for the given import. E.g. for a "* as ..." import.
38
+ *
39
+ * @type {string}
40
+ * @memberof AliasedImport
41
+ */
42
+ alias: string;
43
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ import { SymbolSpecifier } from '../SymbolSpecifier';
2
+ import { Import } from './Import';
3
+ /**
4
+ * Basic typescript import (ES6 style). Does contain multiple symbols of a file and converts
5
+ * itself to a multiline import if the threshold is reached.
6
+ * Can also contain a default import part.
7
+ * (i.e. import {Foobar} from ...).
8
+ *
9
+ * @export
10
+ * @class NamedImport
11
+ * @implements {Import}
12
+ */
13
+ export declare class NamedImport implements Import {
14
+ libraryName: string;
15
+ start?: number | undefined;
16
+ end?: number | undefined;
17
+ specifiers: SymbolSpecifier[];
18
+ defaultAlias?: string;
19
+ get isNew(): boolean;
20
+ constructor(libraryName: string, start?: number | undefined, end?: number | undefined);
21
+ /**
22
+ * Clone the current import object.
23
+ *
24
+ * @returns {NamedImport}
25
+ *
26
+ * @memberof NamedImport
27
+ */
28
+ clone(): NamedImport;
29
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NamedImport = void 0;
4
+ /**
5
+ * Basic typescript import (ES6 style). Does contain multiple symbols of a file and converts
6
+ * itself to a multiline import if the threshold is reached.
7
+ * Can also contain a default import part.
8
+ * (i.e. import {Foobar} from ...).
9
+ *
10
+ * @export
11
+ * @class NamedImport
12
+ * @implements {Import}
13
+ */
14
+ class NamedImport {
15
+ constructor(libraryName, start, end) {
16
+ this.libraryName = libraryName;
17
+ this.start = start;
18
+ this.end = end;
19
+ this.specifiers = [];
20
+ }
21
+ get isNew() {
22
+ return this.start === undefined || this.end === undefined;
23
+ }
24
+ /**
25
+ * Clone the current import object.
26
+ *
27
+ * @returns {NamedImport}
28
+ *
29
+ * @memberof NamedImport
30
+ */
31
+ clone() {
32
+ const clone = new NamedImport(this.libraryName, this.start, this.end);
33
+ clone.specifiers = this.specifiers.map(o => o.clone());
34
+ clone.defaultAlias = this.defaultAlias;
35
+ return clone;
36
+ }
37
+ }
38
+ exports.NamedImport = NamedImport;
@@ -0,0 +1,24 @@
1
+ import { AliasedImport } from './Import';
2
+ /**
3
+ * Import that imports a whole namespace (i.e. import * as foobar from 'foobar';).
4
+ *
5
+ * @export
6
+ * @class TsNamespaceImport
7
+ * @implements {AliasedImport}
8
+ */
9
+ export declare class NamespaceImport implements AliasedImport {
10
+ libraryName: string;
11
+ alias: string;
12
+ start?: number | undefined;
13
+ end?: number | undefined;
14
+ get isNew(): boolean;
15
+ constructor(libraryName: string, alias: string, start?: number | undefined, end?: number | undefined);
16
+ /**
17
+ * Clone the current import object.
18
+ *
19
+ * @returns {NamespaceImport}
20
+ *
21
+ * @memberof NamespaceImport
22
+ */
23
+ clone(): NamespaceImport;
24
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NamespaceImport = void 0;
4
+ /**
5
+ * Import that imports a whole namespace (i.e. import * as foobar from 'foobar';).
6
+ *
7
+ * @export
8
+ * @class TsNamespaceImport
9
+ * @implements {AliasedImport}
10
+ */
11
+ class NamespaceImport {
12
+ constructor(libraryName, alias, start, end) {
13
+ this.libraryName = libraryName;
14
+ this.alias = alias;
15
+ this.start = start;
16
+ this.end = end;
17
+ }
18
+ get isNew() {
19
+ return this.start === undefined || this.end === undefined;
20
+ }
21
+ /**
22
+ * Clone the current import object.
23
+ *
24
+ * @returns {NamespaceImport}
25
+ *
26
+ * @memberof NamespaceImport
27
+ */
28
+ clone() {
29
+ return new NamespaceImport(this.libraryName, this.alias, this.start, this.end);
30
+ }
31
+ }
32
+ exports.NamespaceImport = NamespaceImport;
@@ -0,0 +1,23 @@
1
+ import { Import } from './Import';
2
+ /**
3
+ * Simple string import (i.e. import "reflect-metadata";).
4
+ *
5
+ * @export
6
+ * @class StringImport
7
+ * @implements {Import}
8
+ */
9
+ export declare class StringImport implements Import {
10
+ libraryName: string;
11
+ start?: number | undefined;
12
+ end?: number | undefined;
13
+ get isNew(): boolean;
14
+ constructor(libraryName: string, start?: number | undefined, end?: number | undefined);
15
+ /**
16
+ * Clone the current import object.
17
+ *
18
+ * @returns {StringImport}
19
+ *
20
+ * @memberof StringImport
21
+ */
22
+ clone(): StringImport;
23
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StringImport = void 0;
4
+ /**
5
+ * Simple string import (i.e. import "reflect-metadata";).
6
+ *
7
+ * @export
8
+ * @class StringImport
9
+ * @implements {Import}
10
+ */
11
+ class StringImport {
12
+ constructor(libraryName, start, end) {
13
+ this.libraryName = libraryName;
14
+ this.start = start;
15
+ this.end = end;
16
+ }
17
+ get isNew() {
18
+ return this.start === undefined || this.end === undefined;
19
+ }
20
+ /**
21
+ * Clone the current import object.
22
+ *
23
+ * @returns {StringImport}
24
+ *
25
+ * @memberof StringImport
26
+ */
27
+ clone() {
28
+ return new StringImport(this.libraryName, this.start, this.end);
29
+ }
30
+ }
31
+ exports.StringImport = StringImport;
@@ -0,0 +1,5 @@
1
+ export * from './ExternalModuleImport';
2
+ export * from './Import';
3
+ export * from './NamedImport';
4
+ export * from './NamespaceImport';
5
+ export * from './StringImport';