Skip to content
Advertisement

TypeScript in combination with BreezeJS

I’m currently working on a project prototype with TypeScript in combination with BreezeJS. I’m using the HotTowel template from John Papa and wrote my own TypeScript ViewModels for each HTML page.

To use normal JavaScript libs you need a TypeScript file file.d.ts which is some sort of interface class so TypeScript knows which JavaScript functions there are.

With this combination I’m trying to create a new entity but I can’t find the function CreateEntity. This is located in my breeze.d.ts file but its not working. Intellisense is not autocomplete my statement.

So if I type this.Manager.CreateEntity it is not showing CreateEntity and of course its not working also 😉 I believe the mistake is in the .d.ts file but I can’t seem to find it.

Other functions of the this.Manager are working and autocompleted!

JavaScript

Advertisement

Answer

I haven’t used BreezeJS – so I’m basing this off of a glance at the documentation.

It looks like the definition is missing from the definition file… for example, it looks like this should be possible:

JavaScript

But the EntityManager class is missing this declaration:

JavaScript

I have submitted a pull request to Definitely Typed for this.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement