drachtio-srf icon indicating copy to clipboard operation
drachtio-srf copied to clipboard

Srf types not updated correctly sometime after 4.5.23

Open jeffwhelpley opened this issue 1 year ago • 3 comments

If you are using TypeScript with drachtio-srf, the following has type errors after 4.5.23 BUT no actual runtime errors (i.e. the objects are there, but the types are wrong):

import { parseUri } from 'drachtio-srf';

This function is not exposed at all on the types. It is actually exposed, though, and you can use it if you ignore the typing error.

Also, the type signature for the invite() function is:

Srf.invite(sipUri: string, options: any): void

Even though in reality the invite() function accepts a function with req and res. createB2BUA is not exposed on the Srf type either.

jeffwhelpley avatar Oct 11 '23 17:10 jeffwhelpley

Came here looking for this. Unfortunately it seems several of the types are out of date. It may behoove one of us to pitch in and get a PR opened. I'll see if I can get a few updated for my current project and contribute them back.

benashby avatar Oct 26 '23 16:10 benashby

yeah I dont use TS myself so I rely on PRs for this feature

davehorton avatar Oct 26 '23 17:10 davehorton

I used locally defined types up until yesterday when I updated drachtio-srf and found that types were added a while ago. It broke my application though so I attempted to merge my local types with the ones in the repository.

Could you (@jeffwhelpley and @benashby) possibly help me test and see if something is wrong or missing? https://github.com/drachtio/drachtio-srf/pull/164

danvirsen avatar Nov 10 '23 10:11 danvirsen