botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Feature Request] Add missing UniversalBot constructor signatures in botbuilder.d.ts

Open jorenl opened this issue 9 years ago • 2 comments

System Information

  • SDK Language: Node.js
  • SDK Version: latest

Issue Description

While in the implementation, UniversalBot constructor signatures exist allowing you to pass in a settings object (IUniversalBotSettings), for example to use a different IBotStorage than the one provided by the ChatConnector, the .d.ts file does not seem to include them, so my typescript code won't compile out of the box.

https://github.com/Microsoft/BotBuilder/blob/master/Node/core/lib/botbuilder.d.ts#L3859

Is this intentional? If not, and the .d.ts is manually maintained and not auto-generated, I'd be happy to submit a PR.

Code Example

import * as bb from 'botbuilder';

let storage: bb.IBotStorage = new MyBotStorage();
let bot = new bb.UniversalBot(connector, {storage: storage});

Produces:

severity: 'Error'
message: 'Argument of type '{ storage: IBotStorage; }' is not assignable to parameter of type 'IDialogWaterfallStep | IDialogWaterfallStep[]'.
  Object literal may only specify known properties, and 'storage' does not exist in type 'IDialogWaterfallStep | IDialogWaterfallStep[]'.'
at: '305,47'
source: 'ts'

jorenl avatar Aug 04 '17 02:08 jorenl

Thanks for reporting @jorenl - Feel free to submit a PR if you have the fix.

nwhitmont avatar Aug 04 '17 02:08 nwhitmont

Closing issue as #4182 has been merged.

stevengum avatar Feb 16 '18 22:02 stevengum