global.d.ts 970 B

1234567891011121314151617181920212223242526272829
  1. /// <reference types="@tarojs/taro" />
  2. declare module '*.png';
  3. declare module '*.gif';
  4. declare module '*.jpg';
  5. declare module '*.jpeg';
  6. declare module '*.svg';
  7. declare module '*.css';
  8. declare module '*.less';
  9. declare module '*.scss';
  10. declare module '*.sass';
  11. declare module '*.styl';
  12. declare namespace NodeJS {
  13. interface ProcessEnv {
  14. /** NODE 内置环境变量, 会影响到最终构建生成产物 */
  15. NODE_ENV: 'development' | 'production',
  16. /** 当前构建的平台 */
  17. TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'qq' | 'jd' | 'harmony' | 'jdrn'
  18. /**
  19. * 当前构建的小程序 appid
  20. * @description 若不同环境有不同的小程序,可通过在 env 文件中配置环境变量`TARO_APP_ID`来方便快速切换 appid, 而不必手动去修改 dist/project.config.json 文件
  21. * @see https://taro-docs.jd.com/docs/next/env-mode-config#特殊环境变量-taro_app_id
  22. */
  23. TARO_APP_ID: string
  24. }
  25. }