uni_modules.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import type { UTSTargetLanguage } from './uts';
  2. export type DefineOptions = {
  3. name?: string;
  4. app?: boolean | {
  5. js?: boolean;
  6. kotlin?: boolean;
  7. swift?: boolean;
  8. };
  9. [key: string]: any;
  10. };
  11. export type Define = string | string[] | Record<string, string | DefineOptions> | false;
  12. export type Defines = {
  13. [name: string]: Define;
  14. };
  15. export interface Exports {
  16. [name: string]: Define | Defines | false;
  17. }
  18. export declare function getUniExtApiProviders(): {
  19. plugin: string;
  20. service: string;
  21. name?: string | undefined;
  22. servicePlugin?: string | undefined;
  23. }[];
  24. export declare function parseUniExtApis(vite: boolean | undefined, platform: typeof process.env.UNI_UTS_PLATFORM, language?: UTSTargetLanguage): Injects;
  25. export type Injects = {
  26. [name: string]: string | [string, string] | [string, string, DefineOptions['app']] | false;
  27. };
  28. /**
  29. * uni:'getBatteryInfo'
  30. * import getBatteryInfo from '..'
  31. *
  32. * uni:['getBatteryInfo']
  33. * import { getBatteryInfo } from '..'
  34. *
  35. * uni:['openLocation','chooseLocation']
  36. * import { openLocation, chooseLocation } from '..'
  37. *
  38. * uni:{
  39. * onUserCaptureScreen: "onCaptureScreen"
  40. * offUserCaptureScreen: "offCaptureScreen"
  41. * }
  42. *
  43. * uni.getBatteryInfo = getBatteryInfo
  44. * @param source
  45. * @param globalObject
  46. * @param define
  47. * @returns
  48. */
  49. export declare function parseInjects(vite: boolean | undefined, platform: typeof process.env.UNI_UTS_PLATFORM, language: UTSTargetLanguage, source: string, uniModuleRootDir: string, exports?: Exports): Injects;