mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-13 20:55:32 +08:00
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.
find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.
Reviewed By: TheSavior, yungsters
Differential Revision: D7007050
fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
53 lines
1.8 KiB
Java
53 lines
1.8 KiB
Java
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
package com.facebook.react.bridge;
|
|
|
|
import com.facebook.proguard.annotations.DoNotStrip;
|
|
|
|
|
|
/**
|
|
* A native module whose API can be provided to JS catalyst instances. {@link NativeModule}s whose
|
|
* implementation is written in Java should extend {@link BaseJavaModule} or {@link
|
|
* ReactContextBaseJavaModule}. {@link NativeModule}s whose implementation is written in C++
|
|
* must not provide any Java code (so they can be reused on other platforms), and instead should
|
|
* register themselves using {@link CxxModuleWrapper}.
|
|
*/
|
|
@DoNotStrip
|
|
public interface NativeModule {
|
|
interface NativeMethod {
|
|
void invoke(JSInstance jsInstance, ReadableNativeArray parameters);
|
|
String getType();
|
|
}
|
|
|
|
/**
|
|
* @return the name of this module. This will be the name used to {@code require()} this module
|
|
* from javascript.
|
|
*/
|
|
String getName();
|
|
|
|
/**
|
|
* This is called at the end of {@link CatalystApplicationFragment#createCatalystInstance()}
|
|
* after the CatalystInstance has been created, in order to initialize NativeModules that require
|
|
* the CatalystInstance or JS modules.
|
|
*/
|
|
void initialize();
|
|
|
|
/**
|
|
* Return true if you intend to override some other native module that was registered e.g. as part
|
|
* of a different package (such as the core one). Trying to override without returning true from
|
|
* this method is considered an error and will throw an exception during initialization. By
|
|
* default all modules return false.
|
|
*/
|
|
boolean canOverrideExistingModule();
|
|
|
|
/**
|
|
* Called before {CatalystInstance#onHostDestroy}
|
|
*/
|
|
void onCatalystInstanceDestroy();
|
|
}
|