index.d.ts 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 { DiffOptions } from 'jest-diff';
  8. declare type MatcherHintColor = (arg: string) => string;
  9. export declare type MatcherHintOptions = {
  10. comment?: string;
  11. expectedColor?: MatcherHintColor;
  12. isDirectExpectCall?: boolean;
  13. isNot?: boolean;
  14. promise?: string;
  15. receivedColor?: MatcherHintColor;
  16. secondArgument?: string;
  17. secondArgumentColor?: MatcherHintColor;
  18. };
  19. export { DiffOptions };
  20. export declare const EXPECTED_COLOR: import("chalk").Chalk & {
  21. supportsColor: import("chalk").ColorSupport;
  22. };
  23. export declare const RECEIVED_COLOR: import("chalk").Chalk & {
  24. supportsColor: import("chalk").ColorSupport;
  25. };
  26. export declare const INVERTED_COLOR: import("chalk").Chalk & {
  27. supportsColor: import("chalk").ColorSupport;
  28. };
  29. export declare const BOLD_WEIGHT: import("chalk").Chalk & {
  30. supportsColor: import("chalk").ColorSupport;
  31. };
  32. export declare const DIM_COLOR: import("chalk").Chalk & {
  33. supportsColor: import("chalk").ColorSupport;
  34. };
  35. export declare const SUGGEST_TO_CONTAIN_EQUAL: string;
  36. export declare const stringify: (object: unknown, maxDepth?: number) => string;
  37. export declare const highlightTrailingWhitespace: (text: string) => string;
  38. export declare const printReceived: (object: unknown) => string;
  39. export declare const printExpected: (value: unknown) => string;
  40. export declare const printWithType: (name: string, value: unknown, print: (value: unknown) => string) => string;
  41. export declare const ensureNoExpected: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void;
  42. export declare const ensureActualIsNumber: (actual: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void;
  43. export declare const ensureExpectedIsNumber: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void;
  44. export declare const ensureNumbers: (actual: unknown, expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void;
  45. export declare const ensureExpectedIsNonNegativeInteger: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void;
  46. export declare const printDiffOrStringify: (expected: unknown, received: unknown, expectedLabel: string, receivedLabel: string, expand: boolean) => string;
  47. export declare const diff: (a: any, b: any, options?: import("jest-diff/build/types").DiffOptions | undefined) => string | null;
  48. export declare const pluralize: (word: string, count: number) => string;
  49. declare type PrintLabel = (string: string) => string;
  50. export declare const getLabelPrinter: (...strings: string[]) => PrintLabel;
  51. export declare const matcherErrorMessage: (hint: string, generic: string, specific: string) => string;
  52. export declare const matcherHint: (matcherName: string, received?: string, expected?: string, options?: MatcherHintOptions) => string;
  53. //# sourceMappingURL=index.d.ts.map