jsii 5.9.5-dev.4 → 5.9.5-dev.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.
@@ -1,19 +0,0 @@
1
- import * as spec from '@jsii/spec';
2
- export interface TypeReferenceVisitor<A = void> {
3
- named(ref: spec.NamedTypeReference): A;
4
- primitive(ref: spec.PrimitiveTypeReference): A;
5
- collection(ref: spec.CollectionTypeReference): A;
6
- union(ref: spec.UnionTypeReference): A;
7
- intersection(ref: spec.IntersectionTypeReference): A;
8
- }
9
- export declare function visitTypeReference<A>(typeRef: spec.TypeReference, visitor: TypeReferenceVisitor<A>): A;
10
- export interface TypeVisitor<A = void> {
11
- classType(t: spec.ClassType): A;
12
- interfaceType(t: spec.InterfaceType): A;
13
- dataType(t: spec.InterfaceType): A;
14
- enumType(t: spec.EnumType): A;
15
- }
16
- export declare function visitType<A>(t: spec.Type, visitor: TypeVisitor<A>): A;
17
- export declare function isDataType(t: spec.Type): t is spec.InterfaceType;
18
- export declare function isBehavioralInterfaceType(t: spec.Type): t is spec.InterfaceType;
19
- //# sourceMappingURL=type-visitor.d.ts.map
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.visitTypeReference = visitTypeReference;
4
- exports.visitType = visitType;
5
- exports.isDataType = isDataType;
6
- exports.isBehavioralInterfaceType = isBehavioralInterfaceType;
7
- const spec = require("@jsii/spec");
8
- function visitTypeReference(typeRef, visitor) {
9
- if (spec.isNamedTypeReference(typeRef)) {
10
- return visitor.named(typeRef);
11
- }
12
- else if (spec.isPrimitiveTypeReference(typeRef)) {
13
- return visitor.primitive(typeRef);
14
- }
15
- else if (spec.isCollectionTypeReference(typeRef)) {
16
- return visitor.collection(typeRef);
17
- }
18
- else if (spec.isUnionTypeReference(typeRef)) {
19
- return visitor.union(typeRef);
20
- }
21
- else if (spec.isIntersectionTypeReference(typeRef)) {
22
- return visitor.intersection(typeRef);
23
- }
24
- else {
25
- throw new Error(`Unknown type reference: ${JSON.stringify(typeRef)}`);
26
- }
27
- }
28
- function visitType(t, visitor) {
29
- if (spec.isClassType(t)) {
30
- return visitor.classType(t);
31
- }
32
- else if (spec.isInterfaceType(t) && t.datatype) {
33
- return visitor.dataType(t);
34
- }
35
- else if (spec.isInterfaceType(t)) {
36
- return visitor.interfaceType(t);
37
- }
38
- else if (spec.isEnumType(t)) {
39
- return visitor.enumType(t);
40
- }
41
- else {
42
- throw new Error(`Unknown type: ${JSON.stringify(t)}`);
43
- }
44
- }
45
- function isDataType(t) {
46
- return spec.isInterfaceType(t) && !!t.datatype;
47
- }
48
- function isBehavioralInterfaceType(t) {
49
- return spec.isInterfaceType(t) && !t.datatype;
50
- }
51
- //# sourceMappingURL=type-visitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-visitor.js","sourceRoot":"","sources":["../src/type-visitor.ts"],"names":[],"mappings":";;AAUA,gDAcC;AASD,8BAYC;AAED,gCAEC;AAED,8DAEC;AArDD,mCAAmC;AAUnC,SAAgB,kBAAkB,CAAI,OAA2B,EAAE,OAAgC;IACjG,IAAI,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;SAAM,IAAI,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,CAAC;QAClD,OAAO,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;SAAM,IAAI,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;SAAM,IAAI,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9C,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;SAAM,IAAI,IAAI,CAAC,2B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export interface TypeReferenceVisitor<A = void> {\n named(ref: spec.NamedTypeReference): A;\n primitive(ref: spec.PrimitiveTypeReference): A;\n collection(ref: spec.CollectionTypeReference): A;\n union(ref: spec.UnionTypeReference): A;\n intersection(ref: spec.IntersectionTypeReference): A;\n}\n\nexport function visitTypeReference<A>(typeRef: spec.TypeReference, visitor: TypeReferenceVisitor<A>) {\n if (spec.isNamedTypeReference(typeRef)) {\n return visitor.named(typeRef);\n } else if (spec.isPrimitiveTypeReference(typeRef)) {\n return visitor.primitive(typeRef);\n } else if (spec.isCollectionTypeReference(typeRef)) {\n return visitor.collection(typeRef);\n } else if (spec.isUnionTypeReference(typeRef)) {\n return visitor.union(typeRef);\n } else if (spec.isIntersectionTypeReference(typeRef)) {\n return visitor.intersection(typeRef);\n } else {\n throw new Error(`Unknown type reference: ${JSON.stringify(typeRef)}`);\n }\n}\n\nexport interface TypeVisitor<A = void> {\n classType(t: spec.ClassType): A;\n interfaceType(t: spec.InterfaceType): A;\n dataType(t: spec.InterfaceType): A;\n enumType(t: spec.EnumType): A;\n}\n\nexport function visitType<A>(t: spec.Type, visitor: TypeVisitor<A>) {\n if (spec.isClassType(t)) {\n return visitor.classType(t);\n } else if (spec.isInterfaceType(t) && t.datatype) {\n return visitor.dataType(t);\n } else if (spec.isInterfaceType(t)) {\n return visitor.interfaceType(t);\n } else if (spec.isEnumType(t)) {\n return visitor.enumType(t);\n } else {\n throw new Error(`Unknown type: ${JSON.stringify(t)}`);\n }\n}\n\nexport function isDataType(t: spec.Type): t is spec.InterfaceType {\n return spec.isInterfaceType(t) && !!t.datatype;\n}\n\nexport function isBehavioralInterfaceType(t: spec.Type): t is spec.InterfaceType {\n return spec.isInterfaceType(t) && !t.datatype;\n}\n"]}