At the moment, the IDialogOptions
resolve signature is as follows:
resolve? : ng.IPromise<any>
However, based on the documentation, it should also be able to accept functions that return a promise. Therefore, I have modified it to the following structure:
interface IDialogOptions {
//more options
resolve ? : {
[index: string]: (...any) => angular.IPromise < any > | angular.IPromise < any >
}
}
The issue now is that it should also support an array with strings where the last element of the array must be a function. It should look something like this:
['dependency1', 'dependency2', (dependency1, dependency2) : angular.IPromise<any> => {
// somecode returning a promise.
}]
My question is, is this arrangement feasible in TypeScript?
Here is the complete source code for Angular Material TypeScript definitions.