getEnv.d.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. * 运行容器 mPaaS | DingTalk | Alipay
  3. */
  4. export declare enum InvokerContainerTypeEnum {
  5. /**
  6. * 钉钉容器
  7. * - 钉钉小程序容器
  8. * - 钉钉 H5 容器
  9. * - ...
  10. */
  11. DingTalk = "DingTalk",
  12. /**
  13. * mPaaS 容器
  14. */
  15. mPaaS = "mPaaS",
  16. /**
  17. * 支付宝容器
  18. */
  19. Alipay = "Alipay",
  20. Unknown = "unknown"
  21. }
  22. /**
  23. * 操作系统平台
  24. */
  25. export declare enum InvokerPlatformTypeEnum {
  26. Android = "Android",
  27. IOS = "IOS",
  28. Mac = "Mac",
  29. Linux = "Linux",
  30. Windows = "Windows",
  31. Unknown = "Unknown"
  32. }
  33. /**
  34. * 专有钉钉运行脚本的应用类型
  35. * Mobile | Desktop | MiniApp | WebBrowser | Unknown
  36. */
  37. export declare enum InvokerAppTypeEnum {
  38. /**
  39. * 移动端 Mobile H5
  40. */
  41. Mobile = "mobile",
  42. /**
  43. * 客户端 Desktop H5
  44. * Mac / Win / Linux
  45. */
  46. Desktop = "desktop",
  47. /**
  48. * 小程序 MiniApp
  49. */
  50. MiniApp = "mini",
  51. /**
  52. * 平台无关,通用 H5
  53. */
  54. Web = "web",
  55. /**
  56. * 未知平台
  57. */
  58. Unknown = "unknown"
  59. }
  60. /**
  61. * 专有钉钉代码运行时
  62. * Module:模块
  63. * Plugin:插件
  64. * App:正常应用
  65. */
  66. export declare enum InvokerRuntimeTypeEnum {
  67. /**
  68. * 原生本地模块(一般以 app://xxx or file:// 协议在桌面端打开)
  69. */
  70. Module = "module",
  71. /**
  72. * 模块上的扩展插件
  73. */
  74. Plugin = "plugin",
  75. /**
  76. * 正常应用
  77. */
  78. App = "app",
  79. Unknown = "Unknown"
  80. }
  81. export declare const UA_IDENTIFIER: string;
  82. export declare function getUAIdentifier(): any;
  83. export declare const getContainerType: () => InvokerContainerTypeEnum;
  84. export declare const APP_NAME: string;
  85. export declare const APP_VERSION: string;
  86. export declare const getPlatformType: () => InvokerPlatformTypeEnum;
  87. /**
  88. * 获取当前执行应用的类型
  89. * @public
  90. * @return InvokerAppTypeEnum
  91. */
  92. export declare const getAppType: () => InvokerAppTypeEnum;