import type { EventSubscription } from "react-native"; import { NAME, VERSION, type CounterType, type StepCountData } from "./NativeStepCounter"; export interface ParsedStepCountData { dailyGoal: string; steps: number; stepsString: string; calories: string; startDate: string; endDate: string; distance: string; } type StepCountUpdateCallback = (data: StepCountData) => void; export type StepCountFilter = (data: StepCountData) => StepCountData | null; export interface StepCountFilterOptions { /** * Minimum elapsed time expected per accepted step. * * Events that imply a faster cadence are treated as sensor false positives. * 250ms allows up to 4 steps/second, which is already faster than typical walking. */ minimumStepIntervalMs?: number; } /** * Transform the step count data into a more readable format. * You can use it or directly use the `StepCountData` type. * @param {StepCountData} data - Step Counter Sensor Event Data. * @returns {ParsedStepCountData} - String Parsed Count Data. */ export declare function parseStepData(data: StepCountData): ParsedStepCountData; /** * Create a stateful filter for live step-count updates. * * Native pedometer APIs can already include device/OS false positives, and the * Android accelerometer fallback can also react to quick hand rotation. This * helper drops updates that imply an impossible cadence and rebases later * cumulative values so ignored burst steps do not come back on the next event. */ export declare function createStepCountFilter(options?: StepCountFilterOptions): StepCountFilter; /** * Returns whether the stepCounter is enabled on the device. * iOS 8.0+ only. Android is available since KitKat (4.4 / API 19). * @see https://developer.android.com/about/versions/android-4.4.html * @see https://developer.apple.com/documentation/coremotion/cmpedometer/1613963-isstepcountingavailable * @returns {Promise<{ supported: boolean; granted: boolean }>} A promise that resolves with an object containing the stepCounter availability. * supported - Whether the stepCounter is supported on device. * granted - Whether user granted the permission. */ export declare function isStepCountingSupported(): Promise<{ supported: boolean; granted: boolean; }>; /** * Start to subscribe stepCounter updates. * Only the past seven days worth of data is stored and available for you to retrieve. * Specifying a start date that is more than seven days in the past returns only the available data. * ### iOS * `CMStepCounter.startStepCountingUpdates` is deprecated since iOS 8.0. so used `CMPedometer.startUpdates` instead. * @see https://developer.apple.com/documentation/coremotion/cmpedometer/1613950-startupdates * @see https://developer.apple.com/documentation/coremotion/cmstepcounter/1616151-startstepcountingupdates * @param {Date} start A date indicating the start of the range over which to measure steps. * @param {StepCountUpdateCallback} callBack - This callback function makes it easy for app developers to receive sensor events. * @returns {EventSubscription} - Returns a Subscription that enables you to call. * When you would like to unsubscribe the listener, just use a method of subscriptions's `remove()`. * @example * const startDate = new Date(); * subscriptionRef.current = startStepCounterUpdate(startDate, (response) => { * const data = parseStepCountData(response); * }) */ export declare function startStepCounterUpdate(start: Date, callBack: StepCountUpdateCallback): EventSubscription; /** * Stop the step counter updates. * ### iOS * `CMStepCounter.stopStepCountingUpdates` is deprecated since iOS 8.0. so used `CMPedometer.stopUpdates` instead. * @see https://developer.apple.com/documentation/coremotion/cmpedometer/1613973-stopupdates * @see https://developer.apple.com/documentation/coremotion/cmstepcounter/1616157-stopstepcountingupdates */ export declare function stopStepCounterUpdate(): void; export { NAME, VERSION, type CounterType, type StepCountData }; //# sourceMappingURL=index.d.ts.map