-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support parse method result #2485
Changes from 6 commits
95c31f3
45fe351
8813081
4397241
68bc369
bf1733e
3c2c29f
ff700c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,15 @@ export interface IHierarchyFile { | |
entities: Array<IEntity>; | ||
} | ||
|
||
export type IMethodParams = Array<IBasicType>; | ||
export type ICanParseResultObject = { | ||
params: Array<IBasicType>; | ||
result?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addComponents is handled specifically,addEffect can't follow it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you give a specific example? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我说的是HierarcyParser里的parseComponent,如果你指的是引擎代码里的addComponent可以加参数的形式的话,是不满足我们这次的需求的。addComponent只能传构造参数,且不能调用方法。这次需要addEffect调用之后拿到实例再去赋值和调用方法。 |
||
methods?: { [methodName: string]: Array<IMethodParams> }; | ||
props?: { [key: string]: IBasicType | IMethodParams }; | ||
}; | ||
}; | ||
|
||
export type IMethodParams = Array<IBasicType> | ICanParseResultObject; | ||
|
||
export interface IBasicEntity { | ||
name?: string; | ||
|
@@ -73,11 +81,15 @@ export type IComponent = { id: string; refId?: string } & IClassObject; | |
|
||
export type IClassObject = { | ||
class: string; | ||
constructParams?: IMethodParams; | ||
constructParams?: Array<IBasicType>; | ||
methods?: { [methodName: string]: Array<IMethodParams> }; | ||
props?: { [key: string]: IBasicType | IMethodParams }; | ||
}; | ||
|
||
export type IClassTypeObject = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need discuss: merge to IClassObject use needInstance to distinguish? |
||
classType: string; | ||
}; | ||
|
||
export type IBasicType = | ||
| string | ||
| number | ||
|
@@ -86,6 +98,7 @@ export type IBasicType = | |
| undefined | ||
| IAssetRef | ||
| IClassObject | ||
| IClassTypeObject | ||
| IMethodParams | ||
| IEntityRef; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a awful name 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i think so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use markdown and pay attention to format of typescript code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, opted after discuss