index.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { UTSBundleOptions, UTSResult, UTSTarget } from './types';
  2. export { UTSTarget, UTSResult, UTSBundleOptions, UTSInputOptions, UTSOutputOptions, UTSParseOptions, } from './types';
  3. export type UTSMode = 'dev' | 'build';
  4. export declare const UTSTargetExtNames: {
  5. readonly kotlin: "kt";
  6. readonly swift: "swift";
  7. };
  8. export interface ToOptions {
  9. /**
  10. * 为 true 时,禁用日志输出,默认为 false
  11. */
  12. silent?: boolean;
  13. input: {
  14. /**
  15. * 插件根目录
  16. */
  17. dir: string;
  18. /**
  19. * 文件后缀,默认 .uts
  20. */
  21. extname?: string;
  22. };
  23. output: {
  24. /**
  25. * 输出目录
  26. */
  27. dir: string;
  28. /**
  29. * 包名
  30. */
  31. package?: string;
  32. /**
  33. * 自动导入的包
  34. */
  35. imports?: string[];
  36. /**
  37. * 是否生成 sourceMap,为 string 时,表示生成的 sourceMap 目标目录
  38. */
  39. sourceMap?: boolean | string;
  40. /**
  41. * sourceMap 中是否包含源码
  42. */
  43. inlineSourcesContent?: boolean;
  44. extname?: string;
  45. };
  46. }
  47. export { parse, bundleKotlin, bundleSwift } from './api';
  48. export declare function bundle(target: UTSTarget, opts: UTSBundleOptions): Promise<UTSResult>;