@@ -412,6 +412,7 @@ export function isMemberAccessExpr(item: unknown): item is MemberAccessExpr {
412
412
export interface Model extends AstNode {
413
413
readonly $type : 'Model' ;
414
414
declarations : Array < AbstractDeclaration >
415
+ imports : Array < ModelImport >
415
416
}
416
417
417
418
export const Model = 'Model' ;
@@ -420,6 +421,18 @@ export function isModel(item: unknown): item is Model {
420
421
return reflection . isInstance ( item , Model ) ;
421
422
}
422
423
424
+ export interface ModelImport extends AstNode {
425
+ readonly $container : Model ;
426
+ readonly $type : 'ModelImport' ;
427
+ path : string
428
+ }
429
+
430
+ export const ModelImport = 'ModelImport' ;
431
+
432
+ export function isModelImport ( item : unknown ) : item is ModelImport {
433
+ return reflection . isInstance ( item , ModelImport ) ;
434
+ }
435
+
423
436
export interface NullExpr extends AstNode {
424
437
readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
425
438
readonly $type : 'NullExpr' ;
@@ -563,6 +576,7 @@ export interface ZModelAstType {
563
576
LiteralExpr : LiteralExpr
564
577
MemberAccessExpr : MemberAccessExpr
565
578
Model : Model
579
+ ModelImport : ModelImport
566
580
NullExpr : NullExpr
567
581
ObjectExpr : ObjectExpr
568
582
Plugin : Plugin
@@ -579,7 +593,7 @@ export interface ZModelAstType {
579
593
export class ZModelAstReflection extends AbstractAstReflection {
580
594
581
595
getAllTypes ( ) : string [ ] {
582
- return [ 'AbstractDeclaration' , 'Argument' , 'ArrayExpr' , 'Attribute' , 'AttributeArg' , 'AttributeAttribute' , 'AttributeParam' , 'AttributeParamType' , 'BinaryExpr' , 'DataModel' , 'DataModelAttribute' , 'DataModelField' , 'DataModelFieldAttribute' , 'DataModelFieldType' , 'DataSource' , 'DataSourceField' , 'Enum' , 'EnumField' , 'Expression' , 'FieldInitializer' , 'FunctionDecl' , 'FunctionParam' , 'FunctionParamType' , 'GeneratorDecl' , 'GeneratorField' , 'InvocationExpr' , 'LiteralExpr' , 'MemberAccessExpr' , 'Model' , 'NullExpr' , 'ObjectExpr' , 'Plugin' , 'PluginField' , 'ReferenceArg' , 'ReferenceExpr' , 'ReferenceTarget' , 'ThisExpr' , 'TypeDeclaration' , 'UnaryExpr' , 'UnsupportedFieldType' ] ;
596
+ return [ 'AbstractDeclaration' , 'Argument' , 'ArrayExpr' , 'Attribute' , 'AttributeArg' , 'AttributeAttribute' , 'AttributeParam' , 'AttributeParamType' , 'BinaryExpr' , 'DataModel' , 'DataModelAttribute' , 'DataModelField' , 'DataModelFieldAttribute' , 'DataModelFieldType' , 'DataSource' , 'DataSourceField' , 'Enum' , 'EnumField' , 'Expression' , 'FieldInitializer' , 'FunctionDecl' , 'FunctionParam' , 'FunctionParamType' , 'GeneratorDecl' , 'GeneratorField' , 'InvocationExpr' , 'LiteralExpr' , 'MemberAccessExpr' , 'Model' , 'ModelImport' , ' NullExpr', 'ObjectExpr' , 'Plugin' , 'PluginField' , 'ReferenceArg' , 'ReferenceExpr' , 'ReferenceTarget' , 'ThisExpr' , 'TypeDeclaration' , 'UnaryExpr' , 'UnsupportedFieldType' ] ;
583
597
}
584
598
585
599
protected override computeIsSubtype ( subtype : string , supertype : string ) : boolean {
@@ -813,7 +827,8 @@ export class ZModelAstReflection extends AbstractAstReflection {
813
827
return {
814
828
name : 'Model' ,
815
829
mandatory : [
816
- { name : 'declarations' , type : 'array' }
830
+ { name : 'declarations' , type : 'array' } ,
831
+ { name : 'imports' , type : 'array' }
817
832
]
818
833
} ;
819
834
}
0 commit comments