parse-ast-index.d.mts 1.0 KB

123456789101112131415161718192021222324252627282930
  1. import { H as ParserOptions$1, V as ParseResult$1 } from "./shared/binding-tzp6Hc_3.mjs";
  2. import { Program } from "@oxc-project/types";
  3. //#region src/parse-ast-index.d.ts
  4. /**
  5. * @hidden
  6. */
  7. export type ParseResult = ParseResult$1;
  8. /**
  9. * @hidden
  10. */
  11. export type ParserOptions = ParserOptions$1;
  12. /**
  13. * Parse code synchronously and return the AST.
  14. *
  15. * This function is similar to Rollup's `parseAst` function.
  16. * Prefer using {@linkcode parseSync} instead of this function as it has more information in the return value.
  17. *
  18. * @category Utilities
  19. */
  20. export declare function parseAst(sourceText: string, options?: ParserOptions | null, filename?: string): Program;
  21. /**
  22. * Parse code asynchronously and return the AST.
  23. *
  24. * This function is similar to Rollup's `parseAstAsync` function.
  25. * Prefer using {@linkcode parseAsync} instead of this function as it has more information in the return value.
  26. *
  27. * @category Utilities
  28. */
  29. export declare function parseAstAsync(sourceText: string, options?: ParserOptions | null, filename?: string): Promise<Program>;
  30. //#endregion