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