ryanvolum / offline-directline

Unofficial package to emulate the bot framework connector locally.
https://www.npmjs.com/package/offline-directline
78 stars 44 forks source link

getRouter return type of `any` instead of `express.Router` #31

Closed mattmazzola closed 5 years ago

mattmazzola commented 6 years ago

I'm not sure how it could happen as the build process is a simple tsc on the src folder, but somehow in the latest 1.2.5 package I'm seeing the bridge.d.ts file with this

export declare const getRouter: (serviceUrl: string, botUrl: string, conversationInitRequired?: boolean) => any;
export declare const initializeRoutes: (app: any, serviceUrl: string, botUrl: string, conversationInitRequired?: boolean, port?: number) => void;

I'm guessing that maybe the latest package was published with stale .d.ts. It has getRouter returning any instead of the express.Router

However, when I build the source locally I get the following which looks correct:

import * as express from 'express';
export declare const getRouter: (serviceUrl: string, botUrl: string, conversationInitRequired?: boolean) => express.Router;
export declare const initializeRoutes: (app: express.Express, serviceUrl: string, botUrl: string, conversationInitRequired?: boolean, port?: number) => void;

I could imagine weird scenario where of the .d.ts exports types depending on express then it should also be declared as a peerDependency so consumers have it.

ryanvolum commented 6 years ago

That's odd - thanks for pointing this out. Will check it out.

ryanvolum commented 5 years ago

Doing some much needed old bug cleanup. This does seem to resolved in the latest (1.3.1) version:

export declare const initializeRoutes: (app: express.Express, port: number, botUrl: string, conversationInitRequired?: boolean) => void;