|
| 1 | +// Generated by typings |
| 2 | +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/08ed4e9f1869e37e29514d862e0158b40e550232/react/react-addons-test-utils.d.ts |
| 3 | +declarenamespace__React{ |
| 4 | +interfaceOptionalEventProperties{ |
| 5 | +bubbles?:boolean; |
| 6 | +cancelable?:boolean; |
| 7 | +currentTarget?:EventTarget; |
| 8 | +defaultPrevented?:boolean; |
| 9 | +eventPhase?:number; |
| 10 | +isTrusted?:boolean; |
| 11 | +nativeEvent?:Event; |
| 12 | +preventDefault?():void; |
| 13 | +stopPropagation?():void; |
| 14 | +target?:EventTarget; |
| 15 | +timeStamp?:Date; |
| 16 | +type?:string; |
| 17 | +} |
| 18 | + |
| 19 | +interfaceSyntheticEventDataextendsOptionalEventProperties{ |
| 20 | +altKey?:boolean; |
| 21 | +button?:number; |
| 22 | +buttons?:number; |
| 23 | +clientX?:number; |
| 24 | +clientY?:number; |
| 25 | +changedTouches?:TouchList; |
| 26 | +charCode?:boolean; |
| 27 | +clipboardData?:DataTransfer; |
| 28 | +ctrlKey?:boolean; |
| 29 | +deltaMode?:number; |
| 30 | +deltaX?:number; |
| 31 | +deltaY?:number; |
| 32 | +deltaZ?:number; |
| 33 | +detail?:number; |
| 34 | +getModifierState?(key:string):boolean; |
| 35 | +key?:string; |
| 36 | +keyCode?:number; |
| 37 | +locale?:string; |
| 38 | +location?:number; |
| 39 | +metaKey?:boolean; |
| 40 | +pageX?:number; |
| 41 | +pageY?:number; |
| 42 | +relatedTarget?:EventTarget; |
| 43 | +repeat?:boolean; |
| 44 | +screenX?:number; |
| 45 | +screenY?:number; |
| 46 | +shiftKey?:boolean; |
| 47 | +targetTouches?:TouchList; |
| 48 | +touches?:TouchList; |
| 49 | +view?:AbstractView; |
| 50 | +which?:number; |
| 51 | +} |
| 52 | + |
| 53 | +interfaceEventSimulator{ |
| 54 | +(element:Element|Component<any,any>,eventData?:SyntheticEventData):void; |
| 55 | +} |
| 56 | + |
| 57 | +interfaceMockedComponentClass{ |
| 58 | +new():any; |
| 59 | +} |
| 60 | + |
| 61 | +classShallowRenderer{ |
| 62 | +getRenderOutput<EextendsReactElement<any>>():E; |
| 63 | +getRenderOutput():ReactElement<any>; |
| 64 | +render(element:ReactElement<any>,context?:any):void; |
| 65 | +unmount():void; |
| 66 | +} |
| 67 | + |
| 68 | +namespace__Addons{ |
| 69 | +namespaceTestUtils{ |
| 70 | +namespaceSimulate{ |
| 71 | +exportvarblur:EventSimulator; |
| 72 | +exportvarchange:EventSimulator; |
| 73 | +exportvarclick:EventSimulator; |
| 74 | +exportvarcopy:EventSimulator; |
| 75 | +exportvarcut:EventSimulator; |
| 76 | +exportvardoubleClick:EventSimulator; |
| 77 | +exportvardrag:EventSimulator; |
| 78 | +exportvardragEnd:EventSimulator; |
| 79 | +exportvardragEnter:EventSimulator; |
| 80 | +exportvardragExit:EventSimulator; |
| 81 | +exportvardragLeave:EventSimulator; |
| 82 | +exportvardragOver:EventSimulator; |
| 83 | +exportvardragStart:EventSimulator; |
| 84 | +exportvardrop:EventSimulator; |
| 85 | +exportvarfocus:EventSimulator; |
| 86 | +exportvarinput:EventSimulator; |
| 87 | +exportvarkeyDown:EventSimulator; |
| 88 | +exportvarkeyPress:EventSimulator; |
| 89 | +exportvarkeyUp:EventSimulator; |
| 90 | +exportvarmouseDown:EventSimulator; |
| 91 | +exportvarmouseEnter:EventSimulator; |
| 92 | +exportvarmouseLeave:EventSimulator; |
| 93 | +exportvarmouseMove:EventSimulator; |
| 94 | +exportvarmouseOut:EventSimulator; |
| 95 | +exportvarmouseOver:EventSimulator; |
| 96 | +exportvarmouseUp:EventSimulator; |
| 97 | +exportvarpaste:EventSimulator; |
| 98 | +exportvarscroll:EventSimulator; |
| 99 | +exportvarsubmit:EventSimulator; |
| 100 | +exportvartouchCancel:EventSimulator; |
| 101 | +exportvartouchEnd:EventSimulator; |
| 102 | +exportvartouchMove:EventSimulator; |
| 103 | +exportvartouchStart:EventSimulator; |
| 104 | +exportvarwheel:EventSimulator; |
| 105 | +} |
| 106 | + |
| 107 | +exportfunctionrenderIntoDocument<TextendsElement>( |
| 108 | +element:DOMElement<any,T>):T; |
| 109 | +exportfunctionrenderIntoDocument( |
| 110 | +element:SFCElement<any>):void; |
| 111 | +exportfunctionrenderIntoDocument<TextendsComponent<any,any>>( |
| 112 | +element:CElement<any,T>):T; |
| 113 | +exportfunctionrenderIntoDocument<P>( |
| 114 | +element:ReactElement<P>):Component<P,{}>|Element|void; |
| 115 | + |
| 116 | +exportfunctionmockComponent( |
| 117 | +mocked:MockedComponentClass,mockTagName?:string):typeofTestUtils; |
| 118 | + |
| 119 | +exportfunctionisElementOfType<TextendsHTMLElement>( |
| 120 | +element:ReactElement<any>,type:string):element isReactHTMLElement<T>; |
| 121 | +exportfunctionisElementOfType<PextendsDOMAttributes,TextendsElement>( |
| 122 | +element:ReactElement<any>,type:string):element isDOMElement<P,T>; |
| 123 | +exportfunctionisElementOfType<P>( |
| 124 | +element:ReactElement<any>,type:SFC<P>):element isSFCElement<P>; |
| 125 | +exportfunctionisElementOfType<P,TextendsComponent<P,{}>,CextendsComponentClass<P>>( |
| 126 | +element:ReactElement<any>,type:ClassType<P,T,C>):element isCElement<P,T>; |
| 127 | + |
| 128 | +exportfunctionisDOMComponent(instance:ReactInstance):instance isElement; |
| 129 | +exportfunctionisCompositeComponent(instance:ReactInstance):instance isComponent<any,any>; |
| 130 | +exportfunctionisCompositeComponentWithType<TextendsComponent<any,any>,CextendsComponentClass<any>>( |
| 131 | +instance:ReactInstance,type:ClassType<any,T,C>):T; |
| 132 | + |
| 133 | +exportfunctionfindAllInRenderedTree( |
| 134 | +root:Component<any,any>, |
| 135 | +fn:(i:ReactInstance)=>boolean):ReactInstance[]; |
| 136 | + |
| 137 | +exportfunctionscryRenderedDOMComponentsWithClass( |
| 138 | +root:Component<any,any>, |
| 139 | +className:string):Element[]; |
| 140 | +exportfunctionfindRenderedDOMComponentWithClass( |
| 141 | +root:Component<any,any>, |
| 142 | +className:string):Element; |
| 143 | + |
| 144 | +exportfunctionscryRenderedDOMComponentsWithTag( |
| 145 | +root:Component<any,any>, |
| 146 | +tagName:string):Element[]; |
| 147 | +exportfunctionfindRenderedDOMComponentWithTag( |
| 148 | +root:Component<any,any>, |
| 149 | +tagName:string):Element; |
| 150 | + |
| 151 | +exportfunctionscryRenderedComponentsWithType<TextendsComponent<{},{}>,CextendsComponentClass<{}>>( |
| 152 | +root:Component<any,any>, |
| 153 | +type:ClassType<any,T,C>):T[]; |
| 154 | + |
| 155 | +exportfunctionfindRenderedComponentWithType<TextendsComponent<{},{}>,CextendsComponentClass<{}>>( |
| 156 | +root:Component<any,any>, |
| 157 | +type:ClassType<any,T,C>):T; |
| 158 | + |
| 159 | +exportfunctioncreateRenderer():ShallowRenderer; |
| 160 | +} |
| 161 | +} |
| 162 | +} |
| 163 | + |
| 164 | +declare module"react-addons-test-utils"{ |
| 165 | +importTestUtils=__React.__Addons.TestUtils; |
| 166 | +export=TestUtils; |
| 167 | +} |