mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
1 parent
c0bf53b716
commit
66e0258885
3 files changed
+19
-20
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user