@@ -305,8 +305,12 @@ export interface IDialogResult<T> {
305
305
export interface IPromptOptions {
306
306
/**
307
307
* Optional retry prompt to send if the users response isn't understood. Default is to just
308
- * reprompt with the configured [defaultRetryPrompt](http://docs.botframework.com/sdkreference/nodejs/interfaces/_botbuilder_d_.ipromptsoptions.html#defaultretryprompt) plus the original prompt. Note that if the original
309
- * prompt is an _IMessage_ the default behaviour is to simply re-send the original prompt.
308
+ * reprompt with the configured [defaultRetryPrompt](http://docs.botframework.com/sdkreference/nodejs/interfaces/_botbuilder_d_.ipromptsoptions.html#defaultretryprompt)
309
+ * plus the original prompt.
310
+ *
311
+ * Note that if the original prompt is an _IMessage_ the retry prompt will be sent as a seperate
312
+ * message followed by the original message. If the retryPrompt is also an _IMessage_ it will
313
+ * instead be sent in place of the original message.
310
314
* * _{string}_ - Initial message to send the user.
311
315
* * _{string[]}_ - Array of possible messages to send user. One will be chosen at random.
312
316
* * _{IMessage}_ - Initial message to send the user. Message can contain attachments.
@@ -367,6 +371,9 @@ export interface IPromptChoiceResult extends IPromptResult<IFindMatchResult> { }
367
371
/** Strongly typed Time Prompt Result. */
368
372
export interface IPromptTimeResult extends IPromptResult < IEntity > { }
369
373
374
+ /** Strongly typed Attachment Prompt Result. */
375
+ export interface IPromptAttachmentResult extends IPromptResult < IAttachment [ ] > { }
376
+
370
377
/** Plugin for recognizing prompt responses recieved by a user. */
371
378
export interface IPromptRecognizer {
372
379
/**
@@ -412,40 +419,6 @@ export interface IPromptRecognizerArgs {
412
419
export interface IPromptsOptions {
413
420
/** Replaces the default recognizer (SimplePromptRecognizer) used to recognize prompt replies. */
414
421
recognizer ?: IPromptRecognizer
415
-
416
- /** The default retry prompt to use. The default value is "I didn't understand." */
417
- defaultRetryPrompt ?: string ;
418
- }
419
-
420
- /** Context information passed to field related handlers. */
421
- export interface IFieldConext {
422
- userData : any ;
423
- form : any ;
424
- field : string ;
425
- }
426
-
427
- /**
428
- * Handler that gets called anytime a field is about to invoke a prompt.
429
- */
430
- export interface IFieldPromptHandler {
431
- /**
432
- * @param context Contextual information related to the current field.
433
- * @param next Function to call to continue execution of the prompt.
434
- * Passing _true_ for __skip__ will cause the current field to be skipped.
435
- */
436
- ( context : IFieldConext , next : ( skip : boolean ) => void ) : void ;
437
- }
438
-
439
- /** Options passed to form fields. */
440
- export interface IFieldOptions extends IPromptOptions {
441
- /**
442
- * Called anytime a given field is about to invoke the prompt. This function lets the
443
- * developer progromatically determine if a prompt should be skipped or not.
444
- *
445
- * The handler can also manipulate the forms current values. For instance a fields value
446
- * could be pulled from context.userData if not already specified on the form.
447
- */
448
- onPrompt ?: IFieldPromptHandler ;
449
422
}
450
423
451
424
/** A recognized intent. */
@@ -1149,9 +1122,9 @@ export class Message implements IMessage {
1149
1122
1150
1123
/**
1151
1124
* Selects a prompt at random.
1152
- * @param prompts Array of prompts to choose from.
1125
+ * @param prompts Array of prompts to choose from. When prompts is type _string_ the prompt will simply be returned unmodified.
1153
1126
*/
1154
- static randomPrompt ( prompts : string [ ] ) : string ;
1127
+ static randomPrompt ( prompts : string | string [ ] ) : string ;
1155
1128
1156
1129
/**
1157
1130
* Combines an array of prompts into a single localized prompt and then optionally fills the
@@ -1389,84 +1362,17 @@ export class Prompts extends Dialog {
1389
1362
* @param options Optional parameters to control the behaviour of the prompt.
1390
1363
*/
1391
1364
static time ( session : Session , prompt : string | string [ ] | IMessage , options ?: IPromptOptions ) : void ;
1392
- }
1393
1365
1394
- /**
1395
- *
1396
- */
1397
- export class Fields {
1398
1366
/**
1399
- * Captures from the user a raw string of text and saves it to a field on a form.
1400
- * @param field Name of the field to save the users response to.
1401
- * @param prompt
1402
- * * __prompt:__ _{string}_ - Initial message to send the user.
1403
- * * __prompt:__ _{string[]}_ - Array of possible messages to send user. One will be chosen at random.
1404
- * @param options Optional parameters to control the behaviour of the field.
1405
- */
1406
- static text ( field : string , prompt : string | string [ ] , options ?: IFieldOptions ) : IDialogWaterfallStep ;
1407
-
1408
- /**
1409
- * Prompts the user to enter a number and saves it to a field on a form.
1410
- * @param field Name of the field to save the users response to.
1411
- * @param prompt
1412
- * * __prompt:__ _{string}_ - Initial message to send the user.
1413
- * * __prompt:__ _{string[]}_ - Array of possible messages to send user. One will be chosen at random.
1414
- * @param options Optional parameters to control the behaviour of the field.
1415
- */
1416
- static number ( field : string , prompt : string | string [ ] , options ?: IFieldOptions ) : IDialogWaterfallStep ;
1417
-
1418
- /**
1419
- * Prompts the user to enter a boolean yes/no response and saves their answer to a field on a form.
1420
- * @param field Name of the field to save the users response to.
1421
- * @param prompt
1422
- * * __prompt:__ _{string}_ - Initial message to send the user.
1423
- * * __prompt:__ _{string[]}_ - Array of possible messages to send user. One will be chosen at random.
1424
- * @param options Optional parameters to control the behaviour of the field.
1425
- */
1426
- static confirm ( field : string , prompt : string | string [ ] , options ?: IFieldOptions ) : IDialogWaterfallStep ;
1427
-
1428
- /**
1429
- * Prompts the user to choose from a list of options and saves their selection to a field on a form.
1430
- * @param field Name of the field to save the users response to.
1431
- * @param prompt
1432
- * * __prompt:__ _{string}_ - Initial message to send the user.
1433
- * * __prompt:__ _{string[]}_ - Array of possible messages to send user. One will be chosen at random.
1434
- * @param choices
1435
- * * __choices:__ _{string}_ - List of choices as a pipe ('|') delimted string.
1436
- * * __choices:__ _{Object}_ - List of choices expressed as an Object map. The objects field names will be used to build the list of values.
1437
- * * __choices:__ _{string[]}_ - List of choices as an array of strings.
1438
- * @param options Optional parameters to control the behaviour of the field.
1439
- */
1440
- static choice ( field : string , prompt : string | string [ ] , choices : string | Object | string [ ] , options ?: IFieldOptions ) : IDialogWaterfallStep ;
1441
-
1442
- /**
1443
- * Prompts the user to enter a time saves it to a field on a form as a timestamp.
1444
- * @param field Name of the field to save the users response to.
1367
+ * Prompts the user to upload a file attachment.
1368
+ * @param session Session object for the current conversation.
1445
1369
* @param prompt
1446
1370
* * __prompt:__ _{string}_ - Initial message to send the user.
1447
1371
* * __prompt:__ _{string[]}_ - Array of possible messages to send user. One will be chosen at random.
1448
- * @param options Optional parameters to control the behaviour of the field.
1449
- */
1450
- static time ( field : string , prompt : string | string [ ] , options ?: IPromptOptions ) : IDialogWaterfallStep ;
1451
-
1452
- /**
1453
- * Finalizes the form by saving the response from the last prompt and then passes the completed
1454
- * form to the next step of the waterfall for processing.
1455
- */
1456
- static endForm ( ) : IDialogWaterfallStep ;
1457
-
1458
- /**
1459
- * Finalizes the form by saving the response from the last prompt and then returns the completed
1460
- * form to the parent dialog by calling [endDialog()](http://docs.botframework.com/sdkreference/nodejs/classes/_botbuilder_d_.session.html#enddialog).
1461
- */
1462
- static returnForm ( ) : IDialogWaterfallStep ;
1463
-
1464
- /**
1465
- * Handler for IFieldOptions.onPrompt that will copy a default value from Session.userData if
1466
- * a field is empty. The default value must be in a property with the same name as the field.
1467
- * If successfully copied the prompt will be skipped.
1372
+ * * __prompt:__ _{IMessage}_ - Initial message to send the user. Message can contain attachments.
1373
+ * @param options Optional parameters to control the behaviour of the prompt.
1468
1374
*/
1469
- static onPromptUseDefault ( ) : IFieldPromptHandler
1375
+ static attachment ( session : Session , prompt : string | string [ ] | IMessage , options ?: IPromptOptions ) : void ;
1470
1376
}
1471
1377
1472
1378
/**
0 commit comments