fix(angular): Required<> is not available

This commit is contained in:
Manu Mtz.-Almeida
2018-05-14 17:31:17 +02:00
parent 618f708bc4
commit 8aa696537b

View File

@@ -3,7 +3,14 @@ import { Animation, AnimationBuilder, Config, Mode } from '../interface';
let lastId = 1;
export function createOverlay<T extends HTMLIonOverlayElement & Required<B>, B>
/**
* Convert an interface where all the properties are optional to mandatory.
*/
export type Requires<K extends string> = {
[P in K]: any;
};
export function createOverlay<T extends HTMLIonOverlayElement & Requires<keyof B>, B>
(element: T, opts: B): Promise<T> {
// convert the passed in overlay options into props
// that get passed down into the new overlay