feat: implement Haptika PPG and Watch V1
This commit is contained in:
Generated
+71
@@ -0,0 +1,71 @@
|
||||
///
|
||||
/// HybridHaptikaHealthKitSpec.hpp
|
||||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
||||
/// https://github.com/mrousavy/nitro
|
||||
/// Copyright © Marc Rousavy @ Margelo
|
||||
///
|
||||
|
||||
#pragma once
|
||||
|
||||
#if __has_include(<NitroModules/HybridObject.hpp>)
|
||||
#include <NitroModules/HybridObject.hpp>
|
||||
#else
|
||||
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
||||
#endif
|
||||
|
||||
// Forward declaration of `NativeHealthKitContext` to properly resolve imports.
|
||||
namespace margelo::nitro::haptika::ppg { struct NativeHealthKitContext; }
|
||||
// Forward declaration of `NativeHeartbeatSeriesSummary` to properly resolve imports.
|
||||
namespace margelo::nitro::haptika::ppg { struct NativeHeartbeatSeriesSummary; }
|
||||
|
||||
#include <NitroModules/Promise.hpp>
|
||||
#include "NativeHealthKitContext.hpp"
|
||||
#include "NativeHeartbeatSeriesSummary.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace margelo::nitro::haptika::ppg {
|
||||
|
||||
using namespace margelo::nitro;
|
||||
|
||||
/**
|
||||
* An abstract base class for `HaptikaHealthKit`
|
||||
* Inherit this class to create instances of `HybridHaptikaHealthKitSpec` in C++.
|
||||
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
||||
* @example
|
||||
* ```cpp
|
||||
* class HybridHaptikaHealthKit: public HybridHaptikaHealthKitSpec {
|
||||
* public:
|
||||
* HybridHaptikaHealthKit(...): HybridObject(TAG) { ... }
|
||||
* // ...
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
class HybridHaptikaHealthKitSpec: public virtual HybridObject {
|
||||
public:
|
||||
// Constructor
|
||||
explicit HybridHaptikaHealthKitSpec(): HybridObject(TAG) { }
|
||||
|
||||
// Destructor
|
||||
~HybridHaptikaHealthKitSpec() override = default;
|
||||
|
||||
public:
|
||||
// Properties
|
||||
|
||||
|
||||
public:
|
||||
// Methods
|
||||
virtual bool isAvailable() = 0;
|
||||
virtual std::shared_ptr<Promise<bool>> requestReadAuthorization() = 0;
|
||||
virtual std::shared_ptr<Promise<NativeHealthKitContext>> fetchContext(double lookbackDays) = 0;
|
||||
virtual std::shared_ptr<Promise<std::optional<NativeHeartbeatSeriesSummary>>> fetchLatestHeartbeatSeries() = 0;
|
||||
|
||||
protected:
|
||||
// Hybrid Setup
|
||||
void loadHybridMethods() override;
|
||||
|
||||
protected:
|
||||
// Tag for logging
|
||||
static constexpr auto TAG = "HaptikaHealthKit";
|
||||
};
|
||||
|
||||
} // namespace margelo::nitro::haptika::ppg
|
||||
Reference in New Issue
Block a user