import { Intent } from './core/generate'; import { AppFlags } from './core/targetApp'; export default class CallApp { options: CallAppOptions; targetInfo?: TargetInfo; downloadLink?: string; urlScheme?: string; universalLink?: string; intentLink?: string; version?: string; installedPlugins?: any; constructor(options?: CallAppOptions); init(options: CallAppOptions): void; /** * 触发唤起 */ start(options?: CallAppOptions): void; /** * 触发下载 */ download(options?: CallAppOptions): void; /** * plugins */ use(plugin: Plugin, ...options: any[]): this; } export * as utils from './libs/platform'; export type Plugin = (app: CallAppInstance, ...options: any[]) => any; export interface DownloadConfig { ios: string; android: string; android_api?: string; android_yyb: string; api?: string; } export interface TargetInfo { flag: AppFlags; name: string; schemePrefix: string; universalPath: string; downloadConfig: DownloadConfig; } export type TargetApp = 'zz' | 'zlj' | 'zzHunter' | 'wxMini' | undefined; export interface CallAppOptions { path?: string; targetApp?: TargetApp; universal?: boolean; intent?: boolean; download?: boolean; urlSearch?: any; delay?: number; channelId?: string | number; onWechatReady?: (...arg: any[]) => void; wechatStyle?: number | string; deeplinkId?: number | string; middleWareUrl?: string; callFailed?: () => void; callSuccess?: () => void; callStart?: (ctx: CallAppInstance) => void; callDownload?: () => void; intentParams?: Intent; callError?: () => void; customConfig?: { schemeUrl: string; downloadConfig?: { ios: string; android: string; android_yyb: string; }; universalLink?: string; landingPage?: string; }; } export interface CallAppInstance { options: CallAppOptions; start: () => void; download: () => void; targetInfo?: TargetInfo; downloadLink?: string; urlScheme?: string; universalLink?: string; intentLink?: string; }