import type { AnyMap, HybridObject } from 'react-native-nitro-modules'; import type { MetadataForQuantityIdentifier, QuantitySample, QuantitySampleTyped } from '../types/QuantitySample'; import type { AggregationStyle, IntervalComponents, QuantitySamplesWithAnchorResponse, QuantitySamplesWithAnchorResponseTyped, QueryStatisticsResponse, QueryStatisticsResponseFromSingleSource, StatisticsOptions, StatisticsQueryOptions, StatisticsQueryOptionsWithStringUnit, UnitForIdentifier } from '../types/QuantityType'; import type { QuantityTypeIdentifier, QuantityTypeIdentifierWriteable } from '../types/QuantityTypeIdentifier'; import type { QueryOptionsWithAnchorAndStringUnit, QueryOptionsWithAnchorAndUnit, QueryOptionsWithSortOrderAndStringUnit, QueryOptionsWithSortOrderAndUnit } from '../types/QueryOptions'; export interface QuantityTypeModule extends HybridObject<{ ios: 'swift'; }> { isQuantityCompatibleWithUnit(identifier: QuantityTypeIdentifier, unit: string): boolean; aggregationStyle(identifier: QuantityTypeIdentifier): AggregationStyle; saveQuantitySample(identifier: QuantityTypeIdentifierWriteable, unit: string, value: number, start: Date, end: Date, metadata?: AnyMap): Promise; queryQuantitySamples(identifier: QuantityTypeIdentifier, options: QueryOptionsWithSortOrderAndStringUnit): Promise; queryStatisticsForQuantity(identifier: QuantityTypeIdentifier, statistics: readonly StatisticsOptions[], options?: StatisticsQueryOptionsWithStringUnit): Promise; queryStatisticsCollectionForQuantity(identifier: QuantityTypeIdentifier, statistics: readonly StatisticsOptions[], anchorDate: Date, intervalComponents: IntervalComponents, options?: StatisticsQueryOptionsWithStringUnit): Promise; queryStatisticsForQuantitySeparateBySource(identifier: QuantityTypeIdentifier, statistics: readonly StatisticsOptions[], options?: StatisticsQueryOptionsWithStringUnit): Promise; queryStatisticsCollectionForQuantitySeparateBySource(identifier: QuantityTypeIdentifier, statistics: readonly StatisticsOptions[], anchorDate: Date, intervalComponents: IntervalComponents, options?: StatisticsQueryOptionsWithStringUnit): Promise; queryQuantitySamplesWithAnchor(identifier: QuantityTypeIdentifier, options: QueryOptionsWithAnchorAndStringUnit): Promise; } export interface QuantityTypeModuleTyped { isQuantityCompatibleWithUnit(identifier: T, unit: UnitForIdentifier): boolean; aggregationStyle(identifier: QuantityTypeIdentifier): AggregationStyle; saveQuantitySample(identifier: T, unit: UnitForIdentifier, value: number, start: Date, end: Date, metadata?: MetadataForQuantityIdentifier): Promise | undefined>; queryQuantitySamples(identifier: T, options: QueryOptionsWithSortOrderAndUnit>): Promise[]>; queryStatisticsForQuantity(identifier: T, statistics: readonly StatisticsOptions[], options?: StatisticsQueryOptions>): Promise; queryStatisticsCollectionForQuantity(identifier: T, statistics: readonly StatisticsOptions[], anchorDate: Date, intervalComponents: IntervalComponents, options?: StatisticsQueryOptions>): Promise; queryStatisticsForQuantitySeparateBySource(identifier: T, statistics: readonly StatisticsOptions[], options?: StatisticsQueryOptions>): Promise; queryStatisticsCollectionForQuantitySeparateBySource(identifier: T, statistics: readonly StatisticsOptions[], anchorDate: Date, intervalComponents: IntervalComponents, options?: StatisticsQueryOptions>): Promise; queryQuantitySamplesWithAnchor(identifier: T, options: QueryOptionsWithAnchorAndUnit>): Promise>; }