interface ControllerShape {
create(options: Opts): Promise;
dismiss(data?: any, role?: string, id?: string): Promise;
getTop(): Promise;
}
export class OverlayBaseController implements ControllerShape {
constructor(private ctrl: ControllerShape) {}
/**
* Creates a new overlay
*/
create(opts?: Opts): Promise {
return this.ctrl.create((opts || {}) as any);
}
/**
* When `id` is not provided, it dismisses the top overlay.
*/
dismiss(data?: any, role?: string, id?: string): Promise {
return this.ctrl.dismiss(data, role, id);
}
/**
* Returns the top overlay.
*/
getTop(): Promise {
return this.ctrl.getTop();
}
}