XrmDefinitelyTyped
XrmDefinitelyTyped copied to clipboard
Split xrm.d.ts into a separate package
Max Ewing has made a blogpost, where he describes a use case for writing typescript that only interfaces with xrm.d.ts
. Currently this is done by extracting the generated file and distribute it in some way.
Although this is not the intended way of using XDT, I believe we should support it.
xrm.d.ts
is already used separately from the rest of XDT. Therefore it is possible to extract it into a new project and generate a separate package, preferably for each version of the file. This would allow Max Ewing to reference those packages, instead of having to generate it himself.
Any news about this enhancement? It would be useful because currently it is a little bit hard to use for example xrm-mock library for testing.
There is a problem with directly using the typings from @types/xrm with XrmDefinitelyTyped.
The problem is that XrmDefinitelyTyped does not wish to allow magic strings in getAttribute
and getControl
, but @types/xrm has to support that. I have not made much effort into splitting up the packages, since it was not an easy fix.
There is a PR submitted this week ((https://github.com/delegateas/XrmDefinitelyTyped/pull/278)) which allows XrmDT to use a custom namespace (instead of 'Xrm'). While I think the issue here may have other benefits, using a custom namespace avoids the collision between this project and @types/xrm, which I think was a prime motivator for this issue.
It seems this issue has been going on for so long that another project has been created that is pure npm and combines types/xrm with XDT :) https://github.com/OliverFlint/XrmTypesGen