mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
[enzyme] state() with no props as an "S" (state type) return type (#12211)
* clarify and fix 'options' object types; Hammer.Manager requires an EventTarget, not HTMLElement * fix RecognizerTuple type * `state()` with no props has an `S` (state type) return value
This commit is contained in:
committed by
Masahiro Wakame
parent
b6f6ba5f89
commit
4cc7cbabf6
@@ -204,7 +204,7 @@ namespace ShallowWrapperTest {
|
||||
}
|
||||
|
||||
function test_state() {
|
||||
shallowWrapper.state();
|
||||
const state: MyComponentState = shallowWrapper.state();
|
||||
shallowWrapper.state('key');
|
||||
const tmp: String = shallowWrapper.state<String>('key');
|
||||
}
|
||||
|
||||
Vendored
+3
-2
@@ -204,8 +204,9 @@ declare module "enzyme" {
|
||||
* Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value.
|
||||
* @param [key]
|
||||
*/
|
||||
state(key?: string): any;
|
||||
state<T>(key?: string): T;
|
||||
state(): S;
|
||||
state(key: string): any;
|
||||
state<T>(key: string): T;
|
||||
|
||||
/**
|
||||
* Returns the context hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value.
|
||||
|
||||
Reference in New Issue
Block a user