88 * @flow strict-local
99 */
1010
11- /* eslint-disable react-internal/invariant-args */
12-
1311'use strict' ;
1412
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' ;
2115
2216// Event configs
2317const customBubblingEventTypes : {
@@ -42,9 +36,7 @@ exports.customDirectEventTypes = customDirectEventTypes;
4236const viewConfigCallbacks = new Map ( ) ;
4337const viewConfigs = new Map ( ) ;
4438
45- function processEventTypes (
46- viewConfig : ReactNativeBaseComponentViewConfig < > ,
47- ) : void {
39+ function processEventTypes ( viewConfig : ViewConfig ) : void {
4840 const { bubblingEventTypes, directEventTypes} = viewConfig ;
4941
5042 if ( __DEV__ ) {
@@ -82,7 +74,7 @@ function processEventTypes(
8274 * A callback is provided to load the view config from UIManager.
8375 * The callback is deferred until the view is actually rendered.
8476 */
85- exports . register = function ( name : string , callback : ViewConfigGetter ) : string {
77+ exports . register = function ( name : string , callback : ( ) = > ViewConfig ) : string {
8678 invariant (
8779 ! viewConfigCallbacks . has ( name ) ,
8880 'Tried to register two views with the same name %s' ,
@@ -103,7 +95,7 @@ exports.register = function(name: string, callback: ViewConfigGetter): string {
10395 * If this is the first time the view has been used,
10496 * This configuration will be lazy-loaded from UIManager.
10597 */
106- exports . get = function ( name : string ) : ReactNativeBaseComponentViewConfig < > {
98+ exports . get = function ( name : string ) : ViewConfig {
10799 let viewConfig ;
108100 if ( ! viewConfigs . has ( name ) ) {
109101 const callback = viewConfigCallbacks . get ( name ) ;
0 commit comments