Skip to content

Commit 70bccca

Browse files
committed
Remove some unused types
1 parent f325289 commit 70bccca

File tree

2 files changed

+0
-118
lines changed

2 files changed

+0
-118
lines changed

src/types.ts

-117
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
/* eslint-disable no-unused-vars */
2-
// TODO Ignoring all unused variables for now
3-
41
import { ClassAttributes, ComponentClass, ComponentType } from 'react'
52

63
import { Action, AnyAction, Dispatch } from 'redux'
74

8-
// import hoistNonReactStatics = require('hoist-non-react-statics');
95
import type { NonReactStatics } from 'hoist-non-react-statics'
106

117
import type { ConnectProps } from './components/connect'
@@ -26,9 +22,6 @@ export interface DefaultRootState {}
2622
export type AnyIfEmpty<T extends object> = keyof T extends never ? any : T
2723
export type RootStateOrAny = AnyIfEmpty<DefaultRootState>
2824

29-
// Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
30-
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
31-
3225
export type DistributiveOmit<T, K extends keyof T> = T extends unknown
3326
? Omit<T, K>
3427
: never
@@ -152,116 +145,6 @@ export type ResolveThunks<TDispatchProps> = TDispatchProps extends {
152145
}
153146
: TDispatchProps
154147

155-
// the conditional type is to support TypeScript 3.0, which does not support mapping over tuples and arrays;
156-
// once the typings are updated to at least TypeScript 3.1, a simple mapped type can replace this mess
157-
export type ResolveArrayThunks<TDispatchProps extends ReadonlyArray<any>> =
158-
TDispatchProps extends [
159-
infer A1,
160-
infer A2,
161-
infer A3,
162-
infer A4,
163-
infer A5,
164-
infer A6,
165-
infer A7,
166-
infer A8,
167-
infer A9
168-
]
169-
? [
170-
HandleThunkActionCreator<A1>,
171-
HandleThunkActionCreator<A2>,
172-
HandleThunkActionCreator<A3>,
173-
HandleThunkActionCreator<A4>,
174-
HandleThunkActionCreator<A5>,
175-
HandleThunkActionCreator<A6>,
176-
HandleThunkActionCreator<A7>,
177-
HandleThunkActionCreator<A8>,
178-
HandleThunkActionCreator<A9>
179-
]
180-
: TDispatchProps extends [
181-
infer A1,
182-
infer A2,
183-
infer A3,
184-
infer A4,
185-
infer A5,
186-
infer A6,
187-
infer A7,
188-
infer A8
189-
]
190-
? [
191-
HandleThunkActionCreator<A1>,
192-
HandleThunkActionCreator<A2>,
193-
HandleThunkActionCreator<A3>,
194-
HandleThunkActionCreator<A4>,
195-
HandleThunkActionCreator<A5>,
196-
HandleThunkActionCreator<A6>,
197-
HandleThunkActionCreator<A7>,
198-
HandleThunkActionCreator<A8>
199-
]
200-
: TDispatchProps extends [
201-
infer A1,
202-
infer A2,
203-
infer A3,
204-
infer A4,
205-
infer A5,
206-
infer A6,
207-
infer A7
208-
]
209-
? [
210-
HandleThunkActionCreator<A1>,
211-
HandleThunkActionCreator<A2>,
212-
HandleThunkActionCreator<A3>,
213-
HandleThunkActionCreator<A4>,
214-
HandleThunkActionCreator<A5>,
215-
HandleThunkActionCreator<A6>,
216-
HandleThunkActionCreator<A7>
217-
]
218-
: TDispatchProps extends [
219-
infer A1,
220-
infer A2,
221-
infer A3,
222-
infer A4,
223-
infer A5,
224-
infer A6
225-
]
226-
? [
227-
HandleThunkActionCreator<A1>,
228-
HandleThunkActionCreator<A2>,
229-
HandleThunkActionCreator<A3>,
230-
HandleThunkActionCreator<A4>,
231-
HandleThunkActionCreator<A5>,
232-
HandleThunkActionCreator<A6>
233-
]
234-
: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5]
235-
? [
236-
HandleThunkActionCreator<A1>,
237-
HandleThunkActionCreator<A2>,
238-
HandleThunkActionCreator<A3>,
239-
HandleThunkActionCreator<A4>,
240-
HandleThunkActionCreator<A5>
241-
]
242-
: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4]
243-
? [
244-
HandleThunkActionCreator<A1>,
245-
HandleThunkActionCreator<A2>,
246-
HandleThunkActionCreator<A3>,
247-
HandleThunkActionCreator<A4>
248-
]
249-
: TDispatchProps extends [infer A1, infer A2, infer A3]
250-
? [
251-
HandleThunkActionCreator<A1>,
252-
HandleThunkActionCreator<A2>,
253-
HandleThunkActionCreator<A3>
254-
]
255-
: TDispatchProps extends [infer A1, infer A2]
256-
? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>]
257-
: TDispatchProps extends [infer A1]
258-
? [HandleThunkActionCreator<A1>]
259-
: TDispatchProps extends Array<infer A>
260-
? Array<HandleThunkActionCreator<A>>
261-
: TDispatchProps extends ReadonlyArray<infer A>
262-
? ReadonlyArray<HandleThunkActionCreator<A>>
263-
: never
264-
265148
/**
266149
* This interface allows you to easily create a hook that is properly typed for your
267150
* store's root state.

test/hooks/useSelector.spec.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*eslint-disable react/prop-types*/
22

33
import React, { useCallback, useReducer, useLayoutEffect } from 'react'
4-
import ReactDOM from 'react-dom'
54
import { createStore } from 'redux'
65
import * as rtl from '@testing-library/react'
76
import {

0 commit comments

Comments
 (0)