mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(angular): Required<> is not available
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user