Add wizard navigation validator (#1587)

This commit is contained in:
Matt Irvine
2018-06-08 15:32:37 -07:00
committed by GitHub
parent 20c4f085c8
commit e3a2ed95d4
8 changed files with 104 additions and 8 deletions

View File

@@ -621,7 +621,7 @@ declare module 'sqlops' {
lastPage: number,
/**
* The new page number
* The new page number or undefined if the user is closing the wizard
*/
newPage: number
}
@@ -734,6 +734,16 @@ declare module 'sqlops' {
* Close the wizard. Does nothing if the wizard is not open.
*/
close(): Thenable<void>;
/**
* Register a callback that will be called when the user tries to navigate by
* changing pages or clicking done. Only one callback can be registered at once, so
* each registration call will clear the previous registration.
* @param validator The callback that gets executed when the user tries to
* navigate. Return true to allow the navigation to proceed, or false to
* cancel it.
*/
registerNavigationValidator(validator: (pageChangeInfo: WizardPageChangeInfo) => boolean | Thenable<boolean>): void;
}
}
}