jsii-reflect 1.35.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.
Files changed (67) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +189 -0
  3. package/bin/jsii-tree +2 -0
  4. package/bin/jsii-tree.d.ts +1 -0
  5. package/bin/jsii-tree.js +99 -0
  6. package/lib/assembly.d.ts +118 -0
  7. package/lib/assembly.js +285 -0
  8. package/lib/callable.d.ts +43 -0
  9. package/lib/callable.js +61 -0
  10. package/lib/class.d.ts +52 -0
  11. package/lib/class.js +110 -0
  12. package/lib/dependency.d.ts +8 -0
  13. package/lib/dependency.js +15 -0
  14. package/lib/docs.d.ts +53 -0
  15. package/lib/docs.js +107 -0
  16. package/lib/enum.d.ts +21 -0
  17. package/lib/enum.js +36 -0
  18. package/lib/index.d.ts +22 -0
  19. package/lib/index.js +35 -0
  20. package/lib/initializer.d.ts +11 -0
  21. package/lib/initializer.js +18 -0
  22. package/lib/interface.d.ts +43 -0
  23. package/lib/interface.js +85 -0
  24. package/lib/method.d.ts +42 -0
  25. package/lib/method.js +59 -0
  26. package/lib/module-like.d.ts +26 -0
  27. package/lib/module-like.js +50 -0
  28. package/lib/optional-value.d.ts +12 -0
  29. package/lib/optional-value.js +30 -0
  30. package/lib/overridable.d.ts +10 -0
  31. package/lib/overridable.js +3 -0
  32. package/lib/parameter.d.ts +22 -0
  33. package/lib/parameter.js +32 -0
  34. package/lib/property.d.ts +54 -0
  35. package/lib/property.js +82 -0
  36. package/lib/reference-type.d.ts +57 -0
  37. package/lib/reference-type.js +52 -0
  38. package/lib/source.d.ts +37 -0
  39. package/lib/source.js +43 -0
  40. package/lib/submodule.d.ts +24 -0
  41. package/lib/submodule.js +29 -0
  42. package/lib/tree.d.ts +51 -0
  43. package/lib/tree.js +281 -0
  44. package/lib/type-member.d.ts +18 -0
  45. package/lib/type-member.js +22 -0
  46. package/lib/type-ref.d.ts +17 -0
  47. package/lib/type-ref.js +78 -0
  48. package/lib/type-system.d.ts +93 -0
  49. package/lib/type-system.js +287 -0
  50. package/lib/type.d.ts +84 -0
  51. package/lib/type.js +139 -0
  52. package/lib/util.d.ts +3 -0
  53. package/lib/util.js +12 -0
  54. package/package.json +57 -0
  55. package/test/__snapshots__/jsii-tree.test.ts.snap +5625 -0
  56. package/test/__snapshots__/tree.test.ts.snap +3773 -0
  57. package/test/__snapshots__/type-system.test.ts.snap +194 -0
  58. package/test/independent.test.d.ts +1 -0
  59. package/test/independent.test.js +25 -0
  60. package/test/jsii-tree.test.d.ts +1 -0
  61. package/test/jsii-tree.test.js +28 -0
  62. package/test/tree.test.d.ts +1 -0
  63. package/test/tree.test.js +56 -0
  64. package/test/type-system.test.d.ts +1 -0
  65. package/test/type-system.test.js +344 -0
  66. package/test/util.d.ts +2 -0
  67. package/test/util.js +13 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,189 @@
1
+ # jsii-reflect: strongly-type reflection library and tools for jsii
2
+
3
+ **jsii-reflect** providers a reflection API for jsii type systems. It consumes
4
+ `.jsii` manifest files (either directly or by traversing a closure of npm
5
+ modules) and creates an in-memory object model that allows exploring the type
6
+ system via a strongly-typed API.
7
+
8
+ ## Installation
9
+
10
+ Install the npm module:
11
+
12
+ ```console
13
+ $ npm i jsii-reflect
14
+ ```
15
+
16
+ Import the `TypeSystem` class:
17
+
18
+ ```ts
19
+ import { TypeSystem } from 'jsii-reflect';
20
+ ```
21
+
22
+ ## Loading Assemblies
23
+
24
+ Create a `TypeSystem`:
25
+
26
+ ```ts
27
+ const typesystem = new TypeSystem();
28
+ ```
29
+
30
+ Now, we want to load assemblies into the type system via the `typesystem.load()`
31
+ method.
32
+
33
+ You can either pass in a path to a `.jsii` file, in which case you will have to
34
+ eventually load the .jsii files of all the dependencies.
35
+
36
+ ```ts
37
+ typesystem.load('jsii-calc/.jsii');
38
+ typesystem.load('jsii-calc-lib/.jsii');
39
+ typesystem.load('jsii-calc-base/.jsii');
40
+ typesystem.load('jsii-calc-base-of-base/.jsii');
41
+ ```
42
+
43
+ Or, you can point `load` to an npm module's directory, in which case the loader
44
+ will transitively load all dependent modules:
45
+
46
+ ```ts
47
+ // will automatically bring in all dependencies
48
+ typesystem.load('jsii-calc');
49
+ ```
50
+
51
+ ## Reflecting on the Type System
52
+
53
+ Now that your `TypeSystem` is loaded with assemblies, you can use the APIs to
54
+ query and reflect on the types.
55
+
56
+ For example:
57
+
58
+ ```ts
59
+ const calc = typesystem.findClass('jsii-calc.Calculator');
60
+
61
+ const actual = new Array<string>();
62
+ calc.getMethods(/* inherited */ true).forEach(method => {
63
+ actual.push(`${method.name} from ${method.parentType.name}`);
64
+ });
65
+
66
+ expect(actual).toEqual([
67
+ "typeName from Base",
68
+ "toString from Value",
69
+ "toString from Operation",
70
+ "toString from CompositeOperation",
71
+ "add from Calculator",
72
+ "mul from Calculator",
73
+ "neg from Calculator",
74
+ "pow from Calculator",
75
+ "readUnionValue from Calculator"
76
+ ]);
77
+ ```
78
+
79
+ ## jsii-tree
80
+
81
+ jsii-tree is a command-line tool which can be used to print an ASCII tree of
82
+ a jsii type system:
83
+
84
+ ```console
85
+ $ jsii-tree jsii-calc
86
+ assemblies
87
+ ├─┬ jsii-calc
88
+ │ └─┬ types
89
+ │ ├── AbstractClass class
90
+ │ ├── AbstractClassBase class
91
+ │ ├── AbstractClassReturner class
92
+ │ ├── Add class
93
+ │ ├── AllTypes class
94
+ │ ├── AllowedMethodNames class
95
+ │ ├── AsyncVirtualMethods class
96
+ │ ├── BinaryOperation class
97
+ │ ├── Calculator class
98
+ │ ├── ClassWithMutableObjectLiteralProperty class
99
+ │ ├── ClassWithPrivateConstructorAndAutomaticProperties class
100
+ │ ├── DefaultedConstructorArgument class
101
+ │ ├── Base class
102
+ │ ├── Derived class
103
+ │ ├── DoNotOverridePrivates class
104
+ │ ├── DoNotRecognizeAnyAsOptional class
105
+ │ ├── DontComplainAboutVariadicAfterOptional class
106
+ │ ├── DoubleTrouble class
107
+ │ ├── ExportedBaseClass class
108
+ │ ├── GiveMeStructs class
109
+ │ ├── GreetingAugmenter class
110
+ │ ├── Foo class
111
+ │ ├── JSObjectLiteralForInterface class
112
+ │ ├── JSObjectLiteralToNative class
113
+ │ ├── JSObjectLiteralToNativeClass class
114
+ │ ├── JavaReservedWords class
115
+ │ ├── JsiiAgent class
116
+ │ ├── Multiply class
117
+ │ ├── Negate class
118
+ │ ├── NodeStandardLibrary class
119
+ │ ├── NullShouldBeTreatedAsUndefined class
120
+ │ ├── NumberGenerator class
121
+ │ ├── ObjectRefsInCollections class
122
+ │ ├── OptionalConstructorArgument class
123
+ │ ├── OverrideReturnsObject class
124
+ │ ├── Polymorphism class
125
+ │ ├── Power class
126
+ │ ├── ReferenceEnumFromScopedPackage class
127
+ │ ├── ReturnsPrivateImplementationOfInterface class
128
+ │ ├── RuntimeTypeChecking class
129
+ │ ├── Statics class
130
+ │ ├── Sum class
131
+ │ ├── SyncVirtualMethods class
132
+ │ ├── Thrower class
133
+ │ ├── UnaryOperation class
134
+ │ ├── UseBundledDependency class
135
+ │ ├── UseCalcBase class
136
+ │ ├── UsesInterfaceWithProperties class
137
+ │ ├── VariadicMethod class
138
+ │ ├── VirtualMethodPlayground class
139
+ │ ├── CompositeOperation class
140
+ │ ├── CalculatorProps interface
141
+ │ ├── DerivedStruct interface
142
+ │ ├── IFriendlier interface
143
+ │ ├── IFriendlyRandomGenerator interface
144
+ │ ├── IInterfaceThatShouldNotBeADataType interface
145
+ │ ├── IInterfaceWithMethods interface
146
+ │ ├── IInterfaceWithOptionalMethodArguments interface
147
+ │ ├── IPrivatelyImplemented interface
148
+ │ ├── IRandomNumberGenerator interface
149
+ │ ├── IReturnsNumber interface
150
+ │ ├── ImplictBaseOfBase interface
151
+ │ ├── IInterfaceImplementedByAbstractClass interface
152
+ │ ├── Hello interface
153
+ │ ├── Hello interface
154
+ │ ├── InterfaceWithProperties interface
155
+ │ ├── InterfaceWithPropertiesExtension interface
156
+ │ ├── LoadBalancedFargateServiceProps interface
157
+ │ ├── MutableObjectLiteral interface
158
+ │ ├── NullShouldBeTreatedAsUndefinedData interface
159
+ │ ├── UnionProperties interface
160
+ │ ├── AllTypesEnum enum
161
+ │ ├── StringEnum enum
162
+ │ └── CompositionStringStyle enum
163
+ ├─┬ @scope/jsii-calc-base
164
+ │ └─┬ types
165
+ │ ├── Base class
166
+ │ └── BaseProps interface
167
+ ├─┬ @scope/jsii-calc-base-of-base
168
+ │ └─┬ types
169
+ │ ├── Very class
170
+ │ └── VeryBaseProps interface
171
+ └─┬ @scope/jsii-calc-lib
172
+ └─┬ types
173
+ ├── Number class
174
+ ├── Operation class
175
+ ├── Value class
176
+ ├── IDoublable interface
177
+ ├── IFriendly interface
178
+ ├── MyFirstStruct interface
179
+ ├── StructWithOnlyOptionals interface
180
+ └── EnumFromScopedModule enum
181
+ ```
182
+
183
+ See `jsii-tree --help` for options.
184
+
185
+ ## License
186
+
187
+ Distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
188
+
189
+ See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for more information.
package/bin/jsii-tree ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require('./jsii-tree.js');
@@ -0,0 +1 @@
1
+ import '@jsii/check-node/run';
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("@jsii/check-node/run");
4
+ const colors = require("colors/safe");
5
+ const yargs = require("yargs");
6
+ const lib_1 = require("../lib");
7
+ async function main() {
8
+ var _a;
9
+ const options = yargs
10
+ .usage('$0 [JSII-FILE | MODULE-DIR...]', 'Prints an ASCII tree representation of a jsii type system.', (args) => args
11
+ .positional('JSII-FILE', {
12
+ type: 'string',
13
+ desc: 'path to a .jsii file to load, all dependency .jsii files must be explicitly supplied',
14
+ })
15
+ .positional('MODULE-DIR', {
16
+ type: 'string',
17
+ desc: 'path to an jsii npm module directory, all jsii dependencies will be loaded transitively',
18
+ }))
19
+ .option('closure', {
20
+ type: 'string',
21
+ alias: 'c',
22
+ desc: 'Load dependencies of package without assuming its a JSII package itself',
23
+ })
24
+ .option('all', {
25
+ type: 'boolean',
26
+ alias: 'a',
27
+ desc: 'show all details',
28
+ default: false,
29
+ })
30
+ .option('colors', {
31
+ type: 'boolean',
32
+ desc: 'enable/disable ANSI colors in output',
33
+ default: true,
34
+ })
35
+ .option('dependencies', {
36
+ type: 'boolean',
37
+ alias: 'd',
38
+ desc: 'show assembly dependencies',
39
+ default: false,
40
+ })
41
+ .option('inheritance', {
42
+ type: 'boolean',
43
+ alias: 'i',
44
+ desc: 'show base classes and implemented interfaces',
45
+ default: false,
46
+ })
47
+ .option('members', {
48
+ type: 'boolean',
49
+ alias: 'm',
50
+ desc: 'show type members',
51
+ default: false,
52
+ })
53
+ .option('signatures', {
54
+ type: 'boolean',
55
+ alias: 's',
56
+ desc: 'show method and property signatures',
57
+ default: false,
58
+ })
59
+ .option('types', {
60
+ type: 'boolean',
61
+ alias: 't',
62
+ desc: 'show types',
63
+ default: false,
64
+ })
65
+ .option('validate', {
66
+ type: 'boolean',
67
+ alias: 'V',
68
+ desc: 'Validate that assemblies match schema while loading',
69
+ default: true,
70
+ })
71
+ .option('stabilities', {
72
+ type: 'boolean',
73
+ alias: 'S',
74
+ desc: 'Show stabilities',
75
+ default: false,
76
+ }).argv;
77
+ const typesys = new lib_1.TypeSystem();
78
+ if (options.closure) {
79
+ await typesys.loadNpmDependencies(options.closure, {
80
+ validate: options.validate,
81
+ });
82
+ }
83
+ await Promise.all(((_a = options.jsiiFile) !== null && _a !== void 0 ? _a : []).map((fileOrDirectory) => typesys.load(fileOrDirectory, { validate: options.validate })));
84
+ const tst = new lib_1.TypeSystemTree(typesys, {
85
+ dependencies: options.dependencies || options.all,
86
+ types: options.types || options.all || options.members || options.inheritance,
87
+ members: options.members || options.all,
88
+ inheritance: options.inheritance || options.all,
89
+ signatures: options.signatures || options.all,
90
+ stabilities: options.stabilities || options.all,
91
+ colors: options.colors,
92
+ });
93
+ tst.printTree();
94
+ }
95
+ main().catch((e) => {
96
+ console.log(colors.red(e));
97
+ process.exit(1);
98
+ });
99
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNpaS10cmVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsianNpaS10cmVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsZ0NBQThCO0FBRTlCLHNDQUFzQztBQUN0QywrQkFBK0I7QUFFL0IsZ0NBQW9EO0FBRXBELEtBQUssVUFBVSxJQUFJOztJQUNqQixNQUFNLE9BQU8sR0FBRyxLQUFLO1NBQ2xCLEtBQUssQ0FDSixnQ0FBZ0MsRUFDaEMsNERBQTRELEVBQzVELENBQUMsSUFBSSxFQUFFLEVBQUUsQ0FDUCxJQUFJO1NBQ0QsVUFBVSxDQUFDLFdBQVcsRUFBRTtRQUN2QixJQUFJLEVBQUUsUUFBUTtRQUNkLElBQUksRUFBRSxzRkFBc0Y7S0FDN0YsQ0FBQztTQUNELFVBQVUsQ0FBQyxZQUFZLEVBQUU7UUFDeEIsSUFBSSxFQUFFLFFBQVE7UUFDZCxJQUFJLEVBQUUseUZBQXlGO0tBQ2hHLENBQUMsQ0FDUDtTQUNBLE1BQU0sQ0FBQyxTQUFTLEVBQUU7UUFDakIsSUFBSSxFQUFFLFFBQVE7UUFDZCxLQUFLLEVBQUUsR0FBRztRQUNWLElBQUksRUFBRSx5RUFBeUU7S0FDaEYsQ0FBQztTQUNELE1BQU0sQ0FBQyxLQUFLLEVBQUU7UUFDYixJQUFJLEVBQUUsU0FBUztRQUNmLEtBQUssRUFBRSxHQUFHO1FBQ1YsSUFBSSxFQUFFLGtCQUFrQjtRQUN4QixPQUFPLEV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cml0YW5jZTogb3B0aW9ucy5pbmhlcml0YW5jZSB8fCBvcHRpb25zLmFsbCxcbiAgICBzaWduYXR1cmVzOiBvcHRpb25zLnNpZ25hdHVyZXMgfHwgb3B0aW9ucy5hbGwsXG4gICAgc3RhYmlsaXRpZXM6IG9wdGlvbnMuc3RhYmlsaXRpZXMgfHwgb3B0aW9ucy5hbGwsXG4gICAgY29sb3JzOiBvcHRpb25zLmNvbG9ycyxcbiAgfSk7XG5cbiAgdHN0LnByaW50VHJlZSgpO1xufVxuXG5tYWluKCkuY2F0Y2goKGUpID0+IHtcbiAgY29uc29sZS5sb2coY29sb3JzLnJlZChlKSk7XG4gIHByb2Nlc3MuZXhpdCgxKTtcbn0pO1xuIl19
@@ -0,0 +1,118 @@
1
+ import * as jsii from '@jsii/spec';
2
+ import { Dependency } from './dependency';
3
+ import { ModuleLike } from './module-like';
4
+ import { Submodule } from './submodule';
5
+ import { Type } from './type';
6
+ import { TypeSystem } from './type-system';
7
+ export declare class Assembly extends ModuleLike {
8
+ readonly spec: jsii.Assembly;
9
+ private _typeCache?;
10
+ private _submoduleCache?;
11
+ private _dependencyCache?;
12
+ constructor(system: TypeSystem, spec: jsii.Assembly);
13
+ get fqn(): string;
14
+ /**
15
+ * The version of the spec schema
16
+ */
17
+ get schema(): jsii.SchemaVersion;
18
+ /**
19
+ * The version of the jsii compiler that was used to produce this Assembly.
20
+ */
21
+ get jsiiVersion(): string;
22
+ /**
23
+ * The name of the assembly
24
+ */
25
+ get name(): string;
26
+ /**
27
+ * Description of the assembly, maps to "description" from package.json
28
+ * This is required since some package managers (like Maven) require it.
29
+ */
30
+ get description(): string;
31
+ /**
32
+ * The metadata associated with the assembly, if any.
33
+ */
34
+ get metadata(): {
35
+ readonly [key: string]: any;
36
+ } | undefined;
37
+ /**
38
+ * The url to the project homepage. Maps to "homepage" from package.json.
39
+ */
40
+ get homepage(): string;
41
+ /**
42
+ * The module repository, maps to "repository" from package.json
43
+ * This is required since some package managers (like Maven) require it.
44
+ */
45
+ get repository(): {
46
+ readonly type: string;
47
+ readonly url: string;
48
+ readonly directory?: string;
49
+ };
50
+ /**
51
+ * The main author of this package.
52
+ */
53
+ get author(): jsii.Person;
54
+ /**
55
+ * Additional contributors to this package.
56
+ */
57
+ get contributors(): readonly jsii.Person[];
58
+ /**
59
+ * A fingerprint that can be used to determine if the specification has changed.
60
+ */
61
+ get fingerprint(): string;
62
+ /**
63
+ * The version of the assembly
64
+ */
65
+ get version(): string;
66
+ /**
67
+ * The SPDX name of the license this assembly is distributed on.
68
+ */
69
+ get license(): string;
70
+ /**
71
+ * A map of target name to configuration, which is used when generating packages for
72
+ * various languages.
73
+ */
74
+ get targets(): jsii.AssemblyTargets | undefined;
75
+ /**
76
+ * Dependencies on other assemblies (with semver), the key is the JSII assembly name.
77
+ */
78
+ get dependencies(): readonly Dependency[];
79
+ findDependency(name: string): Dependency;
80
+ /**
81
+ * List if bundled dependencies (these are not expected to be jsii assemblies).
82
+ */
83
+ get bundled(): {
84
+ readonly [module: string]: string;
85
+ };
86
+ /**
87
+ * The top-level readme document for this assembly (if any).
88
+ */
89
+ get readme(): jsii.ReadMe | undefined;
90
+ /**
91
+ * Return the those submodules nested directly under the assembly
92
+ */
93
+ get submodules(): readonly Submodule[];
94
+ /**
95
+ * Return all submodules, even those transtively nested
96
+ */
97
+ get allSubmodules(): readonly Submodule[];
98
+ findType(fqn: string): Type;
99
+ /**
100
+ * Validate an assembly after loading
101
+ *
102
+ * If the assembly was loaded without validation, call this to validate
103
+ * it after all. Throws an exception if validation fails.
104
+ */
105
+ validate(): void;
106
+ protected get submoduleMap(): Readonly<Record<string, Submodule>>;
107
+ /**
108
+ * All types in the root of the assembly
109
+ */
110
+ protected get typeMap(): Readonly<Record<string, Type>>;
111
+ private get _dependencies();
112
+ private _analyzeTypes;
113
+ /**
114
+ * Return a builder for all submodules in this assembly (so that we can
115
+ * add types into the objects).
116
+ */
117
+ private discoverSubmodules;
118
+ }