zs.sdk.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. declare namespace zs {
  2. module sdk {
  3. interface adData {
  4. position_type: string;
  5. app_desc: string;
  6. link_path: string;
  7. app_id: string;
  8. open_ad: string;
  9. appid: string;
  10. app_icon: string;
  11. app_title: string;
  12. app_qrcode: string;
  13. link_text: string;
  14. type: string;
  15. }
  16. interface adDataSet {
  17. promotion: adData[];
  18. indexLeft: adData[];
  19. endPage: adData[];
  20. backAd: adData[];
  21. }
  22. /**
  23. * 获取广告数据
  24. * @param {*} callback
  25. * @returns more 更多好玩 个人中心的广告 现已经不用了
  26. * promotion 首页推广 首页开始按钮下的广告
  27. * indexFloat 首页浮动广告 首页右上的广告
  28. * indexLeft 首页侧栏
  29. * gameFloat 游戏页浮动广告
  30. * endPage 结束页广告
  31. */
  32. function loadAd(callback:Function);
  33. /**
  34. * 跳转小程序
  35. * @param {*} row 从loadAd接口中返回的数组项 @example indexLeft[0]
  36. * @param {*} openid 小游戏中的用户openid
  37. * @param {function} success 接口调用成功的回调函数
  38. * @param {function} fail 接口调用失败的回调函数
  39. * @param {function} complete 接口调用结束的回调函数(调用成功、失败都会执行)
  40. */
  41. function navigate2Mini(adData: adData, uniqueId: string, success: Function, failed: Function, completed: Function);
  42. /**
  43. * 初始化 sdk
  44. * @param {*} user_id 用户唯一标识
  45. */
  46. function init(user_id);
  47. /**
  48. * 发送视频观看记录
  49. */
  50. function sendVideoLog();
  51. /**
  52. * 加载广告配置
  53. * @param {function} success 接口调用成功的回调函数
  54. * @param {function} fail 接口调用失败的回调函数
  55. */
  56. function loadConfig(success: Function, failed: Function);
  57. /**
  58. * 是否开启自家导出
  59. * @returns true/false
  60. */
  61. function isExportValid();
  62. /**
  63. * 是否通过链接打开
  64. * @returns true/false
  65. */
  66. function isFromLink();
  67. }
  68. }