TM: attempt to integrate with internal codegen infra

Summary: An attempt to integrate the module flow types with internal codegen infra. Nothing of interest here, other than minor tweak on a spec (we don't support tupples...).

Reviewed By: mdvacca

Differential Revision: D15753278

fbshipit-source-id: b91d564fdbe8f72b90bea725779a9684993472b5
This commit is contained in:
Kevin Gozali authored and Facebook Github Bot committed 2019-06-10 20:40:59 -07:00
1 parent c0bf53b716
commit 66e0258885
3 files changed
+19 -20

No files matched your search

+17 -1
View File
@@ -15,7 +15,23 @@ import NativeDialogManagerAndroid, {
type DialogOptions,
} from '../NativeModules/specs/NativeDialogManagerAndroid';
import RCTAlertManager from './RCTAlertManager';
import {type Buttons, type Options, type AlertType} from './NativeAlertManager';
export type AlertType =
| 'default'
| 'plain-text'
| 'secure-text'
| 'login-password';
export type AlertButtonStyle = 'default' | 'cancel' | 'destructive';
export type Buttons = Array<{
text?: string,
onPress?: ?Function,
style?: AlertButtonStyle,
}>;
type Options = {
cancelable?: ?boolean,
onDismiss?: ?() => void,
};
/**
* Launches an alert dialog with the specified title and message.
+1 -18
View File
@@ -13,27 +13,10 @@
import type {TurboModule} from '../TurboModule/RCTExport';
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
export type Buttons = Array<{
text?: string,
onPress?: ?Function,
style?: AlertButtonStyle,
}>;
export type Options = {
cancelable?: ?boolean,
onDismiss?: ?() => void,
};
/* 'default' | plain-text' | 'secure-text' | 'login-password' */
export type AlertType = string;
/* 'default' | 'cancel' | 'destructive' */
export type AlertButtonStyle = string;
export type Args = {|
title?: string,
message?: string,
buttons?: Buttons,
buttons?: Object, // TODO: have a better type
type?: string,
defaultValue?: string,
cancelButtonKey?: string,
+1 -1
View File
@@ -30,7 +30,7 @@ export interface Spec extends TurboModule {
+blur: (reactTag: ?number) => void;
+findSubviewIn: (
reactTag: ?number,
point: [number, number],
point: Array<number>,
callback: (
nativeViewTag: number,
left: number,