Skip to content

Commit

Permalink
remove unneccessary type
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Dec 4, 2023
1 parent 0521529 commit 188dd0a
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions src/testing/matchers/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import {
ProfiledHook,
} from "../internal/index.js";

declare class WeakRef<T extends WeakKey> {
constructor(target: T);
deref(): T | undefined;
}

interface ApolloCustomMatchers<R = void, T = {}> {
/**
* Used to determine if two GraphQL query documents are equal to each other by
Expand All @@ -25,30 +20,33 @@ interface ApolloCustomMatchers<R = void, T = {}> {
/**
* Used to determine if the Suspense cache has a cache entry.
*/
toHaveSuspenseCacheEntryUsing: T extends ApolloClient<any> ?
(
query: DocumentNode,
options?: {
variables?: OperationVariables;
queryKey?: string | number | any[];
}
) => R
: { error: "matcher needs to be called on an ApolloClient instance" };
toHaveSuspenseCacheEntryUsing: T extends ApolloClient<any>
? (
query: DocumentNode,
options?: {
variables?: OperationVariables;
queryKey?: string | number | any[];
}
) => R
: { error: "matcher needs to be called on an ApolloClient instance" };

toRerender: T extends (
Profiler<any, any> | ProfiledComponent<any, any> | ProfiledHook<any, any>
) ?
(options?: NextRenderOptions) => Promise<R>
: { error: "matcher needs to be called on a ProfiledComponent instance" };
toRerender: T extends
| Profiler<any, any>
| ProfiledComponent<any, any>
| ProfiledHook<any, any>
? (options?: NextRenderOptions) => Promise<R>
: { error: "matcher needs to be called on a ProfiledComponent instance" };

toRenderExactlyTimes: T extends (
Profiler<any, any> | ProfiledComponent<any, any> | ProfiledHook<any, any>
) ?
(count: number, options?: NextRenderOptions) => Promise<R>
: { error: "matcher needs to be called on a ProfiledComponent instance" };
toRenderExactlyTimes: T extends
| Profiler<any, any>
| ProfiledComponent<any, any>
| ProfiledHook<any, any>
? (count: number, options?: NextRenderOptions) => Promise<R>
: { error: "matcher needs to be called on a ProfiledComponent instance" };

toBeGarbageCollected: T extends WeakRef<any> ? () => Promise<R>
: { error: "matcher needs to be called on a WeakRef instance" };
toBeGarbageCollected: T extends WeakRef<any>
? () => Promise<R>
: { error: "matcher needs to be called on a WeakRef instance" };
}

declare global {
Expand Down

0 comments on commit 188dd0a

Please sign in to comment.