UNPKG

react-native-ble-nitro

Version:

High-performance React Native BLE library built on Nitro Modules - drop-in replacement for react-native-ble-plx

44 lines (43 loc) 2.07 kB
/** * Enum compatibility layer * * Provides conversion between Nitro's numeric enums and the original * string-based enums from react-native-ble-plx */ import { State, LogLevel, CharacteristicSubscriptionType, RefreshGattMoment } from '../specs/types'; export declare const StateString: { readonly 0: "Unknown"; readonly 1: "Resetting"; readonly 2: "Unsupported"; readonly 3: "Unauthorized"; readonly 4: "PoweredOff"; readonly 5: "PoweredOn"; }; export declare const LogLevelString: { readonly 0: "None"; readonly 1: "Verbose"; readonly 2: "Debug"; readonly 3: "Info"; readonly 4: "Warning"; readonly 5: "Error"; }; export declare const CharacteristicSubscriptionTypeString: { readonly 0: "notification"; readonly 1: "indication"; }; export declare const RefreshGattMomentString: { readonly 0: "OnConnected"; }; export declare function stateToString(state: State): string; export declare function stringToState(stateString: string): State; export declare function logLevelToString(logLevel: LogLevel): string; export declare function stringToLogLevel(logLevelString: string): LogLevel; export declare function characteristicSubscriptionTypeToString(type: CharacteristicSubscriptionType): string; export declare function stringToCharacteristicSubscriptionType(typeString: string): CharacteristicSubscriptionType; export declare function refreshGattMomentToString(moment: RefreshGattMoment): 'OnConnected'; export declare function stringToRefreshGattMoment(momentString: 'OnConnected'): RefreshGattMoment; export declare function isStringEnumValue(value: any): boolean; export declare function normalizeState(state: State | string): State; export declare function normalizeLogLevel(logLevel: LogLevel | string): LogLevel; export declare function normalizeCharacteristicSubscriptionType(type: CharacteristicSubscriptionType | 'notification' | 'indication'): CharacteristicSubscriptionType; export declare function normalizeRefreshGattMoment(moment: RefreshGattMoment | 'OnConnected'): RefreshGattMoment;