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
Naturalclar authored and JunielKatarn committed Feb 11, 2019
1 parent 1447c2e commit 2680ba7
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Libraries/RCTTest/RCTSnapshotNativeComponent.js
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 2680ba7

Please sign in to comment.