Fix up NativeDialogManagerAndroid PR
Summary: This diff has three changes: 1. Remove all references to `Stringish` from `NativeDialogManagerAndroid`. (All Fbt objects expose a `.toString` method we could call). 2. Make sure that we only access `DialogManagerAndroid` through `NativeDialogManagerAndroid`. 3. Removed a bunch of `$FlowFixMes` in the files I touched. Probably not the best idea to bite into this cleanup on this diff, but what's done is done. Since this diff is fairly large, I've commented on parts of it I thought were note-worthy. I've also commented on the changes I had to make to fix flow after removing the `$FlowFixMe`s. Reviewed By: PeteTheHeat Differential Revision: D16428855 fbshipit-source-id: 0e6daf2957f4b086ebb1e78e0a59930668c65576
This commit is contained in:
Родитель
3eaf245540
Коммит
a5b925d950
|
@ -739,10 +739,10 @@ namespace JS {
|
|||
namespace NativeDialogManagerAndroid {
|
||||
struct DialogOptions {
|
||||
NSString *title() const;
|
||||
id<NSObject> _Nullable message() const;
|
||||
id<NSObject> _Nullable buttonPositive() const;
|
||||
id<NSObject> _Nullable buttonNegative() const;
|
||||
id<NSObject> _Nullable buttonNeutral() const;
|
||||
NSString *message() const;
|
||||
NSString *buttonPositive() const;
|
||||
NSString *buttonNegative() const;
|
||||
NSString *buttonNeutral() const;
|
||||
folly::Optional<facebook::react::LazyVector<NSString *>> items() const;
|
||||
folly::Optional<bool> cancelable() const;
|
||||
|
||||
|
@ -2463,25 +2463,25 @@ inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::title() const
|
|||
id const p = _v[@"title"];
|
||||
return RCTBridgingToString(p);
|
||||
}
|
||||
inline id<NSObject> _Nullable JS::NativeDialogManagerAndroid::DialogOptions::message() const
|
||||
inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::message() const
|
||||
{
|
||||
id const p = _v[@"message"];
|
||||
return p;
|
||||
return RCTBridgingToString(p);
|
||||
}
|
||||
inline id<NSObject> _Nullable JS::NativeDialogManagerAndroid::DialogOptions::buttonPositive() const
|
||||
inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::buttonPositive() const
|
||||
{
|
||||
id const p = _v[@"buttonPositive"];
|
||||
return p;
|
||||
return RCTBridgingToString(p);
|
||||
}
|
||||
inline id<NSObject> _Nullable JS::NativeDialogManagerAndroid::DialogOptions::buttonNegative() const
|
||||
inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::buttonNegative() const
|
||||
{
|
||||
id const p = _v[@"buttonNegative"];
|
||||
return p;
|
||||
return RCTBridgingToString(p);
|
||||
}
|
||||
inline id<NSObject> _Nullable JS::NativeDialogManagerAndroid::DialogOptions::buttonNeutral() const
|
||||
inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::buttonNeutral() const
|
||||
{
|
||||
id const p = _v[@"buttonNeutral"];
|
||||
return p;
|
||||
return RCTBridgingToString(p);
|
||||
}
|
||||
inline folly::Optional<facebook::react::LazyVector<NSString *>> JS::NativeDialogManagerAndroid::DialogOptions::items() const
|
||||
{
|
||||
|
|
|
@ -23,10 +23,10 @@ type DialogAction = string;
|
|||
type DialogButtonKey = number;
|
||||
export type DialogOptions = {|
|
||||
title?: string,
|
||||
message?: Stringish,
|
||||
buttonPositive?: Stringish,
|
||||
buttonNegative?: Stringish,
|
||||
buttonNeutral?: Stringish,
|
||||
message?: string,
|
||||
buttonPositive?: string,
|
||||
buttonNegative?: string,
|
||||
buttonNeutral?: string,
|
||||
items?: Array<string>,
|
||||
cancelable?: boolean,
|
||||
|};
|
||||
|
|
Загрузка…
Ссылка в новой задаче