mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add typings for enzyme-redux (#24948)
This commit is contained in:
parent
22bea9740b
commit
8cf4294b84
9
types/enzyme-redux/enzyme-redux-tests.tsx
Normal file
9
types/enzyme-redux/enzyme-redux-tests.tsx
Normal file
@ -0,0 +1,9 @@
|
||||
import { mountWithState, mountWithStore, shallowWithState, shallowWithStore } from 'enzyme-redux';
|
||||
import * as React from 'react';
|
||||
|
||||
const Component = () => <div>component</div>;
|
||||
const shallowWithStateWrapper = shallowWithState(<Component />, {});
|
||||
const shallowWithStoreWrapper = shallowWithStore(<Component />, {});
|
||||
|
||||
const mountWithStateWrapper = mountWithState(<Component />, {});
|
||||
const mountWithStoreWrapper = mountWithStore(<Component />, {});
|
||||
25
types/enzyme-redux/index.d.ts
vendored
Normal file
25
types/enzyme-redux/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for enzyme-redux 0.2
|
||||
// Project: https://github.com/Knegusen/enzyme-redux#readme
|
||||
// Definitions by: Dennis Axelsson <https://github.com/knegusen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import { ReactWrapper, ShallowWrapper } from 'enzyme';
|
||||
import { ReactElement } from 'react';
|
||||
|
||||
export function shallowWithStore<P>(
|
||||
Component: ReactElement<P>,
|
||||
store: any
|
||||
): ShallowWrapper<P>;
|
||||
export function mountWithStore<P>(
|
||||
Component: ReactElement<P>,
|
||||
store: any
|
||||
): ReactWrapper<P>;
|
||||
export function shallowWithState<P>(
|
||||
Component: ReactElement<P>,
|
||||
state: any
|
||||
): ShallowWrapper<P>;
|
||||
export function mountWithState<P>(
|
||||
Component: ReactElement<P>,
|
||||
state: any
|
||||
): ReactWrapper<P>;
|
||||
24
types/enzyme-redux/tsconfig.json
Normal file
24
types/enzyme-redux/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"enzyme-redux-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/enzyme-redux/tslint.json
Normal file
1
types/enzyme-redux/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user