Skip to content

Commit 067462f

Browse files
chore: fix extend-expect.d.ts types by internalizing them (#1536)
1 parent 01c770d commit 067462f

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/matchers/extend-expect.d.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import type { StyleProp } from 'react-native';
22
import type { ReactTestInstance } from 'react-test-renderer';
3-
import type { TextMatch, TextMatchOptions } from '../matches';
4-
import type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';
5-
import type { Style } from './to-have-style';
63

74
export interface JestNativeMatchers<R> {
85
toBeOnTheScreen(): R;
@@ -38,3 +35,22 @@ declare module '@jest/expect' {
3835
interface Matchers<R extends void | Promise<void>>
3936
extends JestNativeMatchers<R> {}
4037
}
38+
39+
// Used types
40+
41+
export type Style = ViewStyle | TextStyle | ImageStyle;
42+
43+
export interface AccessibilityValueMatcher {
44+
min?: number;
45+
max?: number;
46+
now?: number;
47+
text?: TextMatch;
48+
}
49+
50+
export type TextMatch = string | RegExp;
51+
export type TextMatchOptions = {
52+
exact?: boolean;
53+
normalizer?: NormalizerFn;
54+
};
55+
56+
export type NormalizerFn = (textToNormalize: string) => string;

0 commit comments

Comments
 (0)