您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

functions.native.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // @flow
  2. import { NativeModules } from 'react-native';
  3. const { Dropbox } = NativeModules;
  4. /**
  5. * Returns the display name for the current dropbox account.
  6. *
  7. * @param {string} token - The dropbox access token.
  8. * @returns {Promise<string>} - The promise will be resolved with the display
  9. * name or rejected with an error.
  10. */
  11. export function getDisplayName(token: string) {
  12. return Dropbox.getDisplayName(token);
  13. }
  14. /**
  15. * Returns information about the space usage for the current dropbox account.
  16. *
  17. * @param {string} token - The dropbox access token.
  18. * @returns {Promise<{ used: number, allocated: number}>} - The promise will be
  19. * resolved with the object with information about the space usage (the used
  20. * space and the allocated space) for the current dropbox account or rejected
  21. * with an error.
  22. */
  23. export function getSpaceUsage(token: string) {
  24. return Dropbox.getSpaceUsage(token);
  25. }
  26. /**
  27. * Action to authorize the Jitsi Recording app in dropbox.
  28. *
  29. * @param {string} clientId - The Jitsi Recorder dropbox app ID.
  30. * @param {string} redirectURI - The return URL.
  31. * @returns {Promise<string>} - The promise will be resolved with the dropbox
  32. * access token or rejected with an error.
  33. */
  34. export function _authorizeDropbox(): Promise<string> {
  35. return Dropbox.authorize();
  36. }
  37. /**
  38. * Returns <tt>true</tt> if the dropbox features is enabled and <tt>false</tt>
  39. * otherwise.
  40. *
  41. * @returns {boolean}
  42. */
  43. export function isEnabled() {
  44. return Dropbox.ENABLED;
  45. }