1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type {SnapshotFormat} from '@jest/schemas';
|
8 |
|
9 | export declare type Colors = {
|
10 | comment: {
|
11 | close: string;
|
12 | open: string;
|
13 | };
|
14 | content: {
|
15 | close: string;
|
16 | open: string;
|
17 | };
|
18 | prop: {
|
19 | close: string;
|
20 | open: string;
|
21 | };
|
22 | tag: {
|
23 | close: string;
|
24 | open: string;
|
25 | };
|
26 | value: {
|
27 | close: string;
|
28 | open: string;
|
29 | };
|
30 | };
|
31 |
|
32 | export declare type CompareKeys =
|
33 | | ((a: string, b: string) => number)
|
34 | | undefined;
|
35 |
|
36 | export declare type Config = {
|
37 | callToJSON: boolean;
|
38 | compareKeys: CompareKeys;
|
39 | colors: Colors;
|
40 | escapeRegex: boolean;
|
41 | escapeString: boolean;
|
42 | indent: string;
|
43 | maxDepth: number;
|
44 | maxWidth: number;
|
45 | min: boolean;
|
46 | plugins: Plugins;
|
47 | printBasicPrototype: boolean;
|
48 | printFunctionName: boolean;
|
49 | spacingInner: string;
|
50 | spacingOuter: string;
|
51 | };
|
52 |
|
53 | export declare const DEFAULT_OPTIONS: Options;
|
54 |
|
55 | /**
|
56 | * Returns a presentation string of your `val` object
|
57 | * @param val any potential JavaScript object
|
58 | * @param options Custom settings
|
59 | */
|
60 | declare function format(val: unknown, options?: OptionsReceived): string;
|
61 | export default format;
|
62 | export {format};
|
63 |
|
64 | declare type Indent = (arg0: string) => string;
|
65 |
|
66 | export declare type NewPlugin = {
|
67 | serialize: (
|
68 | val: any,
|
69 | config: Config,
|
70 | indentation: string,
|
71 | depth: number,
|
72 | refs: Refs,
|
73 | printer: Printer,
|
74 | ) => string;
|
75 | test: Test;
|
76 | };
|
77 |
|
78 | export declare type OldPlugin = {
|
79 | print: (
|
80 | val: unknown,
|
81 | print: Print,
|
82 | indent: Indent,
|
83 | options: PluginOptions,
|
84 | colors: Colors,
|
85 | ) => string;
|
86 | test: Test;
|
87 | };
|
88 |
|
89 | export declare interface Options
|
90 | extends Omit<RequiredOptions, 'compareKeys' | 'theme'> {
|
91 | compareKeys: CompareKeys;
|
92 | theme: Required<RequiredOptions['theme']>;
|
93 | }
|
94 |
|
95 | export declare type OptionsReceived = PrettyFormatOptions;
|
96 |
|
97 | declare type Plugin_2 = NewPlugin | OldPlugin;
|
98 | export {Plugin_2 as Plugin};
|
99 |
|
100 | declare type PluginOptions = {
|
101 | edgeSpacing: string;
|
102 | min: boolean;
|
103 | spacing: string;
|
104 | };
|
105 |
|
106 | export declare type Plugins = Array<Plugin_2>;
|
107 |
|
108 | export declare const plugins: {
|
109 | AsymmetricMatcher: NewPlugin;
|
110 | ConvertAnsi: NewPlugin;
|
111 | DOMCollection: NewPlugin;
|
112 | DOMElement: NewPlugin;
|
113 | Immutable: NewPlugin;
|
114 | ReactElement: NewPlugin;
|
115 | ReactTestComponent: NewPlugin;
|
116 | };
|
117 |
|
118 | export declare interface PrettyFormatOptions extends SnapshotFormat {
|
119 | compareKeys?: CompareKeys;
|
120 | plugins?: Plugins;
|
121 | }
|
122 |
|
123 | declare type Print = (arg0: unknown) => string;
|
124 |
|
125 | export declare type Printer = (
|
126 | val: unknown,
|
127 | config: Config,
|
128 | indentation: string,
|
129 | depth: number,
|
130 | refs: Refs,
|
131 | hasCalledToJSON?: boolean,
|
132 | ) => string;
|
133 |
|
134 | export declare type Refs = Array<unknown>;
|
135 |
|
136 | declare type RequiredOptions = Required<PrettyFormatOptions>;
|
137 |
|
138 | declare type Test = (arg0: any) => boolean;
|
139 |
|
140 | export declare type Theme = Options['theme'];
|
141 |
|
142 | export {};
|