export { B as BaseProfile, a5 as defineProfile, a6 as parseRawBytes } from '../base-BkianuQ_.js'; export { HEART_RATE_SERVICES, HeartRateData, HeartRateProfile, parseHeartRate } from './heart-rate.js'; export { BatteryProfile } from './battery.js'; export { DeviceInfo, DeviceInfoProfile } from './device-info.js'; export { NUS_SERVICES, NordicUARTProfile } from './nordic-uart.js'; export { HM10SerialProfile } from './serial-ffe0.js'; import '../error-taxonomy-CWrJx3aZ.js'; /** * A profile class that declares the GATT services it (and its device family) may * reach after connection, as a static `services` array. {@link deriveOptionalServices} * reads this so a caller can pass the profile itself instead of hand-copying its * service UUIDs into `optionalServices`. */ interface ProfileWithServices { readonly services: readonly string[]; } /** * A source of service UUIDs accepted by {@link deriveOptionalServices}: either a * profile class carrying a static `services` array, or a raw list of service * names / 4-8-hex / full 128-bit UUID strings. */ type OptionalServicesSource = ProfileWithServices | readonly string[]; /** * Flatten one or more profiles / service-UUID arrays into a single canonical, * de-duped, lowercase 128-bit `string[]` suitable for `optionalServices` (or * {@link Beacio.registerServices}). Every entry is resolved via the core * {@link resolveUUID} (names like `'battery_service'`, 4/8-hex, and full UUIDs * are all accepted) and de-duped while preserving first-seen order. * * This retires the hand-maintained parallel `optionalServices` lists a multi- * device integration would otherwise keep in sync: declare the profiles (or a * vendor bundle such as `StorzBickel.allServices()`) once and derive the list. * * Pure and idempotent: `deriveOptionalServices(deriveOptionalServices(x))` equals * `deriveOptionalServices(x)`, because the output is already canonical UUIDs that * {@link resolveUUID} passes through unchanged. * * @param sources - Profile classes (with a static `services` array) and/or raw * service-UUID arrays (names, 4/8-hex, or full 128-bit UUID strings). * @returns De-duped canonical lowercase 128-bit service UUIDs, first-seen order. * @throws {TypeError} If any value is not a resolvable UUID or known SIG name. * * @example * ```ts * import { deriveOptionalServices, NordicUARTProfile, HeartRateProfile } from '@beacio/core/profiles'; * * const optionalServices = deriveOptionalServices(NordicUARTProfile, HeartRateProfile); * const device = await ble.requestDevice({ acceptAllDevices: true, optionalServices }); * ``` */ declare function deriveOptionalServices(...sources: OptionalServicesSource[]): string[]; export { type OptionalServicesSource, type ProfileWithServices, deriveOptionalServices };