8
8
* @flow strict-local
9
9
*/
10
10
11
- /* eslint-disable react-internal/invariant-args */
12
-
13
11
'use strict' ;
14
12
15
- import type {
16
- ReactNativeBaseComponentViewConfig ,
17
- ViewConfigGetter ,
18
- } from './ReactNativeTypes' ;
19
-
20
- const invariant = require ( 'invariant' ) ;
13
+ import { type ViewConfig } from './ReactNativeTypes' ;
14
+ import invariant from 'invariant' ;
21
15
22
16
// Event configs
23
17
const customBubblingEventTypes : {
@@ -42,9 +36,7 @@ exports.customDirectEventTypes = customDirectEventTypes;
42
36
const viewConfigCallbacks = new Map ( ) ;
43
37
const viewConfigs = new Map ( ) ;
44
38
45
- function processEventTypes (
46
- viewConfig : ReactNativeBaseComponentViewConfig < > ,
47
- ) : void {
39
+ function processEventTypes ( viewConfig : ViewConfig ) : void {
48
40
const { bubblingEventTypes, directEventTypes} = viewConfig ;
49
41
50
42
if ( __DEV__ ) {
@@ -82,7 +74,7 @@ function processEventTypes(
82
74
* A callback is provided to load the view config from UIManager.
83
75
* The callback is deferred until the view is actually rendered.
84
76
*/
85
- exports . register = function ( name : string , callback : ViewConfigGetter ) : string {
77
+ exports . register = function ( name : string , callback : ( ) = > ViewConfig ) : string {
86
78
invariant (
87
79
! viewConfigCallbacks . has ( name ) ,
88
80
'Tried to register two views with the same name %s' ,
@@ -103,7 +95,7 @@ exports.register = function(name: string, callback: ViewConfigGetter): string {
103
95
* If this is the first time the view has been used,
104
96
* This configuration will be lazy-loaded from UIManager.
105
97
*/
106
- exports . get = function ( name : string ) : ReactNativeBaseComponentViewConfig < > {
98
+ exports . get = function ( name : string ) : ViewConfig {
107
99
let viewConfig ;
108
100
if ( ! viewConfigs . has ( name ) ) {
109
101
const callback = viewConfigCallbacks . get ( name ) ;
0 commit comments