forked from microsoft/react-native-windows-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNativeFancyMath.js
More file actions
26 lines (21 loc) · 813 Bytes
/
NativeFancyMath.js
File metadata and controls
26 lines (21 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* This makes the JS forward looking, in that it supports the implementation of FancyMath being a NativeModule or a TurboModule
* It also provides flow type information for the FancyMath module, which in the future can be used to verify that the
* native implementation matches the JS definition.
*
* @flow
* @format
*/
import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
export interface Spec extends TurboModule {
// Exported methods.
+getConstants: () => {|
E: number,
Pi: number,
|};
+add: (a: number, b: number, callback: (value: number) => void) => void;
}
export default (TurboModuleRegistry.getEnforcing<Spec>(
'FancyMath',
): Spec);