code.d.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import type { Param, TsInterfaceDeclaration } from '../types/types';
  2. export declare const enum FORMATS {
  3. ES = "es",
  4. CJS = "cjs"
  5. }
  6. type Types = {
  7. interface: Record<string, {
  8. returned: boolean;
  9. decl: TsInterfaceDeclaration;
  10. }>;
  11. class: string[];
  12. fn: Record<string, Param[]>;
  13. };
  14. interface Meta {
  15. exports: Record<string, 'var' | 'function' | 'class' | 'interface'>;
  16. types: Record<string, 'function' | 'class' | 'interface'>;
  17. }
  18. interface GenProxyCodeOptions {
  19. is_uni_modules: boolean;
  20. id: string;
  21. name: string;
  22. extname: string;
  23. namespace: string;
  24. androidComponents?: Record<string, string>;
  25. iosComponents?: Record<string, string>;
  26. format?: FORMATS;
  27. inputDir?: string;
  28. pluginRelativeDir?: string;
  29. moduleName?: string;
  30. moduleType?: string;
  31. types?: Types;
  32. meta?: Meta;
  33. }
  34. export declare function genProxyCode(module: string, options: GenProxyCodeOptions): Promise<string>;
  35. export declare function genComponentsCode(format: FORMATS | undefined, androidComponents: Record<string, string>, iosComponents: Record<string, string>): string;
  36. export declare function resolveRootIndex(module: string, options: GenProxyCodeOptions): string | false;
  37. export declare function resolveRootInterface(module: string, options: GenProxyCodeOptions): string | false;
  38. export declare function resolvePlatformIndexFilename(platform: 'app-android' | 'app-ios', module: string, options: GenProxyCodeOptions): string;
  39. export declare function resolvePlatformIndex(platform: 'app-android' | 'app-ios', module: string, options: GenProxyCodeOptions): string | false;
  40. export {};