mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added type definitions for use-combined-reducers (#38647)
* Added type definitions for use-combined-reducers * fixed errors * fixed typo * deleted typescript version declaration * defined the same typescript version as react
This commit is contained in:
parent
a6bf231f3f
commit
06484d13df
9
types/use-combined-reducers/index.d.ts
vendored
Normal file
9
types/use-combined-reducers/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Type definitions for use-combined-reducers 1.0
|
||||
// Project: https://github.com/the-road-to-learn-react/use-combined-reducers#readme
|
||||
// Definitions by: kwdowik <https://github.com/kwdowik>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export default function useCombinedReducers<T, A>(combinedReducers: Record<keyof T, [T[keyof T], React.Dispatch<A>]>): [T, (action: A) => void];
|
||||
23
types/use-combined-reducers/tsconfig.json
Normal file
23
types/use-combined-reducers/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"use-combined-reducers-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/use-combined-reducers/tslint.json
Normal file
1
types/use-combined-reducers/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@ -0,0 +1,6 @@
|
||||
import useCombinedReducers from 'use-combined-reducers';
|
||||
|
||||
useCombinedReducers<{ a: number; b: any }, () => {}>({
|
||||
a: ['', () => { }],
|
||||
b: ['', () => { }],
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user