File tree Expand file tree Collapse file tree 6 files changed +317
-210
lines changed Expand file tree Collapse file tree 6 files changed +317
-210
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,6 @@ suppress_type=$FlowFixMe
44
44
suppress_type=$FlowFixMeProps
45
45
suppress_type=$FlowFixMeState
46
46
47
- suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
48
- suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
49
- suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
50
-
51
47
[lints]
52
48
sketchy-null-number=warn
53
49
sketchy-null-mixed=warn
@@ -56,7 +52,6 @@ untyped-type-import=warn
56
52
nonstrict-import=warn
57
53
deprecated-type=warn
58
54
unsafe-getters-setters=warn
59
- inexact-spread=warn
60
55
unnecessary-invariant=warn
61
56
signature-verification-failure=warn
62
57
deprecated-utility=error
@@ -71,4 +66,4 @@ untyped-import
71
66
untyped-type-import
72
67
73
68
[version]
74
- ^0.113 .0
69
+ ^0.137 .0
Original file line number Diff line number Diff line change 5
5
* @flow
6
6
*/
7
7
8
- import React , { useState , useEffect } from 'react' ;
8
+ import * as React from 'react' ;
9
+ import { useState , useEffect } from 'react' ;
9
10
import {
10
11
Alert ,
11
12
StyleSheet ,
@@ -16,20 +17,26 @@ import {
16
17
} from 'react-native' ;
17
18
import PushNotificationIOS from '../js' ;
18
19
19
- class Button extends React . Component < $FlowFixMeProps > {
20
- render ( ) {
21
- return (
22
- < TouchableHighlight
23
- underlayColor = { 'white' }
24
- style = { styles . button }
25
- onPress = { this . props . onPress } >
26
- < Text style = { styles . buttonLabel } > { this . props . label } </ Text >
27
- </ TouchableHighlight >
28
- ) ;
29
- }
30
- }
20
+ type ButtonProps = { |
21
+ onPress : ( ) => void | Promise < void > ,
22
+ label : string ,
23
+ | } ;
24
+
25
+ const Button : React . StatelessFunctionalComponent < ButtonProps > = ({
26
+ onPress ,
27
+ label ,
28
+ } ) => {
29
+ return (
30
+ < TouchableHighlight
31
+ underlayColor = { 'white' }
32
+ style = { styles . button }
33
+ onPress = { onPress } >
34
+ < Text style = { styles . buttonLabel } > { label } </ Text >
35
+ </ TouchableHighlight >
36
+ ) ;
37
+ } ;
31
38
32
- export const App = ( ) = > {
39
+ export const App = (): React.Node => {
33
40
const [ permissions , setPermissions ] = useState ( { } ) ;
34
41
35
42
useEffect ( ( ) => {
Original file line number Diff line number Diff line change 12
12
13
13
import { NativeEventEmitter , NativeModules } from 'react-native' ;
14
14
import invariant from 'invariant' ;
15
- import {
15
+ import type {
16
16
NotificationAlert ,
17
17
NotificationRequest ,
18
18
NotificationCategory ,
@@ -29,7 +29,7 @@ const NOTIF_REGISTER_EVENT = 'remoteNotificationsRegistered';
29
29
const NOTIF_REGISTRATION_ERROR_EVENT = 'remoteNotificationRegistrationError' ;
30
30
const DEVICE_LOCAL_NOTIF_EVENT = 'localNotificationReceived' ;
31
31
32
- export {
32
+ export type {
33
33
NotificationAlert ,
34
34
NotificationRequest ,
35
35
NotificationCategory ,
Original file line number Diff line number Diff line change 1
- export type NotificationRequest = {
1
+ /**
2
+ * @flow
3
+ */
4
+
5
+ export type NotificationRequest = { |
2
6
/**
3
7
* identifier of the notification.
4
8
* Required in order to retrieve specific notification.
@@ -49,33 +53,33 @@ export type NotificationRequest = {
49
53
* Optional data to be added to the notification
50
54
*/
51
55
userInfo ? : Object ,
52
- } ;
56
+ | } ;
53
57
54
58
/**
55
59
* Alert Object that can be included in the aps `alert` object
56
60
*/
57
- export type NotificationAlert = {
61
+ export type NotificationAlert = { |
58
62
title ? : string ,
59
63
subtitle ? : string ,
60
64
body ? : string ,
61
- } ;
65
+ | } ;
62
66
63
67
/**
64
68
* Notification Category that can include specific actions
65
69
*/
66
- export type NotificationCategory = {
70
+ export type NotificationCategory = { |
67
71
/**
68
72
* Identifier of the notification category.
69
73
* Notification with this category will have the specified actions.
70
74
*/
71
75
id : string ,
72
76
actions : NotificationAction [ ] ,
73
- } ;
77
+ | } ;
74
78
75
79
/**
76
80
* Notification Action that can be added to specific categories
77
81
*/
78
- export type NotificationAction = {
82
+ export type NotificationAction = { |
79
83
/**
80
84
* Identifier of Action.
81
85
* This value will be returned as actionIdentifier when notification is received.
@@ -109,4 +113,4 @@ export type NotificationAction = {
109
113
*/
110
114
placeholder ?: string ,
111
115
} ,
112
- } ;
116
+ | } ;
Original file line number Diff line number Diff line change 48
48
"babel-core" : " ^7.0.0-bridge.0" ,
49
49
"babel-jest" : " 24.1.0" ,
50
50
"babel-plugin-module-resolver" : " ^3.1.3" ,
51
- "eslint" : " ^6.8 .0" ,
52
- "flow-bin" : " ^0.113 .0" ,
51
+ "eslint" : " ^7.13 .0" ,
52
+ "flow-bin" : " 0.137 .0" ,
53
53
"jest" : " ^24.9.0" ,
54
- "metro-react-native-babel-preset" : " 0.58 .0" ,
54
+ "metro-react-native-babel-preset" : " ^0.64 .0" ,
55
55
"react" : " 16.11.0" ,
56
56
"react-native" : " 0.62.2" ,
57
57
"typescript" : " ^3.9.5"
You can’t perform that action at this time.
0 commit comments