-
Notifications
You must be signed in to change notification settings - Fork 53
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
Suggestion #1
Comments
It was originally implemented like this because it was the only way to have specific string overloads in function definitions. It required you to have a default/catch-all case of type But with the addition of string literals in the later TypeScript versions, it is likely possible that it will work without this catch-all function definition anymore. If this is the case, I can get rid of these additional functions definitions along with I will be looking into the possibility of removing them. Good suggestion, thanks! |
Thank you for your time mate. Is there any actual use of EmptyAttribute? It is impossible to set/get value of EmptyAttribute (without explicitly casting to StringAttribute for example) which made me wonder why it existed in the first place. Casting getAttribute to a specific type does the job, but it looks ugly This looks much better in my opinion: But again, since the script is generating typings for all existing fields there wont be a case when we're actually using this overload anyway. As for the screenshots you posted above, we can only blame the poor intellisense of VS, I am using resharper and this is what I get 😃 Just thinking loudly here. Thank you for your efforts! |
The whole point behind XrmDefinitelyTyped for forms is that the type of an attribute/control should be inferred from the string given to the getter function. It should not be possible to request it with a generic version of that function, since this will defeat the whole purpose of eliminating potential bugs, that arise from using incorrect strings. The In an upcoming minor version, I may be replacing all Regarding the more descriptive Resharper error message: It does look nicer, but this tool should not be reliant on developers using certain third-party extensions. The goal for this tool is to provide a good developer experience using TypeScript for CRM regardless of IDE and external tooling. |
I absolutely agree with the last part, I was only pointing out the beauty of Resharper. One last thing, why is Xrm.FormType enumeration private? Is there another enumeration that we could use? Edit: I am using |
Oh yeah, this issue was mentioned to me by a co-worker a while back, but I have not gotten around to fixing it yet. The issue only arises when you use the I will be looking into fixing this soon. |
@themike10452 latest patch release should fix this issue |
Hello there, first I would like to thank you for this awesome tool.
I have a small suggestion; is it possible to add an option to omit
get(name: string): Xrm.EmptyAttribute;
andget(name: string): Xrm.EmptyControl;
that way we can only use valid attribute/control names withXrm.Page.getAttribute
andXrm.Page.getControl
.What do you think?
The text was updated successfully, but these errors were encountered: