3030var { TestModule } = React . addons ;
3131var Settings = require ( 'Settings' ) ;
3232
33+ import type { Example , ExampleModule } from 'ExampleTypes' ;
34+
3335var createExamplePage = require ( './createExamplePage' ) ;
3436
3537var COMPONENTS = [
@@ -107,9 +109,17 @@ COMPONENTS.concat(APIS).forEach((Example) => {
107109 }
108110} ) ;
109111
112+ type Props = {
113+ navigator : Array < { title : string , component : ReactClass < any , any, any> } > ,
114+ onExternalExampleRequested : Function ,
115+ } ;
116+
117+
118+
110119class UIExplorerList extends React . Component {
120+ props : Props ;
111121
112- constructor ( props ) {
122+ constructor ( props : Props ) {
113123 super ( props ) ;
114124 this . state = {
115125 dataSource : ds . cloneWithRowsAndSections ( {
@@ -149,7 +159,7 @@ class UIExplorerList extends React.Component {
149159 ) ;
150160 }
151161
152- _renderSectionHeader ( data , section ) {
162+ _renderSectionHeader ( data : any , section : string ) {
153163 return (
154164 < View style = { styles . sectionHeader } >
155165 < Text style = { styles . sectionHeaderTitle } >
@@ -159,7 +169,7 @@ class UIExplorerList extends React.Component {
159169 ) ;
160170 }
161171
162- _renderRow ( example , i ) {
172+ _renderRow ( example : ExampleModule , i : number ) {
163173 return (
164174 < View key = { i } >
165175 < TouchableHighlight onPress = { ( ) => this . _onPressRow ( example ) } >
@@ -177,7 +187,7 @@ class UIExplorerList extends React.Component {
177187 ) ;
178188 }
179189
180- _search ( text ) {
190+ _search ( text : mixed ) {
181191 var regex = new RegExp ( text , 'i' ) ;
182192 var filter = ( component ) => regex . test ( component . title ) ;
183193
@@ -191,7 +201,7 @@ class UIExplorerList extends React.Component {
191201 Settings . set ( { searchText : text } ) ;
192202 }
193203
194- _onPressRow ( example ) {
204+ _onPressRow ( example : ExampleModule ) {
195205 if ( example . external ) {
196206 this . props . onExternalExampleRequested ( example ) ;
197207 return ;
0 commit comments