printDiffs.d.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. import { Diff } from './cleanupSemantic';
  8. import { DiffOptions } from './types';
  9. export declare const DIM_COLOR: import("chalk").Chalk & {
  10. supportsColor: import("chalk").ColorSupport;
  11. };
  12. export declare const EXPECTED_COLOR: import("chalk").Chalk & {
  13. supportsColor: import("chalk").ColorSupport;
  14. };
  15. export declare const INVERTED_COLOR: import("chalk").Chalk & {
  16. supportsColor: import("chalk").ColorSupport;
  17. };
  18. export declare const RECEIVED_COLOR: import("chalk").Chalk & {
  19. supportsColor: import("chalk").ColorSupport;
  20. };
  21. export declare const getHighlightedString: (op: number, diffs: Diff[]) => string;
  22. export declare const getExpectedString: (diffs: Diff[]) => string;
  23. export declare const getReceivedString: (diffs: Diff[]) => string;
  24. export declare const MULTILINE_REGEXP: RegExp;
  25. export declare const printDeleteLine: (line: string) => string;
  26. export declare const printInsertLine: (line: string) => string;
  27. export declare const printCommonLine: (line: string, isFirstOrLast?: boolean) => string;
  28. export declare const computeStringDiffs: (expected: string, received: string) => {
  29. diffs: Diff[];
  30. isMultiline: boolean;
  31. };
  32. export declare const hasCommonDiff: (diffs: Diff[], isMultiline: boolean) => boolean;
  33. export declare const printAnnotation: (options?: DiffOptions | undefined) => string;
  34. export declare const createPatchMark: (aStart: number, aEnd: number, bStart: number, bEnd: number) => string;
  35. export declare const printMultilineStringDiffs: (diffs: Diff[], expand: boolean) => string;
  36. declare type StringDiffResult = {
  37. isMultiline: true;
  38. annotatedDiff: string;
  39. } | {
  40. isMultiline: false;
  41. a: string;
  42. b: string;
  43. } | null;
  44. export declare const getStringDiff: (expected: string, received: string, options?: DiffOptions | undefined) => StringDiffResult;
  45. export {};
  46. //# sourceMappingURL=printDiffs.d.ts.map