import { _decorator } from 'cc';
const { ccclass, property } = _decorator;

export interface IPlatform {
    /**
     * 登录
     * @param success   成功
     * @param failure   失败
     */
    login(success: Function, failure: Function): void;

    /**
     * 跳转
     * @param data 
     * @param success 
     * @param failure 
     */
    navigate2Mini(data: any, success?: Function, failure?: Function): void;

    /**
     * 分享
     * @param data 
     * @param success 
     * @param failure 
     */
    shareMessage(data: any, success?: Function, failure?: Function): void;

    /**
     * 显示Banner
     * @param data 
     */
    showBanner(data: any): void;

    /**
     * 隐藏Banner
     */
    hideBanner(): void;

    /**
     * 显示激励广告
     * @param success 
     * @param failure 
     */
    showRewardedVideo(success?: Function, failure?: Function): void;

    /**
     * 显示插屏广告
     */
    showInsertAd(success?: Function, failure?: Function): void;

    /**
     * 显示原生广告
     */
    showNativeAd(success?: Function, failure?: Function): void;

    /**
     * 打点
     * @param eventName 
     * @param data 
     */
    sendEvent(eventName: string, data?: any): void;

    /**
     * 设置加载进度
     * @param progress 
     */
    setLoadingProgress(progress: number): void;

    /**
     * 加载完成
     * @param completeHandler 
     */
    loadingComplete(completeHandler?: Function): void;

    /**
     * 游戏互推
     * @param num 
     */
    getRandomPageAd(num: number): any[];
}
