Skip to content

Commit 67ad72f

Browse files
jessefacebook-github-bot
authored andcommitted
Add types to RCTSnapshotNativeComponent (#23111)
Summary: Changelog: ---------- [iOS][Changed] - added types to RCTSnapshotNativeComponent.js, as mentioned in #22990 Pull Request resolved: #23111 Differential Revision: D13781429 Pulled By: cpojer fbshipit-source-id: 7efffe150fd29cbfbb3a6b8f13e38295f83acb3c
1 parent 70227fe commit 67ad72f

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Libraries/RCTTest/RCTSnapshotNativeComponent.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,29 @@
55
* LICENSE file in the root directory of this source tree.
66
*
77
* @format
8-
* @flow strict-local
8+
* @flow
99
*/
1010

1111
'use strict';
1212

13+
import type {SyntheticEvent} from 'CoreEventTypes';
14+
import type {ViewProps} from 'ViewPropTypes';
15+
import type {NativeComponent} from 'ReactNative';
16+
17+
type SnapshotReadyEvent = SyntheticEvent<
18+
$ReadOnly<{
19+
testIdentifier: string,
20+
}>,
21+
>;
22+
23+
type NativeProps = $ReadOnly<{|
24+
...ViewProps,
25+
onSnapshotReady?: ?(event: SnapshotReadyEvent) => mixed,
26+
testIdentifier?: ?string,
27+
|}>;
28+
29+
type SnapshotViewNativeType = Class<NativeComponent<NativeProps>>;
30+
1331
const requireNativeComponent = require('requireNativeComponent');
1432

15-
module.exports = requireNativeComponent('RCTSnapshot');
33+
module.exports = ((requireNativeComponent('RCTSnapshot'):any): SnapshotViewNativeType);

0 commit comments

Comments
 (0)