kotlin.d.ts 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import type { UTSResult } from '@dcloudio/uts';
  2. import { CompilerServer, ToKotlinOptions } from './utils';
  3. import { Module } from '../types/types';
  4. import { APP_PLATFORM } from './manifest/utils';
  5. export interface KotlinCompilerServer extends CompilerServer {
  6. getKotlincHome(): string;
  7. getDefaultJar(arg?: any): string[];
  8. compile(options: {
  9. kotlinc: string[];
  10. d8: string[];
  11. }, projectPath: string): Promise<boolean>;
  12. checkDependencies?: (configJsonPath: string) => Promise<{
  13. code: number;
  14. msg: string;
  15. data: string[];
  16. }>;
  17. checkRResources?: (resDir: string) => Promise<{
  18. code: number;
  19. msg: string;
  20. data: {
  21. jarPath: string;
  22. uniModuleName: string;
  23. };
  24. }>;
  25. }
  26. export declare function createKotlinResolveTypeReferenceName(_namespace: string, _ast: Module): (name: string) => string;
  27. export declare function runKotlinProd(filename: string, components: Record<string, string>, { isPlugin, isX, extApis, }: {
  28. isPlugin: boolean;
  29. isX: boolean;
  30. extApis?: Record<string, [string, string]>;
  31. }): Promise<void>;
  32. export type RunKotlinDevResult = UTSResult & {
  33. type: 'kotlin';
  34. changed: string[];
  35. };
  36. interface RunKotlinDevOptions {
  37. components: Record<string, string>;
  38. isX: boolean;
  39. isPlugin: boolean;
  40. cacheDir: string;
  41. pluginRelativeDir: string;
  42. is_uni_modules: boolean;
  43. extApis?: Record<string, [string, string]>;
  44. }
  45. export declare function runKotlinDev(filename: string, { components, isX, isPlugin, cacheDir, pluginRelativeDir, is_uni_modules, extApis, }: RunKotlinDevOptions): Promise<RunKotlinDevResult | undefined>;
  46. export declare function resolveAndroidDepFiles(filename: string): string[];
  47. export declare function compile(filename: string, { inputDir, outputDir, sourceMap, components, isX, isPlugin, extApis, }: ToKotlinOptions): Promise<UTSResult | undefined>;
  48. export declare function resolveKotlincArgs(filename: string, dest: string, kotlinc: string, jars: string[]): string[];
  49. export declare function resolveD8Args(filename: string): string[];
  50. export declare function resolveDexFile(jarFile: string): string;
  51. export declare function resolveJarPath(platform: APP_PLATFORM, cacheDir: string, pluginRelativeDir: string, filename: string): string;
  52. export declare function checkAndroidVersionTips(pluginId: string, pluginDir: string, is_uni_modules: boolean): string | undefined;
  53. export declare function getUniModulesCacheJars(cacheDir: string): string[];
  54. export declare function getUniModulesJars(outputDir: string): string[];
  55. export {};