forked from react/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodegenTypes.js
More file actions
38 lines (32 loc) · 1.15 KB
/
Copy pathCodegenTypes.js
File metadata and controls
38 lines (32 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
import type {NativeComponent} from '../Renderer/shims/ReactNative';
import type {SyntheticEvent} from './CoreEventTypes';
// Event types
export type BubblingEvent<T> = SyntheticEvent<T>;
export type DirectEvent<T> = SyntheticEvent<T>;
// Prop types
export type Float = number;
export type Int32 = number;
// Default handling, ignore the unused value
// we're only using it for type checking
//
// TODO: (rickhanlonii) T44881457 If a default is provided, it should always be optional
// but that is currently not supported in the codegen since we require a default
// eslint-disable-next-line no-unused-vars
export type WithDefault<Type: number | boolean | string, Value: Type> = Type;
// We're not using ComponentName or Options in JS
// We only use these types to codegen native code
//
// eslint-disable-next-line no-unused-vars
export type CodegenNativeComponent<ComponentName, Props, Options = {}> = Class<
NativeComponent<Props>,
>;