Skip to content

Commit

Permalink
chore: fix extend-expect.d.ts types by internalizing them (#1536)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjastrzebski committed Nov 29, 2023
1 parent 01c770d commit 067462f
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/matchers/extend-expect.d.ts
Original file line number Diff line number Diff line change
@@ -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<R> {
toBeOnTheScreen(): R;
Expand Down Expand Up @@ -38,3 +35,22 @@ declare module '@jest/expect' {
interface Matchers<R extends void | Promise<void>>
extends JestNativeMatchers<R> {}
}

// 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;

0 comments on commit 067462f

Please sign in to comment.