Closed mikejf-pr closed 5 years ago
Hey, i use this Libary in Typescript without any Problems.
npm install @types/odata
and in my Code
import * as o from 'odata'
o().config({
endpoint:'https://myBase'
});
o("MyRessouce").Take(10).then(.....
If you call o()
without Parameter you get the OHandlerStatic
Interface for Gobal Settings.
If you call o("MyRessource")
with Parameter you get the OHandler<{}>
Interface to Request the Ressources.
For my Case i wrote a generic wrapper/factory for o.js to work with Types in o.js Otherwise create your own Definition / Interface.
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/odata/index.d.ts
I'm running with the @types/odata typings from npm, but as far as I can tell they've been set up in a way that doesn't support imports for es2015 modules, without an export of the interfaces in a way that I can reference in my code.