index.d.ts 858 B

12345678910111213141516171819202122232425262728293031323334
  1. /// <reference path="./types/index.d.ts" />
  2. interface VoiceProps {
  3. noMute: boolean,
  4. pullUrls: string[],
  5. pushUrl?: boolean
  6. }
  7. interface GlobalUserInfo extends WechatMiniprogram.UserInfo {
  8. phoneNumber?: string
  9. wxUserId?: string
  10. }
  11. interface LoginProps {
  12. isLogin: boolean
  13. }
  14. interface GlobalDataProps {
  15. userInfo?: GlobalUserInfo,
  16. voiceProps?: VoiceProps,
  17. token: string,
  18. isLogin: boolean
  19. }
  20. interface IAppOption {
  21. globalData: GlobalDataProps
  22. userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback,
  23. addVoicePropsListener?: (cb: Function) => void
  24. removeVoicePropsListener?: (cb: Function) => void
  25. setVoiceProps?: (param: VoiceProps) => void
  26. setLogin: (status: boolean) => Promise<boolean>
  27. watch: (key: string, method: Function) => void
  28. unwatch: (key: string, method: Function) => void
  29. resetUserInfo: () => void
  30. }