-
Notifications
You must be signed in to change notification settings - Fork 215
Expand file tree
/
Copy pathFancyMath.h
More file actions
47 lines (35 loc) · 1.06 KB
/
FancyMath.h
File metadata and controls
47 lines (35 loc) · 1.06 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "pch.h"
#include "pch.h"
#include "resource.h"
#if __has_include("codegen/NativeFancyMathDataTypes.g.h")
#include "codegen/NativeFancyMathDataTypes.g.h"
#endif
#include "codegen/NativeFancyMathSpec.g.h"
#include "NativeModules.h"
#include <functional>
#define _USE_MATH_DEFINES
#include <math.h>
namespace winrt::NativeModuleSample {
REACT_TURBO_MODULE(FancyMath);
struct FancyMath {
using ModuleSpec = NativeModuleSampleCodegen::FancyMathSpec;
REACT_GET_CONSTANTS(GetConstants)
NativeModuleSampleCodegen::FancyMathSpec_Constants GetConstants() noexcept {
NativeModuleSampleCodegen::FancyMathSpec_Constants constants;
constants.E = M_E;
constants.Pi = M_PI;
return constants;
}
REACT_METHOD(Add, L"add");
double Add(double a, double b) noexcept {
double result = a + b;
AddEvent(result);
return result;
}
REACT_EVENT(AddEvent);
std::function<void(double)> AddEvent;
};
} // namespace winrt::NativeModuleSample