@teambit/semantics.entities.semantic-schema 0.0.48 → 0.0.49

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/api-schema.ts CHANGED
@@ -13,19 +13,23 @@ import {
13
13
  VariableLikeSchema,
14
14
  } from './schemas';
15
15
  import { Location, SchemaNode } from './schema-node';
16
- import { schemaObjToInstance } from './class-transformers';
16
+ import { schemaObjArrayToInstances, schemaObjToInstance } from './class-transformers';
17
17
  import { componentIdTransformer } from './class-transformers/comp-id-transformer';
18
18
 
19
19
  export class APISchema extends SchemaNode {
20
20
  @Transform(schemaObjToInstance)
21
- readonly module: ModuleSchema;
21
+ readonly module: ModuleSchema; // index
22
+
23
+ @Transform(schemaObjArrayToInstances)
24
+ readonly internals: ModuleSchema[];
22
25
 
23
26
  @Transform(componentIdTransformer)
24
27
  readonly componentId: ComponentID;
25
28
 
26
- constructor(readonly location: Location, module: ModuleSchema, componentId: ComponentID) {
29
+ constructor(readonly location: Location, module: ModuleSchema, internals: ModuleSchema[], componentId: ComponentID) {
27
30
  super();
28
31
  this.module = module;
32
+ this.internals = internals;
29
33
  this.componentId = componentId;
30
34
  }
31
35
 
@@ -73,7 +77,8 @@ export class APISchema extends SchemaNode {
73
77
  static empty(componentId: ComponentID) {
74
78
  return new APISchema(
75
79
  { filePath: '', line: 0, character: 0 },
76
- new ModuleSchema({ filePath: '', line: 0, character: 0 }, []),
80
+ new ModuleSchema({ filePath: '', line: 0, character: 0 }, [], []),
81
+ [],
77
82
  componentId
78
83
  );
79
84
  }
@@ -4,8 +4,9 @@ import { Location, SchemaNode } from './schema-node';
4
4
  export declare class APISchema extends SchemaNode {
5
5
  readonly location: Location;
6
6
  readonly module: ModuleSchema;
7
+ readonly internals: ModuleSchema[];
7
8
  readonly componentId: ComponentID;
8
- constructor(location: Location, module: ModuleSchema, componentId: ComponentID);
9
+ constructor(location: Location, module: ModuleSchema, internals: ModuleSchema[], componentId: ComponentID);
9
10
  toString(): string;
10
11
  toStringPerType(): string;
11
12
  listSignatures(): string[];
@@ -17,10 +17,11 @@ const schema_node_1 = require("./schema-node");
17
17
  const class_transformers_1 = require("./class-transformers");
18
18
  const comp_id_transformer_1 = require("./class-transformers/comp-id-transformer");
19
19
  class APISchema extends schema_node_1.SchemaNode {
20
- constructor(location, module, componentId) {
20
+ constructor(location, module, internals, componentId) {
21
21
  super();
22
22
  this.location = location;
23
23
  this.module = module;
24
+ this.internals = internals;
24
25
  this.componentId = componentId;
25
26
  }
26
27
  toString() {
@@ -53,12 +54,15 @@ class APISchema extends schema_node_1.SchemaNode {
53
54
  return (0, class_transformer_1.plainToInstance)(APISchema, obj);
54
55
  }
55
56
  static empty(componentId) {
56
- return new APISchema({ filePath: '', line: 0, character: 0 }, new schemas_1.ModuleSchema({ filePath: '', line: 0, character: 0 }, []), componentId);
57
+ return new APISchema({ filePath: '', line: 0, character: 0 }, new schemas_1.ModuleSchema({ filePath: '', line: 0, character: 0 }, [], []), [], componentId);
57
58
  }
58
59
  }
59
60
  __decorate([
60
61
  (0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
61
62
  ], APISchema.prototype, "module", void 0);
63
+ __decorate([
64
+ (0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
65
+ ], APISchema.prototype, "internals", void 0);
62
66
  __decorate([
63
67
  (0, class_transformer_1.Transform)(comp_id_transformer_1.componentIdTransformer)
64
68
  ], APISchema.prototype, "componentId", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"api-schema.js","sourceRoot":"","sources":["../api-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA+D;AAC/D,kDAA0B;AAE1B,uCAUmB;AACnB,+CAAqD;AACrD,6DAA2D;AAC3D,kFAAkF;AAElF,MAAa,SAAU,SAAQ,wBAAU;IAOvC,YAAqB,QAAkB,EAAE,MAAoB,EAAE,WAAwB;QACrF,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAA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AAU,CAAC,0BAAgB,EAAE,YAAY,CAAC,CAC3C,CAAC;IACJ,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,OAAO,IAAA,mCAAe,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAwB;QACnC,OAAO,IAAI,SAAS,CAClB,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EACvC,IAAI,sBAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EACjE,EAAE,EACF,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AAhEC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;yCACD;AAG9B;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;4CACF;AAGnC;IADC,IAAA,6BAAS,EAAC,4CAAsB,CAAC;8CACA;AARpC,8BAkEC"}
@@ -1,5 +1,5 @@
1
1
  ;
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.48/dist/semantic-schema.docs.md';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.49/dist/semantic-schema.docs.md';
3
3
 
4
4
  export const compositions = [];
5
5
  export const overview = [overview_0];
@@ -1,9 +1,8 @@
1
- import { Location, SchemaNode } from '../schema-node';
1
+ import { Location } from '../schema-node';
2
2
  import { ParameterSchema } from './parameter';
3
- export declare class ConstructorSchema extends SchemaNode {
4
- readonly location: Location;
5
- readonly signature?: string;
6
- readonly params: ParameterSchema[];
7
- constructor(location: Location, params: ParameterSchema[], signature?: string);
8
- toString(): string;
3
+ import { FunctionLikeSchema, Modifier } from './function-like';
4
+ import { DocSchema } from './docs';
5
+ import { ThisTypeSchema } from './this-type';
6
+ export declare class ConstructorSchema extends FunctionLikeSchema {
7
+ constructor(location: Location, params: ParameterSchema[], returns: ThisTypeSchema, signature: string, modifiers?: Modifier[], doc?: DocSchema);
9
8
  }
@@ -1,33 +1,11 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.ConstructorSchema = void 0;
13
- const class_transformer_1 = require("class-transformer");
14
- const chalk_1 = __importDefault(require("chalk"));
15
- const schema_node_1 = require("../schema-node");
16
- const class_transformers_1 = require("../class-transformers");
17
- class ConstructorSchema extends schema_node_1.SchemaNode {
18
- constructor(location, params, signature) {
19
- super();
20
- this.location = location;
21
- this.signature = signature;
22
- this.params = params;
23
- }
24
- toString() {
25
- const paramsStr = this.params.map((param) => param.toString()).join(', ');
26
- return `${chalk_1.default.bold('constructor')}(${paramsStr})`;
4
+ const function_like_1 = require("./function-like");
5
+ class ConstructorSchema extends function_like_1.FunctionLikeSchema {
6
+ constructor(location, params, returns, signature, modifiers = [], doc) {
7
+ super(location, 'constructor', params, returns, signature, modifiers, doc, undefined);
27
8
  }
28
9
  }
29
- __decorate([
30
- (0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
31
- ], ConstructorSchema.prototype, "params", void 0);
32
10
  exports.ConstructorSchema = ConstructorSchema;
33
11
  //# sourceMappingURL=constructor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constructor.js","sourceRoot":"","sources":["../../schemas/constructor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AAEtD,8DAAkE;AAElE,MAAa,iBAAkB,SAAQ,wBAAU;IAG/C,YAAqB,QAAkB,EAAE,MAAyB,EAAW,SAAkB;QAC7F,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAsC,cAAS,GAAT,SAAS,CAAS;QAE7F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,QAAQ;QACN,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1E,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,SAAS,GAAG,CAAC;IACtD,CAAC;CACF;AAVC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;iDACF;AAFrC,8CAYC"}
1
+ {"version":3,"file":"constructor.js","sourceRoot":"","sources":["../../schemas/constructor.ts"],"names":[],"mappings":";;;AAEA,mDAA+D;AAI/D,MAAa,iBAAkB,SAAQ,kCAAkB;IACvD,YACE,QAAkB,EAClB,MAAyB,EACzB,OAAuB,EACvB,SAAiB,EACjB,YAAwB,EAAE,EAC1B,GAAe;QAEf,KAAK,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IACxF,CAAC;CACF;AAXD,8CAWC"}
@@ -2,8 +2,9 @@ import { Location, SchemaNode } from '../schema-node';
2
2
  export declare class ModuleSchema extends SchemaNode {
3
3
  readonly location: Location;
4
4
  exports: SchemaNode[];
5
+ internals: SchemaNode[];
5
6
  namespace?: string;
6
- constructor(location: Location, exports: SchemaNode[]);
7
+ constructor(location: Location, exports: SchemaNode[], internals: SchemaNode[]);
7
8
  toObject(): {
8
9
  constructorName: string;
9
10
  namespace: string;
@@ -15,10 +15,11 @@ const class_transformer_1 = require("class-transformer");
15
15
  const schema_node_1 = require("../schema-node");
16
16
  const class_transformers_1 = require("../class-transformers");
17
17
  class ModuleSchema extends schema_node_1.SchemaNode {
18
- constructor(location, exports) {
18
+ constructor(location, exports, internals) {
19
19
  super();
20
20
  this.location = location;
21
21
  this.exports = exports;
22
+ this.internals = internals;
22
23
  }
23
24
  toObject() {
24
25
  return {
@@ -48,5 +49,8 @@ class ModuleSchema extends schema_node_1.SchemaNode {
48
49
  __decorate([
49
50
  (0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
50
51
  ], ModuleSchema.prototype, "exports", void 0);
52
+ __decorate([
53
+ (0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
54
+ ], ModuleSchema.prototype, "internals", void 0);
51
55
  exports.ModuleSchema = ModuleSchema;
52
56
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../schemas/module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA0B;AAC1B,yDAA8C;AAC9C,gDAAsD;AACtD,8DAAkE;AAElE,MAAa,YAAa,SAAQ,wBAAU;IAI1C,YAAqB,QAAkB,EAAE,OAAqB;QAC5D,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAErC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED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,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3E,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,UAAU,EAAE,CAAC;IAClE,CAAC;CACF;AAxCC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;6CACf;AAGtB;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;+CACb;AAL1B,oCA0CC"}
@@ -8,8 +8,9 @@ export declare type PlainTypeRefSchema = {
8
8
  /**
9
9
  * can be one of the following:
10
10
  * 1. a reference to another "export" in the same component
11
- * 2. a reference to another component.
12
- * 3. a reference to a package.
11
+ * 2 a reference to another declaration in the same file (internal)
12
+ * 3. a reference to another component.
13
+ * 4. a reference to a package.
13
14
  */
14
15
  export declare class TypeRefSchema extends SchemaNode {
15
16
  readonly location: Location;
@@ -21,6 +22,7 @@ export declare class TypeRefSchema extends SchemaNode {
21
22
  * target package name. existing if type is defined in different package.
22
23
  */
23
24
  readonly packageName?: string;
25
+ readonly internalFilePath?: string;
24
26
  /**
25
27
  * optional type arguments, e.g. type Foo = Bar<X, Y>. The X and Y are type arguments.
26
28
  */
@@ -38,7 +40,7 @@ export declare class TypeRefSchema extends SchemaNode {
38
40
  /**
39
41
  * target package name. existing if type is defined in different package.
40
42
  */
41
- packageName?: string);
43
+ packageName?: string, internalFilePath?: string);
42
44
  toString(): string;
43
45
  private nameToString;
44
46
  /**
@@ -18,8 +18,9 @@ const comp_id_transformer_1 = require("../class-transformers/comp-id-transformer
18
18
  /**
19
19
  * can be one of the following:
20
20
  * 1. a reference to another "export" in the same component
21
- * 2. a reference to another component.
22
- * 3. a reference to a package.
21
+ * 2 a reference to another declaration in the same file (internal)
22
+ * 3. a reference to another component.
23
+ * 4. a reference to a package.
23
24
  */
24
25
  class TypeRefSchema extends schema_node_1.SchemaNode {
25
26
  constructor(location,
@@ -34,11 +35,12 @@ class TypeRefSchema extends schema_node_1.SchemaNode {
34
35
  /**
35
36
  * target package name. existing if type is defined in different package.
36
37
  */
37
- packageName) {
38
+ packageName, internalFilePath) {
38
39
  super();
39
40
  this.location = location;
40
41
  this.name = name;
41
42
  this.packageName = packageName;
43
+ this.internalFilePath = internalFilePath;
42
44
  this.componentId = componentId;
43
45
  }
44
46
  toString() {
@@ -1 +1 @@
1
- {"version":3,"file":"type-ref.js","sourceRoot":"","sources":["../../schemas/type-ref.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAE9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAkE;AAClE,mFAAmF;AAQnF;;;;;GAKG;AACH,MAAa,aAAc,SAAQ,wBAAU;IAU3C,YACW,QAAkB;IAC3B;;OAEG;IACM,IAAY;IAErB;;OAEG;IACH,WAAyB;IAEzB;;OAEG;IACM,WAAoB;QAE7B,KAAK,EAAE,CAAC;QAhBC,aAAQ,GAAR,QAAQ,CAAU;QAIlB,SAAI,GAAJ,IAAI,CAAQ;QAUZ,gBAAW,GAAX,WAAW,CAAS;QAG7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,QAAQ;QACN,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;IAC5B,CAAC;IAEO,YAAY;QAClB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,OAAO,GAAG,eAAK,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,WAAW,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;YACvF,OAAO,GAAG,OAAO,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Q,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;IAC5B,CAAC;IAEO,YAAY;QAClB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,OAAO,GAAG,eAAK,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,WAAW,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;YACvF,OAAO,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;SAClC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,MAAM,GAAG,eAAK,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;YAC3D,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;SACjC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;IAChD,CAAC;CACF;AAvDC;IAJC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;+CAIb;AAGxB;IADC,IAAA,6BAAS,EAAC,4CAAsB,CAAC;kDACC;AARrC,sCA4DC"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/semantics.entities.semantic-schema",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "homepage": "https://bit.dev/teambit/semantics/entities/semantic-schema",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.semantics",
8
8
  "name": "entities/semantic-schema",
9
- "version": "0.0.48"
9
+ "version": "0.0.49"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -17,9 +17,9 @@
17
17
  "devDependencies": {
18
18
  "@types/lodash": "4.14.165",
19
19
  "@types/mocha": "9.1.0",
20
- "@babel/runtime": "7.20.0",
20
+ "@types/jest": "26.0.20",
21
21
  "@types/node": "12.20.4",
22
- "@types/jest": "26.0.20"
22
+ "@babel/runtime": "7.20.0"
23
23
  },
24
24
  "peerDependencies": {},
25
25
  "license": "Apache-2.0",
@@ -1,19 +1,18 @@
1
- import { Transform } from 'class-transformer';
2
- import chalk from 'chalk';
3
- import { Location, SchemaNode } from '../schema-node';
1
+ import { Location } from '../schema-node';
4
2
  import { ParameterSchema } from './parameter';
5
- import { schemaObjArrayToInstances } from '../class-transformers';
3
+ import { FunctionLikeSchema, Modifier } from './function-like';
4
+ import { DocSchema } from './docs';
5
+ import { ThisTypeSchema } from './this-type';
6
6
 
7
- export class ConstructorSchema extends SchemaNode {
8
- @Transform(schemaObjArrayToInstances)
9
- readonly params: ParameterSchema[];
10
- constructor(readonly location: Location, params: ParameterSchema[], readonly signature?: string) {
11
- super();
12
- this.params = params;
13
- }
14
-
15
- toString() {
16
- const paramsStr = this.params.map((param) => param.toString()).join(', ');
17
- return `${chalk.bold('constructor')}(${paramsStr})`;
7
+ export class ConstructorSchema extends FunctionLikeSchema {
8
+ constructor(
9
+ location: Location,
10
+ params: ParameterSchema[],
11
+ returns: ThisTypeSchema,
12
+ signature: string,
13
+ modifiers: Modifier[] = [],
14
+ doc?: DocSchema
15
+ ) {
16
+ super(location, 'constructor', params, returns, signature, modifiers, doc, undefined);
18
17
  }
19
18
  }
package/schemas/module.ts CHANGED
@@ -6,10 +6,16 @@ import { schemaObjArrayToInstances } from '../class-transformers';
6
6
  export class ModuleSchema extends SchemaNode {
7
7
  @Transform(schemaObjArrayToInstances)
8
8
  exports: SchemaNode[];
9
+
10
+ @Transform(schemaObjArrayToInstances)
11
+ internals: SchemaNode[];
12
+
9
13
  namespace?: string;
10
- constructor(readonly location: Location, exports: SchemaNode[]) {
14
+
15
+ constructor(readonly location: Location, exports: SchemaNode[], internals: SchemaNode[]) {
11
16
  super();
12
17
  this.exports = exports;
18
+ this.internals = internals;
13
19
  }
14
20
 
15
21
  toObject() {
@@ -14,8 +14,9 @@ export type PlainTypeRefSchema = {
14
14
  /**
15
15
  * can be one of the following:
16
16
  * 1. a reference to another "export" in the same component
17
- * 2. a reference to another component.
18
- * 3. a reference to a package.
17
+ * 2 a reference to another declaration in the same file (internal)
18
+ * 3. a reference to another component.
19
+ * 4. a reference to a package.
19
20
  */
20
21
  export class TypeRefSchema extends SchemaNode {
21
22
  @Transform(schemaObjArrayToInstances)
@@ -42,7 +43,9 @@ export class TypeRefSchema extends SchemaNode {
42
43
  /**
43
44
  * target package name. existing if type is defined in different package.
44
45
  */
45
- readonly packageName?: string
46
+ readonly packageName?: string,
47
+
48
+ readonly internalFilePath?: string
46
49
  ) {
47
50
  super();
48
51
  this.componentId = componentId;