大侠
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

200 lines
4.0 KiB

import { EPlatformType } from "./EPlatformType";
import IRecordManager from "./IRecordManager";
import { IDevice } from "./IDevice";
import PlatformData from "../Data/PlatformData";
import { ShareInfo } from "./ShareInfo";
import { PlatformCommonDefine } from "../Common/PlatformCommonDefine";
import { Recommend } from "../Recommend/Recommend";
/**
* 平台实例接口
*/
export default interface IPlatform {
/**
* 基础句柄
*/
base: any;
/**
* 平台数据
*/
platformData: PlatformData;
/**
* 当前平台
*/
platform: EPlatformType;
/**
* 启动参数
*/
lauchOption: PlatformCommonDefine.LaunchOption;
/**
* 登录状态
*/
loginState: PlatformCommonDefine.LoginState;
/**
* 登录完成回调(成功失败都会调用)
*/
onLoginEnd: Function;
/**
* 回到前台
*/
onResume: Function;
/**
* 回到前台
*/
onPause: Function;
/**
* 视频录制器
*/
recordManager: IRecordManager;
/**
* 是否支持直接跳转到其他小程序
*/
isSupportJumpOther: boolean;
/**是否支持侧边栏 */
isSliderBar:boolean;
/**是否已添加桌面 */
isAddShortcut:boolean;
/**
* 系统信息
*/
systemInfo: any;
// Buildle:Map<string,cc.AssetManager.Bundle>;
/**是否启用排行榜 */
IsLeaderboardsEnable: boolean;
/**推荐功能 */
mRecommend:Recommend;
isCanShowRecommend:boolean;
showRecommend(callBack:Function);
/**
* 初始化
*/
Init(platformData: PlatformData,callBack:Function);
/**
* banner广告是否可以展示
*/
IsBannerAvaliable(): boolean;
/**
* 视频广告是否可以展示
*/
IsVideoAvaliable(): boolean;
/**
* 插页广告是否可以展示
*/
IsInterstitalAvaliable(): boolean;
/**
* 展示banner广告
*/
ShowBannerAd();
/**
* 隐藏banner广告
*/
HideBannerAd();
/**
* 展示有奖视频
* @param onSuccess
* @param onSkipped
*/
ShowRewardVideoAd(onSuccess: Function, onSkipped: Function, LoadFail?: Function);
/**
* 异步方法展示广告
*/
ShowRewardVideoAdAsync(): Promise<boolean>;
/**
* 展示插页广告
*/
ShowInterstitalAd(callBack:Function);
/**
* 获取来源APPID,如果没有则返回null
*/
GetFromAppId(): string;
/**
* 获取访问类型(抖音)-1:正常访问,0:获客,3:复访
*/
GetFeedType(): number;
/**
* 分享消息
* @param obj
* @param onSuccess
* @param onFailed
*/
ShareAppMessage(obj: ShareInfo, onSuccess: Function, onFailed: Function);
/**
* 记录事件
*/
RecordEvent(eventId: string, param: object);
/**
* 检查更新,非外部调用
*/
_CheckUpdate();
/**
* 显示toast
*/
ShowToast(str: string);
/**
* 打开游戏盒子
*/
OpenGameBox(appIds: string[]);
/**
* 跳转到其他小程序
*/
NavigateToApp(appId: string, path?: string, extra?: any, showGameCenter?: boolean, isBanner?: boolean, adid?: number): Promise<boolean>;
/**
* 创建桌面图标
*/
createShortcut(BackFun:(isOK:boolean)=>void);
checkShortcut(BackFun:(isOK:boolean)=>void);
/**
* 推荐流直玩订阅
*/
requestFeedSubscribe(BackFun:(isOK:boolean)=>void);
checkFeedSubscribe(BackFun:(isOK:boolean)=>void);
/**获取用户云数据(QQ WX 平台 不可使用) */
GetUserCloudStorage();
/**设置用户云数据 */
SetUserCloudStorage();
CloseGame();
GetUserInfo(value: {
success?: Function,
fail?: Function,
btnStyle?:{ left: number, top: number, width: number, height: number },
});
hideUserInfoButton();
_InitABTest();
_InitShareList();
oceanengineEvent();
reportScene(sceneID: number);
}