index.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /// <reference path="./types/index.d.ts" />
  2. interface VoiceProps {
  3. noMute?: boolean,
  4. pullUrls?: string[],
  5. pushUrl?: boolean
  6. sdkAppID?: number
  7. sig?: string
  8. action?: string
  9. userId?: string
  10. roomId?: string
  11. role?: string
  12. }
  13. interface GlobalUserInfo extends WechatMiniprogram.UserInfo {
  14. phoneNumber?: string
  15. wxUserId?: string
  16. }
  17. interface LoginProps {
  18. isLogin: boolean
  19. }
  20. interface GlobalDataProps {
  21. userInfo?: GlobalUserInfo,
  22. voiceProps?: VoiceProps,
  23. token: string,
  24. isLogin: boolean
  25. roomId: string
  26. }
  27. interface IAppOption {
  28. sleep: (ms: number) => Promise<any>
  29. globalData: GlobalDataProps
  30. userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback,
  31. addVoicePropsListener?: (cb: Function) => void
  32. removeVoicePropsListener?: (cb: Function) => void
  33. setVoiceProps: (param: VoiceProps) => void
  34. setLogin: (status: boolean) => Promise<boolean>
  35. login: (slient?: boolean) => Promise<GlobalUserInfo | undefined>
  36. watch: (key: string, method: Function) => void
  37. unwatch: (key: string, method: Function) => void
  38. resetUserInfo: () => void
  39. }
  40. interface SocketParams {
  41. vruserId: string
  42. roomId: string
  43. role: string
  44. avatar: string
  45. name: string
  46. isTour: number
  47. m: string
  48. fromMiniApp: number
  49. vlog?: number
  50. wxToken?: string
  51. }
  52. interface SocketAction {
  53. type: string
  54. muted?: boolean
  55. userId?: string
  56. members?: any[]
  57. data: any
  58. }