normalize.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { RangeTree } from "./range-tree";
  2. import { FunctionCov, ProcessCov, ScriptCov } from "./types";
  3. /**
  4. * Normalizes a process coverage.
  5. *
  6. * Sorts the scripts alphabetically by `url`.
  7. * Reassigns script ids: the script at index `0` receives `"0"`, the script at
  8. * index `1` receives `"1"` etc.
  9. * This does not normalize the script coverages.
  10. *
  11. * @param processCov Process coverage to normalize.
  12. */
  13. export declare function normalizeProcessCov(processCov: ProcessCov): void;
  14. /**
  15. * Normalizes a process coverage deeply.
  16. *
  17. * Normalizes the script coverages deeply, then normalizes the process coverage
  18. * itself.
  19. *
  20. * @param processCov Process coverage to normalize.
  21. */
  22. export declare function deepNormalizeProcessCov(processCov: ProcessCov): void;
  23. /**
  24. * Normalizes a script coverage.
  25. *
  26. * Sorts the function by root range (pre-order sort).
  27. * This does not normalize the function coverages.
  28. *
  29. * @param scriptCov Script coverage to normalize.
  30. */
  31. export declare function normalizeScriptCov(scriptCov: ScriptCov): void;
  32. /**
  33. * Normalizes a script coverage deeply.
  34. *
  35. * Normalizes the function coverages deeply, then normalizes the script coverage
  36. * itself.
  37. *
  38. * @param scriptCov Script coverage to normalize.
  39. */
  40. export declare function deepNormalizeScriptCov(scriptCov: ScriptCov): void;
  41. /**
  42. * Normalizes a function coverage.
  43. *
  44. * Sorts the ranges (pre-order sort).
  45. * TODO: Tree-based normalization of the ranges.
  46. *
  47. * @param funcCov Function coverage to normalize.
  48. */
  49. export declare function normalizeFunctionCov(funcCov: FunctionCov): void;
  50. /**
  51. * @internal
  52. */
  53. export declare function normalizeRangeTree(tree: RangeTree): void;