refactor(alert): update various interfaces and exports, fix alert dismiss promise flow to work correctly

This commit is contained in:
Dan Bucholtz
2017-11-27 15:33:11 -06:00
parent d5d3753c22
commit a817bd7b66
5 changed files with 66 additions and 42 deletions

View File

@ -1,4 +1,4 @@
import { Animation, StencilElement } from '../index';
import { Animation, DomController, StencilElement } from '../index';
export function clamp(min: number, n: number, max: number) {
return Math.max(min, Math.min(n, max));
@ -279,3 +279,12 @@ export function playAnimationAsync(animation: Animation): Promise<Animation> {
animation.play();
});
}
export function domControllerAsync(domControllerFunction: Function, callback: Function) {
return new Promise((resolve) => {
domControllerFunction(() => {
callback();
resolve();
});
});
}