parse-ast-index.d.mts 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import { L as ParseResult$1, R as ParserOptions$1 } from "./shared/binding-DUEnSb0A.mjs";
  2. import { Program } from "@oxc-project/types";
  3. //#region src/parse-ast-index.d.ts
  4. /**
  5. * @hidden
  6. */
  7. type ParseResult = ParseResult$1;
  8. /**
  9. * @hidden
  10. */
  11. 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. 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. declare function parseAstAsync(sourceText: string, options?: ParserOptions | null, filename?: string): Promise<Program>;
  30. //#endregion
  31. export { ParseResult, ParserOptions, parseAst, parseAstAsync };