Browse Source

fix some ts errors

Arnaud Vergnet 2 years ago
parent
commit
63722c2417

+ 1
- 1
src/components/Home/FeedItem.tsx View File

@@ -113,7 +113,7 @@ function FeedItem(props: PropsType) {
113 113
           ) : null}
114 114
           <Card.Content>
115 115
             {item.message !== undefined ? (
116
-              <Autolink<typeof Text>
116
+              <Autolink
117 117
                 text={item.message}
118 118
                 hashtag={'facebook'}
119 119
                 component={Text}

+ 1
- 1
src/components/Lists/DashboardEdit/DashboardEditAccordion.tsx View File

@@ -60,7 +60,7 @@ function DashboardEditAccordion(props: PropsType) {
60 60
   };
61 61
 
62 62
   const getItemLayout = (
63
-    data: Array<ServiceItemType> | null | undefined,
63
+    _data: Array<ServiceItemType> | null | undefined,
64 64
     index: number
65 65
   ): { length: number; offset: number; index: number } => ({
66 66
     length: LIST_ITEM_HEIGHT,

+ 1
- 1
src/components/Lists/PlanexGroups/GroupListAccordion.tsx View File

@@ -88,7 +88,7 @@ class GroupListAccordion extends React.Component<PropsType> {
88 88
   }
89 89
 
90 90
   itemLayout = (
91
-    data: Array<PlanexGroupType> | null | undefined,
91
+    _data: Array<PlanexGroupType> | null | undefined,
92 92
     index: number
93 93
   ): { length: number; offset: number; index: number } => ({
94 94
     length: LIST_ITEM_HEIGHT,

+ 3
- 3
src/components/Overrides/CustomHTML.tsx View File

@@ -30,14 +30,14 @@ type PropsType = {
30 30
  * Abstraction layer for Agenda component, using custom configuration
31 31
  */
32 32
 function CustomHTML(props: PropsType) {
33
-  const openWebLink = (event: GestureResponderEvent, link: string) => {
33
+  const openWebLink = (_event: GestureResponderEvent, link: string) => {
34 34
     Linking.openURL(link);
35 35
   };
36 36
 
37 37
   const getBasicText = (
38
-    htmlAttribs: any,
38
+    _htmlAttribs: any,
39 39
     children: any,
40
-    convertedCSSStyles: any,
40
+    _convertedCSSStyles: any,
41 41
     passProps: any
42 42
   ) => {
43 43
     return <Text {...passProps}>{children}</Text>;

+ 3
- 3
src/managers/ConnectionManager.ts View File

@@ -67,9 +67,9 @@ export default class ConnectionManager {
67 67
   /**
68 68
    * Tries to recover login token from the secure keychain
69 69
    *
70
-   * @returns Promise<string>
70
+   * @returns Promise<void>
71 71
    */
72
-  async recoverLogin(): Promise<string> {
72
+  async recoverLogin(): Promise<void> {
73 73
     return new Promise((resolve: () => void) => {
74 74
       const token = this.getToken();
75 75
       if (token != null) {
@@ -103,7 +103,7 @@ export default class ConnectionManager {
103 103
    * @param token
104 104
    * @returns Promise<void>
105 105
    */
106
-  async saveLogin(email: string, token: string): Promise<void> {
106
+  async saveLogin(_email: string, token: string): Promise<void> {
107 107
     return new Promise((resolve: () => void, reject: () => void) => {
108 108
       Keychain.setGenericPassword('token', token)
109 109
         .then(() => {

+ 1
- 1
src/screens/Amicale/Clubs/ClubAboutScreen.tsx View File

@@ -69,7 +69,7 @@ function ClubAboutScreen() {
69 69
         />
70 70
         <Card.Content>
71 71
           <Text>{i18n.t('screens.clubs.about.message')}</Text>
72
-          <Autolink<typeof Text>
72
+          <Autolink
73 73
             text={CONTACT_LINK}
74 74
             hashtag={'facebook'}
75 75
             component={Text}

+ 1
- 1
src/screens/Amicale/Clubs/ClubListScreen.tsx View File

@@ -224,7 +224,7 @@ class ClubListScreen extends React.Component<PropsType, StateType> {
224 224
   keyExtractor = (item: ClubType): string => item.id.toString();
225 225
 
226 226
   itemLayout = (
227
-    data: Array<ClubType> | null | undefined,
227
+    _data: Array<ClubType> | null | undefined,
228 228
     index: number
229 229
   ): { length: number; offset: number; index: number } => ({
230 230
     length: LIST_ITEM_HEIGHT,

+ 6
- 1
src/screens/Home/ScannerScreen.tsx View File

@@ -61,7 +61,12 @@ const styles = StyleSheet.create({
61 61
   },
62 62
 });
63 63
 
64
-type PermissionResults = 'unavailable' | 'denied' | 'blocked' | 'granted';
64
+type PermissionResults =
65
+  | 'unavailable'
66
+  | 'denied'
67
+  | 'blocked'
68
+  | 'granted'
69
+  | 'limited';
65 70
 
66 71
 class ScannerScreen extends React.Component<{}, StateType> {
67 72
   constructor(props: {}) {

+ 2
- 2
src/screens/Planning/PlanningScreen.tsx View File

@@ -174,8 +174,8 @@ class PlanningScreen extends React.Component<PropsType, StateType> {
174 174
 
175 175
     if (canRefresh) {
176 176
       this.setState({ refreshing: true });
177
-      readData(Urls.amicale.events)
178
-        .then((fetchedData: Array<PlanningEventType>) => {
177
+      readData<Array<PlanningEventType>>(Urls.amicale.events)
178
+        .then((fetchedData) => {
179 179
           this.setState({
180 180
             refreshing: false,
181 181
             agendaItems: generateEventAgenda(fetchedData, AGENDA_MONTH_SPAN),

Loading…
Cancel
Save