UNPKG

@ohu-mobile/core

Version:
18 lines (17 loc) 954 B
import Vue, { VueConstructor, CreateElement, VNode } from 'vue'; import { PopupOutSideEvents } from '../Popup'; import { VueEventWrapper } from '../types'; export interface MethodBaseOptions extends VueEventWrapper<PopupOutSideEvents> { parent?: Vue; render?: (h?: CreateElement) => VNode | VNode[]; } export type PopupDepositComponent = InstanceType<VueConstructor> & { visible: boolean; close: () => void; show: () => void; }; export default function createPopupMethodApi<T extends VueConstructor>(component: T, singleton?: boolean): { createCustomApi: <A extends any[], O extends MethodBaseOptions, T_1 extends MethodBaseOptions = O>(func: (...args: A) => O, defaultOptions?: T_1 | undefined) => (...args: A) => PopupDepositComponent; createOpenApi: <O_1 extends MethodBaseOptions, T_2 extends MethodBaseOptions = O_1>(defaultOptions?: T_2 | undefined) => (options: O_1) => PopupDepositComponent; close: () => void; };