From cad97909b1f916c237cf0290f3e984dd14e258d7 Mon Sep 17 00:00:00 2001 From: Maciej Jastrzebski Date: Tue, 28 Nov 2023 23:00:24 +0100 Subject: [PATCH] chore: fix extend-expect.d.ts types by internalizing them --- src/matchers/extend-expect.d.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/matchers/extend-expect.d.ts b/src/matchers/extend-expect.d.ts index 7d76db0c1..d83358924 100644 --- a/src/matchers/extend-expect.d.ts +++ b/src/matchers/extend-expect.d.ts @@ -1,8 +1,5 @@ import type { StyleProp } from 'react-native'; import type { ReactTestInstance } from 'react-test-renderer'; -import type { TextMatch, TextMatchOptions } from '../matches'; -import type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value'; -import type { Style } from './to-have-style'; export interface JestNativeMatchers { toBeOnTheScreen(): R; @@ -38,3 +35,22 @@ declare module '@jest/expect' { interface Matchers> extends JestNativeMatchers {} } + +// Used types + +export type Style = ViewStyle | TextStyle | ImageStyle; + +export interface AccessibilityValueMatcher { + min?: number; + max?: number; + now?: number; + text?: TextMatch; +} + +export type TextMatch = string | RegExp; +export type TextMatchOptions = { + exact?: boolean; + normalizer?: NormalizerFn; +}; + +export type NormalizerFn = (textToNormalize: string) => string;