Skip to content

Commit

Permalink
Add types to RCTSnapshotNativeComponent (facebook#23111)
Browse files Browse the repository at this point in the history
Summary:
Changelog:
----------
[iOS][Changed] - added types to RCTSnapshotNativeComponent.js, as mentioned in facebook#22990
Pull Request resolved: facebook#23111

Differential Revision: D13781429

Pulled By: cpojer

fbshipit-source-id: 7efffe150fd29cbfbb3a6b8f13e38295f83acb3c
  • Loading branch information
jesse authored and facebook-github-bot committed Jan 23, 2019
1 parent fe7bc09 commit 19cdbd3
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Libraries/RCTTest/RCTSnapshotNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,29 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict-local
* @flow
*/

'use strict';

import type {SyntheticEvent} from 'CoreEventTypes';
import type {ViewProps} from 'ViewPropTypes';
import type {NativeComponent} from 'ReactNative';

type SnapshotReadyEvent = SyntheticEvent<
$ReadOnly<{
testIdentifier: string,
}>,
>;

type NativeProps = $ReadOnly<{|
...ViewProps,
onSnapshotReady?: ?(event: SnapshotReadyEvent) => mixed,
testIdentifier?: ?string,
|}>;

type SnapshotViewNativeType = Class<NativeComponent<NativeProps>>;

const requireNativeComponent = require('requireNativeComponent');

module.exports = requireNativeComponent('RCTSnapshot');
module.exports = ((requireNativeComponent('RCTSnapshot'):any): SnapshotViewNativeType);

0 comments on commit 19cdbd3

Please sign in to comment.