env.d.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. interface IPlatform {
  2. APP: "APP";
  3. APP_ANDROID: "APP-ANDROID";
  4. APP_IOS: "APP-IOS";
  5. APP_HARMONY: "APP-HARMONY";
  6. WEB: "WEB";
  7. MP: "MP";
  8. MP_WEIXIN: "MP-WEIXIN";
  9. MP_ALIPAY: "MP-ALIPAY";
  10. MP_BAIDU: "MP-BAIDU";
  11. MP_TOUTIAO: "MP-TOUTIAO";
  12. MP_LARK: "MP-LARK";
  13. MP_QQ: "MP-QQ";
  14. MP_KUAISHOU: "MP-KUAISHOU";
  15. MP_JD: "MP-JD";
  16. MP_360: "MP-360";
  17. MP_XHS: "MP-XHS";
  18. MP_HARMONY: "MP-HARMONY";
  19. QUICKAPP_WEBVIEW: "QUICKAPP-WEBVIEW";
  20. QUICKAPP_WEBVIEW_UNION: "QUICKAPP-WEBVIEW-UNION";
  21. QUICKAPP_WEBVIEW_HUAWEI: "QUICKAPP-WEBVIEW-HUAWEI";
  22. OTHER: "OTHER";
  23. }
  24. export declare const Platform: IPlatform;
  25. export declare function getPlatform(): IPlatform[keyof IPlatform];
  26. export declare const platform: ReturnType<typeof getPlatform>;
  27. /** App */
  28. export declare const isApp: boolean;
  29. /** App Android */
  30. export declare const isAppAndroid: boolean;
  31. /** App iOS */
  32. export declare const isAppIos: boolean;
  33. /** App HarmonyOS Next */
  34. export declare const isAppHarmony: boolean;
  35. /** Web */
  36. export declare const isWeb: boolean;
  37. /** 小程序 */
  38. export declare const isMp: boolean;
  39. /** 微信小程序 */
  40. export declare const isMpWeixin: boolean;
  41. /** 支付宝小程序 */
  42. export declare const isMpAlipay: boolean;
  43. /** 百度小程序 */
  44. export declare const isMpBaidu: boolean;
  45. /** 头条小程序 */
  46. export declare const isMpToutiao: boolean;
  47. /** 飞书小程序 */
  48. export declare const isMpLark: boolean;
  49. /** QQ小程序 */
  50. export declare const isMpQq: boolean;
  51. /** 快手小程序 */
  52. export declare const isMpKuaishou: boolean;
  53. /** 京东小程序 */
  54. export declare const isMpJd: boolean;
  55. /** 360小程序 */
  56. export declare const isMp360: boolean;
  57. /** 小红书小程序 */
  58. export declare const isMpXhs: boolean;
  59. /** 鸿蒙元服务 */
  60. export declare const isMpHarmony: boolean;
  61. /** 快应用 */
  62. export declare const isQuickappWebview: boolean;
  63. /** 快应用联盟 */
  64. export declare const isQuickappWebviewUnion: boolean;
  65. /** 快应用华为 */
  66. export declare const isQuickappWebviewHuawei: boolean;
  67. /** 其他平台 */
  68. export declare const isOtherPlatform: boolean;