diff --git a/types/enzyme-redux/enzyme-redux-tests.tsx b/types/enzyme-redux/enzyme-redux-tests.tsx new file mode 100644 index 0000000000..ecd196dfd8 --- /dev/null +++ b/types/enzyme-redux/enzyme-redux-tests.tsx @@ -0,0 +1,9 @@ +import { mountWithState, mountWithStore, shallowWithState, shallowWithStore } from 'enzyme-redux'; +import * as React from 'react'; + +const Component = () =>
component
; +const shallowWithStateWrapper = shallowWithState(, {}); +const shallowWithStoreWrapper = shallowWithStore(, {}); + +const mountWithStateWrapper = mountWithState(, {}); +const mountWithStoreWrapper = mountWithStore(, {}); diff --git a/types/enzyme-redux/index.d.ts b/types/enzyme-redux/index.d.ts new file mode 100644 index 0000000000..ad312d6d1f --- /dev/null +++ b/types/enzyme-redux/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for enzyme-redux 0.2 +// Project: https://github.com/Knegusen/enzyme-redux#readme +// Definitions by: Dennis Axelsson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { ReactWrapper, ShallowWrapper } from 'enzyme'; +import { ReactElement } from 'react'; + +export function shallowWithStore

( + Component: ReactElement

, + store: any +): ShallowWrapper

; +export function mountWithStore

( + Component: ReactElement

, + store: any +): ReactWrapper

; +export function shallowWithState

( + Component: ReactElement

, + state: any +): ShallowWrapper

; +export function mountWithState

( + Component: ReactElement

, + state: any +): ReactWrapper

; diff --git a/types/enzyme-redux/tsconfig.json b/types/enzyme-redux/tsconfig.json new file mode 100644 index 0000000000..7cc21814b3 --- /dev/null +++ b/types/enzyme-redux/tsconfig.json @@ -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" + ] +} diff --git a/types/enzyme-redux/tslint.json b/types/enzyme-redux/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/enzyme-redux/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }