mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-03 23:35:06 +08:00
Open source Android date and time pickers
Reviewed By: bestander Differential Revision: D2856486 fb-gh-sync-id: 0bb81136289e2f121387649765ba682103e4701b
This commit is contained in:
committed by
facebook-github-bot-8
parent
5f0ef12cb5
commit
9a0539d2c4
@@ -9,8 +9,6 @@
|
||||
|
||||
package com.facebook.react.bridge;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Interface that represents a JavaScript Promise which can be passed to the native module as a
|
||||
* method parameter.
|
||||
@@ -19,10 +17,38 @@ import javax.annotation.Nullable;
|
||||
* will be marked as "remoteAsync" and will return a promise when invoked from JavaScript.
|
||||
*/
|
||||
public interface Promise {
|
||||
|
||||
/**
|
||||
* Successfully resolve the Promise.
|
||||
*/
|
||||
void resolve(Object value);
|
||||
void reject(Throwable reason);
|
||||
|
||||
/**
|
||||
* Report an error which wasn't caused by an exception.
|
||||
*/
|
||||
void reject(String code, String message);
|
||||
|
||||
/**
|
||||
* Report an exception.
|
||||
*/
|
||||
void reject(String code, Throwable e);
|
||||
|
||||
/**
|
||||
* Report an exception with a custom error message.
|
||||
*/
|
||||
void reject(String code, String message, Throwable e);
|
||||
|
||||
/**
|
||||
* Report an error which wasn't caused by an exception.
|
||||
* @deprecated Prefer passing a module-specific error code to JS.
|
||||
* Using this method will pass the error code "EUNSPECIFIED".
|
||||
*/
|
||||
@Deprecated
|
||||
void reject(String reason);
|
||||
void reject(String code, Throwable extra);
|
||||
void reject(String code, String reason, @Nullable Throwable extra);
|
||||
void reject(String message);
|
||||
|
||||
/**
|
||||
* Report an exception, with default error code.
|
||||
* Useful in catch-all scenarios where it's unclear why the error occurred.
|
||||
*/
|
||||
void reject(Throwable reason);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user